So I’ve finally been able to get the output I want using hardware acceleration. I’m trying to output the overlay result to a file (and eventually RTMP). But I’m getting stuck…
This works to display on the display:
gst-launch-1.0 \
v4l2src io-mode=2 device=/dev/video0 ! "image/jpeg,width=1920,height=1080, framerate=30/1" ! nvjpegdec ! video/x-raw ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! comp.sink_0 \
v4l2src io-mode=2 device=/dev/video1 ! "image/jpeg,width=640,height=360, framerate=30/1" ! nvjpegdec ! video/x-raw ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! comp.sink_1 \
nvcompositor name=comp sink_1::xpos=1270 sink_1::ypos=10 sink_2::xpos=50 sink_2::ypos=50 ! \
nvoverlaysink
When I try and do something with the nvcompositor, like save to a file, with this command:
gst-launch-1.0 \
v4l2src io-mode=2 device=/dev/video0 ! "image/jpeg,width=1920,height=1080, framerate=30/1" ! nvjpegdec ! video/x-raw ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! comp.sink_0 \
v4l2src io-mode=2 device=/dev/video1 ! "image/jpeg,width=640,height=360, framerate=30/1" ! nvjpegdec ! video/x-raw ! nvvidconv ! 'video/x-raw(memory:NVMM),format=RGBA' ! comp.sink_1 \
nvcompositor name=comp sink_1::xpos=1270 sink_1::ypos=10 sink_2::xpos=50 sink_2::ypos=50 ! \
nvvidconv ! nvv4l2h264enc maxperf-enable=1 bitrate=4000000 profile=4 ! h264parse ! qtmux ! filesink location=test_MJPG_H264enc_video1_rgba.mp4 -e
It hangs at this:
Setting pipeline to PAUSED ...
Opening in BLOCKING MODE
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
Redistribute latency...
H264: Profile = 100, Level = 0
Redistribute latency...
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
Any ideas on what to try? Looking at these two threads, it should be possible: