[Ffmpeg-devel] Audio-video sync problem when transcoding to xvid in AVI

Michael Niedermayer michaelni
Tue Mar 14 12:19:23 CET 2006


On Mon, Mar 13, 2006 at 04:13:56PM -0800, Harikrishnan Varma wrote:
> Hi,
>  When using ffmpeg to transcode certain vob files to xvid, the
> audio-video tracks of the encoded file were out of sync. This happened
> irrespective of whether the audio or video stream was used for syncing.
> Investigating specific clips, I noticed that a lot of contigous frames
> were being dropped (in ffmpeg.c:do_video_out()) after the point of SCR
> reset and resulting PTS rewind in the input vob. Since frame dropping
> didn't happen at all SCR reset points, it seemed to be the magnitude of
> the negative PTS delta that was causing this to happen. 
> When the delta threshold to update input_files_ts_offset in ffmpeg.c was
> changed, it stopped dropping frames.
> The following condition:
> if(ABS(delta) > 10LL*AV_TIME_BASE && !copy_ts)
> Was changed to:
> if(ABS(delta) > 1LL*AV_TIME_BASE && !copy_ts)
> As a result of this, input_files_ts_offset was updated, which meant
> get_sync_ipts() called from do_video_out() had updated values after the
> SCR reset (PTS rewind)
> Why was a factor of 10 used for comparing the delta magnitude?

maybe there was a file which needed it, feel free to send a patch to make
it a user specifyable parameter



More information about the ffmpeg-devel mailing list