v4l2-ctl command usage

Hi All,

Connected OV5693 camera module to jetson TX2 board and tried to stream the live video using v4l2 interfce.
tried the following command for caputre and stream the live video

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG12 --stream-mmap -set-ctrl=sensor_mode=0 --stream-count=100 -d /dev/video0

v4l2-ctl -d /dev/video0 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw

Didn’t get any output for these two command
later we removed --set-fmt-video and -set-ctl from the first command and tried

v4l2-ctl --stream-mmap --stream-count=100 -d /dev/video0

And output obtained as in the command prompt

<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.04 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.03 fps
<<<<<<<<​

  1. Can we stream the video using theses commands
  2. How to play the .RAW file

thanks in advance…

v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=100 --stream-to=test.raw
1 Like
gst-launch-1.0 filesrc location=./test.raw blocksize=4147200 num-buffers=100 do-timestamp=true ! \
    'video/x-bayer,format=(string)bggr,width=(int)1920,height=(int)1080,depth=10,bpp=16,framerate=(fraction)30/1' ! \
    bayer2rgb ! \
    'video/x-raw,format=(string)RGBA,width=(int)1920,height=(int)1080,framerate=(fraction)30/1' ! \
    videoconvert ! \
    'video/x-raw,format=(string)I420,framerate=(fraction)30/1' ! \
    omxh264enc ! \
    'video/x-h264,stream-format=(string)byte-stream,framerate=(fraction)30/1' ! \
    h264parse ! \
    qtmux ! \
    filesink sync=true location=test.mp4 -e \

But,there are something wrong in this pipeline,the video looks strange.my abilities is limitied,so this is just a direction,a try.

@muhammed
Why get the raw data? Does the argus/nvcamerasrc didn’t fit your use case?

I am trying to get RAW from ZED converted to mp4.
Could you provide a hint on how to implement that? I tried to customize the code excerpt above but it will require more precise adjustments, for It will work in my case.

v4l2-ctl --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap --stream-count=1 -d /dev/video0 --stream-to=ov5693.raw

cat convert.sh

gst-launch-1.0 filesrc location=./ov5693.raw blocksize=4147200 num-buffers=100 do-timestamp=true ! \
    'video/x-raw,format=(string)RGBA,width=(int)1920,height=(int)1080,framerate=(fraction)30/1' ! \
    videoconvert ! \
    'video/x-raw,format=(string)I420,framerate=(fraction)30/1' ! \
    omxh264enc ! \
    'video/x-h264,stream-format=(string)byte-stream,framerate=(fraction)30/1' ! \
    h264parse ! \
    qtmux ! \
    filesink sync=true location=ov5693.mp4 -e \

Actually the objective I am investigating is getting picture from zed using v4l2-ctl

@Addrey
What’s ZED? USB type sensor?

Yep. USB type sensor. Actually not necessarily ZED, but any USB type sensor.
Apparently, the issue of streaming rtsp using USB type sensor doesn’t appear to be that interesting as steaming MIPI CSI, in my opinion. And the latter has been successfully resolved previously. Therefore, the issue appears to somewhat exhaust itself.
However, being doing a research on how to use usb-type sensor for the app I used to look through usb-sensor use in the context of gstreamer and v4l2 application. And that was why the question emerged.

Usually the USB sensor output YUV format. You can try v4l2src gstreamer pipeline or use MMAPI to encod to mp4.