HowTo Convert Videos on Windows with Mencoder

Mencoder is a powerfull converter, that allows to convert nearly all types of video into any other format. There is a couple of frontends out there but most of them are complicated to use or lack functionality. My goal was to be able to have a "one click" solution to convert a video into some format, using a predefined set of settings.

I did this simply using the "SendTo" feature on windows. At the end you can convert the videos using the context menu:

The following steps are necessary:

  1. Download mencoder and codec packs:
    Mencoder can be downloaded for the sourceforge page. Use the latest versions. Unpack to a suitable directory. Afterwards download the binary codec packs from the mplayer page and install them into the codec directory below mencoder.
  2. Download a batch file that calls mencoder with various options.
    The basic syntax for calling this batch file is:
    encode.cmd [-s w:h] mode filename
    e.g.: encode.cmd -s 480:360 flv myVideo.avi
    After putting the script into any suitable directory, open it with notepad (or any other editor) and adapt the line
    set MENCODER=m:\programme\mplayer\mencoder.exe
    to your location of the mencoder binary.
  3. Create a link in your SendTo folder.
    I created a directory "convertes" below the sendTo folder. This folder is found (on a german system) e.g. at C:\Dokumente und Einstellungen\<username>\SendTo. Allow showing hidden files in explorer!
    Within this directory create links to the converter script as shown in the pictures below. Those are always 2 steps:
    1. create the link
    2. change the settings to have the mode (and optional the scale) after the destination

After you have created any suitable links, you can now start using it via the context menu. If you need other conversions, just add them as new modes to the batch file like follows:

if "%mode%" == "pal-dvd" (
set modeok=1
%MENCODER% -ofps 25 -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:-3,harddup -srate 48000 -af lavcresample=48000 -lavcopts \ vcodec=mpeg2video:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=5000:keyint=15:acodec=ac3:abitrate=192:aspect=4/3 -o %ofile%.mpg %2

As variables you can use here:

  • %mode% - the mode parameter from the command line
  • %MENCODER% - the mencoder command
  • %scale% - the scale parameter
  • %ofile% - the name of the input file without extenstion - normally used as name for the output file.

The following links can give you more ideas for suitable conversions: