FFmpeg

Muldimedia manipulation made easy

What is FFmpeg?

A/V manipulation

  • one format to another
  • reduce the file size (and quality)
  • draw text on some fancy graphics while playing music

practical examples


              ffmpeg -i foo.mp4 bar.mp4
            

              ffmpeg -i foo.mp4 -c:v libx264 -crf 28 \
                     -vf "scale=-2:720" -c:a aac -b:a 128k bar.mp4
            

              ffmpeg -i in.mp4 -b:v 1800k -minrate 900k -maxrate 2160k \
                     -tile-columns 2 -g 240 -threads 8 -deadline good \
                     -crf 31 -c:v libvpx-vp9 -c:a libopus -ac 2 -vbr on \
                     -b:a 96k -c:s copy -map 0 -pass 1 -cpu-used 1 out.mkv
            

              ffmpeg -i in.mp4 -b:v 1800k -minrate 900k -maxrate 2160k \
                     -tile-columns 4 -g 240 -threads 8 -deadline good \
                     -crf 31 -c:v libvpx-vp9 -c:a libopus -ac 2 -vbr on \
                     -b:a 96k -c:s copy -map 0 -pass 2 -cpu-used 1 out.mkv
            

End