I am recording and piping my video with the following command :
raspivid -w 1920 -h 1080 -fps 25 -b 7000000 -o - -t 0 | ffmpeg -re -f h264 -framerate 25 -i - -vcodec copy -y -r 25 -strict experimental /media/video/testyolol.mp4
It does work for some time but the longer the recording is the lower is the speed and the fps drop slightly. I first started at 30 fps and after ~20min the fps was down to 26. And setting the fps to 25 also results in a drop after some time. Here is the output in the first few seconds :
frame= 15 fps=0.0 q=-1.0 size= 439kB time=00:00:00.56 bitrate=6421.2kbits
frame= 27 fps= 27 q=-1.0 size= 891kB time=00:00:01.04 bitrate=7021.2kbits
frame= 40 fps= 26 q=-1.0 size= 1352kB time=00:00:01.56 bitrate=7096.9kbits
frame= 52 fps= 26 q=-1.0 size= 1754kB time=00:00:02.04 bitrate=7044.8kbits
frame= 65 fps= 26 q=-1.0 size= 2302kB time=00:00:02.56 bitrate=7365.8kbits
frame= 78 fps= 26 q=-1.0 size= 2675kB time=00:00:03.08 bitrate=7115.6kbits
frame= 90 fps= 25 q=-1.0 size= 3065kB time=00:00:03.56 bitrate=7053.7kbits
frame= 103 fps= 25 q=-1.0 size= 3508kB time=00:00:04.08 bitrate=7042.8kbits
frame= 116 fps= 25 q=-1.0 size= 3953kB time=00:00:04.60 bitrate=7039.9kbits
frame= 128 fps= 25 q=-1.0 size= 4426kB time=00:00:05.08 bitrate=7137.2kbits
frame= 141 fps= 25 q=-1.0 size= 4828kB time=00:00:05.60 bitrate=7062.7kbits
frame= 153 fps= 25 q=-1.0 size= 5222kB time=00:00:06.08 bitrate=7036.0kbits
frame= 166 fps= 25 q=-1.0 size= 5672kB time=00:00:06.60 bitrate=7040.6kbits
And here after 20~ min
frame=37003 fps= 24 q=-1.0 size= 1264751kB time=00:24:40.08 bitrate=7000.2kbits
frame=37039 fps= 24 q=-1.0 size= 1265996kB time=00:24:41.52 bitrate=7000.3kbits
frame=37052 fps= 24 q=-1.0 size= 1266428kB time=00:24:42.04 bitrate=7000.2kbits
frame=37065 fps= 24 q=-1.0 size= 1266854kB time=00:24:42.56 bitrate=7000.1kbits/
As you can see the fps drop to 24 which resulst in the safed file not beeing 25min long if i have recorded for 25min meaning the recording is slightly sped up. Roughly 1min is missing after 20min of recording.
Is there a way to ensure the recorded file is as long as the actual recording and not sped up (important for my current project)?
-strict experimental
?