Question regarding "Thread message queue blocking"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Question regarding "Thread message queue blocking"

imalkevich
Hi Team,

 

I have a question about the following log entry appearing when running FFmpeg – “Thread message queue blocking; consider raising the thread_queue_size option (current value: %d)”:



 

I’m asking because in my Team we are trying to use FFmpeg for video processing purposes and one of my colleagues can easily reproduce this issue by spinning up another instance of FFmpeg process using the following command: `ffmpeg -f lavfi -i testsrc2=s=1920x1080:r=30 -f lavfi -i sine -c:a aac -ar 48000 -b:a 64k -c:v libx264 -crf 10 -preset slow -pix_fmt yuv420p -f mpegts - > NUL`.

 

And then he easily gets the mentioned warning and experiences frames dropping and overall degradation of performance.

 

In attempt to understand what is going on there, I added the following logs into “\FFmpeg\libavutil\threadmessage.c”:



 

 

And not surprisingly when the second FFmpeg process is started on my colleague’s machine, then av_fifo_space goes from 2300 to 0 within a minute…. (and he sees frames dropping)

 

On my machine I’m having a different situation – my main process stays steady with av_fifo_space at 2300 even if the second process is started, but the second process itself after ~5 seconds of running hits into av_fifo_space to 0 – here are the log entries added by me collected on my machine for the second process:



 

I spent decent amount of time trying to understand what is going on and what might be causing issues, thought of adding more logs… but unfortunately I wasn’t able to come up with some other idea… ☹

 

Based on what I’m seeing from code is something like this (and for sure sorry in case I’m missing something….) – and my main question why I’m having issues with the space taking into account that my machine doesn’t seem overloaded at all at the moment I’m seeing the warning…:



 

I would really appreciate any help in form of clarification/question/suggestion, anything…

 

Thanks


_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

image007.png (67K) Download Attachment
image003.jpg (72K) Download Attachment
image006.jpg (63K) Download Attachment
image008.png (58K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Question regarding "Thread message queue blocking"

Carl Eugen Hoyos-2


> Am 10.03.2021 um 07:01 schrieb <[hidden email]> <[hidden email]>:
>
> I have a question

Please (test current FFmpeg git head, the only version supported here, and) provide the command line you tested together with the complete, uncut console output as text, do not attach images.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: Question regarding "Thread message queue blocking"

imalkevich
Carl,

Attaching another file that I just generated with the most recent build  (ffmpeg-2021-03-07-git-a7f841718f-full_build.7z).

Command used to start FFmpeg:

Starting FFmpeg: -hide_banner -nostats -loglevel verbose -guess_layout_max 0 -probesize 32 -analyzeduration 0 -use_wallclock_as_timestamps 1 -thread_queue_size 32 -f s16le -ac 1 -ar 16000 -i \\.\pipe\Encoder-Call/teststream-dev-1615365903929-A -guess_layout_max 0 -probesize 32 -analyzeduration 0 -use_wallclock_as_timestamps 1 -thread_queue_size 32 -f rawvideo -pix_fmt nv12 -s 1920x1080 -r 30 -i \\.\pipe\Encoder-Call/teststream-dev-1615365903929-V -map 0 -map 1 -c:a aac -ac 1 -ar 16000 -b:a 40k -filter:a aresample=async=1 -r 30 -vsync cfr -c:v libx264 -pix_fmt yuv420p -profile:v high -preset fast -sc_threshold 0 -x264-params keyint=60:min-keyint=60:rc-lookahead=2:bframes=0:sliced-threads=0 -threads 3 -filter:v setdar=dar=1920/1080 -s:v:0 512x288 -b:v:0 250k -minrate:v:0 250k -maxrate:v:0 250k -bufsize:v:0 62k -f mpegts -y \\.\pipe\PipeFork-2673d229-5e73-403b-af52-87eda215b0f3-In

And part of the logs:

2021-03-10T08:45:21.2126663Z|Trace|Call/teststream-dev-1615365903929-Encoder|No more output streams to write to, finishing.|
2021-03-10T08:45:21.2126663Z|Warn|Call/teststream-dev-1615365903929-Encoder|Probable CPU overload detected during encoding:
[s16le @ 000001e77e2326c0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 32)|
2021-03-10T08:45:21.2126663Z|Trace|Call/teststream-dev-1615365903929-Encoder|[s16le @ 000001e77e2326c0] Thread message queue blocking; consider raising the thread_queue_size option (current value: 32)|
2021-03-10T08:45:21.2126663Z|Warn|Call/teststream-dev-1615365903929-Encoder|Probable CPU overload detected during encoding:
[rawvideo @ 000001e77e245480] Thread message queue blocking; consider raising the thread_queue_size option (current value: 32)|

Thanks

-----Original Message-----
From: ffmpeg-user <[hidden email]> On Behalf Of Carl Eugen Hoyos
Sent: Wednesday, March 10, 2021 8:46 AM
To: FFmpeg user questions <[hidden email]>
Subject: Re: [FFmpeg-user] Question regarding "Thread message queue blocking"



> Am 10.03.2021 um 07:01 schrieb <[hidden email]> <[hidden email]>:
>
> I have a question

Please (test current FFmpeg git head, the only version supported here, and) provide the command line you tested together with the complete, uncut console output as text, do not attach images.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email [hidden email] with subject "unsubscribe".

_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".

teststream-dev-1615365903929-Encoder.log (12K) Download Attachment