Transmit absolute time

Sebastian Dröge sebastian at centricular.com
Thu Oct 22 03:45:38 PDT 2015


On Do, 2015-10-22 at 12:29 +0200, Pietro Bonfa' wrote:
> On 10/21/2015 04:26 PM, Sebastian Dröge wrote:
> > However
> > the timestamps (PTS) are not the interesting things. The
> > corresponding
> > clock-time is.
> 
> Ok, so if I cannot trust PTS think I'm lost again.
> 
> If by "clock-time" you mean gst_segment_to_running_time or
> gst_segment_to_stream_time this is not sufficiently accurate (see
> code
> attached).
> 
> Considering this pipeline
> 
> "appsrc name=mysrc ! autovideoconvert ! x264enc tune=\"zerolatency\"
> !
> appsink name=mysink"
> 
> I provide a piece of output
>  [...]
> 
> As you can see PTS + begin (begin is my own field where I save the
> time when the first frame was produced) corresponds to when the
> function is called (1002:12:00.116792629 vs 2:12:00.116802521) while
> instead gst_segment_to_stream_time + base_time is off by about 8 ms
> if I consider the encoded frame with PTS 3600001000000000.
> 
> Do I have alternatives to gst_segment_to_stream_time or
> gst_segment_to_running_time?

gst_segment_to_running_time() + gst_element_get_base_time() should give
you the *accurate* clock time. If it doesn't, there is a problem
somewhere. It shouldn't be off by 8ms, maybe by +/- 1ns due to
rounding.

-- 
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/20151022/19de403c/attachment.sig>


More information about the gstreamer-devel mailing list