NextPVR Forums

Full Version: DVD to MVP SYnch Issues using mencoder
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In trying to solve issues with Lip Synch and Subtitles Synch using mencoder to convert a DVD Folder into mpg so that I can play it on the MVP, i found the MVPRecoder plugin that seems to give me the best mpg as far as quality and Synch. The TimeStamps are not quite perfect, but I guess I can live with that. (I press 20 Skip to try to skip 20 minutes in the future and I skip about 3 minutes). But again that is not a big issue now. What I want to do is make it run a bit faster. I am only getting 13FPS and it takes more than 5 hours to encode something that is already MPG2 (a VOB Set), only I want to show subtitles and that needs to reencode.

My Entire mencoder line is :

c:\windows\mencoder.exe -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -ofps 24000/1001 -vf softskip,harddup -af volnorm,volume=16:1 -lavcopts vcodec=mpeg2video:lmin=2.1:lmax=42.0:vqmin=2:vqmax=18:vmax_b_frames=0:vqdiff=3:vme=4:mbd=2:vbitrate=6800:vratetol=13000:vrc_maxrate=9800:vrc_buf_size=1835:vpass=1:vi_qfactor=1.00:vi_qoffset=0.00:vqblur=0.0:vqcomp=0.5:vfdct=6:idct=1:mv0:ildctcmp=2:predia=6:dia=6:trell:cbp:preme=2:nr=0:dc=10:vqmin=2:vqmax=31:vmax_b_frames=2:keyint=16:mbcmp=0:preme=2:precmp=0:cmp=0Confusedubcmp=0:mbd=1:vb_qfactor=1.00:vb_qoffset=0.00:vi_qfactor=1.00:mbqmin=2:mbqmax=31:lmin=2.1:lmax=31:vqdiff=3:vhq:acodec=mp2:abitrate=192 -priority belownormal dvd:// -dvd-device "%1" -v -o "%2" -sid %3

Pbs. Is there anything you see there that can make it run a little closet to realtime ?

I am not intersted in doing AVI or MPEG4 encoding to save space on the hard drive. I want an MPG file that I can play reliably on the MVP, which is my primary GBPVR frontEnd. So I can live with 3.5 or 4 Gigs per movie.
too many options..alot of those are for archival quality encodes..
my line runs at about 45-50 fps so about 45 mins for 1 hr encode..[should be good for mvp] but i bet you'd be better converting at 352x480...the picture is great..hardly noticeable that it's half horiz. resolution...Smile[ but up to you,it can do full res fast too]
here's my usual line...adjust the 'qscale' to fit your quality needs..[constant quality]
Code:
Mencoder.exe "input.mpg" -priority belownormal -idx -vfm ffmpeg  -noskip  -vf tfields=0,tinterlace=0,fspp  -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf -lavcopts ildct:vratetol=10000:vqscale=4.9:vcodec=mpeg2video:vqmin=4:vrc_buf_size=1835:vrc_maxrate=9800:vmax_b_frames=2:keyint=15:acodec=mp2:abitrate=128:autoaspect -o "outfile.mpg"
add "-vf scale=352:480:1" to scale to half... [try it,ya might like it!]
let me know how that works for you..
mostly just copy the -vf part and the -lavcopts part....keep the rest of yours as is..
here's a little more info on the individual options..
-idx = re-index timestamps in file
-noskip = don't skip duplicate frames, encode them as new frames
-vfm ffmpeg = use ffmpeg decoders [built in one has problems with some streams]
-cache = caching for input
-ovc & -oac = codec for video and audio compression
-vf = video filters [use sparingly,some slow down alot,some don't] also place where scaling,3:2 pulldown etc. happens
-fps = input fps
-ofps = output fps
-of = format [mpeg/avi,etc.]
-mpegopts = mpeg options.. [format= dvd/ntsc-dvd/pal, etc.]

-lavcopts = this is where most of the quality settings are..usually only thing needing changes...
including
preme=pre-motion estimation
ildct = interlaced dct
ilme=interlaced motion estimation
vcodec=[usually mpeg2video]
vqscale= constant quality level,choose this or vbitrate=XXX for quality adjustments...
vrc*= video rate control stuff
vmax_bframes= bframes ratio,
keyint= keyframe interval,
acodec=audio codec,
abitrate=duh,
autoaspect= read aspect from input file,
-af= audio filters..[i use -af volume=16 for dvd's]
any others that are puzzling you?
Dude, Pbs .... That definetly needs to be a sticky.

Not even on the official mplayer/mencoder site will we find such helpful information.

I will try it later on tonight. I beleive that my problem is dropping frames. That is why, even with the -idx option, I loose Audio Symch and get really bad FF/Rew control on the mpg.

I'll let you know on my resulta with your script.
Thanks Pbs. Yesterday test was pretty good, as far as Quality and ability to Rewind and Skip. It did the whole movie in about 40 minutes.

If I wanted to run this script on a PVR350 captured MPG (Captured by GBPVR), do I need to make changes ? (other than dvd://1 and -dvd-device)

I capture all my shows at Medium Quality. It would be nice to start using this on a postprocessing.bat if it is as reliable with captured mpgs as it is with DVDs.
pBS. I wanted to thank you for that great insight on the Mencoder command line.

I have done now about 3 recordings and 2 dvds that I have mencoded with excellent quality, subtitles overlayed, no Synch issues and "Almost" , Good enough FW-REW skipping.

It is weird that If I play the exact same mpg using GBPVR on the PC I can skip to the second with ff/rew. But on the MVP it is about 2 minutes off. So to skip 5 minutes ahead I have to do something like 8 ->.

Other than that, you have restored my faith on mencoder.

By the way, does the "-vfm ffmpeg" option makes mencoder encode with ffmpeg instead of its own engine ? . May be this is why I am getting such good results.

Thanks again.