Dynamic text-overlay on live-stream using gst-launch-1.0
philippe renon
philippe_renon at yahoo.fr
Mon Feb 27 08:49:25 UTC 2017
You can also connect the text overlay element to an udpsrc element.
And then use the tools of the trade to send your text file as udp packets.For example (not tested at all) : tail -f <file> > /dev/udp/127.0.0.1/<port>There are other ways to send udp packets (netcat, Packet Sender, ...).
An advantage of this approach is that it decouples your pipeline from the text overlay source.
So you can start/stop it without having to start/stop the pipeline.
Note that textoverlay supports pango-markup. This allows you to send more than just plain text if you need to.
Le Lundi 27 février 2017 6h18, Nicolas Dufresne <nicolas at ndufresne.ca> a écrit :
Le dimanche 26 février 2017 à 06:18 -0800, Adam Plocher a écrit :
> Hello, I apologize if I'm posting this in the wrong place. I've
> previously asked this on stackoverflow and never got a response: http
> ://stackoverflow.com/questions/42128804/polling-a-text-file-and-
> overlaying-the-result-in-gstreamer
>
> I have a Raspberry Pi with a camera and I'm live streaming that back
> to another unit (it's for a baby monitor). On the same Pi, I have a
> temperature sensor that is dumping the current temp to a file every 5
> seconds.
>
> My question: Is it possible to somehow poll that txt file and update
> a text-overlay on the live stream based on the current contents of
> that file?
filsesrc does not have this feature unfortunatly. I believe using
fdsrc, you could:
tail -f text.txt | gst-launch-1.0 fdsrc ! ...
Let me know if that is a good work-around. If you are writing an app,
this can be done with a pipe, or if you prefer, with appsrc.
>
> I've tried using a filesrc and subparse, and it will grab it
> initially if I format the input text file properly, but it doesn't
> seem to update itself:
>
> gst-launch-1.0 -v \
> filesrc location=/home/pi/temp.txt ! subparse ! txt. rpicamsrc
> awb-mode=0 awb-gain-red=1 awb-gain-blue=2 rotation=0 bitrate=820000
> preview=false brightness=67 contrast=30 sharpness=40 \
> ! video/x-h264,width=800,height=480,framerate=10/1 \
> ! h264parse ! decodebin ! videoconvert ! clockoverlay shaded-
> background=true draw-shadow=true font-desc="Nimbus Mono" \
> ! textoverlay name=txt shaded-background=yes \
> ! omxh264enc control-rate=3 target-bitrate=850000 \
> ! tcpserversink host=0.0.0.0 port=5555 sync=true
>
> The input file looks like this:
> 1
> 00:00:00,000 --> 99:59:59,000
> 69 degrees
> Thank you!
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
_______________________________________________
gstreamer-devel mailing list
gstreamer-devel at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170227/76760500/attachment-0001.html>
More information about the gstreamer-devel
mailing list