My 5 CSI 4k m.264 cameras are set at different resolutions. None at the 3840x2160 16fps res, as seen in profile 0 below. I believe its something to do with argus.
I can go into gst-launch at the right resolution, if i set it with v4l2, they all work fine there.
But when i go into camera-capture or my python code, gstreamer always selects a different resolution from elsewhere. Even if i put a v4l2 command:
inputs = [videoSource(f'v4l2src device=/dev/video{i} ! video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080, framerate=(fraction)30/1 ! nvvidconv ! video/x-raw(memory:NVMM), format=(string)I420, width=(int)1920, height=(int)1080 ! videoconvert ! video/x-raw, format=(string)BGR ! appsink', argv=['--input-codec=h264']) for i in range(5)]
output = videoOutput("display://0")
in my code before. Gstreamer still selects another resolution.
[gstreamer] gstCamera – found v4l2 device: vi-output, ar0821 32-0044
[gstreamer] v4l2-proplist, device.path=(string)/dev/video4, udev-probed=(boolean)false, device.api=(string)v4l2, v4l2.device.driver=(string)tegra-video, v4l2.device.card=(string)“vi-output,\ ar0821\ 32-0044”, v4l2.device.bus_info=(string)platform:tegra-capture-vi:5, v4l2.device.version=(uint)330344, v4l2.device.capabilities=(uint)2216689665, v4l2.device.device_caps=(uint)69206017;
[gstreamer] gstCamera – found v4l2 device: vi-output, ar0821 32-0043
[gstreamer] v4l2-proplist, device.path=(string)/dev/video3, udev-probed=(boolean)false, device.api=(string)v4l2, v4l2.device.driver=(string)tegra-video, v4l2.device.card=(string)“vi-output,\ ar0821\ 32-0043”, v4l2.device.bus_info=(string)platform:tegra-capture-vi:4, v4l2.device.version=(uint)330344, v4l2.device.capabilities=(uint)2216689665, v4l2.device.device_caps=(uint)69206017;
[gstreamer] gstCamera – found v4l2 device: vi-output, ar0821 31-0044
[gstreamer] v4l2-proplist, device.path=(string)/dev/video2, udev-probed=(boolean)false, device.api=(string)v4l2, v4l2.device.driver=(string)tegra-video, v4l2.device.card=(string)“vi-output,\ ar0821\ 31-0044”, v4l2.device.bus_info=(string)platform:tegra-capture-vi:3, v4l2.device.version=(uint)330344, v4l2.device.capabilities=(uint)2216689665, v4l2.device.device_caps=(uint)69206017;
[gstreamer] gstCamera – found v4l2 device: vi-output, ar0821 31-0043
[gstreamer] v4l2-proplist, device.path=(string)/dev/video1, udev-probed=(boolean)false, device.api=(string)v4l2, v4l2.device.driver=(string)tegra-video, v4l2.device.card=(string)“vi-output,\ ar0821\ 31-0043”, v4l2.device.bus_info=(string)platform:tegra-capture-vi:2, v4l2.device.version=(uint)330344, v4l2.device.capabilities=(uint)2216689665, v4l2.device.device_caps=(uint)69206017;
[gstreamer] gstCamera – found v4l2 device: vi-output, ar0821 30-0043
[gstreamer] v4l2-proplist, device.path=(string)/dev/video0, udev-probed=(boolean)false, device.api=(string)v4l2, v4l2.device.driver=(string)tegra-video, v4l2.device.card=(string)“vi-output,\ ar0821\ 30-0043”, v4l2.device.bus_info=(string)platform:tegra-capture-vi:0, v4l2.device.version=(uint)330344, v4l2.device.capabilities=(uint)2216689665, v4l2.device.device_caps=(uint)69206017;
[gstreamer] gstCamera – found 6 caps for v4l2 device /dev/video0
[gstreamer] [0] video/x-raw, format=(string)UYVY, width=(int)3840, height=(int)2160, framerate=(fraction)16/1;
[gstreamer] [1] video/x-raw, format=(string)UYVY, width=(int)1920, height=(int)1080, framerate=(fraction)60/1;
[gstreamer] [2] video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)720, framerate=(fraction)60/1;
[gstreamer] [3] video/x-raw, format=(string)NV16, width=(int)3840, height=(int)2160, framerate=(fraction)16/1;
[gstreamer] [4] video/x-raw, format=(string)NV16, width=(int)1920, height=(int)1080, framerate=(fraction)60/1;
[gstreamer] [5] video/x-raw, format=(string)NV16, width=(int)1280, height=(int)720, framerate=(fraction)60/1;
[gstreamer] gstCamera – selected device profile: codec=raw format=uyvy width=1280 height=720
[gstreamer] gstCamera pipeline string:
[gstreamer] v4l2src device=/dev/video0 do-timestamp=true ! video/x-raw, format=(string)UYVY, width=(int)1280, height=(int)720 ! appsink name=mysink sync=false
[gstreamer] gstCamera successfully created device v4l2:///dev/video0
In my code, this also preceeds with:
(python3.8:11404): GStreamer-CRITICAL **: 18:45:01.716: gst_element_message_full_with_details: assertion 'GST_IS_ELEMENT (element)' failed
But I believe that to be another problem, as the rest of the terminal is the same as initial block in camera-capture.
I have also tried:
def set_gstcamera_profile(device, profile_number):
subprocess.run(f'v4l2-ctl -d {device} --set-selection=1 --selection-target=1 --set-profile={profile_number}', shell=True)
Nothing I try changes it.
I’ve learnt that my cameras are not 4k compatible with ARGUS API, but they are 1920x1080. Which I still cannot set.
Please Help, I have days on my project.
Jetson Orin, R35, python3.8, linux debian arm64.