VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. For the past few years I've been using Mencoder to convert ripped DVDs to Divx5/AVI. Up until a few months ago, I was watching the AVIs on a modded Xbox running XBMC, until it finally rolled over and died. Last week I bought a WDTV Live to replace it. It worked great, playing a few videos I had downloaded. However, when I tried to play AVIs I'd made with Mencoder, the video was constantly pausing, about every 5-8 seconds, for a second or two. When it unpaused, the audio would be out of sync briefly, until the next pause.

    I've tried for a week to find a solution to the problem, trying a few different things in Mencoder, and nothing has worked. I need help, desperately. Right now I have a $150 device that can't play 90% of my video library correctly.

    Below is the original Mencoder settings I'd used. Honestly, I have no idea what most of the video codec settings do - this was cobbled together from multiple Google searches, and has evolved over several years as I tried to increase the video quality.

    Code:
    mencoder -alang en $CHAPNUM -dvd-device $VIDPATH -sws 2 -oac mp3lame -lameopts mode=2:cbr:br=96:vol=$VOL -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=$BITRATE:vpass=$PASSNUM -vf crop=$CROP,scale -zoom -xy $SCALE -ffourcc DX50 -o $OUTNAME >> .mencodedvd_status
    As the variables show, this is wrapped in a bash script. It uses 2-pass encoding, and the crop & scale settings are determined in a "preview run" of mencoder earlier in the script; takes about 15 seconds to get them. All the other variable values come from the command line.

    This is what I tried the first time after noticing the problem. I'd come across a post saying that the WDTV doesn't support Global Motion Compensation, so this setting changes the codec to Xvid and explicitly turns GMC off. This didn't fix the problem (in fact, it didn't seem to do anything). A check of some videos with MediaInfo showed that GMC was never on in the first place.

    Code:
    mencoder -alang en $CHAPNUM -dvd-device $VIDPATH -sws 2 -oac mp3lame -lameopts aq=0:abr:br=192:vol=$VOL -ovc xvid -xvidencopts autoaspect:qpel:nogmc:nochroma_opt:bitrate=$BITRATE:pass=$PASSNUM -vf crop=$CROP,scale -zoom -xy $SCALE -o $OUTNAME >> .mencodedvd_status
    I'm at a real loss here. I don't know what the problem is, much less how to fix it, or even which direction to explore. If anybody can help me, or even just suggest some improvement to my settings (heck, maybe we'll get lucky and some innocuous suggesting will fix it), I'd be eternally grateful. Otherwise, I'll have to try to dump this device on Craiglist.

    Thanks
    Quote Quote  
  2. Can you make a small sample available? I'll try it on my WDTV Live and see if I can find anything "wrong". I don't use mencoder but are there any settings for A/V interleaving? VirtualDub normally interleaves audio frame by frame.

    A few things you can try: remux the audio and video with VirtualDub or Mpeg4Modifier. See if it plays any differently. Try turning off/on packed bitstream (I haven't had any problems with either with files produced by VirtualDub). Encode only the video and see if the problem persists.
    Quote Quote  
  3. Originally Posted by jagabo
    Can you make a small sample available? I'll try it on my WDTV Live and see if I can find anything "wrong".
    Absolutely; I'll take any help I can get. A 2min sample is attached. I checked it on my WDTV Live and it does have the pauses in it.

    Thanks.

    sample.avi
    Quote Quote  
  4. I know the problem persists even with the audio stripped out (tried that one yesterday). I gave Mpeg4Modifier a try, and a sampling of problem videos shows the pack bitstream checkbox grayed out, so that's a no-go.

    I've used VirtualDub in the past and am pretty familiar with it. I haven't used it in years since I discovered Mencoder. I'm downloading it now and will give it a try.
    Quote Quote  
  5. Got your sample and verified the WDTV Live pauses for about 2 seconds every 8 seconds or so. Here's what I think is happening:

    The AVI header is marked as 29.97 fps but the mpeg4 video seems to be 24 fps internally. So the WDTV plays the video at 29.97 fps and after 8 seconds finds there there is a discrepancy between where it is in the video and where it should be so it pauses the video for 2 seconds (24 * 10 / 8 = 30).

    There are some other unusual aspects to your encoding too:

    The video fourcc is FMP4 even though you specified DX50.

    There are no B frames so packed bitstream is not an issue.

    VirtualDub opens the file and shows the frame rate as 29.97 fps and it shows enough frames (3597) to last for the 2 minute running time at that frame rate. When I play the video with a video player (MPCHC for example) the video renderer (what's actually putting frames on the screen) shows ~24 fps. Single stepping through the video with VirtualDub shows a pattern of one duplicate frame every 4 frames. Again, this is the difference between 24 and 30 fps (24 * 5 / 4 = 30). I don't know exactly what's going on but there is some kind of confusion over whether the frame rate is 24 or 30 fps.

    I don't know mencoder but look to see if there are any frame rate options. Try specifying 23.976 fps instead of 29.97.
    Quote Quote  
  6. Wow, thanks for that analysis. I'd wondered about the FPS, as I noticed all my rips reported 29 FPS whereas most of the ones that played fine had 24. But a few reported 29 and played fine, so I didn't think that was the problem. Mine being reported as 29 but playing 24....well, I'd never even thought about that. There is an option in Mencoder to explicitly set the FPS, so that'll be my next step. I'll let you know if that fixes it.

    As for the other "unusual aspects"....well, like I said, the settings were cobbled together from multiple Mencoder scripts I found via Google, and evolved over the years in an never-ending quest to increase the video quality while keeping the Mbs/min roughly the same. I have no idea what fourcc, DX50, or a B-frame is (I've tried to read up on that stuff; I just end up with a headache).

    Thanks again for the help.
    Quote Quote  
  7. jagabo, I do believe you nailed it. I converted the sample video from 29.970 to 23.976 (I'm guessing you were rounding up when you said 24 fps) and played it back on the WDTV unit, and couldn't see any pauses at all.

    I want to verify by converting an entire movie, but the results are promising. I'll post an update later.
    Quote Quote  
  8. Yes, you should use 23.976 when converting most DVD sources. The exact value is 24000/1001.
    Quote Quote  
  9. Broken and jagabo

    I'm glad I found this thread! I have an avi video which VideoInspector reports is 29.97 fps. When I try to play it on my WDTV Live, it does the same as you describe here - pauses for a second or 2 every few seconds. When I play it with VLC on my computer, it plays fine. I'd like to try converting it to 23.976 fps which seems to have solved the problem for you.

    Broken, can you please tell me how you did it? I have VirtualDub but I'm not familiar with Mencoder.

    Thanks for your help!
    Quote Quote  
  10. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    edit - sorry, nevermind
    "Quality is cool, but don't forget... Content is King!"
    Quote Quote  
  11. an update:

    When I got home after reading this post, I ran my video frame by frame with VirtualDub and noticed that every 6th frame is a duplicate frame. VideoInspector told me the frame rate was 29.97 and so did VLC player. When playing on WDTV Live, the video freezes for a second every 8 seconds, and the sound gets out of sync.

    So, I made a direct stream copy using VirtualDub and converting the frame rate to 25 - I figured since every 6th frame was a duplicate, throw that one out and go to 5/6 * 30 = 25; this is probably not the right way to think about this, but it actually worked. Now it plays perfectly on the WDTV Live, and the audio is in sync. The file size is just a bit smaller than the original (1.38 GB instead of 1.39 GB). Checking on VirtualDub, there are no more duplicate frames.

    Incidentally, I found another video which is also 29.97 fps and it plays fine on the WDTV Live. I ran it with VirtualDub and in this case every 5th frame is a duplicate.

    So, converting the frame rate worked, but I don't really understand any of this in depth - can anyone explain it?
    Quote Quote  
  12. Member Soopafresh's Avatar
    Join Date
    Jan 2004
    Location
    United States
    Search Comp PM
    "Quality is cool, but don't forget... Content is King!"
    Quote Quote  
  13. Thanks - does VirtualDub process in a similar way if I asked for frame rate conversion rather than inverse telecine? Would the picture be better with inverse telecine? Why would WDTV be able to handle one video but not the other - does it have to do with how the video was originally encoded?
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!