Skip to content

Instantly share code, notes, and snippets.

@cocoabox
Created November 29, 2019 09:25
Show Gist options
  • Select an option

  • Save cocoabox/a8318be3246a9b5241c7ade18f9057d0 to your computer and use it in GitHub Desktop.

Select an option

Save cocoabox/a8318be3246a9b5241c7ade18f9057d0 to your computer and use it in GitHub Desktop.
to-mp4-baseline.sh
# .bashrc
# =======
to-mp4-baseline ()
{
if [ -z "$2" ]; then
OUT="$1.mp4";
else
OUT="$2";
fi;
if [ -f "$OUT" ]; then
echo "output file already exists : $OUT" > /dev/stderr;
exit 1;
fi;
ffmpeg -i "$1" -c:v libx264 -crf 23 -profile:v baseline -level 3.0 -pix_fmt yuv420p -c:a aac -ac 2 -b:a 128k -vsync 0 -movflags faststart "$OUT";
return $?
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment