timecodestamper after webrtcbin -> decodebin failed ?

Sebastian Dröge sebastian at centricular.com
Sat May 16 08:33:17 UTC 2020


On Fri, 2020-05-08 at 20:52 +0200, Michael wrote:
> 
> I try to add a `timecodestamper` and a `timeoverlay` after a
> `decodebin`
> 
> [...]
> 
> which I put after a `webrtcbin`
> 
> ** (python3:1527): CRITICAL **: 18:44:43.253:
> gst_video_time_code_add_frames: assertion
> 'gst_video_time_code_is_valid (tc)' failed
> 
> Why isn't that possible?
> Or better why doesn't the webrtcbin -> decodebin offer a timestamp?

The problem is not about timestamps here. Note that timecodes and
timestamps are completely different things, the former acting more like
a "frame label" while the latter are used for actual synchronization.
webrtcbin (and RTP streams in general) provide timestamp information
but not timecodes. There are some RTP extensions for carrying timecodes
over RTP though, if that's something you need, but this is not
standardized for WebRTC. You could make it work between GStreamer
applications, or other custom applications, but web browsers would
simply ignore that.

For the actual problem here with timecodestamper: RTP streams generally
have no fixed framerate, so you get 0/1 as framerate. Timecodes however
only make sense with a fixed framerate, so the above always gives you
invalid timecodes.

To solve this you need to use a videorate element before
timecodestamper to enforce a fixed framerate, and after videorate a
capsfilter that specifies the framerate you want to have. Then
timecodestamper gets a fixed framerate stream of a given framerate, and
can properly generate timecodes for that.

What do you want to use the timecodes for?

-- 
Sebastian Dröge, Centricular Ltd · https://www.centricular.com



More information about the gstreamer-devel mailing list