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

Sameer Naik sameer at damagehead.com
Wed Oct 24 11:39:22 CEST 2007


On Wed, 2007-10-24 at 16:29 +0800, Volter Yen wrote:
>  
> Hi Sameer,
>  now the problem is that the dsp decoder is blackbox(put encoded datum
> in, 
> and get decoded datum out)for me ,It is obvious that it would no set
> the 
> outbuffer's TIMESTAMP, so how should I set the correct timestamp of
> video 
> outbuffer in my application? how to decide the  timestamp value of the
> video 
> outbuffer from my dsp decoder?   I have an idea, set the timestamp of
> audio 
> out buffer from the alsasink to the videooutbuffer and update it
> dynamicly 
> with the bus-message mechanism of that the sink element, is that
> fesible and 
> resonable? 
> there is a new question :
>   say that datum from the audio and video buffers with same
> timestamp(the demuxer set the timestamp and duration on the buffer
> before it is pushed out to the decoder),if the timestamp of audio and
> video decoder outbuffer putted to the sink element, must be the same? 
> thanks!
> volter
>  

alright,
im sure when u input encoded data to the dsp decoder, you would be able
set some id on the frame inputted, now if this id is a datatype of 32 or
more bits, then you can directly set the id as the frame timestamp or
else you would have to store the corresponding timestamp values for the
id's in an array or linked list.
now when you get the decoded frame from the dsp use the decoded frame to
figure out the frame timestamp.
its as simple as that

better luck
~sameer

>  
> 
> 在2007-10-24,"Sameer Naik" <sameer at damagehead.com> 写道:
>         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
>         
> 
> 
> 
> ______________________________________________________________________
> LOGO
> 把爱心注入牛奶,共同凝聚这份力量
> 快来参加蒙牛免费赠奶爱心行动 





More information about the gstreamer-devel mailing list