Hi
Struggling with frame positioning with Nvcompositor element. Wanting to combine different resolutions for different frames, and result should end in a 21:9 ratio frame for displaying on a 2560x1080 monitor.
I’ve achieved to fill a whole screen with 6 video sources, with the use of this pipeline:
gst-launch-1.0 nvcompositor name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=1080 sink_0::height=1920 sink_0::zorder=1 \
sink_1::xpos=1080 sink_1::ypos=0 sink_1::width=1080 sink_1::height=1920 sink_1::zorder=1 \
sink_2::xpos=2160 sink_2::ypos=0 sink_2::width=1280 sink_2::height=720 sink_2::zorder=1 \
sink_3::xpos=3440 sink_3::ypos=0 sink_3::width=1280 sink_3::height=720 sink_3::zorder=1 \
sink_4::xpos=2160 sink_4::ypos=720 sink_4::width=1280 sink_4::height=720 sink_4::zorder=2 \
sink_5::xpos=3440 sink_5::ypos=720 sink_5::width=1280 sink_5::height=720 sink_5::zorder=2 \
! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)I420, width=(int)2560, height=(int)1080" ! nvv4l2h264enc ! 'video/x-h264' ! h264parse ! qtmux ! filesink location=placement_current.mp4 -e \
videotestsrc pattern=1 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv flip-method=3 ! "video/x-raw(memory:NVMM), format=I420, width=720, height=1280" ! comp. \
videotestsrc pattern=0 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv flip-method=3 ! "video/x-raw(memory:NVMM), format=I420, width=720, height=1280" ! comp. \
videotestsrc pattern=3 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv ! "video/x-raw(memory:NVMM), format=I420, width=960, height=540" ! comp. \
videotestsrc pattern=4 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv ! "video/x-raw(memory:NVMM), format=I420, width=960, height=540" ! comp. \
videotestsrc pattern=5 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv ! "video/x-raw(memory:NVMM), format=I420, width=960, height=540" ! comp. \
videotestsrc pattern=6 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv ! "video/x-raw(memory:NVMM), format=I420, width=960, height=540" ! comp.
This pipeline results in this frame:
However, I now want to reposition the pictures to fit to smaller ones on the left side (over/under) followed by the two vertical pictures in the middle, and again two smaller ones (as red/blue frames position). Trying to just change the position values makes the resulting frame repositioning it self, making an annoying black, empty border on the right side, with the same amount of assumed pixels (width) as one of the vertical frames.
By running this pipeline, it results in the following picture:
gst-launch-1.0 nvcompositor name=comp \
sink_0::xpos=1280 sink_0::ypos=0 sink_0::width=1080 sink_0::height=1920 sink_0::zorder=2 \
sink_1::xpos=2360 sink_1::ypos=0 sink_1::width=1080 sink_1::height=1920 sink_1::zorder=2 \
sink_2::xpos=0 sink_2::ypos=0 sink_2::width=1280 sink_2::height=720 sink_2::zorder=1 \
sink_3::xpos=3440 sink_3::ypos=0 sink_3::width=1280 sink_3::height=720 sink_3::zorder=1 \
sink_4::xpos=0 sink_4::ypos=720 sink_4::width=1280 sink_4::height=720 sink_4::zorder=1 \
sink_5::xpos=3440 sink_5::ypos=720 sink_5::width=1280 sink_5::height=720 sink_5::zorder=1 \
! nvvidconv ! "video/x-raw(memory:NVMM), format=(string)I420, width=(int)2560, height=(int)1080" ! nvv4l2h264enc ! 'video/x-h264' ! h264parse ! qtmux ! filesink location=placement_new.mp4 -e \
videotestsrc pattern=1 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv flip-method=3 ! "video/x-raw(memory:NVMM), format=I420, width=720, height=1280" ! comp. \
videotestsrc pattern=0 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv flip-method=3 ! "video/x-raw(memory:NVMM), format=I420, width=720, height=1280" ! comp. \
videotestsrc pattern=3 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv ! "video/x-raw(memory:NVMM), format=I420, width=960, height=540" ! comp. \
videotestsrc pattern=4 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv ! "video/x-raw(memory:NVMM), format=I420, width=960, height=540" ! comp. \
videotestsrc pattern=5 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv ! "video/x-raw(memory:NVMM), format=I420, width=960, height=540" ! comp. \
videotestsrc pattern=6 ! 'video/x-raw, width=1920, height=1080' ! nvvidconv ! "video/x-raw(memory:NVMM), format=I420, width=960, height=540" ! comp.
The aspect ratio also seems to increase, making the total frame wider, which is not what I want. Any suggestions to make it fit (almost) as perfect as in the first picture? For me, logically the two pipelines are just the same, except a few minor changes in the frames placement. The only changes are x_pos and y_pos of all of the sinks.