Note that there are some explanatory texts on larger screens.

plurals
  1. POLimiting send rate of gstreamer's udpsink
    primarykey
    data
    text
    <p>Is there a way to limit gstreamer's udpsink, if I'm sending out data without demultiplexing it?</p> <p>I have a pipe that needs to send out the stream unmultiplexed.</p> <p><code>filesrc ! tee name=t ! tsdemux ! ffdec_h264 ! videosink t. udpsink</code></p> <p>Where the main concern is this: <code>filesrc ! udpsink</code></p> <p>I don't see any way to limit it via the filesrc, queue, or udpsink options. Using <code>sync</code> doesn't work since, I'm assuming, there's no media stream to sync to. So, the result of using that pipeline is that the data is fed through the udpsink as fast as possible, which the receiving udpsrc can't handle.</p> <p>We've tried writing our own udpsink using the appsrc as a base element, with this packet limit scheme (there's a <code>thread.sleep(throttleDelay);</code> in the packet sending method):</p> <pre><code>/** * Update the delay to pause the packet sending thread. * Calculated by dividing how many bytes (roughly) need to be sent &lt;code&gt;packMaxSize&lt;/code&gt; * by the target bytes/sec rate to get how many seconds are needed. Then multiplying to get * time in milliseconds. */ private void updateThrottle() { if (targetRate &gt; 0) { throttleDelay = (long)((1000.0 * packetMaxSize) / (double)targetRate); if (throttleDelay &lt; 0) { throttleDelay = 0; } } else { throttleDelay = 0; } } </code></pre> <p>But this doesn't seem to work no matter what the speed is set to. Too slow and one frame gets through. Too fast and one or two get through. At the 'right' speed (500 kB/s), frames come in at 0.5-2 FPS, but it's horribly corrupted.</p> <p>Is this the correct way to go about this in code? Does gstreamer have any way to limit throughput?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload