Mira130 Linux Driver: Difference between revisions

From RidgeRun Developer Wiki
No edit summary
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<seo title="Mira130 Linux Driver for NVIDIA Jetson | AMS Mira130 Linux Driver | 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, Mira130 Jetson Nano, Mira130, V4L2 Driver, AMS Mira130, AMS Mira130 Linux Driver, Mira130 Linux driver, AMS Mira130 Linux Driver, AMS, AMS Mira130, MIRA 130." description="Check out our comprehensive overview and features of the AMS Mira130 Linux Driver for NVIDIA Jetson!."></seo>
<seo title="MIRA130 Linux Driver for NVIDIA Jetson | AMS MIRA130 Linux Driver | 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, MIRA130 Jetson Nano, MIRA130, V4L2 Driver, AMS MIRA130, AMS MIRA130 Linux Driver, MIRA130 Linux driver, AMS MIRA130 Linux Driver, AMS, AMS MIRA130, MIRA 130." metadescription="Check out our comprehensive overview and features of the AMS MIRA130 Linux Driver for NVIDIA Jetson!."></seo>


<table>
{{Driver-shoppingcart & NVIDIA logo & RR Contact}}
<tr>
<br>
<td><div class="clear; float:right">__TOC__</div></td>
<td>
<td>
<html>
{{GStreamer debug}}
<div id='product-component-1594671854188'></div>
<script type="text/javascript">
/*<![CDATA[*/
(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}}
<td>
<center>
{{ContactUs Button}}
</center>
</tr>
</table>


== Sony IMX327 Features ==
{{message|title=Driver List Information|Refer to the [[RidgeRun_Linux_Camera_Drivers/Available_Camera_Drivers/List_of_Tested_Camera_Sensors|RidgeRun Linux Camera Drivers]] to meet all the list of Drivers available}}
 
== AMS MIRA130 Features ==


The Mira130 is a global shutter CMOS and monochrome sensor with an effective pixel array output of 1080 H x 1280 V. This sensor supports NIR enhancement of the QE, and operations such as high dynamic range (HDR) mode, external triggering, windowing, horizontal or vertical mirroring. This sensor can perform a framerate of 120 fps with 10-bit data at a resolution of 1080 H x 1280 V as a maximum. This chip operates with analog 2.5 V, digital 1.8 V, and interface 1.8 V.
The Mira130 is a global shutter CMOS and monochrome sensor with an effective pixel array output of 1080 H x 1280 V. This sensor supports NIR enhancement of the QE, and operations such as high dynamic range (HDR) mode, external triggering, windowing, horizontal or vertical mirroring. This sensor can perform a framerate of 120 fps with 10-bit data at a resolution of 1080 H x 1280 V as a maximum. This chip operates with analog 2.5 V, digital 1.8 V, and interface 1.8 V.
High sensitivity, programmable registers through I2C, low power consumption, 28x analog gain, and 32x digital gain are features that this sensor provides.
High sensitivity, programmable registers through I2C, low power consumption, build-in temperature sensor are features that this sensor provides.
(Applications: 3D structured light,  3D Active Stereo systems, Machine vision)
(Applications: 3D structured light,  3D Active Stereo systems, Machine vision)


== Supported Platforms ==
== Supported Platforms ==


* NVIDIA Jetson Nano
* NVIDIA Jetson Nano Development Kit B01


== Features Included in the Driver ==
== Features Included in the Driver ==
Line 285: Line 27:
|<!--
|<!--
-->
-->
{| class="wikitable sortable mw-collapsible mw-collapsed" style="width:100%; margin:0;"
{| class="wikitable sortable mw-collapsible mw-Uncollapsed" style="width:100%; margin:0;"
! Feature
! Feature
! Details
! Details
! SDK Support
! SDK Support
|-
|-
| 1920x1080@30fps
| 1080x1280@120fps
| 4 Lanes, RAW12, RGGB
| 2 Lanes, RAW10, Y10
| L4T 32.5 / Jetpack 4.5
| L4T 32.6.1 / Jetpack 4.6
|-
|-
|}<!--
|}<!--
Line 299: Line 41:
</center>
</center>


== Enabling the Driver ==
RidgeRun has developed a driver for the Jetson Nano platform with the following support:
 
* V4l2 Media controller driver
* Capture with GStreamer v4l2src and v4l2-ctl


In order to use this driver, you have to patch and compile the kernel source using JetPack:
==Enabling the driver==


* Follow the instructions in [[Compiling_Jetson_TX1/TX2_source_code#Download_the_kernel_source_code | (Downloading sources)]] to get the kernel source code.
To use this driver, you have to patch and compile the kernel source.


* Once you have the source code, apply the following the patches in order to add the changes required for the IMX327 camera at kernel and dtb level.
===Using Jetpack===
Follow these instructions:


1.  Download the toolchain following the instructions from:<br>
[[Jetson_Nano/Development/Building_the_Kernel_from_Source#1._Download_and_install_the_Toolchain | Download and install the Toolchain]]
2.  Follow the instructions to download and install the NVIDIA SDK Manager from: <br>
[https://developer.nvidia.com/nvidia-sdk-manager NVIDIA SDK Manager] <br>
- Then choose the platform (Jetson Nano) and version of JetPack (4.6).
- The NVIDIA SDK manager is going to install in a directory similar to:
<source lang="bash">
$HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/
</source>
3.  Get the L4T Nano sources from: <br>
<source lang="bash">
cd $HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/
./source_sync.sh -t tegra-l4t-r32.6.1
</source>
4.  Apply the contents provided in '''4.6_evm_mira130_v0.1.tar''' in the '''sources''' directory:<br>
- First untar the provided tarball:
<pre>
<pre>
4.5_imx327.patch
tar -xvf 4.6_evm_mira130_v0.1.tar
</pre>
</pre>


* Follow the instructions in [[Compiling_Jetson_TX1/TX2_source_code#Build_Kernel | (Build Kernel)]] for building the kernel, and then flash the image.
You can then apply the patch:


Make sure to enable IMX327 driver support:
<pre>
<pre>
make menuconfig
quilt push -a
</pre>
</pre>
5.  To compile the code follow the steps: <br>
<source lang="bash">
export DEVDIR=$HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra
export PATCHESPATH=$HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/sources/patches/
cd $DEVDIR
</source>
<syntaxhighlight lang=bash>
# Create the directory to store the compiled image and dtb
mkdir -p $DEVDIR/images/dtb
</syntaxhighlight>
<syntaxhighlight lang=bash>
export TEGRA_KERNEL_OUT=$DEVDIR/images
export ARCH=arm64
export KERNEL_DIR=$DEVDIR/sources/kernel/kernel-4.9
export CROSS_COMPILE=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export LOCALVERSION=-tegra
</syntaxhighlight>
<syntaxhighlight lang=bash>
cd $KERNEL_DIR
</syntaxhighlight>
<syntaxhighlight lang=bash>
make mrproper
</syntaxhighlight>
* Make sure to enable MIRA130 driver support:


<pre>
<pre>
-> Device Drivers                                                                                                                       
make O=$TEGRA_KERNEL_OUT tegra_defconfig
  -> Multimedia support                                                                                         
make O=$TEGRA_KERNEL_OUT menuconfig
    -> NVIDIA overlay Encoders, decoders, sensors and other helper chips
      -> <M> IMX327 camera sensor support
</pre>
</pre>


And to select the runtime device tree blob by editing the <code>$JETSON_L4T/rootfs/boot/extlinux/extlinux.conf</code> to add the "FDT" line:
* In the terminal menu that appears, select:
 
{{Ambox
|type=notice
|small=left
|issue='''Note:''' By default, the driver is selected with an asterisk. For that reason, if you go back by hitting the double '''''Esc''''' key the message: ''Do you want to save your new configuration?'' will not appear.
|style=width:unset;
}}
 
<pre>
<pre>
TIMEOUT 30
Device Drivers  --->
DEFAULT primary
  <*> Multimedia support  --->
      NVIDIA overlay Encoders, decoders, sensors and other helper chips  --->
          <*> MIRA130 camera sensor support
</pre>
 
If the driver is not selected, press the ''Y'' key in order to select the MIRA130 option.
Go back by hitting the double ''Esc'' key until you get the message: ''Do you want to save your new configuration?'', select ''Yes'' and press ''Enter'
 
* Compile the kernel:
 
<syntaxhighlight lang=bash>
make O=$TEGRA_KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 zImage
</syntaxhighlight>
 
* Compile the device tree:
<syntaxhighlight lang=bash>
make O=$TEGRA_KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 dtbs
</syntaxhighlight>
 
6. Flash the Jetson Nano:
 
Make sure the Jetson Nano is in recovery mode.


MENU TITLE L4T boot options
* Copy the compiled image to the kernel directory.
<syntaxhighlight lang=bash>
cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $TEGRA_KERNEL_OUT/arch/arm64/boot/zImage $DEVDIR/kernel/
</syntaxhighlight>


LABEL primary
* Copy the compiled device tree to the kernel directory.
      MENU LABEL primary kernel
<syntaxhighlight lang=bash>
      LINUX /boot/Image
cp -r $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/* $DEVDIR/kernel/dtb/
      INITRD /boot/initrd
</syntaxhighlight>
      FDT /boot/tegra210-p3448-0000-p3449-0000-a02.dtb
 
      APPEND ${cbootargs} quiet
* Flash the memory following the next guide:
<syntaxhighlight lang=bash>
cd $DEVDIR
sudo ./flash.sh jetson-nano-qspi-sd mmcblk0p1
</syntaxhighlight>
 
* Reboot the board after the flashing is completed.
 
== Apply the v4l2src patch ==
 
In order to capture with v4l2src, a patch needs to be applied to GStreamer in order for v4l2src to support a Y10 format output.
 
'''1.''' Please extract the contents provided in <code> extra_gstreamer_flashing_patches.tar</code> in <code> sources/patches</code> directory:
 
<syntaxhighlight lang=bash>
cd $PATCHESPATH
</syntaxhighlight>
 
<syntaxhighlight lang=bash>
tar -xvf extra_gstreamer_flashing_patches.tar
</syntaxhighlight>
 
=== Apply the v4l2src patch to the Jetson Nano Devkit board ===
 
1. Transfer the patch to the board:
 
<syntaxhighlight lang=bash>
cd $PATCHESPATH
</syntaxhighlight>
 
<syntaxhighlight lang=bash>
scp add-Y10-support-1.14.5.patch <nvidia-nano-user>@<nvidia-nano-ip>:/home/<nvidia-nano-username>
</syntaxhighlight>
 
2. In the board, download the necessary gstreamer dependencies:
 
<syntaxhighlight lang=bash>
sudo apt update
</syntaxhighlight>
 
<syntaxhighlight lang=bash>
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
</syntaxhighlight>
 
3. Download gst-plugins-good:
 
<syntaxhighlight lang=bash>
mkdir gstreamer-1.14.5; cd gstreamer-1.14.5
</syntaxhighlight>
 
<syntaxhighlight lang=bash>
wget https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.14.5.tar.xz
</syntaxhighlight>
 
<syntaxhighlight lang=bash>
tar -xvf gst-plugins-good-1.14.5.tar.xz
</syntaxhighlight>
 
4. Apply the patch:
<syntaxhighlight lang=bash>
cd gst-plugins-good-1.14.5/sys/v4l2/
</syntaxhighlight>
 
<syntaxhighlight lang=bash>
patch -i $HOME/add-Y10-support-1.14.5.patch
</syntaxhighlight>
 
=== Compile and install ===
 
1. Compile:
<syntaxhighlight lang=bash>
cd ~/gstreamer-1.14.5/gst-plugins-good-1.14.5
</syntaxhighlight>
 
<syntaxhighlight lang=bash>
./configure --prefix=/usr --libdir=/usr/lib/aarch64-linux-gnu/
</syntaxhighlight>
 
<syntaxhighlight lang=bash>
make
</syntaxhighlight>
 
<syntaxhighlight lang=bash>
DESTDIR=$(pwd)/install make install
</syntaxhighlight>
 
2. Install the library:
<syntaxhighlight lang=bash>
sudo cp install/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so
</syntaxhighlight>
 
== Using the Driver ==
 
=== Capture with v4l2-ctl ===
 
* Install v4l utils:
<syntaxhighlight lang=bash>
sudo apt install v4l-utils
</syntaxhighlight>
 
* Test the capture framerate:
 
<syntaxhighlight lang=bash>
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1080,height=1280,pixelformat=Y10 --set-ctrl bypass_mode=0 --stream-mmap
</syntaxhighlight>
 
The output should look like the following:
<pre>
ams@ams-desktop:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1080,height=1280,pixelformat=Y10 --set-ctrl bypass_mode=0 --stream-mmap
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
</pre>
</pre>


==Using the Driver==
* Capture a single frame:
<pre>
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1080,height=1280,pixelformat=Y10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test_frame_120fps.raw
</pre>


=== GStreamer Examples ===
The MIRA130 supports a resolution of 1080x1280 but the platform used (Jetson Nano) defined padding of 8 pixels to the image in order to align and optimize the capture process.
The post-process applied is to open the image with a 1088x1280 resolution using Vooya o Rawpixels.


==== Capture and Display ====
Please consider the following settings to be able to view it correctly: <br>


* 1920x1080@30fps RGGB12
* '''rawpixels:''' <br>
<pre style="background:#d6e4f1">
- ''width:'' 1088 <br>
gst-launch-1.0 nvarguscamerasrc ! 'video/x-raw(memory:NVMM), width=1920, height=1080, format=NV12, framerate=30/1' ! nvvidconv ! xvimagesink
- ''height:'' 1280 <br>
</pre>
- ''Predefined format:'' Grayscale 8bit <br>
- ''Pixel format:'' Grayscale <br>
- ''bpp1:'' 16 <br>
- Little Endian box checked <br>
 
{{Ambox
|type=notice
|small=left
|issue='''Note:''' The Y10 format comes in 2 bytes with padding of zeros for the remaining bits. Since rawpixels require the bit depth specification for Y10 to be 16bpps, the image looks darker.
|style=width:unset;
}}
 
* '''vooya:''' <br>
- ''width:'' 1088 <br>
- ''height:'' 1280 <br>
- ''Frames/Second:'' 120 <br>
- ''Color Space:'' Single Channel <br>
- ''Data Container:'' Single Integer <br>
- ''Bit Depth (Value):'' 14bit <br>


==== Video Encoding ====
{{Ambox
|type=notice
|small=left
|issue='''Note1:''' Bit depth needs to be 14 due to how the Jetson boards pack pixels. The image looks darker.
|style=width:unset;
}}


<pre style="background:#d6e4f1">
{{Ambox
CAPS="video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1"
|type=notice
|small=left
|issue='''Note2:''' To see the frame the bit depth needs to be 9 or 10.
|style=width:unset;
}}


gst-launch-1.0 nvarguscamerasrc sensor-id=0 num-buffers=500 ! "video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1" ! omxh264enc ! mpegtsmux ! filesink location=test.ts
=== Capture with GStreamer ===
</pre>


The sensor will capture in the 1920x1080@30fps mode and the pipeline will encode the video and save it into test.ts file.
{{Ambox
|type=notice
|small=left
|issue='''Important:''' To achieve the maximum performance at 120 fps on the Jetson Nano Devkit board, you need to run the following command on the terminal every time the board is powered on:
|style=width:unset;
}}


=== Performance ===
<syntaxhighlight lang=bash>
sudo jetson_clocks
</syntaxhighlight>


==== ARM Load ====
==== Performance statistics ====


Tegrastats display the following output when capturing with the sensor driver used in the Jetson Nano platform:
<pre style="background:#d6e4f1">
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! fakesink
</pre>


<pre>
<pre>
RAM 1167/3963MB (lfb 522x4MB) CPU [25%@1132,16%@1132,9%@1132,12%@1132]
RAM 1233/3963MB (lfb 400x4MB) CPU [0%@1479,0%@1479,0%@1479,50%@1479]
RAM 1168/3963MB (lfb 522x4MB) CPU [28%@921,12%@921,9%@921,13%@921]
RAM 1233/3963MB (lfb 400x4MB) CPU [1%@1479,0%@1479,0%@1479,52%@1479]
RAM 1167/3963MB (lfb 522x4MB) CPU [23%@921,12%@921,13%@921,10%@921]
RAM 1233/3963MB (lfb 400x4MB) CPU [3%@1479,0%@1479,0%@1479,52%@1479]
RAM 1167/3963MB (lfb 522x4MB) CPU [28%@921,8%@921,12%@921,12%@921]
RAM 1233/3963MB (lfb 400x4MB) CPU [8%@1479,1%@1479,0%@1479,51%@1479]
RAM 1169/3963MB (lfb 522x4MB) CPU [26%@1479,9%@1479,16%@1479,9%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [2%@1479,0%@1479,0%@1479,52%@1479]
RAM 1167/3963MB (lfb 522x4MB) CPU [28%@921,13%@921,9%@921,16%@921]
RAM 1233/3963MB (lfb 400x4MB) CPU [1%@1479,0%@1479,0%@1479,51%@1479]
RAM 1168/3963MB (lfb 522x4MB) CPU [23%@1036,13%@1036,14%@1036,7%@1036]
RAM 1233/3963MB (lfb 400x4MB) CPU [1%@1479,1%@1479,0%@1479,51%@1479]
RAM 1167/3963MB (lfb 522x4MB) CPU [25%@921,12%@921,9%@921,11%@921]
RAM 1233/3963MB (lfb 400x4MB) CPU [2%@1479,2%@1479,16%@1479,37%@1479]
RAM 1168/3963MB (lfb 522x4MB) CPU [25%@921,13%@921,16%@921,12%@921]
RAM 1233/3963MB (lfb 400x4MB) CPU [0%@1479,0%@1479,0%@1479,51%@1479]
RAM 1169/3963MB (lfb 522x4MB) CPU [27%@921,12%@921,8%@921,13%@921]
RAM 1233/3963MB (lfb 400x4MB) CPU [0%@1479,0%@1479,45%@1479,7%@1479]
RAM 1168/3963MB (lfb 522x4MB) CPU [24%@921,8%@921,13%@921,10%@921]
RAM 1233/3963MB (lfb 400x4MB) CPU [1%@1479,1%@1479,52%@1479,0%@1479]
RAM 1169/3963MB (lfb 522x4MB) CPU [29%@921,13%@921,15%@921,6%@921]
</pre>
</pre>


==== Framerate ====
==== Framerate ====
Using the next pipeline we were able to measure the framerate for single capture with perf element:
Using the next pipeline we were able to measure the framerate for single capture with perf element:
<pre style="background:#d6e4f1">
<pre style="background:#d6e4f1">
gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! perf  ! fakesink
gst-launch-1.0 v4l2src device=/dev/video0 ! perf ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! fakesink
</pre>
</pre>


<pre>
<pre>
GST-PERF-INFO --> timestamp: 0:44:34.324884537; bps: 0,000; mean_bps: 0,000; fps: 0,000; mean_fps: 0,000
perf: perf0; timestamp: 0:56:38.972435551; bps: 0,000; mean_bps: 0,000; fps: 0,000; mean_fps: 0,000
GST-PERF-INFO -->  timestamp: 0:44:35.354956530; bps: 24192,000; mean_bps: 8064,000; fps: 30,095; mean_fps: 30,095
INFO:
GST-PERF-INFO -->  timestamp: 0:44:36.355520992; bps: 241920,000; mean_bps: 66528,000; fps: 29,983; mean_fps: 30,039
perf: perf0; timestamp: 0:56:39.979731288; bps: 2540175360,000; mean_bps: 0,000; fps: 120,124; mean_fps: 120,124
GST-PERF-INFO -->  timestamp: 0:44:37.356864989; bps: 241920,000; mean_bps: 101606,400; fps: 29,960; mean_fps: 30,013
INFO:
GST-PERF-INFO -->  timestamp: 0:44:38.357433006; bps: 241920,000; mean_bps: 124992,000; fps: 29,983; mean_fps: 30,005
perf: perf0; timestamp: 0:56:40.979764633; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,996; mean_fps: 120,060
GST-PERF-INFO -->  timestamp: 0:44:39.358908010; bps: 241920,000; mean_bps: 141696,000; fps: 29,956; mean_fps: 29,995
INFO:
GST-PERF-INFO -->  timestamp: 0:44:40.359357860; bps: 241920,000; mean_bps: 154224,000; fps: 29,987; mean_fps: 29,994
perf: perf0; timestamp: 0:56:41.979774896; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,999; mean_fps: 120,039
GST-PERF-INFO -->  timestamp: 0:44:41.360617558; bps: 241920,000; mean_bps: 163968,000; fps: 29,962; mean_fps: 29,989
INFO:
GST-PERF-INFO -->  timestamp: 0:44:42.361400607; bps: 241920,000; mean_bps: 171763,200; fps: 29,977; mean_fps: 29,988
perf: perf0; timestamp: 0:56:42.979792024; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,998; mean_fps: 120,029
GST-PERF-INFO -->  timestamp: 0:44:43.362674329; bps: 241920,000; mean_bps: 178141,091; fps: 29,962; mean_fps: 29,985
INFO:
GST-PERF-INFO -->  timestamp: 0:44:44.363320878; bps: 241920,000; mean_bps: 183456,000; fps: 29,981; mean_fps: 29,984
perf: perf0; timestamp: 0:56:43.979810601; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,998; mean_fps: 120,023
GST-PERF-INFO -->  timestamp: 0:44:45.364541434; bps: 241920,000; mean_bps: 187953,231; fps: 29,963; mean_fps: 29,983
INFO:
GST-PERF-INFO -->  timestamp: 0:44:46.365041950; bps: 241920,000; mean_bps: 191808,000; fps: 29,985; mean_fps: 29,983
perf: perf0; timestamp: 0:56:44.979836408; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,997; mean_fps: 120,018
GST-PERF-INFO -->  timestamp: 0:44:47.366186373; bps: 241920,000; mean_bps: 195148,800; fps: 29,966; mean_fps: 29,981
INFO:
GST-PERF-INFO -->  timestamp: 0:44:48.366852845; bps: 241920,000; mean_bps: 198072,000; fps: 29,980; mean_fps: 29,981
perf: perf0; timestamp: 0:56:45.979851268; bps: 2696151040,000; mean_bps: 2677582506,667; fps: 119,998; mean_fps: 120,016
GST-PERF-INFO -->  timestamp: 0:44:49.368081920; bps: 241920,000; mean_bps: 200651,294; fps: 29,963; mean_fps: 29,980
INFO:
GST-PERF-INFO -->  timestamp: 0:44:50.368731947; bps: 241920,000; mean_bps: 202944,000; fps: 29,981; mean_fps: 29,980
perf: perf0; timestamp: 0:56:46.979881952; bps: 2673868800,000; mean_bps: 2677051977,143; fps: 119,996; mean_fps: 120,013
GST-PERF-INFO -->  timestamp: 0:44:51.370037391; bps: 241920,000; mean_bps: 204995,368; fps: 29,961; mean_fps: 29,979
INFO:
GST-PERF-INFO -->  timestamp: 0:44:52.370821395; bps: 241920,000; mean_bps: 206841,600; fps: 29,976; mean_fps: 29,979
perf: perf0; timestamp: 0:56:47.979909813; bps: 2673868800,000; mean_bps: 2676654080,000; fps: 119,997; mean_fps: 120,011
GST-PERF-INFO -->  timestamp: 0:44:53.371545430; bps: 241920,000; mean_bps: 208512,000; fps: 29,978; mean_fps: 29,979
INFO:
GST-PERF-INFO -->  timestamp: 0:44:54.372675500; bps: 241920,000; mean_bps: 210030,545; fps: 29,966; mean_fps: 29,978
perf: perf0; timestamp: 0:56:48.979927144; bps: 2673868800,000; mean_bps: 2676344604,444; fps: 119,998; mean_fps: 120,010
GST-PERF-INFO -->  timestamp: 0:44:55.373703465; bps: 241920,000; mean_bps: 211417,043; fps: 29,969; mean_fps: 29,978
INFO:
perf: perf0; timestamp: 0:56:49.979933060; bps: 2673868800,000; mean_bps: 2676097024,000; fps: 119,999; mean_fps: 120,009
INFO:
perf: perf0; timestamp: 0:56:50.979961414; bps: 2673868800,000; mean_bps: 2675894458,182; fps: 119,997; mean_fps: 120,008
INFO:
perf: perf0; timestamp: 0:56:51.979984914; bps: 2673868800,000; mean_bps: 2675725653,333; fps: 119,997; mean_fps: 120,007
INFO:
perf: perf0; timestamp: 0:56:52.980041219; bps: 2673868800,000; mean_bps: 2675582818,462; fps: 119,993; mean_fps: 120,006
INFO:
perf: perf0; timestamp: 0:56:53.988375122; bps: 2696151040,000; mean_bps: 2677051977,143; fps: 120,000; mean_fps: 120,006
INFO:
perf: perf0; timestamp: 0:56:54.996700006; bps: 2673868800,000; mean_bps: 2676839765,333; fps: 120,001; mean_fps: 120,005
INFO:
perf: perf0; timestamp: 0:56:55.996715395; bps: 2673868800,000; mean_bps: 2676654080,000; fps: 119,998; mean_fps: 120,005
INFO:
perf: perf0; timestamp: 0:56:56.996737859; bps: 2673868800,000; mean_bps: 2676490240,000; fps: 119,997; mean_fps: 120,005
INFO:
perf: perf0; timestamp: 0:56:57.996773699; bps: 2673868800,000; mean_bps: 2676344604,444; fps: 119,996; mean_fps: 120,004
INFO:
perf: perf0; timestamp: 0:56:58.996792290; bps: 2673868800,000; mean_bps: 2676214298,947; fps: 119,998; mean_fps: 120,004
INFO:
perf: perf0; timestamp: 0:56:59.996808788; bps: 2673868800,000; mean_bps: 2676097024,000; fps: 119,998; mean_fps: 120,004
INFO:
perf: perf0; timestamp: 0:57:00.996826163; bps: 2673868800,000; mean_bps: 2675990918,095; fps: 119,998; mean_fps: 120,003
INFO:
perf: perf0; timestamp: 0:57:01.996847486; bps: 2696151040,000; mean_bps: 2676907287,273; fps: 119,997; mean_fps: 120,003
</pre>
</pre>
==== GStreamer Examples ====
{{Ambox
|type=notice
|small=left
|issue='''Important:''' Since Y10 is not supported by v4l2src, GRAY16_LE is used for buffer dequeue, this causes GStreamer to take the full 2 bytes instead of just the 10 bits, which results in a darker image due to a 10bit image being interpreted as a 16bit image.
|style=width:unset;
}}
===== Capture and Display =====
<syntaxhighlight lang=bash>
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! videoconvert ! xvimagesink sync=false
</syntaxhighlight>
===== Video Encoding =====
<syntaxhighlight lang=bash>
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! videoconvert ! queue ! omxh265enc ! h265parse ! qtmux ! filesink location=out.mp4 -e
</syntaxhighlight>
The sensor will capture in the 1080x1280@120fps mode and the pipeline will encode the video and save it into an out.mp4 file.


{{ContactUs}}
{{ContactUs}}


[[Category:Jetson]][[Category:Jetson V4L2 Drivers]][[Category:Sony]]
[[Category:Jetson]][[Category:Jetson V4L2 Drivers]][[Category:AMS]]

Latest revision as of 21:32, 18 September 2024



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


Driver List Information
Refer to the RidgeRun Linux Camera Drivers to meet all the list of Drivers available


AMS MIRA130 Features

The Mira130 is a global shutter CMOS and monochrome sensor with an effective pixel array output of 1080 H x 1280 V. This sensor supports NIR enhancement of the QE, and operations such as high dynamic range (HDR) mode, external triggering, windowing, horizontal or vertical mirroring. This sensor can perform a framerate of 120 fps with 10-bit data at a resolution of 1080 H x 1280 V as a maximum. This chip operates with analog 2.5 V, digital 1.8 V, and interface 1.8 V. High sensitivity, programmable registers through I2C, low power consumption, build-in temperature sensor are features that this sensor provides. (Applications: 3D structured light, 3D Active Stereo systems, Machine vision)

Supported Platforms

  • NVIDIA Jetson Nano Development Kit B01

Features Included in the Driver

Nano
Feature Details SDK Support
1080x1280@120fps 2 Lanes, RAW10, Y10 L4T 32.6.1 / Jetpack 4.6

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

  • V4l2 Media controller driver
  • Capture with GStreamer v4l2src and v4l2-ctl

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. Follow the instructions to download and install the NVIDIA SDK Manager from:
NVIDIA SDK Manager
- Then choose the platform (Jetson Nano) and version of JetPack (4.6). - The NVIDIA SDK manager is going to install in a directory similar to:

$HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/

3. Get the L4T Nano sources from:

cd $HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/
./source_sync.sh -t tegra-l4t-r32.6.1

4. Apply the contents provided in 4.6_evm_mira130_v0.1.tar in the sources directory:
- First untar the provided tarball:

tar -xvf 4.6_evm_mira130_v0.1.tar

You can then apply the patch:

quilt push -a

5. To compile the code follow the steps:

export DEVDIR=$HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra
export PATCHESPATH=$HOME/nvidia/nvidia_sdk/JetPack_4.6_Linux_JETSON_NANO_TARGETS/Linux_for_Tegra/sources/patches/
cd $DEVDIR
# Create the directory to store the compiled image and dtb
mkdir -p $DEVDIR/images/dtb
export TEGRA_KERNEL_OUT=$DEVDIR/images
export ARCH=arm64
export KERNEL_DIR=$DEVDIR/sources/kernel/kernel-4.9
export CROSS_COMPILE=$HOME/l4t-gcc/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
export LOCALVERSION=-tegra
cd $KERNEL_DIR
make mrproper
  • Make sure to enable MIRA130 driver support:
make O=$TEGRA_KERNEL_OUT tegra_defconfig
make O=$TEGRA_KERNEL_OUT menuconfig
  • In the terminal menu that appears, select:
Device Drivers  --->
  <*> Multimedia support  --->
      NVIDIA overlay Encoders, decoders, sensors and other helper chips  --->
          <*> MIRA130 camera sensor support

If the driver is not selected, press the Y key in order to select the MIRA130 option. Go back by hitting the double Esc key until you get the message: Do you want to save your new configuration?, select Yes and press Enter'

  • Compile the kernel:
make O=$TEGRA_KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 zImage
  • Compile the device tree:
make O=$TEGRA_KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 dtbs

6. Flash the Jetson Nano:

Make sure the Jetson Nano is in recovery mode.

  • Copy the compiled image to the kernel directory.
cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $TEGRA_KERNEL_OUT/arch/arm64/boot/zImage $DEVDIR/kernel/
  • Copy the compiled device tree to the kernel directory.
cp -r $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/* $DEVDIR/kernel/dtb/
  • Flash the memory following the next guide:
cd $DEVDIR
sudo ./flash.sh jetson-nano-qspi-sd mmcblk0p1
  • Reboot the board after the flashing is completed.

Apply the v4l2src patch

In order to capture with v4l2src, a patch needs to be applied to GStreamer in order for v4l2src to support a Y10 format output.

1. Please extract the contents provided in extra_gstreamer_flashing_patches.tar in sources/patches directory:

cd $PATCHESPATH
tar -xvf extra_gstreamer_flashing_patches.tar

Apply the v4l2src patch to the Jetson Nano Devkit board

1. Transfer the patch to the board:

cd $PATCHESPATH
scp add-Y10-support-1.14.5.patch <nvidia-nano-user>@<nvidia-nano-ip>:/home/<nvidia-nano-username>

2. In the board, download the necessary gstreamer dependencies:

sudo apt update
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev

3. Download gst-plugins-good:

mkdir gstreamer-1.14.5; cd gstreamer-1.14.5
wget https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.14.5.tar.xz
tar -xvf gst-plugins-good-1.14.5.tar.xz

4. Apply the patch:

cd gst-plugins-good-1.14.5/sys/v4l2/
patch -i $HOME/add-Y10-support-1.14.5.patch

Compile and install

1. Compile:

cd ~/gstreamer-1.14.5/gst-plugins-good-1.14.5
./configure --prefix=/usr --libdir=/usr/lib/aarch64-linux-gnu/
make
DESTDIR=$(pwd)/install make install

2. Install the library:

sudo cp install/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so

Using the Driver

Capture with v4l2-ctl

  • Install v4l utils:
sudo apt install v4l-utils
  • Test the capture framerate:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1080,height=1280,pixelformat=Y10 --set-ctrl bypass_mode=0 --stream-mmap

The output should look like the following:

ams@ams-desktop:~$ v4l2-ctl -d /dev/video0 --set-fmt-video=width=1080,height=1280,pixelformat=Y10 --set-ctrl bypass_mode=0 --stream-mmap
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 120.00 fps
  • Capture a single frame:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1080,height=1280,pixelformat=Y10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test_frame_120fps.raw

The MIRA130 supports a resolution of 1080x1280 but the platform used (Jetson Nano) defined padding of 8 pixels to the image in order to align and optimize the capture process. The post-process applied is to open the image with a 1088x1280 resolution using Vooya o Rawpixels.

Please consider the following settings to be able to view it correctly:

  • rawpixels:

- width: 1088
- height: 1280
- Predefined format: Grayscale 8bit
- Pixel format: Grayscale
- bpp1: 16
- Little Endian box checked

  • vooya:

- width: 1088
- height: 1280
- Frames/Second: 120
- Color Space: Single Channel
- Data Container: Single Integer
- Bit Depth (Value): 14bit

Capture with GStreamer

sudo jetson_clocks

Performance statistics

gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! fakesink
RAM 1233/3963MB (lfb 400x4MB) CPU [0%@1479,0%@1479,0%@1479,50%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [1%@1479,0%@1479,0%@1479,52%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [3%@1479,0%@1479,0%@1479,52%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [8%@1479,1%@1479,0%@1479,51%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [2%@1479,0%@1479,0%@1479,52%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [1%@1479,0%@1479,0%@1479,51%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [1%@1479,1%@1479,0%@1479,51%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [2%@1479,2%@1479,16%@1479,37%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [0%@1479,0%@1479,0%@1479,51%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [0%@1479,0%@1479,45%@1479,7%@1479]
RAM 1233/3963MB (lfb 400x4MB) CPU [1%@1479,1%@1479,52%@1479,0%@1479]

Framerate

Using the next pipeline we were able to measure the framerate for single capture with perf element:

gst-launch-1.0 v4l2src device=/dev/video0 ! perf ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! fakesink
perf: perf0; timestamp: 0:56:38.972435551; bps: 0,000; mean_bps: 0,000; fps: 0,000; mean_fps: 0,000
INFO:
perf: perf0; timestamp: 0:56:39.979731288; bps: 2540175360,000; mean_bps: 0,000; fps: 120,124; mean_fps: 120,124
INFO:
perf: perf0; timestamp: 0:56:40.979764633; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,996; mean_fps: 120,060
INFO:
perf: perf0; timestamp: 0:56:41.979774896; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,999; mean_fps: 120,039
INFO:
perf: perf0; timestamp: 0:56:42.979792024; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,998; mean_fps: 120,029
INFO:
perf: perf0; timestamp: 0:56:43.979810601; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,998; mean_fps: 120,023
INFO:
perf: perf0; timestamp: 0:56:44.979836408; bps: 2673868800,000; mean_bps: 2673868800,000; fps: 119,997; mean_fps: 120,018
INFO:
perf: perf0; timestamp: 0:56:45.979851268; bps: 2696151040,000; mean_bps: 2677582506,667; fps: 119,998; mean_fps: 120,016
INFO:
perf: perf0; timestamp: 0:56:46.979881952; bps: 2673868800,000; mean_bps: 2677051977,143; fps: 119,996; mean_fps: 120,013
INFO:
perf: perf0; timestamp: 0:56:47.979909813; bps: 2673868800,000; mean_bps: 2676654080,000; fps: 119,997; mean_fps: 120,011
INFO:
perf: perf0; timestamp: 0:56:48.979927144; bps: 2673868800,000; mean_bps: 2676344604,444; fps: 119,998; mean_fps: 120,010
INFO:
perf: perf0; timestamp: 0:56:49.979933060; bps: 2673868800,000; mean_bps: 2676097024,000; fps: 119,999; mean_fps: 120,009
INFO:
perf: perf0; timestamp: 0:56:50.979961414; bps: 2673868800,000; mean_bps: 2675894458,182; fps: 119,997; mean_fps: 120,008
INFO:
perf: perf0; timestamp: 0:56:51.979984914; bps: 2673868800,000; mean_bps: 2675725653,333; fps: 119,997; mean_fps: 120,007
INFO:
perf: perf0; timestamp: 0:56:52.980041219; bps: 2673868800,000; mean_bps: 2675582818,462; fps: 119,993; mean_fps: 120,006
INFO:
perf: perf0; timestamp: 0:56:53.988375122; bps: 2696151040,000; mean_bps: 2677051977,143; fps: 120,000; mean_fps: 120,006
INFO:
perf: perf0; timestamp: 0:56:54.996700006; bps: 2673868800,000; mean_bps: 2676839765,333; fps: 120,001; mean_fps: 120,005
INFO:
perf: perf0; timestamp: 0:56:55.996715395; bps: 2673868800,000; mean_bps: 2676654080,000; fps: 119,998; mean_fps: 120,005
INFO:
perf: perf0; timestamp: 0:56:56.996737859; bps: 2673868800,000; mean_bps: 2676490240,000; fps: 119,997; mean_fps: 120,005
INFO:
perf: perf0; timestamp: 0:56:57.996773699; bps: 2673868800,000; mean_bps: 2676344604,444; fps: 119,996; mean_fps: 120,004
INFO:
perf: perf0; timestamp: 0:56:58.996792290; bps: 2673868800,000; mean_bps: 2676214298,947; fps: 119,998; mean_fps: 120,004
INFO:
perf: perf0; timestamp: 0:56:59.996808788; bps: 2673868800,000; mean_bps: 2676097024,000; fps: 119,998; mean_fps: 120,004
INFO:
perf: perf0; timestamp: 0:57:00.996826163; bps: 2673868800,000; mean_bps: 2675990918,095; fps: 119,998; mean_fps: 120,003
INFO:
perf: perf0; timestamp: 0:57:01.996847486; bps: 2696151040,000; mean_bps: 2676907287,273; fps: 119,997; mean_fps: 120,003

GStreamer Examples

Capture and Display
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! videoconvert ! xvimagesink sync=false
Video Encoding
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! videoconvert ! queue ! omxh265enc ! h265parse ! qtmux ! filesink location=out.mp4 -e

The sensor will capture in the 1080x1280@120fps mode and the pipeline will encode the video and save it into an out.mp4 file.


RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us
RidgeRun.ai: Artificial Intelligence | Generative AI | Machine Learning

Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering information is available at RidgeRun Engineering Services, 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.