Is it possible to do Audio and Video synchronization for parallel pipelines

Thiago Santos ts.santos at sisa.samsung.com
Thu May 22 05:42:54 PDT 2014


On 05/21/2014 01:13 PM, Manoj89 wrote:
> Hi,
>     I am creating a proper pipeline with gst_pipeline_new()
>
> (i)   It is like this
>     data->pipeline = gst_pipeline_new("test-pipeline");
>    
> gst_bin_add_many(GST_BIN(data->pipeline),data->videoappsrc,data->videoparser,data->videodecoder,data->videoconvert,data->videosink,data->audioappsrc,data->audioparser,data->audiodecoder,data->audioconvert,data->audiosink,NULL);
> gst_element_link_many(data->videoappsrc,data->videoparser,data->videodecoder,data->videoconvert,data->videosink,NULL);
> gst_element_link_many(data->audioappsrc,data->audioparser,data->audiodecoder,data->audioconvert,data->audiosink,NULL);
>
> (ii) PTS which i get along video frame or audio frame is assigned to
> gstbuffer like this
>
>       GST_BUFFER_TIMESTAMP(buffer) = videoframe.pts
>       GST_BUFFER_TIMESTAMP(buffer) = audioframe.pts
>
>      Merely doing this and passing it through appsrc doesnt give AV sync so I
> was trying to get into GstSegment and try to synchronize it.
Are those pts properly aligned from the source? Are you using any custom 
GstSegment or the default? If the GstSegment is the default and the pts 
are correct it should play in sync. Have you configured appsrc properly 
by setting it to operate in 'time' format instead of the default 'bytes'?

I would only go setting GstSegment fields to offset the running time if 
I was sure that the pts are not correct and there is no way of fixing 
them at the source. IIRC the name of the field is also 'offset', but 
this is all explained in the part-synchronization.txt link I already 
sent you (cgit.freedesktop.org/gstreamer/gstreamer/tree/docs/design).

>
>
>
> --
> View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Is-it-possible-to-do-Audio-and-Video-synchronization-for-parallel-pipelines-tp4667075p4667084.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


-- 
Thiago Sousa Santos
Senior Multimedia Engineer, Open Source Group
Samsung Research America - Silicon Valley



More information about the gstreamer-devel mailing list