<div dir="ltr"><div><div><div><div><div><div>Is there a method/mechanism by which one can prepend data to the beginning of a data stream? Currently I use a shell script with unnamed pipes, but that has limitations and can affect packet boundaries. Here is one example:<br>
<br><div style="margin-left:40px">(<br></div><div style="margin-left:40px"> echo SOMETHING_TO_PREPEND<br></div><div style="margin-left:40px"> gst-launch -v audiotestsrc is-live=true !\<br></div><div style="margin-left:40px">
queue !\<br></div><div style="margin-left:40px"> fdsink fd=3 3>&1 1>&2<br></div><div style="margin-left:40px">) | nc $host $port<br></div><br></div>Usually the above example works nicely, but in some cases, where the audio source may include decoding audio and assuming format=S16LE and channels=2, there is no guarantee that nc receives in ONE chunck a number of audio bytes dividable by 4 due to the unnamed pipe feeding nc.<br>
<br></div>It would be nicer and predictable/controllable if one could do something like this:<br><br><div style="margin-left:40px"> gst-launch -v audiotestsrc is-live=true !\<br></div><div style="margin-left:40px"> queue !\<br>
</div><div style="margin-left:40px"> tcpclientsink prepend-data=SOMETHING_TO_PREPEND host=$host port=$port<br></div><br></div>In fact it could be useful if all (probably non videosinks) datasinks could be prepended and appended (when closing) data.<br>
<br></div>Is there currently a way to prepend data for a stream?<br><br></div>Thanks in advance<br></div>Peter Maersk-Moller<br></div>