<html><head></head><body><div>Le lundi 27 février 2017 à 07:05 -0800, Adam Plocher a écrit :</div><blockquote type="cite"><div dir="ltr">Nicolas, thank you for your response.  fdsrc seems like it would be a good solution, but I'm having issues getting it to work.<div><br></div><div>It seems like I need to specify the caps after the fdsrc, otherwise it fails in other ways.  e.g.</div><div><br></div><div><br></div><div>Specifying text/x-raw:</div><div><br></div><div>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<br></div></div></blockquote><div><br></div><div>I think you forgot to keep subparse element.</div><div><br></div><blockquote type="cite"><div dir="ltr"><div><br></div><div>Results in:</div><div><br></div><div><div>Pipeline is PREROLLING ...</div><div>ERROR: from element /GstPipeline:pipeline0/GstCapsFilter:capsfilter0: Filter caps do not completely specify the output format</div><div>Additional debug info:</div><div>gstcapsfilter.c(455): gst_capsfilter_prepare_buf (): /GstPipeline:pipeline0/GstCapsFilter:capsfilter0:</div><div>Output caps are unfixed: text/x-raw, format=(string){ pango-markup, utf8 }</div><div>ERROR: pipeline doesn't want to preroll.</div></div><div><br></div><div><br></div><div>Specifying text/plain:</div><div><br></div><div>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<br></div><div><br></div><div>Results in:</div><div><br></div><div><div>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</div><div>WARNING: erroneous pipeline: could not link fdsrc0 to txt, txt can't handle caps text/plain</div></div><div><br></div><div><br></div><div>No caps at all:</div><div><br></div><div>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<br></div><div><br></div><div>Results in:</div><div><br></div><div><div>Pipeline is PREROLLING ...</div><div>WARNING: from element /GstPipeline:pipeline0/GstTextOverlay:txt: Could not multiplex stream.</div><div>Additional debug info:</div><div>gstbasetextoverlay.c(2449): gst_base_text_overlay_video_event (): /GstPipeline:pipeline0/GstTextOverlay:txt:</div><div>received non-TIME newsegment event on video input</div><div>WARNING: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0: Delayed linking failed.</div><div>Additional debug info:</div><div>./grammar.y(510): gst_parse_no_more_pads (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0:</div><div>failed delayed linking some pad of GstDecodeBin named decodebin0 to some pad of GstTextOverlay named txt</div><div>ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.</div><div>Additional debug info:</div><div>gstbasesrc.c(2951): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:</div><div>streaming stopped, reason not-linked (-1)</div><div>ERROR: pipeline doesn't want to preroll.</div></div><div><br></div><div><br></div><div>There is some information here (regarding the older version of gst-launch): </div><div><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><br></div><div><br></div><div>And that links to this bug that was resolved (again, old gst-launch): </div><div><a href="https://bugzilla.gnome.org/show_bug.cgi?id=654959">https://bugzilla.gnome.org/show_bug.cgi?id=654959</a><br></div><div><br></div><div><br></div><div>I've seen a couple examples which used the "text/plain" caps.</div><div><br></div><div>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).</div><div><br></div><div>What would you recommend?  Is there an example or resource you could point me towards?</div><div><br></div><div>Thank you for your help</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 26, 2017 at 2:46 PM, Nicolas Dufresne <span dir="ltr"><<a href="mailto:nicolas@ndufresne.ca" target="_blank">nicolas@ndufresne.ca</a>></span> wrote:<br><blockquote type="cite"><span class="">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-" rel="noreferrer" target="_blank">stackoverflow.com/<wbr>questions/42128804/polling-a-<wbr>text-file-and-</a><br>
> overlaying-the-result-in-<wbr>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>
</span>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>
<span class=""><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=<wbr>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>
</span>> ______________________________<wbr>_________________<br>
> gstreamer-devel mailing list<br>
> <a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
> <a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>______________________________<wbr>_________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.<wbr>freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/gstreamer-<wbr>devel</a><br>
<br></blockquote></div><br></div>
<pre>_______________________________________________
gstreamer-devel mailing list
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a>
<a href="https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel">https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a>
</pre></blockquote></body></html>