# Fast recording of raw videos using Jetson Nano and IMX219 image sensor

**URL:** <https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068>\
**Category:** Jetson Nano\
**Tags:** camera\
**Created:** [January 30, 2023, 6:07pm UTC](https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068 "2023-01-30T18:07:23Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![msingh44](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@msingh44](https://forums.developer.nvidia.com/u/msingh44)\
**Post date:** [January 30, 2023, 6:07pm UTC](https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068/1 "2023-01-30T18:07:23Z")

</div>

Hi everyone,

I’m new to the Jetson Nano community. I work in a research lab and we are trying to build a high speed image acquisition system using the Jetson Nano. We are trying to use the IMX219 Raspberry Pi v2 camera and trying to record videos of about 100fps-120fps in RAW format.

I was wondering if:

[1] Is it possible to hit 120fps? I read recently that the new version of Jetpack disabled 120fps support for the IMX219 sensor?

[2] If it is possible, what would be the best way to do it? I’ve dived into Gstreamer to figure it out and I have come up with this command:

gst-launch-1.0 nvarguscamerasrc sensor\_id=0 num-buffers=600 ! ‘video/x-raw(memory:NVMM), width=1280, height=720, framerate=120/1’ ! nvvidconv flip method=0 ! ‘video/x-raw, width=1280, height=720 ! filesink location=test.raw

to hopefully be able to capture 600 frames at 120fps. I was wondering if this is the correct way to do it?

Also, are there any useful pointers I should take note off to further optimize this pipeline? I have heard people suggesting to save these RAW videos directly into an external drive instead of the root file system. I was wondering if there were some other considerations I should take note of.

---

<div class="post-metadata">

**Author:** ![Honey\_Patouceul](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/honey_patouceul/32/389777_2.png) [@Honey\_Patouceul](https://forums.developer.nvidia.com/u/Honey_Patouceul)\
**Post date:** [January 31, 2023, 12:34am UTC](https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068/2 "2023-01-31T00:34:25Z")

</div>

> [@msingh44](#):
>
> [1] Is it possible to hit 120fps? I read recently that the new version of Jetpack disabled 120fps support for the IMX219 sensor?

Not sure, and it may depend on what is the additional CPU load.  
IIRC, using 120 fps with Xavier NX on recent L4T releases, Argus was using [one full CPU core](https://forums.developer.nvidia.com/t/120-fps-mode-support-removed-for-imx219-sensor/174327/15) (Note that these build instructions may no longer be correct with restriction with local-version to be -tegra-xxx for nvidia drivers modules).

> [@msingh44](#):
>
> [2] If it is possible, what would be the best way to do it? I’ve dived into Gstreamer to figure it out and I have come up with this command:

If you can build driver for 120 fps and if it works with Argus, your pipeline is ok (note that nvvidconv flip-method is 0 by default).  
If it doesn’t fit, you may record raw bayer RG10 from V4L, and use offline converting into another format

---

<div class="post-metadata">

**Author:** ![msingh44](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@msingh44](https://forums.developer.nvidia.com/u/msingh44)\
**Post date:** [January 31, 2023, 1:32am UTC](https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068/3 "2023-01-31T01:32:18Z")

</div>

Hi Honey\_Patoucel,

Thank you for your reply. I had a couple of follow up questions I was hoping you could help with:

[1] Some of the pipeline commands I have seen online involved specifying a format such as:  
gst-launch-1.0 nvarguscamerasrc sensor\_id=0 num-buffers=600 ! ‘video/x-raw(memory:NVMM), width=1280, height=720, framerate=120/1 **format = I420** ’ ! nvvidconv flip method=0 ! ‘video/x-raw, width=1280, height=720 ! filesink location=test.raw

In my command, I do not specify a format. My intention is to record 10 bit RAW bayer (which is outputted from the Raspberry Pi V2 camera IMX219). To do this, i simply name my file with the .raw extension and specify video/x-raw. Will this get me the 10 bit raw bayer image?

[2] Is there a way to analyze the .raw video I obtain from the pipeline command above. Is there some way to print out how many frames there are, the exposure time, the timestamps of each frame? I want to have some verification that there are indeed 600 frames, the frame rate was 120fps and the frames were not being dropped.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [January 31, 2023, 9:04am UTC](https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068/5 "2023-01-31T09:04:25Z")

</div>

Hi,  
The output frame data of _nvarguscamerasrc_ is in YUV420. It is the output of hardware ISP engine. If you would like to get raw data, please run _v4l2-ctl_ command like:  
[Jupyter cannot initialize Raspberry Pi V2 camera - #2 by ShaneCCC](https://forums.developer.nvidia.com/t/jupyter-cannot-initialize-raspberry-pi-v2-camera/73855/2)

We have seen stabilitiy issue for 120fps, so the sensor mode is changed to 720p60.

---

<div class="post-metadata">

**Author:** ![msingh44](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@msingh44](https://forums.developer.nvidia.com/u/msingh44)\
**Post date:** [January 31, 2023, 4:05pm UTC](https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068/6 "2023-01-31T16:05:09Z")

</div>

Hi DaneLLL,

Thank you for your response. I will try this command as mentioned:  
`v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=ov1080.raw`

A couple of follow up questions:  
[1] Is there a way to specify a frame rate in the above command? I know 120fps has stability issues but could I specify a frame rate of e.g. 100fps? If so, how would I do that?

[2] Is there going to be a performance decrease in using v4l2-ctl versus nvarguscamerasrc? As I am new to this platform, I am trying to understand these different commands and how they would affect performance speeds?

---

<div class="post-metadata">

**Author:** ![msingh44](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@msingh44](https://forums.developer.nvidia.com/u/msingh44)\
**Post date:** [January 31, 2023, 7:47pm UTC](https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068/7 "2023-01-31T19:47:03Z")

</div>

An update to my question [1] above –  
I am running this command:  
`v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 && v4l2-ctl --set-parm=100 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=600 --stream-to=ov1080.raw` and I am only getting about 21fps. If I set the fps to a lower amount like 8, i.e `set_parm=8`, it still goes to 21fps. How should I specify the fps I need?

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [February 1, 2023, 3:56am UTC](https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068/8 "2023-02-01T03:56:54Z")

</div>

Hi,  
Please refer to commands in the posts and try to set the options:  
[How to set exposure and gain parameters for IMX219 with v4l2-ctl? - #3 by ShaneCCC](https://forums.developer.nvidia.com/t/how-to-set-exposure-and-gain-parameters-for-imx219-with-v4l2-ctl/149092/3)  
[120 fps mode support removed for imx219 sensor - #7 by feupos](https://forums.developer.nvidia.com/t/120-fps-mode-support-removed-for-imx219-sensor/174327/7)

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [February 21, 2023, 1:11pm UTC](https://forums.developer.nvidia.com/t/fast-recording-of-raw-videos-using-jetson-nano-and-imx219-image-sensor/241068/10 "2023-02-21T13:11:10Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
