Dynamic textoverlay from network

uler3161 uler3161 at hotmail.com
Tue Jun 9 12:30:20 PDT 2015


Thanks for the suggestions but I haven't made much progress yet.

I think I originally misunderstood your subtitle suggestion when I was
testing, so I'll have to test some more. That might actually be the best
idea because down the road we may be forwarding the video streams to a
non-gstreamer client and we might like the text to show up there as well. I
think subtitles applied on the PC would accomplish that since everything
goes through the PC.

I think the python script has some promise, but it adds too much delay. Even
without the overlay it adds too much. I'm simply piping in raspivid using
this: "raspivid -rot 270 -g 10 -o - -w 1024 -h 768 -ih -t 0 -n -fps 24 -b
1000000". It works great with the gst-launch version of this python script.

Here is my script:

#!/usr/bin/python3

from os import path
import os
import gi
import time

from gi.repository import GObject, Gst

GObject.threads_init()
Gst.init(None)

class VideoBox():
        def __init__(self):
                mainloop = GObject.MainLoop()

                self.pipeline = Gst.Pipeline()

                self.fdsrc = Gst.ElementFactory.make('fdsrc', None)
                self.pipeline.add(self.fdsrc)

                h264caps =
Gst.Caps.from_string("video/x-h264,width=1024,height=768,framerate=24/1,format=I420")
                self.h264filter = Gst.ElementFactory.make("capsfilter",
"h264filter")
                self.h264filter.set_property("caps", h264caps)
                self.pipeline.add(self.h264filter)

                self.h264parse = Gst.ElementFactory.make('h264parse', None)
                self.pipeline.add(self.h264parse)

                self.omxh264dec = Gst.ElementFactory.make('omxh264dec',
None)
                self.pipeline.add(self.omxh264dec)

#               rawcaps = Gst.Caps.from_string("video/x-raw,format=I420")
#               self.rawfilter = Gst.ElementFactory.make("capsfilter",
"rawfilter")
#               self.rawfilter.set_property("caps", rawcaps)
#               self.pipeline.add(self.rawfilter)

#               self.timeoverlay = Gst.ElementFactory.make("timeoverlay",
None)
#               self.pipeline.add(self.timeoverlay)

                self.autovideosink =
Gst.ElementFactory.make('autovideosink',None)
                self.autovideosink.set_property("sync", "false")
                self.pipeline.add(self.autovideosink)

                self.fdsrc.link(self.h264filter)
                self.h264filter.link(self.h264parse)
                self.h264parse.link(self.omxh264dec)
                self.omxh264dec.link(self.autovideosink)
#               self.omxh264dec.link(self.rawfilter)
#               self.rawfilter.link(self.timeoverlay)
#               self.timeoverlay.link(self.autovideosink)

                self.pipeline.set_state(Gst.State.PLAYING)
                mainloop.run()

if __name__ == "__main__":
        app = VideoBox()
        signal.signal(signal.SIGINT, signal.SIG_DFL)
        exit_status = app.run(sys.argv)
        sys.exit(exit_status)




--
View this message in context: http://gstreamer-devel.966125.n4.nabble.com/Dynamic-textoverlay-from-network-tp4672204p4672229.html
Sent from the GStreamer-devel mailing list archive at Nabble.com.


More information about the gstreamer-devel mailing list