Skip to content

Instantly share code, notes, and snippets.

@dino-su
Forked from romuloceccon/avconv_examples.sh
Last active June 18, 2016 10:09
Show Gist options
  • Save dino-su/ca710e899a1ae7d4248504ee3666b132 to your computer and use it in GitHub Desktop.
Save dino-su/ca710e899a1ae7d4248504ee3666b132 to your computer and use it in GitHub Desktop.
avconv command lines to reduce video size
# https://trac.ffmpeg.org/wiki/Encode/H.264
# https://trac.ffmpeg.org/wiki/Encode/AAC
# -map 0 -c copy: copy all remaining streams
# -pix_fmt yuv420p: be compatible with most players
# high quality video, high quality audio
avconv -i input.mov -map 0 -c copy -c:v libx264 -preset veryslow -pix_fmt yuv420p -crf 17 -c:a libfdk_aac -vbr 4 output.mov
# high quality *compatible* full-hd video, high quality audio
avconv -i input.mov -map 0 -c copy -c:v libx264 -preset veryslow -pix_fmt yuv420p -refs 4 -crf 17 -c:a libfdk_aac -vbr 4 output.mov
# medium-high quality video, high quality audio
avconv -i input.mov -map 0 -c copy -c:v libx264 -preset veryslow -pix_fmt yuv420p -crf 22 -c:a libfdk_aac -vbr 4 output.mov
# medium quality video, medium-high quality audio
avconv -i input.mkv -vcodec libx264 -s hd1080 -crf 27 -acodec ac3 output.mp4
# high quality video (resize to hd)
avconv -i input.mov -map 0 -c copy -c:v libx264 -preset veryslow -pix_fmt yuv420p -s 1280x720 -crf 17 output.mov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment