<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
        {mso-style-priority:34;
        margin-top:0in;
        margin-right:0in;
        margin-bottom:0in;
        margin-left:.5in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:"Consolas",serif;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
/* List Definitions */
@list l0
        {mso-list-id:1585987354;
        mso-list-type:hybrid;
        mso-list-template-ids:-753268070 -37181612 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
@list l0:level1
        {mso-level-start-at:0;
        mso-level-number-format:bullet;
        mso-level-text:-;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Calibri",sans-serif;
        mso-fareast-font-family:Calibri;}
@list l0:level2
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level3
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level4
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level5
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level6
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
@list l0:level7
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Symbol;}
@list l0:level8
        {mso-level-number-format:bullet;
        mso-level-text:o;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:"Courier New";}
@list l0:level9
        {mso-level-number-format:bullet;
        mso-level-text:;
        mso-level-tab-stop:none;
        mso-level-number-position:left;
        text-indent:-.25in;
        font-family:Wingdings;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Thanks again Nicolas.  I feel like I’m getting very close.  Here’s what I have right now, and this basically kinda sorta works:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>tail -n 1000 -f /home/pi/test.txt | /opt/gst/bin/gst-launch-1.0 -v fdsrc ! subparse ! txt. videotestsrc is-live=true ! video/x-raw, width =800, height=480, framerate=10/1 ! videoconvert ! decodebin ! textoverlay name=txt !  omxh264enc target-bitrate=800000 control-rate=3 ! tcpserversink host=0.0.0.0 port=9000<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>I can inject items to test.txt from the shell like this:<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>printf "7\n00:01:59,826 --> 00:02:59,000\nNOW I SAY WORK\n\n" >> /home/pi/test.txt<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Now my challenge is, how do I post the proper time ranges?  Unfortunately it seems I can’t keep appending 00:00:00,000 --> 99:99:99,000 because it will only show one subtitle at a time and it seems to always be the first one for that time-range.  So the second sub-title wouldn’t overwrite the first one (which is basically what I need).<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>So I think these are my options:<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Is there another format or something that the subtitles can be written in?<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Or a way to cause newer sub-titles take precedence over older ones?<o:p></o:p></span></p><p class=MsoListParagraph style='text-indent:-.25in;mso-list:l0 level1 lfo1'><![if !supportLists]><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><span style='mso-list:Ignore'>-<span style='font:7.0pt "Times New Roman"'>          </span></span></span><![endif]><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Or am I going to need to keep track of the play-time from my secondary process and regularly append accurate times to the file/stdout?<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>Thank you<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>-Adam<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'><o:p> </o:p></span></p><div><div style='border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri",sans-serif'> gstreamer-devel [mailto:gstreamer-devel-bounces@lists.freedesktop.org] <b>On Behalf Of </b>Nicolas Dufresne<br><b>Sent:</b> Monday, February 27, 2017 7:34 AM<br><b>To:</b> Discussion of the development of and with GStreamer <gstreamer-devel@lists.freedesktop.org><br><b>Subject:</b> Re: Dynamic text-overlay on live-stream using gst-launch-1.0<o:p></o:p></span></p></div></div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>Le lundi 27 février 2017 à 07:05 -0800, Adam Plocher a écrit :<o:p></o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><p class=MsoNormal>Nicolas, thank you for your response.  fdsrc seems like it would be a good solution, but I'm having issues getting it to work.<o:p></o:p></p><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>It seems like I need to specify the caps after the fdsrc, otherwise it fails in other ways.  e.g.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Specifying text/x-raw:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>tail -f /home/pi/test.txt | /opt/gst/bin/gst-launch-1.0 fdsrc fd=0 ! "text/x-raw" ! txt. videotestsrc ! videoconvert ! decodebin ! textoverlay name=txt ! omxh264enc target-bitrate=800000 control-rate=3 ! tcpserversink host=0.0.0.0 port=9000<o:p></o:p></p></div></div></blockquote><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I think you forgot to keep subparse element.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Results in:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>Pipeline is PREROLLING ...<o:p></o:p></p></div><div><p class=MsoNormal>ERROR: from element /GstPipeline:pipeline0/GstCapsFilter:capsfilter0: Filter caps do not completely specify the output format<o:p></o:p></p></div><div><p class=MsoNormal>Additional debug info:<o:p></o:p></p></div><div><p class=MsoNormal>gstcapsfilter.c(455): gst_capsfilter_prepare_buf (): /GstPipeline:pipeline0/GstCapsFilter:capsfilter0:<o:p></o:p></p></div><div><p class=MsoNormal>Output caps are unfixed: text/x-raw, format=(string){ pango-markup, utf8 }<o:p></o:p></p></div><div><p class=MsoNormal>ERROR: pipeline doesn't want to preroll.<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Specifying text/plain:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>tail -f /home/pi/test.txt | /opt/gst/bin/gst-launch-1.0 fdsrc fd=0 ! "text/plain" ! txt. videotestsrc ! videoconvert ! decodebin ! textoverlay name=txt ! omxh264enc target-bitrate=800000 control-rate=3 ! tcpserversink host=0.0.0.0 port=9000<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Results in:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>0:00:00.501757360  4549  0x1e085c0 ERROR           GST_PIPELINE grammar.y:714:gst_parse_perform_link: could not link fdsrc0 to txt, txt can't handle caps text/plain<o:p></o:p></p></div><div><p class=MsoNormal>WARNING: erroneous pipeline: could not link fdsrc0 to txt, txt can't handle caps text/plain<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>No caps at all:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>tail -f /home/pi/test.txt | /opt/gst/bin/gst-launch-1.0 fdsrc fd=0 ! txt. videotestsrc ! videoconvert ! decodebin ! textoverlay name=txt !  omxh264enc target-bitrate=800000 control-rate=3 ! tcpserversink host=0.0.0.0 port=9000<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Results in:<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><div><p class=MsoNormal>Pipeline is PREROLLING ...<o:p></o:p></p></div><div><p class=MsoNormal>WARNING: from element /GstPipeline:pipeline0/GstTextOverlay:txt: Could not multiplex stream.<o:p></o:p></p></div><div><p class=MsoNormal>Additional debug info:<o:p></o:p></p></div><div><p class=MsoNormal>gstbasetextoverlay.c(2449): gst_base_text_overlay_video_event (): /GstPipeline:pipeline0/GstTextOverlay:txt:<o:p></o:p></p></div><div><p class=MsoNormal>received non-TIME newsegment event on video input<o:p></o:p></p></div><div><p class=MsoNormal>WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0: Delayed linking failed.<o:p></o:p></p></div><div><p class=MsoNormal>Additional debug info:<o:p></o:p></p></div><div><p class=MsoNormal>./grammar.y(510): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0:<o:p></o:p></p></div><div><p class=MsoNormal>failed delayed linking some pad of GstDecodeBin named decodebin0 to some pad of GstTextOverlay named txt<o:p></o:p></p></div><div><p class=MsoNormal>ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.<o:p></o:p></p></div><div><p class=MsoNormal>Additional debug info:<o:p></o:p></p></div><div><p class=MsoNormal>gstbasesrc.c(2951): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:<o:p></o:p></p></div><div><p class=MsoNormal>streaming stopped, reason not-linked (-1)<o:p></o:p></p></div><div><p class=MsoNormal>ERROR: pipeline doesn't want to preroll.<o:p></o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>There is some information here (regarding the older version of gst-launch): <o:p></o:p></p></div><div><p class=MsoNormal><a href="http://gstreamer-devel.966125.n4.nabble.com/Dynamic-text-again-td3676141.html">http://gstreamer-devel.966125.n4.nabble.com/Dynamic-text-again-td3676141.html</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>And that links to this bug that was resolved (again, old gst-launch): <o:p></o:p></p></div><div><p class=MsoNormal><a href="https://bugzilla.gnome.org/show_bug.cgi?id=654959">https://bugzilla.gnome.org/show_bug.cgi?id=654959</a><o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I've seen a couple examples which used the "text/plain" caps.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>I'm certainly open to cracking open the Python lib and giving it a shot.  I would need to read up on it a bit and I'm not familiar with the appsrc, either, but that's something else I'm open to. I have done very basic stuff with the Python libs but nothing too fancy or dynamic (basic pipelines, no more complex than I would get from gst-launch-1.0).<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>What would you recommend?  Is there an example or resource you could point me towards?<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div><div><p class=MsoNormal>Thank you for your help<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p></div></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Sun, Feb 26, 2017 at 2:46 PM, Nicolas Dufresne <<a href="mailto:nicolas@ndufresne.ca" target="_blank">nicolas@ndufresne.ca</a>> wrote:<br><br><o:p></o:p></p><blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><p class=MsoNormal style='margin-bottom:12.0pt'>Le dimanche 26 février 2017 à 06:18 -0800, Adam Plocher a écrit :<br>> Hello, I apologize if I'm posting this in the wrong place. I've<br>> previously asked this on stackoverflow and never got a response: http<br>> ://<a href="http://stackoverflow.com/questions/42128804/polling-a-text-file-and-" target="_blank">stackoverflow.com/questions/42128804/polling-a-text-file-and-</a><br>> overlaying-the-result-in-gstreamer<br>><br>> I have a Raspberry Pi with a camera and I'm live streaming that back<br>> to another unit (it's for a baby monitor).  On the same Pi, I have a<br>> temperature sensor that is dumping the current temp to a file every 5<br>> seconds.<br>><br>> My question: Is it possible to somehow poll that txt file and update<br>> a text-overlay on the live stream based on the current contents of<br>> that file?<br><br>filsesrc does not have this feature unfortunatly. I believe using<br>fdsrc, you could:<br><br>  tail -f text.txt | gst-launch-1.0 fdsrc ! ...<br><br>Let me know if that is a good work-around. If you are writing an app,<br>this can be done with a pipe, or if you prefer, with appsrc.<br><br>><br>> I've tried using a filesrc and subparse, and it will grab it<br>> initially if I format the input text file properly, but it doesn't<br>> seem to update itself:<br>><br>> gst-launch-1.0 -v \<br>>     filesrc location=/home/pi/temp.txt ! subparse ! txt. rpicamsrc<br>> awb-mode=0 awb-gain-red=1 awb-gain-blue=2 rotation=0 bitrate=820000<br>> preview=false brightness=67 contrast=30 sharpness=40 \<br>>     ! video/x-h264,width=800,height=480,framerate=10/1 \<br>>     ! h264parse ! decodebin ! videoconvert ! clockoverlay shaded-<br>> background=true draw-shadow=true font-desc="Nimbus Mono" \<br>>     ! textoverlay name=txt shaded-background=yes \<br>>     ! omxh264enc control-rate=3 target-bitrate=850000 \<br>>     ! tcpserversink host=0.0.0.0 port=5555 sync=true<br>><br>> The input file looks like this:<br>> 1<br>> 00:00:00,000 --> 99:59:59,000<br>> 69 degrees<br>> Thank you!<br>> _______________________________________________<br>> gstreamer-devel mailing list<br>> <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>_______________________________________________<br>gstreamer-devel mailing list<br><a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br><a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><o:p></o:p></p></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div><pre>_______________________________________________<o:p></o:p></pre><pre>gstreamer-devel mailing list<o:p></o:p></pre><pre><a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><o:p></o:p></pre><pre><a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><o:p></o:p></pre></blockquote></div></body></html>