Real-Time Buffer Too Full (FFMPEG)

Questions involving a Windows version of FFmpeg.
Post Reply
roderrooder
Posts: 8
Joined: Tue Jan 02, 2018 10:41 am

Real-Time Buffer Too Full (FFMPEG)

Post by roderrooder » Thu Jan 18, 2018 11:27 am

I'm back hoping to solve my last problem,

sometimes when I'm recording I just start dropping frames like crazy, this can be after an hour of recording or even ten hours in... Everything will be working fine and then suddenly I'll start dropping frames due to "real-time buffer too full or near too full". This happens regardless of how low I put the bitrate, and the buffer size is high as it will allow, eventually I'll just start dropping frames. Almost seems like it could be like a power saving feature kicking in but it's too inconsistent. Like I said sometimes I can go 10 hours without having this issue.

Any ideas?

Here is my block of code:

Code: Select all

ffmpeg -guess_layout_max 0 -y -f dshow -video_size 3440x1440 -rtbufsize 2147.48M -pixel_format nv12 -framerate 200 ^
-i video="Video (00 Pro Capture HDMI 4K+)":audio="SPDIF/ADAT (1+2) (RME Fireface UC)" -map 0:0,0:1 -map 0:1 ^
-preset: llhp -codec:v h264_nvenc -pix_fmt nv12 -b:v 250M -maxrate:v 250M -minrate:v 250M -bufsize:v 250M -b:a 320k ^
-ac 2 -r 100 -async 1 -vsync 1 -segment_time 600 -segment_wrap 9 -f segment C:\Users\djcim\Videos\PC\PC%02d.mp4 ^
-guess_layout_max 0 -f dshow -rtbufsize 2000M -i audio="Analog (3+4) (RME Fireface UC)" -map 1:0 -b:a 320k -ac 2 ^
-af "adelay=200|200" -segment_time 600 -segment_wrap 9 -f segment C:\Users\djcim\Videos\PC\Voices\Theirs\TPC%02d.wav ^
-guess_layout_max 0 -f dshow -rtbufsize 2000M -i audio="Analog (5+6) (RME Fireface UC)" -map 2:0 -b:a 320k -ac 2 ^
-af "adelay=825|825" -segment_time 600 -segment_wrap 9 -f segment C:\Users\djcim\Videos\PC\Voices\Mine\MPC%02d.wav
Here is the error, it repeats around 500 times before stopping and everything is back to normal for a few hours. Other times it will lock ffmpeg up forcing me to restart it:

Code: Select all

[dshow @ 0000019a596bdcc0] real-time buffer [Video (00 Pro Capture HDMI 4K+)] [video input] too full or near too full (63% of size: 2147480000 [rtbufsize parameter])! frame dropped!

roderrooder
Posts: 8
Joined: Tue Jan 02, 2018 10:41 am

Re: Real-Time Buffer Too Full (FFMPEG)

Post by roderrooder » Wed Jan 24, 2018 11:34 pm

Solved my own problem again,

I thought maybe the solution was to try encoding H.265 instead of H.264 but could not for the life of me get it working. I thought maybe it was just the build I was using so I downloaded the latest nightly build. Unfortunately I still couldn't get H.265 encoding working, video always played back blank. However, I was getting a new warning message, something like "Thread queue size too low, default is 8 try raising". Not the direct message but something like that, I had never seen this warning before but thought I might as well fix it if it's warning me.

I threw -thread_queue_size 1024 at the beginning of my code, eventually I got the warning again but this time it suggested that all three of my inputs thread queue size was still too low. First input was at 1024 as I defined but the other inputs were still defaulted to 8, so it's per input? Finally I added -thread_queue_size 5096 to each input, just like magic the warning disappeared and I haven't dropped a frame on ingestion ever since.

Code: Select all

ffmpeg -y -thread_queue_size 5096 -guess_layout_max 0 -f dshow -video_size 3440x1440 -rtbufsize 2147.48M -framerate 200 ^
-pixel_format nv12 -i video="Video (00 Pro Capture HDMI 4K+)":audio="SPDIF/ADAT (1+2) (RME Fireface UC)" -map 0:0,0:1 ^
-map 0:1 -preset: llhp -c:v h264_nvenc -pix_fmt nv12 -b:v 250M -minrate 250M -maxrate 250M -bufsize 250M -b:a 320k -ac 2 ^
-r 100 -async 1 -vsync 1 -segment_time 600 -segment_wrap 9 -f segment C:\Users\djcim\Videos\PC\PC%02d.mp4 ^
-guess_layout_max 0 -thread_queue_size 5096 -f dshow -rtbufsize 2000M -i audio="Analog (3+4) (RME Fireface UC)" -map 1:0 ^
-b:a 320k -ac 2 -af "adelay=200|200" -segment_time 600 -segment_wrap 9 -f segment ^
C:\Users\djcim\Videos\PC\Voices\Theirs\TPC%02d.wav ^
-guess_layout_max 0 -thread_queue_size 5096 -f dshow -rtbufsize 2000M -i audio="Analog (5+6) (RME Fireface UC)" -map 2:0 ^
-b:a 320k -ac 2 -af "adelay=825|825" -segment_time 600 -segment_wrap 9 -f segment ^
C:\Users\djcim\Videos\PC\Voices\Mine\MPC%02d.wav
There isn't a ton about thread queue size in the docs and not much discussion about it online, but then again not many people are capturing 3440x1440 @ 100FPS with multiple audio outputs. Seems right that something a little unconventional would solve my last problem. Nevertheless, I finally have everything working, video looks buttery smooth, outputs are synced even if I drop frames in processing, ffmpeg doesn't have a heart attack when dropping frames at ingestion and crash anymore.

Post Reply