From b0a33e840fdfda08712a6c778db20c997a80f303 Mon Sep 17 00:00:00 2001 From: Erik Cowley Date: Mon, 18 Sep 2023 18:27:18 -0400 Subject: [PATCH] Add ffmpeg convenience scripts --- pic2vid.sh | 23 +++++++++++++++++++++++ standardize_video.sh | 23 +++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 pic2vid.sh create mode 100644 standardize_video.sh diff --git a/pic2vid.sh b/pic2vid.sh new file mode 100644 index 0000000..49927bb --- /dev/null +++ b/pic2vid.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ -z $1 ] ; then + echo "need input file at position 1" + exit 1 +fi + +set -ex + +input=$1 + +if ! [ -f $input ] ; then + echo "$input does not appear to exist" + exit 1 +fi + +basename=${input%.*} +output="${basename}.mp4" + +echo "input: $input" +echo "output: $output" + +ffmpeg -loop 1 -i $input -c:v libx264 -t 8000 -pix_fmt yuv420p -vf scale=640:480 $output diff --git a/standardize_video.sh b/standardize_video.sh new file mode 100644 index 0000000..60de6a5 --- /dev/null +++ b/standardize_video.sh @@ -0,0 +1,23 @@ +#!/bin/bash + +if [ -z $1 ] ; then + echo "need input file at position 1" + exit 1 +fi + +set -ex + +input=$1 + +if ! [ -f $input ] ; then + echo "$input does not appear to exist" + exit 1 +fi + +basename=${input%.*} +output="${basename}_small.mp4" + +echo "input: $input" +echo "output: $output" + +ffmpeg -t 8000 -i $input -s 720x480 -c:a copy $output