How to convert video using MEncoder

By | September 26, 2013

MEncoder is a free command line video decoding, encoding, and filtering tool. As a by-product of MPlayer, it can convert all formats that Mplayer can understand.

  1. install mencoder

    sudo apt-get install mencode
    
  2. avi → mp4

    mencoder 1.avi -o 1.mp4 -oac copy -ovc lavc -lavcopts vcodec=mpeg1video -of mpeg
    
    • o: output file name.
    • oac: audio codecs for encoding. copy does not reencode but just copy compressed frames.
    • ovc: video codecs for encoding. lavc means using one of libavcodec’s video codecs.
    • lavcopts: libavcodec’s video codecs. Here we choose MPEG-1 video.
    • of: output container formats. mpeg means MPEG-1 and MPEG-2 PS.
  3. mov → avi

    mencoder -oac mp3lame -ovc x264 1.mov -o 1.avi
    
    • oac: mp3lame means encoding to VBR, ABR or CBR MP3 with LAME.
    • ovc: x264 means using x264, MPEG-4 Advanced Video Coding (AVC), AKA H.264 codec.

Leave a Reply

Your email address will not be published. Required fields are marked *