Add the vid2twitter script

This commit is contained in:
Rodolphe Bréard 2021-08-29 02:20:58 +02:00
parent 50737293be
commit 913942f042

22
bin/vid2twitter Executable file
View file

@ -0,0 +1,22 @@
#!/usr/bin/env bash
INPUT="$1"
OUTPUT="${INPUT%.*}.mp4"
if [ $# -ne 1 ]; then
echo "Usage: vid2twitter [source_video_file]" >&2
exit 1
fi
if [ -f "$OUTPUT" ]; then
echo -n "$OUTPUT: file exists, overwrite? (y|N) "
read -r overwrite
case "${overwrite,,}" in
"y" | "yes") ;;
*)
exit 0
;;
esac
fi
ffmpeg -i "$INPUT" -vcodec libx264 -pix_fmt yuv420p -strict -2 -acodec aac "$OUTPUT"