diff --git a/bin/vid2twitter b/bin/vid2twitter new file mode 100755 index 0000000..0a001bb --- /dev/null +++ b/bin/vid2twitter @@ -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"