re-ordering timestamps GstVideoDecoder

Sebastian Dröge sebastian at centricular.com
Sun Jan 25 05:51:26 PST 2015


On Fr, 2015-01-23 at 19:19 -0500, Nicolas Dufresne wrote:
> Le 2015-01-23 09:50, Thornton, Keith a écrit :
> >
> > I have a decoder plugin which makes use of the Intel QuickSync decoder 
> > under Windows 7 /64 bit. The Frames arrive from the GstVideoDecoder 
> > base class in DTS frame order.
> >
> > The QuickSync decoder re-orders the output frames and returns them in 
> > PTS order. When these frames are returned to the base class via 
> > gst_decoder_finish_frame, some frames are discarded with a warning 
> > “decreasing timestamp” This appears to be because the PTS timestamp in 
> > the frame is older than the most current PTS timestamp passed from the 
> > base class to my decoder.
> >
> > In the source code there is a comment that re-ordering is a TODO. It 
> > is also written that the derived class is responsible for setting the 
> > PTS correctly before calling gst_decoder_finish_frame.
> >
> If your decoder is giving reordered output, this TODO is not for you. 
> This is about reordering when the decoder does not do it.
> >
> > Has anyone else encountered this problem and has found a solution.?
> >
> Normally when you pass output buffer, you try and pass the frame ID. In 
> a way that the returned output has this frame ID attached. Then you get 
> the associate frame to finally finish the frame. If the PTS are not in 
> the right order, it might be that your decoder mixes frame ID or 
> something. Or that you are mixing frame IDs. Unless the input is wrong, 
> but for that you would have to share more information.

My best guess for the problem here is that you're not mapping the input
frames to the output frames correctly. How do you get the
GstVideoCodecFrame that you finish? It must be the one that contained
the encoded video frame that corresponds to the decoded video frame you
got. This is what Nicolas meant.

Note that gst_video_decoder_get_oldest_frame() gives you the oldest
frame in DTS order, not PTS order. So if you need something like that,
take a look at what gst-omx or androidmedia are doing. But ideally you
will have a way to put something like the frame id into the buffer you
give to the quicksync API, and the corresponding output buffer then also
contains it and allows you to directly retrieve the correspnding
GstVideoCodecFrame.

-- 
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: 949 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20150125/a2b77a1f/attachment.sig>


More information about the gstreamer-devel mailing list