Results 1 to 4 of 4

Thread: Mencoder audio delay

  1. #1
    Join Date
    Jul 2006
    Location
    Newcastle, Australia
    Beans
    63
    Distro
    Ubuntu 12.04 Precise Pangolin

    Mencoder audio delay

    Here's what I do:
    [1] Rip a dvd to the hard drive like so:
    Code:
    mplayer -dvd-device /media/SOME_MOVIE -alang en dvd://1 -dumpstream -dumpfile /path/to/output.VOB
    [2] Encode to XVid/MP# avi file:
    Code:
    mencoder -ovc xvid -xvidencopts bitrate=1024 -oac mp3lame -o /path/to/output.avi /path/to/output.VOB
    When I'm done the resulting file plays fine in Totem, but in MPlayer the audio is about 500ms out of sync. I can always just adjust the delay using the numpad +/- buttons after I open MPlayer, but it seems like it just shouldn't be this way.

    It seems to only happen with some DVDs and not others though. My most recent attempt that gave me the strange AV delay had a resulting VOB file that was 5.8Gb and I'm wondering if the large file size has any effect. It also seems that in the encoding step, some files generate a large number of "Skipping frame!" lines near the start (I am wondering if this is what causes the desync). I will have to test a few more DVDs i guess to see if there is a correlation.

    Anybody else have these issues with mencoder/mplayer?
    Last edited by fatalGlory; February 3rd, 2009 at 08:33 AM.
    respLect.com home of the stuff I do in my spare time. Some of it is kind of cool.
    Life is why I have to die today.

  2. #2
    Join Date
    Dec 2006
    Beans
    6,926

    Re: Mencoder audio delay

    Hi,

    Something simple to try might be the filter 'harddup'. This would make your syntax:

    Code:
    $ mencoder -ovc xvid -xvidencopts bitrate=1024 -vf harddup \
    -oac mp3lame -o output.avi input.VOB
    One thing to remember with this option is that it needs to be at the end of the video filter chain. Details can be seen here.

    Edit: Corrected the 'hardup/harddup' error.

    Andrew
    Last edited by andrew.46; February 3rd, 2009 at 08:31 PM. Reason: error
    You think that's air you're breathing now?

  3. #3
    Join Date
    Jul 2006
    Location
    Newcastle, Australia
    Beans
    63
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Mencoder audio delay

    Gave it a try, also tried -vf softskip, no dice. BTW, for anyone trying it, its actually "harddup" (note the double d). Thanks anyway.

    EDIT: I think I may have found a fix. For the movie I have been trying to encode while writing this, audio sync problem seems to go away if I use the -noskip with mencoder. I still get a whole lot of "Skipping frame!" messages, which seems odd, but the sync is right at least. Also seems strange that I would need to do this for some dumpped VOB files but not all.

    Still, if it works it works

    EDIT 2: On closer inspection, adding -noskip makes the audio sync up in mplayer, but when I try to play the movie in Totem (and probably other players), I get the reverse problem, audio that once lagged behind now plays prematurely. Better to encode for non-mplayer players I guess since mplayer has such simple support for setting the A-V delay during playback. Also points to a problem with mplayer's playback rather than encoding I suppose since other players handle the encoded file properly.
    Last edited by fatalGlory; February 3rd, 2009 at 10:54 PM. Reason: Found a fix
    respLect.com home of the stuff I do in my spare time. Some of it is kind of cool.
    Life is why I have to die today.

  4. #4
    Join Date
    Jul 2006
    Location
    Newcastle, Australia
    Beans
    63
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Mencoder audio delay

    Solution found! It appears AVI files work better with constant bit rate audio than variable bit rate audio.

    After reading this thread (about VBR vs. CBR and the AVI container) I decided to try encoding with CBR (constant bit rate) mp3 audio and now the video playback is fine in all players.

    I used this command:
    Code:
    mencoder movie.VOB -ovc xvid -xvidencopts bitrate=1024 -oac mp3lame -lameopts cbr:br=128 -o /media/scratch/Videos/Movies/movie.avi
    All good now.
    respLect.com home of the stuff I do in my spare time. Some of it is kind of cool.
    Life is why I have to die today.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •