Audio/video synchronization with pre-buffered video

Sebastian Dröge sebastian at centricular.com
Fri Mar 17 10:06:57 UTC 2017


On Wed, 2017-02-15 at 12:03 -0500, Anton Protopopov wrote:
> Hello everyone,
> 
> I have a pipeline with live H264 video source and live AAC audio
> source muxed together using mpegtsmux. One problem with this pipeline
> is that the video encoder hardware can buffer some number of frames,
> so when I am creating and setting a pipeline to PLAYING state, there
> could be already, say, 1-2 seconds of video buffered. Audio is not
> buffered in hardware. So when the pipeline is set to the PLAYING
> state, video source produces a set of frames with almost the same
> time
> stamps and several first seconds of video are corrupted (they contain
> old video frames with some audio frames). Is there a way to
> synchronize such sources without dropping video frames?

That sounds like you're handling timestamps wrong. What should happen
is that buffers that belong together have the same timestamps, and if
you have 1-2s of video before the first audio, then the audio will just
start with a timestamps 1-2s later than the first video timestamp.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 963 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170317/389cb698/attachment.sig>


More information about the gstreamer-devel mailing list