Difference between revisions of "OmniVision OVM6211 Linux Driver"

From RidgeRun Developer Connection
Jump to: navigation, search
(Using Jetpack)
m
 
(29 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<seo title="OmniVision OV5647 Driver | Linux driver for Jetson TX1 TX2 | RidgeRun" titlemode="replace" keywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, Nvidia, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework, OV5647, OmniVision OV5647, OV5647 Linux driver, Jetson TX1 OV5647 driver, Jetson TX2 OV5647 Linux driver, OV5647 Linux driver for TX2, OmniVision, Auvidea_J20_board, Auvidea_J20, RidgeRundescription="Read about the OmniVision OV5647 Linux driver for Jetson TX1 and TX2 and building the driver from RidgeRun."></seo>
+
<seo title="OmniVision OVM6211 Driver | Linux driver for Jetson Nano | RidgeRun" titlemode="replace" metakeywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, Nvidia, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework, OVM6211, OmniVision OVM6211, OVM6211 Linux driver, Jetson Nano OVM6211 driver, Jetson Nano OVM6211 Linux driver, OVM6211 Linux driver for Nano, OmniVision, RidgeRun, Jetson Nano, Jetpack 4.3, L4T, V4L2metadescription="Read about the OmniVision OVM6211 Linux driver for Jetson Nano and building the driver from RidgeRun."></seo>
  
 
<table>
 
<table>
Line 5: Line 5:
 
<td><div class="clear; float:right">__TOC__</div></td>
 
<td><div class="clear; float:right">__TOC__</div></td>
 
<td>
 
<td>
<html>
+
{{Shopping cart mpo for V4L2 camera drivers}}
<div id='product-component-1594671854188'></div>
+
<td>
<script type="text/javascript">
+
{{NVIDIA Preferred Partner logo}}
/*<![CDATA[*/
+
<td>
(function () {
 
  var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';
 
  if (window.ShopifyBuy) {
 
    if (window.ShopifyBuy.UI) {
 
      ShopifyBuyInit();
 
    } else {
 
      loadScript();
 
    }
 
  } else {
 
    loadScript();
 
  }
 
  function loadScript() {
 
    var script = document.createElement('script');
 
    script.async = true;
 
    script.src = scriptURL;
 
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);
 
    script.onload = ShopifyBuyInit;
 
  }
 
  function ShopifyBuyInit() {
 
    var client = ShopifyBuy.buildClient({
 
      domain: 'ridgerun1.myshopify.com',
 
      storefrontAccessToken: 'b0ca98633a82de5d2f63cd51f5af30ac',
 
    });
 
    ShopifyBuy.UI.onReady(client).then(function (ui) {
 
      ui.createComponent('product', {
 
        id: '1684420821063',
 
        node: document.getElementById('product-component-1594671854188'),
 
        moneyFormat: '%24%7B%7Bamount%7D%7D',
 
        options: {
 
  "product": {
 
    "styles": {
 
      "product": {
 
        "@media (min-width: 601px)": {
 
          "max-width": "calc(25% - 20px)",
 
          "margin-left": "20px",
 
          "margin-bottom": "50px"
 
        }
 
      },
 
      "button": {
 
        "font-family": "Open Sans, sans-serif",
 
        "font-weight": "bold",
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px",
 
        ":hover": {
 
          "background-color": "#0187a7"
 
        },
 
        "background-color": "#0196ba",
 
        ":focus": {
 
          "background-color": "#0187a7"
 
        },
 
        "border-radius": "5px",
 
        "padding-left": "50px",
 
        "padding-right": "50px"
 
      },
 
      "quantityInput": {
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px"
 
      }
 
    },
 
    "text": {
 
      "button": "Add to cart"
 
    },
 
    "googleFonts": [
 
      "Open Sans"
 
    ]
 
  },
 
  "productSet": {
 
    "styles": {
 
      "products": {
 
        "@media (min-width: 601px)": {
 
          "margin-left": "-20px"
 
        }
 
      }
 
    }
 
  },
 
  "modalProduct": {
 
    "contents": {
 
      "img": false,
 
      "imgWithCarousel": true,
 
      "button": false,
 
      "buttonWithQuantity": true
 
    },
 
    "styles": {
 
      "product": {
 
        "@media (min-width: 601px)": {
 
          "max-width": "100%",
 
          "margin-left": "0px",
 
          "margin-bottom": "0px"
 
        }
 
      },
 
      "button": {
 
        "font-family": "Open Sans, sans-serif",
 
        "font-weight": "bold",
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px",
 
        ":hover": {
 
          "background-color": "#0187a7"
 
        },
 
        "background-color": "#0196ba",
 
        ":focus": {
 
          "background-color": "#0187a7"
 
        },
 
        "border-radius": "5px",
 
        "padding-left": "50px",
 
        "padding-right": "50px"
 
      },
 
      "quantityInput": {
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px"
 
      }
 
    },
 
    "googleFonts": [
 
      "Open Sans"
 
    ]
 
  },
 
  "cart": {
 
    "styles": {
 
      "button": {
 
        "font-family": "Open Sans, sans-serif",
 
        "font-weight": "bold",
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px",
 
        ":hover": {
 
          "background-color": "#0187a7"
 
        },
 
        "background-color": "#0196ba",
 
        ":focus": {
 
          "background-color": "#0187a7"
 
        },
 
        "border-radius": "5px"
 
      },
 
      "title": {
 
        "color": "#4c4c4c"
 
      },
 
      "header": {
 
        "color": "#4c4c4c"
 
      },
 
      "lineItems": {
 
        "color": "#4c4c4c"
 
      },
 
      "subtotalText": {
 
        "color": "#4c4c4c"
 
      },
 
      "subtotal": {
 
        "color": "#4c4c4c"
 
      },
 
      "notice": {
 
        "color": "#4c4c4c"
 
      },
 
      "currency": {
 
        "color": "#4c4c4c"
 
      },
 
      "close": {
 
        "color": "#4c4c4c",
 
        ":hover": {
 
          "color": "#4c4c4c"
 
        }
 
      },
 
      "empty": {
 
        "color": "#4c4c4c"
 
      },
 
      "noteDescription": {
 
        "color": "#4c4c4c"
 
      },
 
      "discountText": {
 
        "color": "#4c4c4c"
 
      },
 
      "discountIcon": {
 
        "fill": "#4c4c4c"
 
      },
 
      "discountAmount": {
 
        "color": "#4c4c4c"
 
      }
 
    },
 
    "googleFonts": [
 
      "Open Sans"
 
    ]
 
  },
 
  "toggle": {
 
    "styles": {
 
      "toggle": {
 
        "font-family": "Open Sans, sans-serif",
 
        "font-weight": "bold",
 
        "background-color": "#0196ba",
 
        ":hover": {
 
          "background-color": "#0187a7"
 
        },
 
        ":focus": {
 
          "background-color": "#0187a7"
 
        }
 
      },
 
      "count": {
 
        "font-size": "18px"
 
      }
 
    },
 
    "googleFonts": [
 
      "Open Sans"
 
    ]
 
  },
 
  "lineItem": {
 
    "styles": {
 
      "variantTitle": {
 
        "color": "#4c4c4c"
 
      },
 
      "title": {
 
        "color": "#4c4c4c"
 
      },
 
      "price": {
 
        "color": "#4c4c4c"
 
      },
 
      "fullPrice": {
 
        "color": "#4c4c4c"
 
      },
 
      "discount": {
 
        "color": "#4c4c4c"
 
      },
 
      "discountIcon": {
 
        "fill": "#4c4c4c"
 
      },
 
      "quantity": {
 
        "color": "#4c4c4c"
 
      },
 
      "quantityIncrement": {
 
        "color": "#4c4c4c",
 
        "border-color": "#4c4c4c"
 
      },
 
      "quantityDecrement": {
 
        "color": "#4c4c4c",
 
        "border-color": "#4c4c4c"
 
      },
 
      "quantityInput": {
 
        "color": "#4c4c4c",
 
        "border-color": "#4c4c4c"
 
      }
 
    }
 
  }
 
},
 
      });
 
    });
 
  }
 
})();
 
/*]]>*/
 
</script>
 
</html>
 
 
<td>
 
<td>
 
{{GStreamer debug}}
 
{{GStreamer debug}}
Line 266: Line 17:
 
</tr>
 
</tr>
 
</table>
 
</table>
 +
<br>
  
 
+
'''Keywords:''' OVM6211 Jetson Nano, GStreamer, Raspberry PI, NVIDIA, RidgeRun, V4L2 Driver, OmniVision
'''Keywords:''' OV5647 Jetson TX1, GStreamer, Raspbery PI, NVIDIA, RidgeRun, V4L2 Driver, OmniVision
 
  
 
==OVM6211 features==
 
==OVM6211 features==
  
The OmniVision OVM5647 is a CMOS image sensor with the following features:
+
The OmniVision OVM6211 is a CMOS image sensor with the following features:
  
 
* Automatic image control functions:  
 
* Automatic image control functions:  
Line 297: Line 48:
 
==Enabling the driver==
 
==Enabling the driver==
  
In order to use this driver, you have to patch and compile the kernel source.
+
To use this driver, you have to patch and compile the kernel source.
  
 
===Using Jetpack===
 
===Using Jetpack===
Follow this instructions:
+
Follow these instructions:
  
 
1.  Download the toolchain following the instructions from:<br>
 
1.  Download the toolchain following the instructions from:<br>
https://developer.ridgerun.com/wiki/index.php?title=Jetson_Nano/Development/Building_the_Kernel_from_Source#1._Download_and_install_the_Toolchain
+
[[Jetson_Nano/Development/Building_the_Kernel_from_Source#1._Download_and_install_the_Toolchain |  Download and install the Toolchain]]
  
 
2.  Download the NVIDIA SDK Manager from: <br>
 
2.  Download the NVIDIA SDK Manager from: <br>
https://developer.nvidia.com/embedded/dlc/nv-sdk-manager <br>
+
[https://developer.nvidia.com/embedded/dlc/nv-sdk-manager NVIDIA SDK Manager] <br>
 
- Then choose the platform (Jetson Nano) and version of JetPack (4.3).
 
- Then choose the platform (Jetson Nano) and version of JetPack (4.3).
  
 
3.  Download the L4T Nano sources from: <br>
 
3.  Download the L4T Nano sources from: <br>
https://developer.nvidia.com/embedded/dlc/r32-3-1_Release_v1.0/Sources/T210/public_sources.tbz2
+
[https://developer.nvidia.com/embedded/dlc/r32-3-1_Release_v1.0/Sources/T210/public_sources.tbz2 L4T Nano sources]
  
 
4.  Decompress the public sources following the instructions from: <br>
 
4.  Decompress the public sources following the instructions from: <br>
https://developer.ridgerun.com/wiki/index.php?title=Jetson_Nano/Development/Building_the_Kernel_from_Source#2._Download_the_kernel_sources
+
[[Jetson_Nano/Development/Building_the_Kernel_from_Source#2._Download_the_kernel_sources | Decompress kernel sources]]
  
 
5.  Apply the patch present in the attached 4.3_ovm6211-v0.1.0.tar file:<br>
 
5.  Apply the patch present in the attached 4.3_ovm6211-v0.1.0.tar file:<br>
  
- First untar the provided tarball:
+
- First, untar the provided tarball:
  
 
   tar -xvf 4.3_ovm6211-v0.1.0.tar
 
   tar -xvf 4.3_ovm6211-v0.1.0.tar
  
- Move the decompress patches folder into your $JETSON_NANO_KERNEL_SOURCE directory, along hardware, kernel and u-boot directories. <br>
+
- Move the decompress patches folder into your $JETSON_NANO_KERNEL_SOURCE directory, along with hardware, kernel, and u-boot directories. <br>
 
- Apply the patches from the $JETSON_NANO_KERNEL_SOURCE directory as follow:
 
- Apply the patches from the $JETSON_NANO_KERNEL_SOURCE directory as follow:
  
Line 327: Line 78:
  
 
6.  To compile the code follow the steps in this link: <br>
 
6.  To compile the code follow the steps in this link: <br>
https://developer.ridgerun.com/wiki/index.php?title=Jetson_Nano/Development/Building_the_Kernel_from_Source#3._Compile_kernel_and_dtb
+
[[Jetson_Nano/Development/Building_the_Kernel_from_Source#3._Compile_kernel_and_dtb |  Compile kernel and dtb]]
  
 
7.  Flash the Tegra following this guide: <br>
 
7.  Flash the Tegra following this guide: <br>
https://developer.ridgerun.com/wiki/index.php?title=Jetson_Nano/Development/Building_the_Kernel_from_Source#Flash_Jetson_NANO
+
[[Jetson_Nano/Development/Building_the_Kernel_from_Source#Flash_Jetson_NANO | Flash Jetson NANO]]
 
 
==Using the driver ([https://www.ridgerun.com/gstreamer 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:
 
 
 
[[Compile_gstreamer_on_Jetson_TX1_and_TX2]]
 
 
 
'''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:
 
<pre style="background:#d6e4f1">
 
DISPLAY=:0 gst-launch-1.0 ...
 
</pre> 
 
  
'''Note:''' These tests were done using the J20 board from Auvidea.
+
==Using the driver ([https://www.ridgerun.com/gstreamer GStreamer] and v4l2-ctl examples)==
[[Getting_started_guide_for_Auvidea_J20_board]]
 
  
=== Demo Video Pipeline Example ===
+
The OVM6211 supports a resolution of 400x400 but the platform used (Jetson Nano) defined padding of 48 pixels to the image in order to align and optimize the capture process. <br>
 +
The following image shows the captured image with and without the padding. The post-process applied is to open the image with a 448x400 resolution.
  
By following this link [[OmniVision_OV5647_Linux_driver_for_Jetson_TX1#OmniVision_OV5647_Linux_driver_Overview_Video | Overview Demo Video]] you can see the results of executing the below pipeline and get some CPU/GPU load percentage and framerate measurements.
+
[[File:Padding ovm6211.png|500px|thumb|center|Padding 48 pixels]]
 +
=== Video Pipeline Example ===
 
   
 
   
The below pipeline executes the following actions:
+
The below pipeline capture video at 10fps with a resolution of 400x400:
*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
 
  
 
<pre style="background:#d6e4f1">
 
<pre style="background:#d6e4f1">
DISPLAY=:0 gst-launch-1.0 nvcamerasrc sensor-id=0 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, \
+
gst-launch-1.0 v4l2src ! video/x-bayer,format=rggb,width=400,height=400,framerate=10/1 ! perf ! filesink location=test.bayer
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
 
 
</pre>
 
</pre>
 
This is a snapshot of the Jetson TX1 display while running the above pipeline:
 
 
[[Image:sextuple-capture-demo-snap.png|thumb|center|800px|Sextuple capture demo video snapshot]]
 
  
 
==== Performance statistics ====
 
==== Performance statistics ====
Line 386: Line 101:
  
 
<pre>
 
<pre>
RAM 827/3995MB (lfb 660x4MB) cpu [4%,3%,2%,6%]@102 GR3D 0%@76 EDP limit 0
+
RAM 645/3964MB (lfb 648x4MB) CPU [3%@102,0%@102,0%@102,0%@102]
RAM 827/3995MB (lfb 660x4MB) cpu [6%,2%,3%,4%]@102 GR3D 0%@76 EDP limit 0
+
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,0%@102,0%@102,1%@102]
RAM 827/3995MB (lfb 660x4MB) cpu [1%,1%,2%,10%]@102 GR3D 0%@76 EDP limit 0
+
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,3%@102,0%@102,0%@102]
RAM 827/3995MB (lfb 660x4MB) cpu [4%,4%,5%,4%]@102 GR3D 0%@76 EDP limit 0
+
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,2%@102,0%@102,0%@102]
RAM 827/3995MB (lfb 660x4MB) cpu [3%,1%,4%,5%]@102 GR3D 0%@76 EDP limit 0
+
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,0%@102,0%@102,0%@102]
RAM 827/3995MB (lfb 660x4MB) cpu [6%,3%,2%,6%]@102 GR3D 0%@76 EDP limit 0
+
RAM 645/3964MB (lfb 648x4MB) CPU [5%@102,0%@102,0%@102,1%@102]  
RAM 827/3995MB (lfb 660x4MB) cpu [3%,1%,2%,10%]@102 GR3D 0%@76 EDP limit 0
+
RAM 645/3964MB (lfb 648x4MB) CPU [1%@102,0%@102,0%@102,0%@102]
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
 
 
</pre>
 
</pre>
  
Line 401: Line 114:
  
 
<pre>
 
<pre>
RAM 1821/3995MB (lfb 404x4MB) cpu [57%,56%,60%,48%]@1734 GR3D 44%@76 EDP limit 0
+
RAM 650/3964MB (lfb 647x4MB) CPU [10%@102,0%@102,3%@102,1%@102]  
RAM 1819/3995MB (lfb 404x4MB) cpu [59%,58%,54%,55%]@1734 GR3D 20%@76 EDP limit 0
+
RAM 650/3964MB (lfb 647x4MB) CPU [10%@102,4%@102,0%@102,2%@102]  
RAM 1821/3995MB (lfb 404x4MB) cpu [53%,66%,52%,56%]@1734 GR3D 28%@76 EDP limit 0
+
RAM 650/3964MB (lfb 647x4MB) CPU [8%@102,2%@102,0%@102,1%@102]  
RAM 1822/3995MB (lfb 404x4MB) cpu [57%,66%,53%,54%]@1734 GR3D 42%@76 EDP limit 0
+
RAM 650/3964MB (lfb 647x4MB) CPU [7%@102,3%@102,1%@102,0%@102]  
RAM 1820/3995MB (lfb 404x4MB) cpu [50%,61%,52%,53%]@1734 GR3D 46%@76 EDP limit 0
+
RAM 650/3964MB (lfb 647x4MB) CPU [8%@102,3%@102,0%@102,0%@102]  
RAM 1822/3995MB (lfb 404x4MB) cpu [55%,63%,52%,59%]@1734 GR3D 29%@76 EDP limit 0
+
RAM 650/3964MB (lfb 647x4MB) CPU [11%@102,1%@102,0%@102,0%@102]
RAM 1822/3995MB (lfb 404x4MB) cpu [56%,62%,56%,51%]@1734 GR3D 42%@76 EDP limit 0
+
RAM 650/3964MB (lfb 647x4MB) CPU [7%@102,2%@102,3%@102,0%@102]  
RAM 1820/3995MB (lfb 404x4MB) cpu [55%,64%,52%,56%]@1734 GR3D 20%@76 EDP limit 0
+
RAM 650/3964MB (lfb 647x4MB) CPU [11%@102,5%@102,1%@102,1%@102]
RAM 1822/3995MB (lfb 404x4MB) cpu [57%,62%,50%,55%]@1734 GR3D 34%@76 EDP limit 0
+
RAM 650/3964MB (lfb 646x4MB) CPU [8%@307,3%@307,2%@307,1%@307]
RAM 1822/3995MB (lfb 404x4MB) cpu [59%,66%,49%,57%]@1734 GR3D 34%@76 EDP limit 0
 
</pre>
 
 
 
=== 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:
 
 
 
<pre>
 
git clone git@github.com:jdthomas/bayer2rgb.git
 
cd bayer2rgb
 
make
 
cp bayer2rgb /usr/bin/
 
</pre>
 
 
 
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
 
<pre style="background:#d6e4f1">
 
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
 
 
</pre>
 
</pre>
  
Check the snapshot with:
+
==== Framerate ====
 +
To test the framerate use the following command:
 +
 
 +
  v4l2-ctl --device /dev/video0 --stream-mmap --stream-count=120 --set-fmt-video=width=400,height=400,pixelformat=RGGB
 +
Obtain:
  
 
<pre>
 
<pre>
./bayer2rgb --input=test#_1920x1080.bayer --output=data.tiff --width=1920 --height=1080 --bpp=16 --first=BGGR \
+
<<<<<<<<<<< 10.00 fps
--method=BILINEAR --tiff
+
<<<<<<<<<< 10.00 fps
</pre>
+
<<<<<<<<<< 10.00 fps
 
+
<<<<<<<<<< 10.00 fps
Use image_magik to convert the tiff to png:
+
<<<<<<<<<< 10.00 fps
 
+
<<<<<<<<<< 10.00 fps
<pre>
+
<<<<<<<<<< 10.00 fps
convert data.tiff data.png
+
<<<<<<<<<< 10.00 fps
</pre>
+
<<<<<<<<<< 10.00 fps
 
+
<<<<<<<<<< 10.00 fps
'''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.  
+
<<<<<<<<<< 10.00 fps
 
+
<<<<<<<<<
'''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/
 
 
 
<pre style="background:#d6e4f1">
 
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
 
 
</pre>
 
</pre>
  
 
=== Single Capture ===
 
=== Single Capture ===
  
==== V4l2src ====
+
It is possible to take captures with GStreamer using v4l2src and with v4l2-ctrl, both will return the same image.
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:
 
 
 
<pre>
 
git clone git clone git@github.com:martinezjavier/raw2rgbpnm.git
 
cd raw2rgbpnm
 
</pre>
 
 
 
Open the file raw2rgbpnm.c and change the line 489 with:
 
 
 
<pre>
 
int c = getopt(argc, argv, "a:b:f:ghs:wn");
 
</pre>
 
 
 
This is to enable the option to extract multiple frames from a file. Now, you can build the application:
 
 
 
<pre>
 
make
 
</pre>
 
 
 
'''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
 
<pre style="background:#d6e4f1">
 
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
 
</pre>
 
 
 
Check the buffers with:
 
 
 
<pre >
 
./raw2rgbpnm -f SGRBG10 -s 1920x1080 -b 5.0 -n test_1920x1080.bayer output_1920x1080
 
</pre>
 
 
 
==== Nvcamerasrc ====
 
* 1920x1080
 
<pre style="background:#d6e4f1">
 
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
 
</pre>
 
 
 
This is an image captured with the above pipeline:
 
 
 
[[Image:ov5647-single-capture-1920x1080.png|thumb|center|800px|OV5647 capture (1920x1080) with nvcamerasrc]]
 
 
 
=== Sextuple Capture ===
 
 
 
The following image consists in a Jetson TX1 with six ov5647 cameras plugged in the Auvidea J20 expansion board and doing video capture at the same time:
 
 
 
[[Image:Tegra_ov5647_6cameras_capture.jpg|thumb|center|800px| OV5647 camera sextuple video capture with Jetson TX1]]
 
 
 
'''''Sextuple Capture Connection Diagram:'''''
 
 
 
[[Image:6-capture-tegra-diagram.png|thumb|center|1000px| OV5647 Sextuple Capture Connection Diagram]]
 
 
 
Using the following pipelines we can test the performance of the Jetson TX1 when doing sextuple capture:
 
 
 
==== V4l2src ====
 
* Pipeline for sextuple video capture using v4l2src, at 1920x1080 @30fps:
 
<pre  style="background:#d6e4f1">
 
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
 
</pre>
 
 
 
===== Performance statistics =====
 
* Tegrastats in normal operation:
 
 
 
<pre>
 
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
 
</pre>
 
 
 
* Tegrastats with the above pipeline running:
 
 
 
<pre>
 
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
 
</pre>
 
 
 
==== Nvcamerasrc ====
 
* Pipeline for sextuple video capture using nvcamerasrc, at 1920x1080 @30fps:
 
<pre style="background:#d6e4f1">
 
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
 
</pre>
 
 
 
===== Performance statistics =====
 
* Tegrastats in normal operation:
 
 
 
<pre>
 
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
 
</pre>
 
 
 
* Tegrastats with the above pipeline running
 
 
 
<pre>
 
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
 
</pre>
 
 
 
===Sextuple Capture, and Display===
 
 
 
Using the following pipelines we can test the performance of the Jetson TX1 when doing sextuple video capture and display:
 
 
 
==== V4l2src ====
 
V4l2 can't be used with the ISP accelerated hardware unit of the Jetson TX1 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 Jetson TX1 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:
 
<pre style="background:#d6e4f1">
 
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
 
</pre>
 
 
 
===== Performance statistics =====
 
* Tegrastats in normal operation:
 
 
 
<pre>
 
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
 
</pre>
 
 
 
* Tegrastats with the above pipeline running
 
 
 
<pre>
 
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
 
</pre>
 
 
 
===Sextuple Capture, Downscale and Display===
 
 
 
Using the following pipelines we can test the performance of the Jetson TX1 when doing sextuple video capture, downscale and display:
 
 
 
==== V4l2src ====
 
V4l2 can't be used with the ISP accelerated hardware unit of the Jetson TX1 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 Jetson TX1 or any actual video sinks, if the camera sensor output is in Bayer color-space format.  
 
  
==== Nvcamerasrc ====
+
*400x400 - gst-launch-1.0
This was the same pipeline used in the ov5647 sextuple capture on Jetson TX1 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:
 
 
<pre style="background:#d6e4f1">
 
<pre style="background:#d6e4f1">
DISPLAY=:0 gst-launch-1.0 nvcamerasrc sensor-id=0 fpsRange="30 30" ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, \
+
gst-launch-1.0 -v v4l2src num-buffers=1 ! video/x-bayer,format=rggb,width=400,height=400 ! identity silent=false ! filesink location=test.raw
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
 
 
</pre>
 
</pre>
  
The following picture is a screenshot of the Jetson TX1 when it was running the above pipeline:
+
*400x400 - v4l2-ctl
 
 
[[Image:Ov5647-sextuple-video-capture-Tegra-X1.png|thumb|center|900px| OV5647 camera sextuple video capture on Jetson TX1 screenshot]]
 
 
 
===== Performance statistics =====
 
* Tegrastats in normal operation:
 
 
 
<pre>
 
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
 
</pre>
 
 
 
* Tegrastats with the above pipeline running
 
 
 
<pre>
 
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
 
</pre>
 
 
 
=== 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.
 
 
 
 
<pre style="background:#d6e4f1">
 
<pre style="background:#d6e4f1">
gst-launch-1.0 -v nvcamerasrc sensor-id=1 fpsRange="30 30" num-buffers=500 ! 'video/x-raw(memory:NVMM), width=(int)1920, \
+
v4l2-ctl -d /dev/video0 --set-fmt-video=width=400,height=400,pixelformat=RGGB --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw
height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! omxh264enc ! qtmux ! filesink location=test.ts
 
 
</pre>
 
</pre>
  
=== OV5647 4x camera 720p recording test ===
+
Check the snapshot at https://rawpixels.net/:
On [https://developer.ridgerun.com/wiki/index.php?title=OV5647_4x_camera_720p_recording_test 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. 
 
  
==See also==
+
Access to raw pixels opens the image captured in the last step and configures the following parameters:
*[[OmniVision_OV5647_Linux_driver_for_Jetson_TX2_(Auvidea_J120)|OmniVision OV5647 Linux driver for Jetson TX2 (Auvidea J120)]]
+
* width  = 448
 +
* height = 400
 +
* Predefined format = Grayscale 8bit
 +
* Pixel Format = Grayscale
  
 
{{ContactUs}}
 
{{ContactUs}}
  
[[Category:Jetson]][[Category:Jetson V4L2 Drivers]]
+
[[Category:Jetson]][[Category:Jetson V4L2 Drivers]][[Category:OmniVision]]

Latest revision as of 14:20, 17 March 2023

Nvidia-preferred-partner-badge-rgb-for-screen.png

Error something wrong.jpg Problems running the pipelines shown on this page?
Please see our GStreamer Debugging guide for help.

RR Contact Us.png


Keywords: OVM6211 Jetson Nano, GStreamer, Raspberry PI, NVIDIA, RidgeRun, V4L2 Driver, OmniVision

OVM6211 features

The OmniVision OVM6211 is a CMOS image sensor with the following features:

  • Automatic image control functions:
    • Automatic black level calibration (ABLC)
  • Image quality controls: lens correction, defective pixel canceling
  • CSI2 serial data output (MIPI interface 1 lane)
  • Support for output formats: 8/10 Raw Monochrome data
  • Maximum image transfer rate:
    • 400x400: 120 fps
    • 200x200: 220 fps
    • 100x100: 380 fps

RidgeRun has developed a driver for the Jetson Nano platform with the following support:

  • V4l2 Media controller driver
  • Tested resolution 400x400 @ 10 fps.
  • Output format: RAW8 Bayer RGGB Monochrome pattern.
  • Capture with GStreamer v4l2src and v4l2-ctl

Currently available for:

  • OVM6211 - Nano - Jetpack 4.3

Enabling the driver

To use this driver, you have to patch and compile the kernel source.

Using Jetpack

Follow these instructions:

1. Download the toolchain following the instructions from:
Download and install the Toolchain

2. Download the NVIDIA SDK Manager from:
NVIDIA SDK Manager
- Then choose the platform (Jetson Nano) and version of JetPack (4.3).

3. Download the L4T Nano sources from:
L4T Nano sources

4. Decompress the public sources following the instructions from:
Decompress kernel sources

5. Apply the patch present in the attached 4.3_ovm6211-v0.1.0.tar file:

- First, untar the provided tarball:

 tar -xvf 4.3_ovm6211-v0.1.0.tar

- Move the decompress patches folder into your $JETSON_NANO_KERNEL_SOURCE directory, along with hardware, kernel, and u-boot directories.
- Apply the patches from the $JETSON_NANO_KERNEL_SOURCE directory as follow:

 quilt push

6. To compile the code follow the steps in this link:
Compile kernel and dtb

7. Flash the Tegra following this guide:
Flash Jetson NANO

Using the driver (GStreamer and v4l2-ctl examples)

The OVM6211 supports a resolution of 400x400 but the platform used (Jetson Nano) defined padding of 48 pixels to the image in order to align and optimize the capture process.
The following image shows the captured image with and without the padding. The post-process applied is to open the image with a 448x400 resolution.

Padding 48 pixels

Video Pipeline Example

The below pipeline capture video at 10fps with a resolution of 400x400:

gst-launch-1.0 v4l2src ! video/x-bayer,format=rggb,width=400,height=400,framerate=10/1 ! perf ! filesink location=test.bayer

Performance statistics

  • Tegrastats in normal operation:
RAM 645/3964MB (lfb 648x4MB) CPU [3%@102,0%@102,0%@102,0%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,0%@102,0%@102,1%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,3%@102,0%@102,0%@102]
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,2%@102,0%@102,0%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,0%@102,0%@102,0%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [5%@102,0%@102,0%@102,1%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [1%@102,0%@102,0%@102,0%@102] 

  • Tegrastats with the above pipeline running
RAM 650/3964MB (lfb 647x4MB) CPU [10%@102,0%@102,3%@102,1%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [10%@102,4%@102,0%@102,2%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [8%@102,2%@102,0%@102,1%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [7%@102,3%@102,1%@102,0%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [8%@102,3%@102,0%@102,0%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [11%@102,1%@102,0%@102,0%@102]
RAM 650/3964MB (lfb 647x4MB) CPU [7%@102,2%@102,3%@102,0%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [11%@102,5%@102,1%@102,1%@102]
RAM 650/3964MB (lfb 646x4MB) CPU [8%@307,3%@307,2%@307,1%@307]

Framerate

To test the framerate use the following command:

 v4l2-ctl --device /dev/video0 --stream-mmap --stream-count=120 --set-fmt-video=width=400,height=400,pixelformat=RGGB

Obtain:

<<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<

Single Capture

It is possible to take captures with GStreamer using v4l2src and with v4l2-ctrl, both will return the same image.

  • 400x400 - gst-launch-1.0
gst-launch-1.0 -v v4l2src num-buffers=1 ! video/x-bayer,format=rggb,width=400,height=400 ! identity silent=false ! filesink location=test.raw
  • 400x400 - v4l2-ctl
v4l2-ctl -d /dev/video0 --set-fmt-video=width=400,height=400,pixelformat=RGGB --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw

Check the snapshot at https://rawpixels.net/:

Access to raw pixels opens the image captured in the last step and configures the following parameters:

  • width = 448
  • height = 400
  • Predefined format = Grayscale 8bit
  • Pixel Format = Grayscale


RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us

OOjs UI icon message-progressive.svg Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering informations are available in RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page. Ridgerun-logo.svg
RR Contact Us.png