# Saved video plays fast

**URL:** <https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123>\
**Category:** Jetson Nano\
**Tags:** gstreamer\
**Created:** [June 8, 2021, 5:21am UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123 "2021-06-08T05:21:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dabradhorton](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dabradhorton/32/40184_2.png) [@dabradhorton](https://forums.developer.nvidia.com/u/dabradhorton)\
**Post date:** [June 8, 2021, 5:21am UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123/1 "2021-06-08T05:21:00Z")

</div>

I’m trying to capture video from a USB webcam located at /dev/video1, convert it from 1920x1080 to 1280x720, and save it file, using Hardware Acceleration.

This is working (in that the file writes), but the file plays back extremely quickly.

> gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg, width=1280, height=720, framerate=30/1 ! jpegparse ! nvjpegdec ! ‘video/x-raw’ ! nvvidconv ! ‘video/x-raw(memory:NVMM),format=NV12,width=1280,height=720’ ! videorate ! omxh265enc ! ‘video/x-h265, stream-format=(string)byte-stream’! h265parse ! qtmux ! filesink location=test.mp4 -e

I’ve tried this with both image\jpeg and video\x-raw formats and am getting the same result.

[Here is the resulting video](https://www.youtube.com/watch?v=opKiuisgteU). You can see it’s running extremely quickly.

Any assistance would be greatly appreciated.

---

<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:** [June 8, 2021, 8:01am UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123/3 "2021-06-08T08:01:03Z")

</div>

Hi,  
It is more like an issue in source. Please check if your source runs in desired framerate:

```auto
gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg, width=1280, height=720, framerate=30/1 ! jpegparse ! nvjpegdec ! 'video/x-raw' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12,width=1280,height=720' ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v

```

We have deprecated omx plugins. You may try _nvv4l2h265enc_.

---

<div class="post-metadata">

**Author:** ![dabradhorton](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dabradhorton/32/40184_2.png) [@dabradhorton](https://forums.developer.nvidia.com/u/dabradhorton)\
**Post date:** [June 8, 2021, 9:33am UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123/4 "2021-06-08T09:33:12Z")

</div>

Thanks for the suggestion.

This is an excerpt of my result.

> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0: sync = false  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 3, dropped: 0, current: 5.22, average: 5.22  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 6, dropped: 0, current: 4.44, average: 4.80  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9, dropped: 0, current: 5.44, average: 4.99  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 13, dropped: 0, current: 7.41, average: 5.55  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 18, dropped: 0, current: 8.32, average: 6.12  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 22, dropped: 0, current: 7.97, average: 6.39  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 25, dropped: 0, current: 5.75, average: 6.30  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 30, dropped: 0, current: 8.30, average: 6.57  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 35, dropped: 0, current: 8.30, average: 6.77  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 40, dropped: 0, current: 8.23, average: 6.92  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 45, dropped: 0, current: 8.38, average: 7.06  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 50, dropped: 0, current: 8.52, average: 7.18  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 55, dropped: 0, current: 8.52, average: 7.29  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 60, dropped: 0, current: 8.54, average: 7.38  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 65, dropped: 0, current: 8.46, average: 7.45  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 70, dropped: 0, current: 8.27, average: 7.50  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 75, dropped: 0, current: 8.46, average: 7.56  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 80, dropped: 0, current: 8.68, average: 7.62  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 85, dropped: 0, current: 8.65, average: 7.68  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 90, dropped: 0, current: 8.62, average: 7.72  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 95, dropped: 0, current: 8.32, average: 7.75  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 100, dropped: 0, current: 8.35, average: 7.78  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 105, dropped: 0, current: 8.51, average: 7.81  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 110, dropped: 0, current: 8.45, average: 7.84  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 115, dropped: 0, current: 8.62, average: 7.87  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 120, dropped: 0, current: 8.85, average: 7.91

I’m guessing that’s not as it’s supposed to be?

---

<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:** [June 8, 2021, 10:28am UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123/5 "2021-06-08T10:28:16Z")

</div>

Hi,  
The mode is 720p30 and should see 30fps. Somehow it is only 5~8fps. Please execute

```auto
$ sudo nvpmodel -m 0
$ sudo jetson_clocks

```

And check if you can achieve target fps:

```auto
gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg, width=1280, height=720, framerate=30/1 ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v

```

```auto
gst-launch-1.0 v4l2src device=/dev/video1 io-mode=2 ! image/jpeg, width=1280, height=720, framerate=30/1 ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v

```

---

<div class="post-metadata">

**Author:** ![dabradhorton](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dabradhorton/32/40184_2.png) [@dabradhorton](https://forums.developer.nvidia.com/u/dabradhorton)\
**Post date:** [June 8, 2021, 10:32am UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123/6 "2021-06-08T10:32:49Z")

</div>

Awesome, that seemed to do the trick. EDIT

> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0: sync = false  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 16, dropped: 0, current: 31.75, average: 31.75  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 31, dropped: 0, current: 29.53, average: 30.64  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 46, dropped: 0, current: 29.53, average: 30.27  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 61, dropped: 0, current: 29.76, average: 30.14  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 76, dropped: 0, current: 29.53, average: 30.02  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 91, dropped: 0, current: 29.53, average: 29.94  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 106, dropped: 0, current: 29.53, average: 29.88  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 121, dropped: 0, current: 29.76, average: 29.86  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 136, dropped: 0, current: 29.53, average: 29.82  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 151, dropped: 0, current: 29.53, average: 29.80  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 166, dropped: 0, current: 29.76, average: 29.79  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 181, dropped: 0, current: 29.53, average: 29.77  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 196, dropped: 0, current: 29.53, average: 29.75  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 211, dropped: 0, current: 29.53, average: 29.74  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 226, dropped: 0, current: 29.76, average: 29.74  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 241, dropped: 0, current: 29.53, average: 29.72  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 256, dropped: 0, current: 29.53, average: 29.71  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 271, dropped: 0, current: 29.76, average: 29.71  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 286, dropped: 0, current: 29.53, average: 29.71  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 301, dropped: 0, current: 29.53, average: 29.70  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 316, dropped: 0, current: 29.76, average: 29.70  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 331, dropped: 0, current: 29.53, average: 29.69  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 346, dropped: 0, current: 29.53, average: 29.68  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 361, dropped: 0, current: 29.52, average: 29.68  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 376, dropped: 0, current: 29.76, average: 29.68  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 391, dropped: 0, current: 29.53, average: 29.68  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 406, dropped: 0, current: 29.53, average: 29.67  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 421, dropped: 0, current: 29.76, average: 29.67

Thank you very much.

Edit: Just tested my original one you sent

> ```auto
> gst-launch-1.0 v4l2src device=/dev/video1 ! image/jpeg, width=1280, height=720, framerate=30/1 ! jpegparse ! nvjpegdec ! 'video/x-raw' ! nvvidconv ! 'video/x-raw(memory:NVMM),format=NV12,width=1280,height=720' ! fpsdisplaysink text-overlay=0 video-sink=fakesink sync=0 -v
> 
> ```

, it’s at 15FPS.

> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstFakeSink:fakesink0: sync = false  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 9, dropped: 0, current: 17.42, average: 17.42  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 17, dropped: 0, current: 15.49, average: 16.45  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 25, dropped: 0, current: 15.34, average: 16.08  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 33, dropped: 0, current: 15.75, average: 16.00  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 41, dropped: 0, current: 15.56, average: 15.91  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 49, dropped: 0, current: 15.45, average: 15.83  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 57, dropped: 0, current: 15.40, average: 15.77  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 65, dropped: 0, current: 15.51, average: 15.74  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 73, dropped: 0, current: 15.54, average: 15.72  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 81, dropped: 0, current: 15.20, average: 15.66  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 89, dropped: 0, current: 15.38, average: 15.64  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 97, dropped: 0, current: 15.27, average: 15.61  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 105, dropped: 0, current: 15.59, average: 15.61  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 113, dropped: 0, current: 15.56, average: 15.60  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 121, dropped: 0, current: 15.39, average: 15.59  
> /GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 129, dropped: 0, current: 15.78, average: 15.60

---

<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:** [June 10, 2021, 2:19am UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123/7 "2021-06-10T02:19:26Z")

</div>

Hi,  
It looks like with _io-mode=2_, it can achieve 30fps. You may try:

```auto
gst-launch-1.0 v4l2src device=/dev/video1 io-mode=2 ! image/jpeg, width=1280, height=720, framerate=30/1 ! jpegparse ! nvv4l2decoder mjpeg=1 ! nvv4l2h265enc ! h265parse ! matroskamux ! filesink location=test.mkv

```

And check if the framerate is correct.

---

<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:** [June 10, 2021, 9:37pm UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123/8 "2021-06-10T21:37:52Z")

</div>

Also note that jpegparse may kill the framerate to 0/1, so using sync=false may result in frames getting sinked as received that may be too fast. Check the framerates in caps before fpsdisplaysink messages and try removing jpegparse to see if it makes a difference.

---

<div class="post-metadata">

**Author:** ![dabradhorton](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/dabradhorton/32/40184_2.png) [@dabradhorton](https://forums.developer.nvidia.com/u/dabradhorton)\
**Post date:** [June 11, 2021, 12:22am UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123/9 "2021-06-11T00:22:05Z")

</div>

Thanks for the assistance. Helped tremendously.

---

<div class="post-metadata">

**Author:** ![nadeemm](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/nadeemm/32/367020_2.png) [@nadeemm](https://forums.developer.nvidia.com/u/nadeemm)\
**Post date:** [October 15, 2021, 3:20am UTC](https://forums.developer.nvidia.com/t/saved-video-plays-fast/180123/11 "2021-10-15T03:20:34Z")

</div>

Closed on October 15, 2021, 3:20am UTC


