<p>I am using a Rapsberry pi zero with a camera. For my use-case i need to pack the output of the camera directly into a mp4 container. Encoding it afterwards is for now not an option.
I tried to start a recording with the following code but this results in a recording that has frozen frames for a few secs followed by either a cut or a speed up untill it catches up to realtime again.</p>

<pre><code>/usr/bin/raspivid -o - --framerate 30 -b 3000000 --width 1920 --height 1080 --sharpness 0 --contrast 0 --saturation 0 --brightness 50 --timeout 0 | sudo ffmpeg -r 30 -use_wallclock_as_timestamps true -i - -y -vcodec copy /media/video/testingNOW.mp4
</code></pre>

<p>I tried to run everything with the standart settings which again results in said behaviour.</p>

<pre><code>/usr/bin/raspivid -o - --width 1920 --height 1080 --timeout 0 | sudo ffmpeg -use_wallclock_as_timestamps true -i - -y -vcodec copy /media/video/testingNOW.mp4
</code></pre>

<p>What am i doing wrong ?</p>

CC BY-SA 4.0
2019-02-25T04:56:48.650Z
Lower the resolution and check. I don't think your Pi can process the video fast enough. The freeze+speed-up is happening since the playback timing is set using the interval at which ffmpeg receives the frames.
Gyan
CC BY-SA 4.0
2019-02-25T22:08:21.010Z
It stops lagging when i set the bitrate to 1mbit or going down to 720p and 1.5mbit but thats not really a usable setup. The pi's core peaks at 25%. I don't think it's a performance issue or am i mistaken ?
Alx
CC BY-SA 4.0
2019-03-03T18:22:29.790Z
Yep - that is definitely a performance issue then.
Dr Mayhem
<ffmpeg>
Raspivid piped into ffmpeg results in jumps and frozen screens in the recording
Alx
# Raspivid piped into ffmpeg results in jumps and frozen screens in the recording

(Asked by: username_0 on 2019-02-24)

I am using a Rapsberry pi zero with a camera. For my use-case i need to pack the output of the camera directly into a mp4 container. Encoding it afterwards is for now not an option.
I tried to start a recording with the following code but this results in a recording that has frozen frames for a few secs followed by either a cut or a speed up untill it catches up to realtime again.
/usr/bin/raspivid -o - --framerate 30 -b 3000000 --width 1920 --height 1080 --sharpness 0 --contrast 0 --saturation 0 --brightness 50 --timeout 0 | sudo ffmpeg -r 30 -use_wallclock_as_timestamps true -i - -y -vcodec copy /media/video/testingNOW.mp4

I tried to run everything with the standart settings which again results in said behaviour.
/usr/bin/raspivid -o - --width 1920 --height 1080 --timeout 0 | sudo ffmpeg -use_wallclock_as_timestamps true -i - -y -vcodec copy /media/video/testingNOW.mp4

What am i doing wrong ?

**Tags:** ffmpeg

> **Comments:**
> **username_1**: Lower the resolution and check. I don't think your Pi can process the video fast enough. The freeze+speed-up is happening since the playback timing is set using the interval at which ffmpeg receives the frames.  
> **username_0**: It stops lagging when i set the bitrate to 1mbit or going down to 720p and 1.5mbit but thats not really a usable setup. The pi's core peaks at 25%. I don't think it's a performance issue or am i mistaken ?  
> **username_2**: Yep - that is definitely a performance issue then.  

---

## 0 answers

