Commit e1cb6dc5 authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

Warn the user if mjpeg cbr encoding with frame threading was requested.

parent 1a5e8511
...@@ -133,6 +133,12 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){ ...@@ -133,6 +133,12 @@ int ff_frame_thread_encoder_init(AVCodecContext *avctx, AVDictionary *options){
"or a constant quantizer if you want to use multiple cpu cores\n"); "or a constant quantizer if you want to use multiple cpu cores\n");
avctx->thread_count = 1; avctx->thread_count = 1;
} }
if( avctx->thread_count > 1
&& avctx->codec_id == AV_CODEC_ID_MJPEG
&& !(avctx->flags & CODEC_FLAG_QSCALE))
av_log(avctx, AV_LOG_WARNING,
"MJPEG CBR encoding works badly with frame multi-threading, consider "
"using -threads 1, -thread_type slice or a constant quantizer.\n");
if(!avctx->thread_count) { if(!avctx->thread_count) {
avctx->thread_count = av_cpu_count(); avctx->thread_count = av_cpu_count();
avctx->thread_count = FFMIN(avctx->thread_count, MAX_THREADS); avctx->thread_count = FFMIN(avctx->thread_count, MAX_THREADS);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment