[MEncoder-users] Problems encoding DVD from Canon HD Video

Gabri Nurtinaz Shally gabri.ns at gmail.com
Sun Aug 12 19:51:36 CEST 2012


On 8/13/12, Ross Clement <rossclement at gmail.com> wrote:
> Dear all,
>
> Could anyone send me a "no-apologies" bash script (or similar) for PAL
> DVD MPEG2 that I could try to see if it fixes the problem?
>

this is my windows batch file.
i successfully create 3 DVD Videos using this script.
well, i'm using DVD Styler too to build the DVD.
-- encode2dvd.bat
@ECHO off
SETLOCAL
SET mencoder=D:\Programs\SMPlayer\MPlayer\mencoder
IF EXIST "%~1" SET filename="%~1"

rem %~1          %~2       %~3     %~4
rem output_file  lavcopts  option  output_folder

IF EXIST "%~4%~n1.mpeg" GOTO EP
IF EXIST "%~n1.log" GOTO LOG
TITLE Encoding %~n1 pass 1
@ECHO on
%mencoder% -passlogfile "%~n1.mpeg.log" -o nul -ofps 30000/1001 -ovc
lavc -oac pcm -lavcopts
threads=2:vcodec=mpeg2video:vqcomp=0.8:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=2500:keyint=18:trell:mbd=2:precmp=2:subcmp=2:cmp=2:dia=-10:predia=-10:cbp:mv0:vqmin=1:lmin=1:dc=10:vstrict=0:aspect=16/9:acodec=ac3:abitrate=192:vpass=1:turbo:%~2
-vf scale=720:480,harddup %~3 %filename%
@ECHO off
REN "%~n1.mpeg.log" "%~n1.log"
:LOG

TITLE Encoding %~n1 pass 2
IF EXIST "%~n1.log.tmp" DEL "%~n1.log.tmp"
COPY "%~n1.log" "%~n1.log.tmp"
@ECHO on
%mencoder% -passlogfile "%~n1.log.tmp" -o "%~4%~n1.mpg" -of mpeg
-mpegopts format=dvd:tsaf -ofps 30000/1001 -ovc lavc -oac lavc
-lavcopts threads=2:vcodec=mpeg2video:vqcomp=0.8:vrc_buf_size=1835:vrc_maxrate=9800:vbitrate=2500:keyint=18:trell:mbd=2:precmp=2:subcmp=2:cmp=2:dia=-10:predia=-10:cbp:mv0:vqmin=1:lmin=1:dc=10:vstrict=0:aspect=16/9:acodec=ac3:abitrate=192:vpass=3:%~2
-vf scale=720:480,harddup -af lavcresample=48000 -srate 48000 %~3
%filename%
@ECHO off
IF %ERRORLEVEL% == 0 (
  DEL "%~n1.log"
  REN "%~n1.log.tmp" "%~n1.log"
) ELSE (
  DEL "%~n1.log.tmp"
  DEL "%~4%~n1.mpg"
)
IF EXIST "%~4%~n1.mpg" REN "%~4%~n1.mpg" "%~n1.mpeg"
:EP

ENDLOCAL
-- encode2dvd.bat --

example:
encode2dvd input.mov "lavc_option" "global_option" "output_dir"

output file name will be same with input name, except with .mpeg extension.
well, the output will be an NTSC video. why do you prefer PAL over NTSC?
your video is 16:9, it will be best suited using NTSC.
it has 60 fps, using 30 fps NTSC will reserve more frame.
if you still prefer PAL, you can add "-vf scale=720:576 -ofps 25" in
global option.

when you sure there is no error in the script,
you can add "-msglevel all=1" in global option to remove skipping frame message.


More information about the MEncoder-users mailing list