[MEncoder-users] A/V synchronization problem using mencoder

Nico Sabbi nsabbi at tiscali.it
Wed Mar 30 10:38:40 CEST 2005


Xie Bo wrote:

>>Try adding to the mencoder command '-mc 0 -noskip'.
>>Might help.
>>
>>    
>>
>I tried and the following is log:
>----------------
>mencoder -mc 0 -noskip dvd:// -of mpeg -o output.mpg -oac copy -ovc
>copy -mpegopts format=dvd
>MEncoder dev-CVS-050329-09:49-3.2.3 (C) 2000-2005 MPlayer Team
>
>MPEG-PS file format detected.
>VIDEO:  MPEG2  720x480  (aspect 3)  29.970 fps  7500.0 kbps (937.5 kbyte/s)
>[V] filefmt:2  fourcc:0x10000002  size:720x480  fps:29.97  ftime:=0.0334
>==========================================================================
>Opening audio decoder: [liba52] AC3 decoding with liba52
>No accelerated IMDCT transform found
>AC3: 5.1 (3f+2r+lfe)  48000 Hz  384.0 kbit/s
>Using MMX optimized resampler
>AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000)
>Selected audio codec: [a52] afm:liba52 (AC3-liba52)
>==========================================================================
>PACKET SIZE: 2048 bytes
>videocodec: framecopy (720x480 24bpp fourcc=10000002)
>audiocodec: framecopy (format=2000 chans=2 rate=48000 bits=16 bps=48000 sample-1
>)
>Writing AVI header...
>Limiting audio preload to 0.4s
>Increasing audio density to 4
>AUDIO FRAME SIZE: 1536, DELTA_PTS: 2949120 (-35982206469911781000000000000000000
>000000000000000000000000000000000000000000000000000000000.000)
>Pos:   0.4s     12f ( 0%)   0fps Trem:   0min   0mb  A-V:0.000 [0:0]
>demux_mpg: 24000/1001fps progressive NTSC content detected, switching framerate.
>
>  
>


there is something  wrong here. The line reading AUDIO FRAME SIZE has 
correct values,
but shows a fake double value; the corresponding lines of source are:

                spriv->aframe_delta_pts = ((double) spriv->frame_size / 
(double) spriv->bitrate);
                //spriv->delta_pts = (uint64_t) (spriv->aframe_delta_pts 
* 92160000);
                spriv->delta_pts = (uint64_t) (92160000 * 
spriv->frame_size) / spriv->bitrate;
                mp_msg(MSGT_MUXER, MSGL_INFO, "AUDIO FRAME SIZE: %u, 
DELTA_PTS: %llu (%.3lf)\n", (uint32_t) spriv->frame_size, spriv->delt
a_pts, spriv->aframe_delta_pts);

why isn't the %.3lf respected?

Anyway, is the desync constantly off by the same amount or does it vary 
over time?
Did you try, as Rich suggested, to use only -mc 0 ?
 

    Nico




More information about the MEncoder-users mailing list