AW: playback H264 encoded file too fast

Thornton, Keith keith.thornton at zeiss.com
Thu Jul 11 12:26:08 UTC 2019


H264 normal doesn't store timestamps. The Buffers going into your Encoder are in PTS order (Presentation Time). The buffers coming out of the Encoder are in DTS order (Decode Time). If you add a Muxer to your pipeline This information will be stored in the mp4 Header blocks. When it is played, the demuxer takes this information and passes it to the decoder so that your recording will be played at the proper speed.

-----Urspr√ľngliche Nachricht-----
Von: gstreamer-devel <gstreamer-devel-bounces at lists.freedesktop.org> Im Auftrag von jles
Gesendet: Donnerstag, 11. Juli 2019 12:50
An: gstreamer-devel at lists.freedesktop.org
Betreff: Re: playback H264 encoded file too fast

Hi Vinod, 

Thanks for your answer. I see what's the issue but I'd like to understand this a bit better.... 

I'm already adding timestamps here: 
       (........) 
        g_object_set(G_OBJECT(appsrc), "do-timestamp", TRUE, NULL); 
       (........) 
        GST_BUFFER_PTS (buffer) = timestamp; 
        GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1, GST_SECOND,
(guint8) fps); 
        timestamp += GST_BUFFER_DURATION (buffer); 

That timestamps look like are added to the GST buffer right? so can I assume that they are only use in the gstreamer flow and they are not added to the frames during H264 encoding? 

So a solutions seems to be to add the H264 stream into a mp4 container right?

Would it possible to do that with the generated H264 file, without the time stamp info? or what would it be the "best way" to do it?








--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


More information about the gstreamer-devel mailing list