I want to output the h264 files using the imxcompositor_g2d element of gstreamer on i.MX8X.
Also, I want to minimize CPU usage as much as possible.
I can output it with the following command, but the CPU usage will be 100%.
gst-launch-1.0 -v imxcompositor_g2d name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=720 sink_0::height=480 \
sink_1::xpos=0 sink_1::ypos=480 sink_1::width=720 sink_1::height=480 \
sink_2::xpos=720 sink_2::ypos=0 sink_2::width=720 sink_2::height=480 \
sink_3::xpos=720 sink_3::ypos=480 sink_3::width=720 sink_3::height=480 ! \
videoconvert ! 'video/x-raw,format=(string)NV12,width=1440,height=960' ! queue ! v4l2h264enc ! filesink location=test.mp4 \
v4l2src device=/dev/video0 ! 'video/x-raw,format=(string)NV12,width=720,height=480,framerate=(fraction)30/1' ! comp.sink_0 \
v4l2src device=/dev/video1 ! 'video/x-raw,format=(string)NV12,width=720,height=480,framerate=(fraction)30/1' ! comp.sink_1 \
v4l2src device=/dev/video2 ! 'video/x-raw,format=(string)NV12,width=720,height=480,framerate=(fraction)30/1' ! comp.sink_2 \
v4l2src device=/dev/video3 ! 'video/x-raw,format=(string)NV12,width=720,height=480,framerate=(fraction)30/1' ! comp.sink_3
The reason why I use the videoconvert element
I used the imxvideoconvert_g2d element, but I got an error.
gst-launch-1.0 -v imxcompositor_g2d name=comp \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=720 sink_0::height=480 \
sink_1::xpos=0 sink_1::ypos=480 sink_1::width=720 sink_1::height=480 \
sink_2::xpos=720 sink_2::ypos=0 sink_2::width=720 sink_2::height=480 \
sink_3::xpos=720 sink_3::ypos=480 sink_3::width=720 sink_3::height=480 ! \
queue ! imxvideoconvert_g2d ! queue ! v4l2h264enc ! avimux ! filesink location=cam_comp.avi \
v4l2src device=/dev/video0 ! 'video/x-raw,format=(string)NV12,width=720,height=480,framerate=(fraction)30/1' ! comp.sink_0 \
v4l2src device=/dev/video1 ! 'video/x-raw,format=(string)NV12,width=720,height=480,framerate=(fraction)30/1' ! comp.sink_1 \
v4l2src device=/dev/video2 ! 'video/x-raw,format=(string)NV12,width=720,height=480,framerate=(fraction)30/1' ! comp.sink_2 \
v4l2src device=/dev/video3 ! 'video/x-raw,format=(string)NV12,width=720,height=480,framerate=(fraction)30/1' ! comp.sink_3ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../../../../git/libs/gst/base/gstbasesrc.c(3072): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
I will test your command and give you feedback
Hi. @Zhiming_Liu
I would appreciate it if you would update me on this matter.
Hi
I didn't reproduce this issue as the EVK can't insert 4 cameras
Hi. @Zhiming_Liu
Thank you for testing. I'm looking forward to your feedback.
I use L5.4.70-2.3.0.
I get the four cameras images from using ISL79987.