@ECHO off SET width=320 SET height=auto REM Default: auto SET fps=25 REM Default: source (same framerate as input; you get an error if the framerate is not compatible) REM Valid framerates:5,10,12,15,24000/1001,24,25,30000/1001,30,50,60000/1001,60 SET audiobitrate=128 SET audiocodec=mp3 REM Default: mp3 REM you can use source if you don't want to transcode audio, audiobitrate is then ignored. SET videobitrate=600 SET videocodec=mpeg2video SET croptop=0 SET cropbottom=0 REM Default: 0 (no cropping) REM Offset between the top of the input video and the top/bottom of the cropped part in pixel. SET rotate=false REM Default: false REM set to true to rotate the video by 90 degrees. In this case set the height of your display as width. SET mencoder="D:\Gigabeat\Video\mplayer\mencoder.exe" REM Path to the mencoder.exe SET targetdir=%~dp0 REM Path to the directory for the encoded files REM using %~dp0 outputs the file to the dir where this batch file is located. REM !!!Don't edit below this line.!!! SET /a croph = %cropbottom% - %croptop% IF %cropbottom%0 GTR %croptop%0 ( SET crop=crop=0:%croph%:0:%croptop%, ) ELSE ( SET crop= ) IF %rotate%==true ( SET rotation=,rotate=1 ) ELSE ( SET rotation= ) IF %audiocodec%==source ( SET audio=-oac copy ) ELSE ( SET audio=-oac lavc -lavcopts acodec=%audiocodec%:abitrate=%audiobitrate% -af resample=44100:0:0 ) IF %fps%==source ( SET ofps= ) ELSE ( SET ofps=-ofps %fps% ) IF "%height%"=="auto" ( SET scale=-vf %crop%scale%rotation% -zoom -xy %width% ) ELSE ( SET scale=-vf %crop%scale=%width%:%height%%rotation% ) %mencoder% %1 -msglevel mencoder=1 -of mpeg %audio% -ovc lavc %ofps% -lavcopts vcodec=%videocodec%:vbitrate=%videobitrate%:keyint=60 %scale% -o "%targetdir%%~n1.rb.mpg" ECHO  PAUSE