AnsweredAssumed Answered

How to create a pipeline to overlay an image on a rtp video source with Gstreamer?

Question asked by Federico Polini on Jan 8, 2018
Latest reply on Jan 9, 2018 by Federico Polini

Hi all,
I would like to overlay a logo on a video played from an IP camera.
The following pipeline from a test source works:
gst-launch-1.0 videotestsrc pattern=0 ! gdkpixbufoverlay location=/filepath/logo.png ! overlaysink


But making the same operation on a rtp stream I get only few frames at the begin and then the stream stops:

gst-launch-1.0 \
rtspsrc location=rtsp://login:pass@IP:port/channel ! rtph264depay ! vpudec \
! queue ! gdkpixbufoverlay location=/filepath/logo.png ! overlaysink


With --gst-debug-level=2 I see the following errors: 

0:00:00.914122666 2329 0xb5e890 ERROR vpu_dec_object gstvpudecobject.c:779:gst_vpu_dec_object_release_frame_buffer_to_vpu:<vpudecobject0> clearing display framebuffer failed: invalid param
0:00:00.914209333 2329 0xb5e890 ERROR vpu_dec_object gstvpudecobject.c:1016:gst_vpu_dec_object_get_gst_buffer:<vpudecobject0> gst_vpu_dec_object_release_frame_buffer_to_vpu fail.
0:00:00.914250666 2329 0xb5e890 ERROR vpu_dec_object gstvpudecobject.c:1228:gst_vpu_dec_object_decode:<vpudecobject0> gst_vpu_dec_object_get_gst_buffer fail: error

 

I even tried with imxcompositor_ipu to combine two videos:

gst-launch-1.0 -v \
rtspsrc location=rtsp://login:pass@IP:port/channel ! rtph264depay ! vpudec name=r \
filesrc location=/filepath/logo.png ! pngdec ! imxvideoconvert_ipu ! imagefreeze name=u \
imxcompositor_ipu start-time-selection=1 name=mix \
sink_0::xpos=0 sink_0::ypos=0 sink_0::zorder=0\
sink_1::xpos=0 sink_1::ypos=0 sink_1::zorder=1\
! overlaysink \
r. ! mix.sink_0 \
u. ! mix.sink_1

But the video is not rendered. With --gst-debug-level=2 I get many warn like:

0:00:01.803386000 2360 0xdc9950 WARN imxaggregator gstaggregator.c:1368:gst_aggregator_query_latency_unlocked:<mix> Latency query failed
and the playback hags there.#

 

Do someone have any idea how to properly overlay a simple image on a rtp video stream?

 

Thanks,

 

Federico

Outcomes