<div dir="ltr">Hi,<div><br></div><div>Is there a guide to achieving good audio/video sync when using libavformat?</div><div><br></div><div>I'm generating .mov files and setting the PTS on both audio and video frames based on the same system clock, but for some reason when played back in ffplay/mplayer the video always runs faster than the audio.</div><div><br></div><div>Should one not set the audio and video frames' PTS based on the same system clock?</div><div><br></div><div>Using 'ffplay -sync audio' reports a close to zero A-V delay on the command lne but the video starts in sync and quickly ends up playing several seconds ahead of the audio.</div><div><br></div><div>Using 'ffplay -sync video' does report a growing A-V delay and similarly the video is playing faster than the audio. In this mode it also resamples the audio which becomes deeper.</div><div><br></div><div>I've included the first few seconds worth of ffprobe -show_frames debug here in case that helps: <a href="https://pastebin.com/69Mcageb">https://pastebin.com/69Mcageb</a></div><div><br></div><div>Any hints would be much appreciated.</div><div><br></div><div>Thanks,</div><div>Kelvin.</div><div><br></div><div><br></div><div><br></div></div>