0

Is there any way to calculate real bitrate of incoming RTSP stream?

I've used "current-level-bytes" property of queue element, but result was unacceptable. I've also tried gst_element_query_duration with GST_FORMAT_BYTES on rtspsrc but it gives 0.

  • Please provide enough code so others can better understand or reproduce the problem. – Community Jul 28 '23 at 15:54
  • You may use `gst-play-1.0 -v your_rtsp_stream_uri` and you'll see in the stats the bitrate that will take some time to converge to its true value. You may filter with grep such as `gst-play-1.0 -v your_rtsp_stream_uri | grep GstSelectorPad`, let it run for one minute and you would have a good estimation. – SeB Jul 29 '23 at 14:06

1 Answers1

0

You can try gst-perf in your pipeline, it will display the framerate and the bitrate.

If you want to know how to calculate the bitrate, take a look at the code. The plugin is a transform type, and in the transform handler gst_perf_transform_ip, the bitrate is calculated using the time between buffers and the buffer size (gst_util_get_timestamp, gst_buffer_get_size).

If you have a pipeline in C, you can add this functionality to a appsrc/appsink part, or use a pad to catch all buffers, and do these operations.

PierreOlivier
  • 1,387
  • 9
  • 23