1

Im running the command such as following and this command broadcasts the video to ethernet port. But here is my question that how I can add overlay onto video where overlay values are stored in shared memory and may change any time.

gst-launch-1.0 -v videotestsrc ! video/xraw,format=NV16, width=1920, height=1080, framerate=30/1 ! omxh264enc ! queue ! rtph264pay config-interval=10 ! udpsink host=192.168.1.5 port=5004

Should I run another thread to do it?

muradaltay
  • 41
  • 7
  • You are talking about doing this from code and not the command line, right? – Mike Sep 10 '21 at 13:37
  • Yes from a C or C++ code @Mike – muradaltay Sep 13 '21 at 04:56
  • I did this via a GTKOverlay at the receiving end and then drew on top of the video stream. If you wanted the result to definitely go over the network, I suppose you could (somehow) capture the output and transmit that. Would this be any use to you? It might take some time to extract the minimum code from my project. – Mike Sep 18 '21 at 21:30
  • Thanks @Mike, Im getting video data from framebuffer on FPGA using only command above. So, how I manipulate it using GTKOverlay? Actually is it possible? – muradaltay Sep 20 '21 at 08:26
  • I think I see what you're needing. If it's text then there's a textoverlay plugin but I've put some info in my answer. Hopefully that will help. – Mike Sep 21 '21 at 05:22

2 Answers2

1

It looks like the compositor or videomixer plugin is what you are looking for. I've never used them myself so I can't be much help, but there's a nearly complete list of plugins here.

Mike
  • 2,721
  • 1
  • 15
  • 20
0

You said you're trying to do this from c or c++ code, you can do this using textoverlay plugin, for example, you name your textoverlay element "textsrc", then when you need to change the text value:

GstElement *textsrc; textsrc = gst_bin_get_by_name_recurse_up(GST_BIN(element), "textsrc");

Then using g_object_set you can change the value for different parameters that correspond to what you want, text for text you want shown, more about the different parameters can be found in the documentation.

mn Stoner
  • 37
  • 5