[gst-devel] AV SYNC Problem of gstreamer when using customized dsp decoder

Sameer Naik sameer at damagehead.com
Wed Oct 24 09:33:29 CEST 2007


first of, the demuxer would set the timestamp and duration on the buffer
before it is pushed out to the decoder.
these timestamps have to be applied to the decoded buffer before you
push them further, unless you decide to change the framerate and stuff.

next, if your using a your own videosink plugin, make sure you subclass
the basevideosink, at it implements av synchronization mechanisms.
if you dont subclass the the basevideosink, then you will have to write
your own av sychronization code in the videosink plugin.

lastly, if your already doing the above and still don't get
synchronization, then set the "max-lateness" property (inherited from
the basevideosink) to some reasonable amount. xvimagesink for example
sets the default value of this property to 20000000, which is half the
duration of a frame at 25 fps.

and yes, also make sure you push a valid play segment (GstSegment)
before you push any buffers out of the decoder..this is very important.
or else gstreamer will flash a message saying buffer received without
new segment, assuming timestamps start from 0. and this will effect your
av sync if the timestamps do nor start from 0.

~sameer


On Mon, 2007-10-22 at 23:50 -0400, pritesh wrote:
> hi,
> if timestamp from decoder plugins are proper , 
> then av sync is done in video/audio sink plugins
> 
> if u have custom videosink plugin , is it subclassed from videosink
> base class, which derives from basesink.
> 
> 
> 
> 
> 
> --- On Mon 10/22, Volter Yen < volter619 at 163.com > wrote:
>         From: Volter Yen [mailto: volter619 at 163.com]
>         To: gstreamer-devel at lists.sourceforge.net
>         Date: Tue, 23 Oct 2007 10:55:56 +0800 (CST)
>         Subject: [gst-devel] AV SYNC Problem of gstreamer when using
>         customized dsp decoder
>         
>         Hi all,
>         
>         
>         
>         Recently, I want to implement a simple mpeg2-ts palyer using
>         gstreamer framework,and the decodec element are customized
>         with dsp, and my demuxer is flutsdemux, Gaurav have told me
>         that the demux will push the two on seperate pads in buffers
>         after applying the same timestamp ,and the the sinks (audio
>         and video ) will play the buffers depending on the stream time
>         and timestamps...
>         
>         and I have read the source code of mpeg2dec which used
>         libmpeg2, it will adjust the outbuffer's timestamps with the
>         related pts if necessarybut when I use a dsp decoder,It seem
>         that I can get only the decoded data from it's outbuffer,how
>         to adjust the videooutbuffer's timpstamps in order to avoid
>         meeting av sync problem?
>         
>         I could not find the av sync sample demo ,can anyone guide me
>         and/or give me some sample codes on the related subject?thanks
>         a lot!
>         
>         
>         
>         Best Regards
>         
>         Volter
>         
>         
>         
>         
>         
>         
>         
>         
>         =====================================================
>         
>         
>         
>         Happy everyday $ Best Regards!
>         
>         
>         
>         msn:volter619 at 163.com
>         
>         
>         
>         Focus on embed linux software!
>         
>         
>         
>         ______________________________________________________________
>         
>         
>         
>         
>         
>         
>         LOGO
>         
>         
>         
>         
>         
>         -------------------------------------------------------------------------
>         This SF.net email is sponsored by: Splunk Inc.
>         Still grepping through log files to find problems? Stop.
>         Now Search log events and configuration files using AJAX and a
>         browser.
>         Download your FREE copy of Splunk now >>
>         http://get.splunk.com/_______________________________________________
>         gstreamer-devel mailing list
>         gstreamer-devel at lists.sourceforge.net
>         https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
>         
>         
> 
> 
> ______________________________________________________________________
> Join Excite! - http://www.excite.com
> The most personalized portal on the Web! 
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________ gstreamer-devel mailing list gstreamer-devel at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gstreamer-devel





More information about the gstreamer-devel mailing list