Hi,
My use-case is an avionics DVR.
I am using Linux R35.5.0 (Jetpack 5.1.3) with a custom carrier board.
I have modified the device tree and ov5693 driver to support camera capture from an FPGA.
In this use-case the data path is NTSC composite camera ->ADV7842->FPGA->Jetson MIPI.
De-interlacing to 480p is done by ADV7842. Jetson captures at 768x480 to obey 64 byte stride alignment requirement. Capture is fine except for fast motion when horizontal tearing occurs. Tearing is always near the top of the video frame as per the attached picture. We have confirmed that video after ADV7842 deinterlacer does not have tearing.
Please advise on how to resolve this.
Does v4l2-ctl dump the frame have the same problem?
v4l2-ctl has error (error, ts-monotonic, ts-src-eof) due to input being 720x480 and jetson capture being 768x480 so cannot dump frame.
root@xavier:~# v4l2-ctl --device /dev/video2 --set-fmt-video=width=768,height=480 --set-ctrl bypass_mode=0 --stream-mmap --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 768/480
Pixel Format : 'YUYV' (YUYV 4:2:2)
Field : None
Bytes per Line : 1536
Size Image : 737280
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 737280 ts: 7543.010882 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 737280 ts: 7543.027566 delta: 16.684 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 737280 ts: 7543.044250 delta: 16.684 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 737280 ts: 7543.060933 delta: 16.683 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 4 bytesused: 737280 ts: 7543.077617 delta: 16.684 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 5 bytesused: 737280 ts: 7543.094301 delta: 16.684 ms (error, ts-monotonic, ts-src-eof
Does below command can’t dump?
v4l2-ctl --device /dev/video2 --set-fmt-video=width=768,height=480 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=5 --stream-to=test.raw
no. See below. I added --verbose
Text
root@xavier:/opt/mercury/gst-1.16.3/usr/local/lib# v4l2-ctl --device /dev/video2 --set-fmt-video=width=768,height=480 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=5 --stream-to=test.raw --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 768/480
Pixel Format : ‘YUYV’ (YUYV 4:2:2)
Field : None
Bytes per Line : 1536
Size Image : 737280
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 737280 ts: 1046.350065 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 737280 ts: 1046.366749 delta: 16.684 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 737280 ts: 1046.383433 delta: 16.684 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 737280 ts: 1046.400117 delta: 16.684 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 4 bytesused: 737280 ts: 1046.416800 delta: 16.683 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 5 bytesused: 737280 ts: 1046.433484 delta: 16.684 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 6 bytesused: 737280 ts: 1046.450168 delta: 16.684 ms (error, ts-monotonic, ts-src-eof)
Expand (33 lines)
What do you mean. Do you check by v4l2src?
Sorry for late reply.
Capture by nvv4l2camerasrc works as per below gstreamer pipeline but v4l2-ctl capture does not.
gst-launch-1.0 nvv4l2camerasrc device=/dev/video2 ! ‘video/x-raw(memory:NVMM),width=768, height=480,framerate=60/1’ ! nvvidconv ! nvv4l2h264enc ! mpegtsmux ! filesink location=/media/nvme0n1p2/test2.ts -e
That’s weird!! suppose v4l2-ctl should be the same with nvv4l2camerasrc?
How about v4l2src?
alanser
August 13, 2024, 11:30pm
10
Pipeline with v4l2src as below works (i see the same tearing at top of frame)
gst-launch-1.0 v4l2src device=/dev/video2 ! ‘video/x-raw(memory),width=768, height=480,framerate=60/1’ ! nvvidconv ! queue ! nvdrmvideosink conn_id=0 plane_id=1 set_mode=0
Try set the preferred_stride like below.
v4l2-ctl -c preferred_stride=1536
alanser
August 23, 2024, 12:15pm
12
Same result, “error, ts-monotonic, ts-src-eof)”, see below
root@xavier:~# v4l2-ctl --device /dev/video2 -c preferred_stride=1536 --set-fmt-video=width=768,height=480 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=5 --stream-to=test.raw --verbose
VIDIOC_QUERYCAP: ok
VIDIOC_S_EXT_CTRLS: ok
VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
Width/Height : 768/480
Pixel Format : ‘YUYV’ (YUYV 4:2:2)
Field : None
Bytes per Line : 1536
Size Image : 737280
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Limited Range)
Flags :
VIDIOC_REQBUFS returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QUERYBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_QBUF returned 0 (Success)
VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq: 0 bytesused: 737280 ts: 725.352621 (error, ts-monotonic, ts-src-eof)
cap dqbuf: 1 seq: 1 bytesused: 737280 ts: 725.369305 delta: 16.684 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 2 seq: 2 bytesused: 737280 ts: 725.385988 delta: 16.683 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 3 seq: 3 bytesused: 737280 ts: 725.402671 delta: 16.683 ms (error, ts-monotonic, ts-src-eof)
cap dqbuf: 0 seq: 4 bytesused: 737280 ts: 725.419354 delta: 16.683 ms (error, ts-monotonic, ts-src-eof)
Please get the trace log for v4l2-ctl capture.
https://elinux.org/Jetson/l4t/Camera_BringUp
See attached for:
v4l2-ctl --device /dev/video2 -c preferred_stride=1536 --set-fmt-video=width=768,height=480,pixelformat=YUYV --stream-mmap --stream-to=/media/nvme0n1p2/frame2.jpg --stream-count=1 --verbose
trace.log (150.8 KB)
PIXEL_SHORT_LINE of CHANSEL_FAULT, that tell the output pixel doesn’t as expected.
kworker/1:4-368 [001] .... 125.584271: rtcpu_vinotify_event: tstamp:4537772387 cch:0 vi:0 tag:CHANSEL_FAULT channel:0x23 frame:0 vi_tstamp:145206878720 data:0x0000000001df0202
alanser
September 4, 2024, 12:00pm
16
We fixed the issue by adding 48 pixels per line in the fpga. Thanks for your help!
1 Like
system
Closed
October 9, 2024, 4:47am
18
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.