Does Jetson Xavier/Tegra multimedia API support v4l2src with “video/x-raw (memory:NVMM)” or “video/x-bayer(memory:NVMM)”?
I want to capture the data from a camera sensor, on the Xavier NX board, process the Bayer data in GPU and I want to use a zero-copy mechanism or NVMM DMA buffer.
What is the possible way of doing this using GStreamer or Tegra multimedia APIs?
Once you have RAW data in CUDA buffers, you can create NvBuffer and debayer/convert RAW data into the NvBuffer. It does not support RAW formats in NvBuffer so you would need to do debayering and conversion.
Hi Ajith
If you are using an on board sensor then
Onboard camera is bayer sensor you need some plugin like bayer2rbg element and the format is bayer “bggr”
a possible command should be like below.
If you don’t want to debayer, you may use V4L API:
# Install package v4l-utils if not yet done, it provides v4l2-ctl command
sudo apt install v4l-utils
# Check available modes for your camera (assuming first camera on /dev/video0)
v4l2-ctl -d /dev/video0 --list-formats-ext
# Capture 100 frames (you would adapt to your sensor modes) to file
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_100frames.RG10
You may have to set framerate, gain and exposure.
That being said, decoding the file may not be obvious. You may have to know how pixels values are stored.
About debayering with gstreamer, this would only work with bayer8 or bayer16. Non byte-aligned sizes are not supported, AFAIK.