Converting video/audio using avconv

These examples show you how to convert videos using avconv. The general usage of avconv is: $avconv [global_options] [input options] -i [some_inputfile] [output_options] [output file].

Convert from raw x264 to quicktime mov:

./avconv -i test_input.264 -vcodec copy output.mov

Convert from raw x264 to flv (when you get an error with monotonically increasing dts):

./avconv -i test_input.264 -vcodec copy output.flv

Convert from flv to mov and specify bitrate:

./avconv -i test_input.flv -b 512k output.mov

Extract audio from movie:

./avconv -i test_input.mp4 -acodec copy -vn -y out.aac

Export only video from movie:

./avconv -i input.mov -an -vcodec copy out.mov

Combine audio and video file

./avconv -i video_input.mov -i audio_input.mp3 -c copy audio_and_video.mov

Create video from image sequence

./avconv -f image2 -i image-%03d.jpeg -b 65536k -r 24 out.mov

Create video from image sequence (really good quality)

./avconv -f image2 -i %04d.png -vcodec h264 -crf 1 -r 24 out.mov