Skip to content

Instantly share code, notes, and snippets.

@mallendeo
Last active September 26, 2017 21:29
Show Gist options
  • Save mallendeo/9b1a52fc1dc53b62c284788ded190184 to your computer and use it in GitHub Desktop.
Save mallendeo/9b1a52fc1dc53b62c284788ded190184 to your computer and use it in GitHub Desktop.
Convert video for web
for i in *.mov;
do name=`echo $i | cut -d'.' -f1`;
echo $name;
# MP4 IE 11
#ffmpeg -i "${name}.mov" -vcodec h264 -acodec aac -strict -2 "../web/${name}.mp4";
# MP4 (best compatibility)
ffmpeg -an -i "${name}.mov" -y -cpu-used 8 -vcodec libx264 -pix_fmt yuv420p -profile:v baseline -level 3 "../web/${name}.mp4";
# VP8
#ffmpeg -i "${name}.mov" -vcodec libvpx -qmin 0 -qmax 50 -crf 10 -b:v 1M -acodec libvorbis "../web/${name}.webm";
# VP9
ffmpeg -i "${name}.mov" -y -cpu-used 8 -deadline good -vcodec libvpx-vp9 -b:v 1M -acodec libvorbis "../web/${name}.webm";
# Thumbnail
ffmpeg -i "${name}.mov" -y -ss 00:00:0.5 -vframes 1 "../../thumbnails/${name}.png"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment