Gstreamer add image from file while encoding

Hi,

I have 2 camera sources which are encoded and mixed together picture in picture and saved using gstreamer. How to add an image from a file to this video?

Below is the pipeline used.

gst-launch-1.0 -e videotestsrc pattern=black ! video/x-raw,width=320,height=240 ! nvvidconv ! queue ! tee name=back ! queue ! comppc.sink_0 v4l2src device=/dev/video0 ! queue ! tee name=t1 ! video/x-raw, width=1920, height=1080, framerate=60/1 ! videorate ! video/x-raw, width=1920, height=1080, framerate=${fpsp1}/1 ! nvvidconv ! queue ! "video/x-raw(memory:NVMM),width=960,height=540,format=NV12" ! queue ! comppc.sink_1 rtspsrc location=rtsp://192.168.8.100:554 latency=0 ! application/x-rtp, media=video, encoding-name=H264 ! rtph264depay ! tee name=t2 ! queue ! h264parse ! queue ! nvv4l2decoder ! nvvidconv ! queue ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=NV12" ! videorate ! "video/x-raw(memory:NVMM),width=1920,height=1080,format=NV12,framerate=${fpsp1}/1" ! nvvidconv ! queue ! "video/x-raw(memory:NVMM),width=960,height=540,format=NV12" ! queue ! comppc.sink_2 nvcompositor name=comppc sink_0::width=1920 sink_0::height=1080 sink_1::xpos=0 sink_1::ypos=270 sink_1::width=960 sink_1::height=540 sink_2::xpos=960 sink_2::ypos=270 sink_2::width=960 sink_2::height=540 ! queue ! nvvidconv ! queue ! nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! queue ! h264parse ! queue ! mux. liveadder name=filaud ! queue ! audioconvert ! voaacenc ! mux. alsasrc device="hw:3,0" ! queue ! audio/x-raw ! queue ! audioresample ! "audio/x-raw,rate=48000" ! tee name=a1 ! queue ! filaud.sink_0 alsasrc device="hw:2,0" ! queue ! audio/x-raw ! queue ! audioresample ! "audio/x-raw,rate=48000" ! tee name=a2 ! queue ! filaud.sink_1 mpegtsmux name=mux ! filesink location="file.ts"

Thanks in advanced

Hi,
Since encoding is continuous and you would need to have one decoded image for each frame. A possible solution is to use multifilesrc and can set up the image source like:

multifilesrc loop=1 start-index=START_IDX stop-index=STOP_IDX ! jpegdec ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=RGBA’ ! comppc.sink_2

I will try this method thank you