Movie conversions are often necessary to ensure that a movie can be played with different movie players or in different browsers (e.g. mp4 for Quicktime/Safari, webm for Firefox, HTML5) or to reduce resolution/speed or size.

We create our movies usually first as avi-files and then convert them to mp4/webm, whatever is prefered.

Convert from avi to mp4 or webm, high quality:

avconv -i movie.avi -q 1 movie.mp4

Or, if you want to set the bitrate manually:

avconv -i movie.avi -b 1024k movie.mp4

Usually 2048k or 4096k is good enough for our movies. This also works with ffmpeg instead of avconv, but on Ubuntu systems 12.x and higher ffmpeg is deprecated.

Reduce resolution

avconv -i movie.avi -s 640x480 -q 1 movie-small.avi

This adjusts height and width of the movie and can be quite useful when putting movies online, since it also reduces the file size.

Increase speed of movie

Following a thread from Ask Ubuntu, it is possible to increase the speed of a movie without loss of quality and without reencoding.

  • Download gpac-tools (Mp4Box) from http://gpac.wp.mines-telecom.fr/
  • Seperate raw-stream from container:

    MP4Box -add mymovie.mp4#video -raw 1 -new test
    
  • Repack using different fps (e.g. 50 for double speed):

    MP4Box -add test_track1.cmp:fps=50 -new fastmovie.mp4
    

Convert from side-by-side stereo movie to anaglyph (color glasses):

Example side-by-side img   Arrow   Example anaglyph img

ffmpeg -i movie-sidebyside.mp4 -vf mp=stereo3d=sbsl:agmd movie-agmd.mp4

This is useful if you don't have a polarisation TV at hand, but anaglyph color glasses. It even works for single images (e.g. png, jpg), not only for movie files. The example above produces a movie for magenta-green glasses (left eye = magenta), but you can choose other colors as well, see ffmpeg documentation documentation, FFmpeg wiki for nice examples or this blog post for some explanations..

I haven't yet found a way to do the same using avconv, there only seem to be ways to set a metadata flag to stereo3D, but nothing else. If you have any suggestion here, please contact us!