OmniVision OV5647 Linux driver

From RidgeRun Developer Wiki
Revision as of 00:33, 9 February 2017 by Dgarbanzo (talk | contribs)

Template:Eval SDK Download, Demo Image download and Contact Us buttons

Keywords: OV5647 Tegra X1, Gstreamer, Raspbery PI, NVIDIA, RidgeRun, V4L2 Driver, OmniVision


Overview Video

OV5647 Features

The Omnivision OV5647 is a CMOS image sensor with the following features:

  • Automatic image control functions:
    • Automatic exposure control (AEC)
    • Automatic white balance (AWB)
    • Automatic band filter (ABF)
    • Automatic 50/60 Hz luminance detection
    • Automatic black level calibration (ABLC)
  • Image quality controls: lens correction, defective pixel canceling
  • CSI2 serial data output (MIPI interface 2 lanes)
  • Support for output formats: 8-/10-bit raw RGB data
  • Maximum image transfer rate:
    • QSXGA "Mpixel" (2592 x 1944): 15 fps
    • 1080p: 30 fps
    • 960p: 45 fps
    • 720p: 60 fps
    • VGA (640 x 480): 90 fps
    • QVGA (320 x 240): 120 fps


Oficial Manufacturer OV5647 camera sensor documentation link: OV5647 5-megapixel product brief


RidgeRun has developed a driver for the Tegra X1 platform with the following support:

  • L4T 24.2 and Jetpack 2.3
  • V4l2 Media controller driver
  • Tested resolution 1080p @ 30 fps. (More resolutions support are in developing process).
  • Output format: RAW10 Bayer BGGR pattern.
  • Tested with J100 and J20 Auvidea boards
  • Capture with v4l2src and nvcamerasrc
  • Support for sextuple video capture. (Tested using the 6 available ports on Auvidea J20 expansion board)

Getting the source code

In order to get the source code please send an email to support@ridgerun.com or contact us



Enabling the driver

In order to use this driver, you have to patch and compile the kernel source, and there are two ways to do it:

Using RidgeRun SDK

Through the SDK you can easily patch the kernel and generate an image with the required changes to get the ov5647 sensor to work. In this wiki Getting_Started_Guide_for_Tegra_X1_Jetson you can find all the information required to build a Tegra X1 SDK from scratch.

In order to add the OV5647 driver follow these steps:

  • Go to to your SDK directory
  • Go to the kernel directory
  • Copy the patches in the patches directory
001-add-j20-board-driver.patch 
002-add-driver-ov5647-camera.patch                    
003-ov5647-custom-dtb-J20.patch
  • Modify the series file in the kernel directory. You have to add the 3 above patches.
  • Run make config and select the OV5647 and J20 drivers in the Kernel Configuration like this:
-> Kernel Configuration
 -> Device Drivers                                                                                                                        
  -> Multimedia support                                                                                           
    -> Encoders, decoders, sensors and other helper chips
       -> <*> Auvidea J20 Expansion board
       -> <*> Omnivision OV5647 camera sensor support
  • Then make the SDK and install following the Started Guide mentioned before

Using Jetpack

  • Once you have the source code, apply the patches for fix kernel error during compilation and add the support for the OV5647:
cd $DEVDIR/64_TX1/Linux_for_Tegra_64_tx1/sources/
PATCHES=<path to the tarball>
tar -xzf $PATCHES/ov5647-driver-for-tegra-x1-patches.tar.gz
mv ov5647-driver-for-tegra-x1-patches patches
quilt push -a

Please change the path in PATCHES for the one where you downloaded the tarball with the OV5647 patches.

Make sure to enable OV5647 and J20 driver support in the step 5:

-> Device Drivers                                                                                                                        
 -> Multimedia support                                                                                           
   -> Encoders, decoders, sensors and other helper chips
      -> <*> Auvidea J20 Expansion board
      -> <*> Omnivision OV5647 camera sensor support


Using the driver (Gstreamer examples)

The Gstreamer version distributed with Jetpack doesn't support bayer RAW10 only RAW8 so gstreamer needs to be patched in order to capture using v4l2src. Follow the steps in the following wiki page to add the support for RAW10:

http://developer.ridgerun.com/wiki/index.php?title=Compile_gstreamer_on_tegra_X1


Important Note: When you are accessing to the board through serial or ssh and you want to run a pipeline to display with autovideosink, nveglglessink, xvimagesink or any other video sink, you have to run your pipeline with DISPLAY=:0 at the beginning of the description:

DISPLAY=:0 gst-launch-1.0 ...

Note: These tests were done using the J20 board from Auvidea Getting_started_guide_for_Auvidea_J20_board


Demo Video Pipeline Example

By following this link Overview Demo Video you can see the results of executing the below pipeline and get some CPU/GPU load percentage and framerate measurements.

The below pipeline executes the following actions:

  • Sextuple RGB video capture at 1080p@30fps
  • Downscale to 320x240 and color-space format conversion to YUV I420
  • Mix of the 6 streams into one window (Mosaic)
  • Display
DISPLAY=:0 gst-launch-1.0 nvcamerasrc sensor-id=0 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, \
height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)320, \
height=(int)240, format=(string)I420, framerate=(fraction)30/1' ! perf ! mixer.sink_1  nvcamerasrc sensor-id=1 \
fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, \
framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)320, height=(int)240, format=(string)I420, \
framerate=(fraction)30/1' ! mixer.sink_2 nvcamerasrc sensor-id=2 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), \
width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, \
width=(int)320, height=(int)240, format=(string)I420, framerate=(fraction)30/1' ! mixer.sink_3 nvcamerasrc \
sensor-id=3 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, \
framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)320, height=(int)240, format=(string)I420, \
framerate=(fraction)30/1' ! mixer.sink_4 nvcamerasrc sensor-id=4 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), \
width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, \
width=(int)320, height=(int)240, format=(string)I420, framerate=(fraction)30/1' ! mixer.sink_5 nvcamerasrc \
sensor-id=5 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, \
framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)320, height=(int)240, format=(string)I420, \
framerate=(fraction)30/1' ! mixer.sink_6 videotestsrc pattern="black" ! video/x-raw,width=1,height=1 ! videomixer \
name=mixer sink_0::xpos=0 sink_0::ypos=0 sink_0::alpha=0 sink_1::xpos=320 sink_1::ypos=0 sink_2::xpos=320 \
sink_2::ypos=240 sink_3::xpos=0 sink_3::ypos=0 sink_4::xpos=0 sink_4::ypos=480 sink_5::xpos=0 sink_5::ypos=240 \
sink_6::xpos=320 sink_6::ypos=480 ! queue ! ximagesink sync=false -v

This is a snapshot of the Tegra-X1 display while running the above pipeline:

Sextuple capture demo video snapshot

Performance statistics

  • Tegrastats in normal operation:
RAM 827/3995MB (lfb 660x4MB) cpu [4%,3%,2%,6%]@102 GR3D 0%@76 EDP limit 0
RAM 827/3995MB (lfb 660x4MB) cpu [6%,2%,3%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 827/3995MB (lfb 660x4MB) cpu [1%,1%,2%,10%]@102 GR3D 0%@76 EDP limit 0
RAM 827/3995MB (lfb 660x4MB) cpu [4%,4%,5%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 827/3995MB (lfb 660x4MB) cpu [3%,1%,4%,5%]@102 GR3D 0%@76 EDP limit 0
RAM 827/3995MB (lfb 660x4MB) cpu [6%,3%,2%,6%]@102 GR3D 0%@76 EDP limit 0
RAM 827/3995MB (lfb 660x4MB) cpu [3%,1%,2%,10%]@102 GR3D 0%@76 EDP limit 0
RAM 828/3995MB (lfb 660x4MB) cpu [9%,2%,2%,2%]@102 GR3D 0%@76 EDP limit 0
RAM 827/3995MB (lfb 660x4MB) cpu [9%,3%,2%,3%]@403 GR3D 0%@76 EDP limit 0
RAM 827/3995MB (lfb 660x4MB) cpu [0%,0%,3%,0%]@102 GR3D 0%@76 EDP limit 0
  • Tegrastats with the above pipeline running
RAM 1821/3995MB (lfb 404x4MB) cpu [57%,56%,60%,48%]@1734 GR3D 44%@76 EDP limit 0
RAM 1819/3995MB (lfb 404x4MB) cpu [59%,58%,54%,55%]@1734 GR3D 20%@76 EDP limit 0
RAM 1821/3995MB (lfb 404x4MB) cpu [53%,66%,52%,56%]@1734 GR3D 28%@76 EDP limit 0
RAM 1822/3995MB (lfb 404x4MB) cpu [57%,66%,53%,54%]@1734 GR3D 42%@76 EDP limit 0
RAM 1820/3995MB (lfb 404x4MB) cpu [50%,61%,52%,53%]@1734 GR3D 46%@76 EDP limit 0
RAM 1822/3995MB (lfb 404x4MB) cpu [55%,63%,52%,59%]@1734 GR3D 29%@76 EDP limit 0
RAM 1822/3995MB (lfb 404x4MB) cpu [56%,62%,56%,51%]@1734 GR3D 42%@76 EDP limit 0
RAM 1820/3995MB (lfb 404x4MB) cpu [55%,64%,52%,56%]@1734 GR3D 20%@76 EDP limit 0
RAM 1822/3995MB (lfb 404x4MB) cpu [57%,62%,50%,55%]@1734 GR3D 34%@76 EDP limit 0
RAM 1822/3995MB (lfb 404x4MB) cpu [59%,66%,49%,57%]@1734 GR3D 34%@76 EDP limit 0

Snapshots

In order to check the snapshot, you can use the following tool:

https://github.com/jdthomas/bayer2rgb

So, run the following commands to download the tool and compile it:

git clone git@github.com:jdthomas/bayer2rgb.git
cd bayer2rgb
make
cp bayer2rgb /usr/bin/

Bayer2rgb will convert naked (no header) bayer grid data into rgb data. There are several choices of interpolation (though they all look essentially the same to my eye). It can output tiff files, and can integrate with ImageMagick to output other formats.

  • 1920x1080
gst-launch-1.0 -v v4l2src device=/dev/video0 num-buffers=1 ! "video/x-bayer, format=bggr, width=1920, height=1080" \
! multifilesink location=test%d_1920x1080.bayer

Check the snapshot with:

./bayer2rgb --input=test#_1920x1080.bayer --output=data.tiff --width=1920 --height=1080 --bpp=16 --first=BGGR \
--method=BILINEAR --tiff

Use image_magik to convert the tiff to png:

convert data.tiff data.png

Important Note 1: In general the first buffer contains very low light because the AWB algorithm of the sensor is calibrating, so we recommend to use multifilesink to test debayer with a buffer above from number one. To obtain better image colors and bright quality, due to automatic sensor image calibration, we recommend to test debayer with a frame above number 10, to give time to the sensor to adjust the best image calibration parameters.

Important Note 2: The debayered image obtained as the output when use the "bayer2rgb" tool presents some kind of light saturation, viewed as multiple color pixels sections. This is a problem of the tool used to do the debayer process, but led the users to verify that the driver and camera sensor is working fine.

Snapshots with nvcamerasrc

The following pipeline will create a file for each captured frame. You can visualize the file in the following web page: http://rawpixels.net/

gst-launch-1.0 -v nvcamerasrc sensor-id=1 fpsRange="30 30" num-buffers=100 ! 'video/x-raw(memory:NVMM), width=(int)1920, \
height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)1920, \
height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! multifilesink location=test_%d.yuv


Single Capture

V4l2src

You can use the raw2rgbpnm tool to check all the buffers:

https://github.com/martinezjavier/raw2rgbpnm

So, run the following commands to download the tool and compile it:

git clone git clone git@github.com:martinezjavier/raw2rgbpnm.git
cd raw2rgbpnm

Open the file raw2rgbpnm.c and change the line 489 with:

int c = getopt(argc, argv, "a:b:f:ghs:wn");

This is to enable the option to extract multiple frames from a file. Now, you can build the application:

make

Important Note: This tool converts from GRBG10 to pnm. We capture BGGR in the OV5647, so you will see that the colors at the output of the image are wrong.


In order to capture 10 buffers and save them in a file, you can run the following pipelines:

  • 1920x1080
gst-launch-1.0 -v v4l2src device=/dev/video0 num-buffers=10 ! "video/x-bayer, format=bggr, width=1920, height=1080" \
! filesink location=test_1920x1080.bayer

Check the buffers with:

./raw2rgbpnm -f SGRBG10 -s 1920x1080 -b 5.0 -n test_1920x1080.bayer output_1920x1080

Nvcamerasrc

  • 1920x1080
DISPLAY=:0 gst-launch-1.0 nvcamerasrc sensor-id=0 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, \
height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvegltransform ! nveglglessink -e

This is an image captured with the above pipeline:

OV5647 capture (1920x1080) with nvcamerasrc


Sextuple Capture

The following image consists in a Tegra X1 with six ov5647 cameras plugged in the Auvidea J20 expansion board and doing video capture at the same time:

OV5647 camera sextuple video capture with Tegra X1


Sextuple Capture Connection Diagram:

OV5647 Sextuple Capture Connection Diagram


Using the following pipelines we can test the performance of the Tegra X1 when doing sextuple capture:

V4l2src

  • Pipeline for sextuple video capture using v4l2src, at 1920x1080 @30fps:
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-bayer,format=bggr,width=1920,height=1080' ! fakesink \
v4l2src device=/dev/video1 ! 'video/x-bayer,format=bggr,width=1920,height=1080' ! fakesink \
v4l2src device=/dev/video2 ! 'video/x-bayer,format=bggr,width=1920,height=1080' ! fakesink \
v4l2src device=/dev/video3 ! 'video/x-bayer,format=bggr,width=1920,height=1080' ! fakesink \
v4l2src device=/dev/video4 ! 'video/x-bayer,format=bggr,width=1920,height=1080' ! fakesink \
v4l2src device=/dev/video5 ! 'video/x-bayer,format=bggr,width=1920,height=1080' ! fakesink

Performance statistics

  • Tegrastats in normal operation:
RAM 1579/3994MB (lfb 378x4MB) cpu [3%,5%,2%,7%]@102 GR3D 0%@76 EDP limit 0
RAM 1579/3994MB (lfb 378x4MB) cpu [3%,4%,5%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 1579/3994MB (lfb 378x4MB) cpu [2%,1%,8%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 1579/3994MB (lfb 378x4MB) cpu [4%,2%,8%,3%]@102 GR3D 0%@76 EDP limit 0
RAM 1579/3994MB (lfb 378x4MB) cpu [2%,3%,7%,3%]@102 GR3D 0%@76 EDP limit 0
RAM 1579/3994MB (lfb 378x4MB) cpu [3%,3%,6%,3%]@102 GR3D 0%@76 EDP limit 0
RAM 1579/3994MB (lfb 378x4MB) cpu [5%,1%,5%,3%]@102 GR3D 0%@76 EDP limit 0
RAM 1579/3994MB (lfb 378x4MB) cpu [1%,2%,7%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 1579/3994MB (lfb 378x4MB) cpu [8%,1%,1%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 1578/3994MB (lfb 378x4MB) cpu [8%,2%,2%,6%]@102 GR3D 0%@76 EDP limit 0
  • Tegrastats with the above pipeline running:
RAM 1677/3994MB (lfb 370x4MB) cpu [20%,3%,5%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 1677/3994MB (lfb 370x4MB) cpu [18%,5%,6%,2%]@102 GR3D 0%@76 EDP limit 0
RAM 1677/3994MB (lfb 370x4MB) cpu [18%,3%,4%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 1677/3994MB (lfb 370x4MB) cpu [18%,7%,3%,3%]@102 GR3D 0%@76 EDP limit 0
RAM 1677/3994MB (lfb 370x4MB) cpu [11%,9%,7%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 1677/3994MB (lfb 370x4MB) cpu [17%,9%,4%,2%]@102 GR3D 0%@76 EDP limit 0
RAM 1677/3994MB (lfb 370x4MB) cpu [17%,4%,8%,3%]@102 GR3D 0%@76 EDP limit 0
RAM 1677/3994MB (lfb 370x4MB) cpu [15%,6%,2%,5%]@102 GR3D 0%@76 EDP limit 0
RAM 1677/3994MB (lfb 370x4MB) cpu [21%,6%,4%,7%]@102 GR3D 0%@76 EDP limit 0
RAM 1677/3994MB (lfb 370x4MB) cpu [19%,3%,5%,4%]@102 GR3D 0%@76 EDP limit 0

Nvcamerasrc

  • Pipeline for sextuple video capture using nvcamerasrc, at 1920x1080 @30fps:
gst-launch-1.0 nvcamerasrc sensor-id=0 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, \
format=(string)I420, framerate=(fraction)30/1' ! fakesink nvcamerasrc sensor-id=1 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), \
width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! fakesink nvcamerasrc sensor-id=2 \
fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' \
! fakesink nvcamerasrc sensor-id=3 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, \
format=(string)I420, framerate=(fraction)30/1' ! fakesink nvcamerasrc sensor-id=4 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), \
width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! fakesink nvcamerasrc sensor-id=5 \
fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' \
! fakesink

Performance statistics

  • Tegrastats in normal operation:
RAM 1490/3994MB (lfb 412x4MB) cpu [5%,3%,5%,2%]@102 GR3D 0%@76 EDP limit 0
RAM 1490/3994MB (lfb 412x4MB) cpu [5%,1%,5%,3%]@307 GR3D 0%@76 EDP limit 0
RAM 1490/3994MB (lfb 412x4MB) cpu [5%,2%,4%,0%]@102 GR3D 0%@76 EDP limit 0
RAM 1490/3994MB (lfb 412x4MB) cpu [8%,1%,6%,2%]@102 GR3D 0%@76 EDP limit 0
RAM 1490/3994MB (lfb 412x4MB) cpu [7%,5%,6%,9%]@102 GR3D 0%@76 EDP limit 0
RAM 1489/3994MB (lfb 412x4MB) cpu [6%,3%,6%,5%]@102 GR3D 0%@76 EDP limit 0
RAM 1489/3994MB (lfb 412x4MB) cpu [6%,2%,3%,3%]@102 GR3D 0%@76 EDP limit 0
RAM 1489/3994MB (lfb 412x4MB) cpu [7%,4%,3%,8%]@102 GR3D 0%@76 EDP limit 0
RAM 1489/3994MB (lfb 412x4MB) cpu [6%,2%,1%,5%]@102 GR3D 0%@76 EDP limit 0
RAM 1489/3994MB (lfb 412x4MB) cpu [8%,4%,1%,4%]@102 GR3D 0%@76 EDP limit 0
  • Tegrastats with the above pipeline running
RAM 1785/3994MB (lfb 408x4MB) cpu [45%,44%,51%,40%]@1428 GR3D 0%@76 EDP limit 0
RAM 1785/3994MB (lfb 408x4MB) cpu [47%,53%,50%,45%]@1036 GR3D 0%@76 EDP limit 0
RAM 1785/3994MB (lfb 408x4MB) cpu [46%,54%,42%,47%]@1326 GR3D 0%@76 EDP limit 0
RAM 1785/3994MB (lfb 408x4MB) cpu [44%,45%,47%,49%]@1036 GR3D 0%@76 EDP limit 0
RAM 1785/3994MB (lfb 408x4MB) cpu [46%,50%,48%,47%]@1036 GR3D 0%@76 EDP limit 0
RAM 1785/3994MB (lfb 408x4MB) cpu [48%,48%,49%,45%]@1224 GR3D 0%@76 EDP limit 0
RAM 1785/3994MB (lfb 408x4MB) cpu [50%,50%,43%,46%]@1326 GR3D 0%@76 EDP limit 0
RAM 1786/3994MB (lfb 408x4MB) cpu [50%,47%,48%,43%]@1326 GR3D 0%@76 EDP limit 0
RAM 1785/3994MB (lfb 408x4MB) cpu [40%,46%,47%,46%]@1132 GR3D 0%@76 EDP limit 0
RAM 1786/3994MB (lfb 408x4MB) cpu [46%,53%,40%,49%]@1428 GR3D 0%@76 EDP limit 0

Sextuple Capture, and Display

Using the following pipelines we can test the performance of the Tegra X1 when doing sextuple video capture and display:

V4l2src

V4l2 can't be used with the ISP accelerated hardware unit of the Tegra X1 to do the de-bayer process (convert to YUV color-space) yet. Because of that, we can't link v4l2src with any hardware accelerated encoder/decoder available on Tegra X1 or any actual video sinks, if the camera sensor output is in Bayer color-space format.

Nvcamerasrc

  • Pipeline for sextuple video capture, at 1920x1080 resolution @30fps and display:
DISPLAY=:0 gst-launch-1.0 nvcamerasrc sensor-id=0 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, \
format=(string)I420, framerate=(fraction)30/1' ! nvegltransform ! nveglglessink nvcamerasrc sensor-id=1 fpsRange="30 30" ! \
'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvegltransform ! \
nveglglessink nvcamerasrc sensor-id=2 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, \ 
format=(string)I420, framerate=(fraction)30/1' ! nvegltransform ! nveglglessink nvcamerasrc sensor-id=3 fpsRange="30 30" ! \
'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvegltransform ! \
nveglglessink nvcamerasrc sensor-id=4 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, \
format=(string)I420, framerate=(fraction)30/1' ! nvegltransform ! nveglglessink nvcamerasrc sensor-id=5 fpsRange="30 30" ! \
'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! perf ! \
nvegltransform ! nveglglessink -e 

Performance statistics

  • Tegrastats in normal operation:
RAM 1661/3994MB (lfb 334x4MB) cpu [3%,7%,5%,1%]@102 GR3D 0%@76 EDP limit 0
RAM 1661/3994MB (lfb 334x4MB) cpu [2%,1%,2%,1%]@102 GR3D 0%@76 EDP limit 0
RAM 1660/3994MB (lfb 334x4MB) cpu [5%,2%,1%,5%]@102 GR3D 0%@76 EDP limit 0
RAM 1660/3994MB (lfb 334x4MB) cpu [3%,3%,4%,6%]@102 GR3D 0%@76 EDP limit 0
RAM 1660/3994MB (lfb 334x4MB) cpu [3%,4%,1%,7%]@102 GR3D 0%@76 EDP limit 0
RAM 1660/3994MB (lfb 334x4MB) cpu [5%,3%,1%,6%]@102 GR3D 0%@76 EDP limit 0
RAM 1661/3994MB (lfb 334x4MB) cpu [3%,3%,1%,9%]@102 GR3D 0%@76 EDP limit 0
RAM 1661/3994MB (lfb 334x4MB) cpu [3%,4%,3%,3%]@102 GR3D 0%@76 EDP limit 0
RAM 1661/3994MB (lfb 334x4MB) cpu [3%,2%,3%,4%]@102 GR3D 0%@76 EDP limit 0
RAM 1661/3994MB (lfb 334x4MB) cpu [2%,4%,4%,6%]@102 GR3D 0%@76 EDP limit 0
  • Tegrastats with the above pipeline running
RAM 2253/3994MB (lfb 284x4MB) cpu [63%,63%,64%,61%]@1734 GR3D 52%@307 EDP limit 0
RAM 2253/3994MB (lfb 284x4MB) cpu [63%,64%,60%,61%]@1734 GR3D 59%@230 EDP limit 0
RAM 2252/3994MB (lfb 284x4MB) cpu [64%,64%,64%,61%]@1734 GR3D 61%@230 EDP limit 0
RAM 2252/3994MB (lfb 284x4MB) cpu [65%,58%,64%,60%]@1734 GR3D 65%@307 EDP limit 0
RAM 2252/3994MB (lfb 284x4MB) cpu [61%,67%,62%,64%]@1734 GR3D 54%@307 EDP limit 0
RAM 2252/3994MB (lfb 284x4MB) cpu [66%,58%,63%,64%]@1734 GR3D 78%@230 EDP limit 0
RAM 2254/3994MB (lfb 283x4MB) cpu [65%,64%,64%,63%]@1734 GR3D 57%@307 EDP limit 0
RAM 2254/3994MB (lfb 283x4MB) cpu [65%,64%,62%,64%]@1734 GR3D 51%@230 EDP limit 0
RAM 2254/3994MB (lfb 283x4MB) cpu [67%,59%,63%,58%]@1734 GR3D 73%@230 EDP limit 0
RAM 2254/3994MB (lfb 283x4MB) cpu [62%,69%,67%,61%]@1734 GR3D 45%@307 EDP limit 0


Sextuple Capture, Downscale and Display

Using the following pipelines we can test the performance of the Tegra X1 when doing sextuple video capture, downscale and display:

V4l2src

V4l2 can't be used with the ISP accelerated hardware unit of the Tegra X1 to do the de-bayer process (convert to YUV color-space) yet. Because of that, we can't link v4l2src with any hardware accelerated encoder/decoder available on Tegra X1 or any actual video sinks, if the camera sensor output is in Bayer color-space format.

Nvcamerasrc

This was the same pipeline used in the ov5647 sextuple capture on Tegra-X1 demo video in the Overview Video section at the beginning of this wiki.

  • Pipeline for sextuple video capture, downscale from 1920x1080 to 640x480 resolution @30fps and display:
DISPLAY=:0 gst-launch-1.0 nvcamerasrc sensor-id=0 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, \
format=(string)I420, framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)640, height=(int)480, format=(string)I420, \
framerate=(fraction)30/1' ! xvimagesink  nvcamerasrc sensor-id=1 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, \
height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)640, height=(int)480, \
format=(string)I420, framerate=(fraction)30/1' ! xvimagesink nvcamerasrc sensor-id=2 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), \
width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)640, \
height=(int)480, format=(string)I420, framerate=(fraction)30/1' ! xvimagesink nvcamerasrc sensor-id=3 fpsRange="30 30" ! \
'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvvidconv ! \
'video/x-raw, width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)30/1' ! xvimagesink nvcamerasrc sensor-id=4 \
fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! \
nvvidconv ! 'video/x-raw, width=(int)640, height=(int)480, format=(string)I420, framerate=(fraction)30/1' ! xvimagesink \
nvcamerasrc sensor-id=5 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, \
framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)640, height=(int)480, format=(string)I420, \
framerate=(fraction)30/1' ! xvimagesink -v

The following picture is a screenshot of the Tegra-X1 when it was running the above pipeline:

OV5647 camera sextuple video capture on Tegra X1 screenshot

Performance statistics

  • Tegrastats in normal operation:
RAM 1694/3994MB (lfb 351x4MB) cpu [4%,3%,1%,8%]@102 GR3D 0%@76 EDP limit 0
RAM 1694/3994MB (lfb 351x4MB) cpu [4%,3%,3%,7%]@102 GR3D 0%@76 EDP limit 0
RAM 1694/3994MB (lfb 351x4MB) cpu [4%,4%,3%,6%]@102 GR3D 0%@76 EDP limit 0
RAM 1694/3994MB (lfb 351x4MB) cpu [4%,5%,0%,7%]@102 GR3D 0%@76 EDP limit 0
RAM 1694/3994MB (lfb 351x4MB) cpu [1%,4%,0%,5%]@102 GR3D 0%@76 EDP limit 0
RAM 1694/3994MB (lfb 351x4MB) cpu [7%,5%,1%,5%]@102 GR3D 0%@76 EDP limit 0
RAM 1694/3994MB (lfb 351x4MB) cpu [8%,3%,1%,2%]@518 GR3D 0%@76 EDP limit 0
RAM 1694/3994MB (lfb 351x4MB) cpu [3%,0%,0%,0%]@102 GR3D 0%@76 EDP limit 0
RAM 1694/3994MB (lfb 351x4MB) cpu [3%,1%,0%,0%]@102 GR3D 0%@76 EDP limit 0
RAM 1694/3994MB (lfb 351x4MB) cpu [4%,3%,1%,0%]@102 GR3D 0%@76 EDP limit 0
  • Tegrastats with the above pipeline running
RAM 2065/3994MB (lfb 340x4MB) cpu [68%,57%,60%,59%]@1734 GR3D 54%@76 EDP limit 0
RAM 2065/3994MB (lfb 340x4MB) cpu [66%,59%,56%,57%]@1734 GR3D 64%@76 EDP limit 0
RAM 2065/3994MB (lfb 340x4MB) cpu [60%,65%,58%,62%]@1734 GR3D 53%@76 EDP limit 0
RAM 2065/3994MB (lfb 340x4MB) cpu [60%,62%,60%,63%]@1734 GR3D 46%@76 EDP limit 0
RAM 2065/3994MB (lfb 340x4MB) cpu [60%,58%,60%,65%]@1734 GR3D 54%@76 EDP limit 0
RAM 2065/3994MB (lfb 340x4MB) cpu [61%,64%,62%,60%]@1734 GR3D 42%@76 EDP limit 0
RAM 2065/3994MB (lfb 340x4MB) cpu [63%,61%,59%,65%]@1734 GR3D 54%@76 EDP limit 0
RAM 2069/3994MB (lfb 339x4MB) cpu [62%,63%,60%,58%]@1734 GR3D 51%@76 EDP limit 0
RAM 2069/3994MB (lfb 339x4MB) cpu [63%,57%,62%,59%]@1734 GR3D 57%@76 EDP limit 0
RAM 2069/3994MB (lfb 339x4MB) cpu [61%,66%,64%,62%]@1734 GR3D 56%@76 EDP limit 0


Video Encoding Transport Stream 1920x1080@30fps

The following pipeline will generate a video, you can visualize it with any video-player like VLC for example.

gst-launch-1.0 -v nvcamerasrc sensor-id=1 fpsRange="30 30" num-buffers=500 ! 'video/x-raw(memory:NVMM), width=(int)1920, \
height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! omxh264enc ! qtmux ! filesink location=test.ts


OV5647 4x camera 720p recording test

On OV5647_4x_camera_720p_recording_test you will find a very descriptive step by step 4x camera 720p video streams recording to disk test. The test consist in save to disk the 4 video streams in RAW, H264 and H265 encoded formats in each case. A SSD and a SD Card (class 10) was used as disk units. Also, you will find performance statistics of each test case, so you can make comparisons between them.



Demo SD card for Tegra Tx1 J20

http://developer.ridgerun.com/wiki/index.php?title=RidgeRun_Demo_Images