From 913942f0420bd4ada5eb6079f4fb8d16a7fc4bc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sun, 29 Aug 2021 02:20:58 +0200 Subject: [PATCH] Add the vid2twitter script --- bin/vid2twitter | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 bin/vid2twitter 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"