Overlay an image on top of a GStreamer UDP stream

(Sorry I’ve edited my question so many times. )

I tried search, but couldn’t find much help. I have a UDP stream running as follows:

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! 'image/jpeg,width=1280,height=720,framerate=60/1' ! videorate ! 'image/jpeg,framerate=12/1' ! nvjpegdec ! 'video/x-raw' ! nvvidconv ! 'video/x-raw(memory:NVMM),width=640,height=480' ! nvv4l2h264enc maxperf-enable=1 control-rate=0 bitrate=400000 insert-sps-pps=true iframeinterval=10 ! h264parse ! rtph264pay pt=96 ! udpsink host=xx.xx.xx.xx port=8001 sync=false -e

I think the problem now is, is there anyway that by giving a signal, we can draw something/shape on gstreamer stream? like receiving the signal to draw, draw the shape, without signal, stream the raw frames…

Any suggestion would be appreciated!

Not sure if it is possible in running gst-launch-1.0. In C code, you can add prob function in source pad of nvjpegdec and access the video buffers. Please look at: