AW: playback H264 encoded file too fast

jles jlesquer at gmail.com
Tue Jul 16 16:14:30 UTC 2019


An update:

I tried to replace:
            GST_BUFFER_PTS (buffer) = timestamp;
	    GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1,
GST_SECOND, (guint8) fps);
	    timestamp += GST_BUFFER_DURATION (buffer);

With:

		clock = gst_element_get_clock (GST_ELEMENT_CAST (appsrc));
		if (clock) {
		 base_time =
		 gst_element_get_base_time (GST_ELEMENT_CAST (appsrc));
		 now = gst_clock_get_time (clock);
		 if (now > base_time)
			 now -= base_time;
		 else
			 now = 0;

		 gst_object_unref (clock);
			GST_BUFFER_PTS (buffer) = now;
			GST_BUFFER_DTS (buffer) = now;
		}

I've checked these last calculate timestamps ("now") , and they match with
the camera framerate so I'm assuming they're correct... but unfortunately it
didn't work either, the resulting file still playing faster...

I tried to push a black and white testing buffer instead the camera frames,
through same pipeline and the resulting video plays fine at the speed I set,
in this case I used 1/2s:
           GST_BUFFER_PTS (buffer) = timestamp;
	    GST_BUFFER_DURATION (buffer) = gst_util_uint64_scale_int (1,
GST_SECOND, 2);
	    timestamp += GST_BUFFER_DURATION (buffer);

 It doesn't matter what I'm doing the video always plays faster when I'm
feeding live stream....

Any light on this would be appreciated. 



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list