<html><head></head><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:13px"><div id="yui_3_16_0_1_1488179136287_23069"><span id="yui_3_16_0_1_1488179136287_23050">You can also connect the text overlay element to an udpsrc element.</span></div><div id="yui_3_16_0_1_1488179136287_25004" dir="ltr"><span id="yui_3_16_0_1_1488179136287_23050"><br></span></div><div dir="ltr" id="yui_3_16_0_1_1488179136287_32287"><span id="yui_3_16_0_1_1488179136287_23050">And then use the tools of the trade to send your text file as udp packets.</span></div><div dir="ltr" id="yui_3_16_0_1_1488179136287_32288"><span id="yui_3_16_0_1_1488179136287_30437">For example (not tested at all) : </span>tail -f <file> > /dev/udp/127.0.0.1/<port></div><div dir="ltr" id="yui_3_16_0_1_1488179136287_32289">There are other ways to send udp packets (netcat, Packet Sender, ...).<br></div><div dir="ltr" id="yui_3_16_0_1_1488179136287_28664"><span id="yui_3_16_0_1_1488179136287_23050"><br></span></div><div dir="ltr" id="yui_3_16_0_1_1488179136287_28667"><span id="yui_3_16_0_1_1488179136287_23050">An advantage of this approach is that it decouples your pipeline from the text overlay source.<br></span></div><div dir="ltr"><span id="yui_3_16_0_1_1488179136287_23050">So you can start/stop it without having to start/stop the pipeline.<br></span></div><div id="yui_3_16_0_1_1488179136287_26797"><span id="yui_3_16_0_1_1488179136287_23050"><br></span></div><div dir="ltr" id="yui_3_16_0_1_1488179136287_28712"><span id="yui_3_16_0_1_1488179136287_24947">Note that textoverlay supports </span>pango-markup. This allows you to send more than just plain text if you need to.<br></div> <div class="qtdSeparateBR"><br><br></div><div class="yahoo_quoted" style="display: block;"> <div style="font-family: lucida console, sans-serif; font-size: 13px;"> <div style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"><font face="Arial" size="2"> Le Lundi 27 février 2017 6h18, Nicolas Dufresne <nicolas@ndufresne.ca> a écrit :<br></font></div>  <br><br> <div class="y_msg_container">Le dimanche 26 février 2017 à 06:18 -0800, Adam Plocher a écrit :<br clear="none">> Hello, I apologize if I'm posting this in the wrong place. I've<br clear="none">> previously asked this on stackoverflow and never got a response: http<br clear="none">> ://stackoverflow.com/questions/42128804/polling-a-text-file-and-<br clear="none">> overlaying-the-result-in-gstreamer<br clear="none">> <br clear="none">> I have a Raspberry Pi with a camera and I'm live streaming that back<br clear="none">> to another unit (it's for a baby monitor).  On the same Pi, I have a<br clear="none">> temperature sensor that is dumping the current temp to a file every 5<br clear="none">> seconds.<br clear="none">> <br clear="none">> My question: Is it possible to somehow poll that txt file and update<br clear="none">> a text-overlay on the live stream based on the current contents of<br clear="none">> that file?<br clear="none"><br clear="none">filsesrc does not have this feature unfortunatly. I believe using<br clear="none">fdsrc, you could:<br clear="none"><br clear="none">  tail -f text.txt | gst-launch-1.0 fdsrc ! ...<br clear="none"><br clear="none">Let me know if that is a good work-around. If you are writing an app,<br clear="none">this can be done with a pipe, or if you prefer, with appsrc.<div class="yqt3834927073" id="yqtfd50638"><br clear="none"><br clear="none">> <br clear="none">> I've tried using a filesrc and subparse, and it will grab it<br clear="none">> initially if I format the input text file properly, but it doesn't<br clear="none">> seem to update itself:<br clear="none">> <br clear="none">> gst-launch-1.0 -v \<br clear="none">>     filesrc location=/home/pi/temp.txt ! subparse ! txt. rpicamsrc<br clear="none">> awb-mode=0 awb-gain-red=1 awb-gain-blue=2 rotation=0 bitrate=820000<br clear="none">> preview=false brightness=67 contrast=30 sharpness=40 \<br clear="none">>     ! video/x-h264,width=800,height=480,framerate=10/1 \<br clear="none">>     ! h264parse ! decodebin ! videoconvert ! clockoverlay shaded-<br clear="none">> background=true draw-shadow=true font-desc="Nimbus Mono" \<br clear="none">>     ! textoverlay name=txt shaded-background=yes \<br clear="none">>     ! omxh264enc control-rate=3 target-bitrate=850000 \<br clear="none">>     ! tcpserversink host=0.0.0.0 port=5555 sync=true<br clear="none">> <br clear="none">> The input file looks like this:<br clear="none">> 1<br clear="none">> 00:00:00,000 --> 99:59:59,000<br clear="none">> 69 degrees<br clear="none">> Thank you!<br clear="none">> _______________________________________________<br clear="none">> gstreamer-devel mailing list<br clear="none">> <a shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br clear="none">> <a shape="rect" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a></div><br><div class="yqt3834927073" id="yqtfd10534">_______________________________________________<br clear="none">gstreamer-devel mailing list<br clear="none"><a shape="rect" ymailto="mailto:gstreamer-devel@lists.freedesktop.org" href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br clear="none"><a shape="rect" href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br clear="none"></div><br><br></div>  </div> </div>  </div></div></body></html>