Mencoder: Very annoying video/audio sync problem..
  • Order of the Butterfly
    Order of the Butterfly
    AmigaMancer
    Posts: 265 from 2005/8/25
    Hi.
    As my Amiga is not powerful enough to play most of the AVI codec movies, i'm trying to convert them to MPGs which is a format my Amiga can easily handle with only some minimal frame skip.
    I have major and very annoying problem with this though..:
    The mpg converted movies are played with the audio being out of sync with the video! For example, i see someone moving his mouth and after some seconds i hear him talking...

    What i have observed is that the MPGs which i produce with mencoder are being played without any frame-skipping whatsoever. Even if this is _absolutely_ required in order to achieve audio/video synchronization.
    I even did this test. I run a very cpu consuming task and then i tried to play these MPGs: Not even one frame was skipped. I'm not sure if this is the source of the problem, but i know that this isn't normal! I mean, when i play movies which were originally encoded as MPGs from the beginning, i do get some frame-skipping and the audio/video sync is PERFECT!

    As you can see in this link:
    http://www.amiga.org/modules/newbb/viewtopic.php?topic_id=32576&forum=9
    i've also tried to do the same proccess using FFmpeg and got similar problems like with mencoder!
    What could i possibly be doing wrong?! :-x Please help.


    [ Edited by AmigaMancer on 2007/4/30 11:37 ]
    Amiga 1200 user.
  • »30.04.07 - 10:31
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Wishmaster
    Posts: 342 from 2003/6/29
    Try using -vf harddup when encoding and
    -framedrop -autosync 30 for playing.

    [ Edited by Wishmaster on 2007/4/30 11:08 ]
    Pegasos PPC
  • »30.04.07 - 11:07
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    AmigaMancer
    Posts: 265 from 2005/8/25
    Quote:

    Try using -vf harddup when encoding and
    -framedrop -autosync 30 for playing.

    Thanks. Now we're getting somewhere.
    MPlayer frame-skips as it should now and the audio/video is synchronized, BUT: Only MPlayer works properly with these videos and this is a problem because MPlayer is not the best choise for classic Amigas, as it is slow.
    AMP (Amidog's player) and Frogger still plays Mencoder produced videos without any frame skipping and thus fail to synchronize. (Although both players have frame-skip enabled by defalt!! :-?) It's still as i describe it in the 2nd paragraph in my above post. Does anyone know why?
    While trying different players, i saw that riva fails to play these videos at all. It just freezes.
    All of these players have no problems with original MPGs, hmm.... :-?

    The command line that i'm using is: Mencoder input.avi -o output.mpg -of mpeg -ovc lavc -oac lavc -lavcopts vcodec=mpeg1video -vf harddup


    [ Edited by AmigaMancer on 2007/4/30 16:23 ]
    Amiga 1200 user.
  • »30.04.07 - 14:59
    Profile
  • MorphOS Developer
    CISC
    Posts: 619 from 2005/8/27
    From: the land with ...
    Try -mc 0 -noskip


    - CISC
  • »30.04.07 - 19:37
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    AmigaMancer
    Posts: 265 from 2005/8/25
    Quote:

    Try -mc 0 -noskip


    - CISC


    I added these options to Mencoder's command line. I'm not sure yet which of the 2 options did the trick but i think that the output MPGs are being played with proper synchronization now. Well, at least with AMP. Riva still can't handle these MPG's but nevermind about that
    MPlayer with -framedrop and -autosynch 30 continues to play them correctly as before.

    An interesting observation is that unlike with original MPGs in which AMP skips frames to maintain audio/video synch, with MPGs produced by Mencoder it never skips frames! It periodically (sort of) fluctuates the frame rate of the video instead. Interesting..
    I would prefer the ordinary frame-skipping method but if it can not be done, it's ok.

    [ Edited by AmigaMancer on 2007/5/1 14:17 ]
    Amiga 1200 user.
  • »01.05.07 - 13:12
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    AmigaMancer
    Posts: 265 from 2005/8/25
    On further investigation the issue is not fixed. Just got a little better. I tried to convert movies of bigger resolution (where frame-skipping is mandatory) with the options -vf harddup, -mc 0, -noskip and the audi/video synch is still messy (f.e. interruptable sound instead of skipped frames) in every available video player except MPLayer. I'm pretty convinced that this is due to that all Amiga players except MPLayer refuse to perform frame skipping with Mencoder's MPGs.. For some strange reason...
    I also tried to burn a VideoCD using the command line provided here: (paragraph "14.8.5.7.?PAL VCD")
    http://www.mplayerhq.hu/DOCS/HTML/en/menc-feat-vcd-dvd.html
    +VCDGear+MakeCD, and when i tried to play it with my stand-alone DVD it was a mess.
    Anyway, i think i'm going to give up on this. :-)



    [ Edited by AmigaMancer on 2007/5/5 10:51 ]
    Amiga 1200 user.
  • »05.05.07 - 09:46
    Profile