[FFmpeg-trac] #4901(undetermined:closed): mjpeg codec ignores -threads 1
FFmpeg
trac at avcodec.org
Fri Oct 2 17:09:12 CEST 2015
#4901: mjpeg codec ignores -threads 1
-------------------------------------+-------------------------------------
Reporter: jvd66 | Owner:
Type: defect | Status: closed
Priority: normal | Component:
Version: unspecified | undetermined
Keywords: | Resolution: invalid
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Comment (by jvd66):
Problem fixed temporarily with patch to ffmpeg.c version 2.2.16 :
{{{
--- ffmpeg.c~ 2015-06-18 18:55:40.000000000 +0000
+++ ffmpeg.c 2015-10-02 14:58:55.153062041 +0000
@@ -2167 +2167,2 @@
- if (!av_dict_get(ist->opts, "threads", NULL, 0))
+ if ((!ist->st->codec->thread_count) &&
+ !av_dict_get(ist->opts, "threads", NULL, 0))
@@ -2355,0 +2357,3 @@
+ if( codec && icodec && codec->thread_count && !
icodec->thread_count )
+ icodec->thread_count = codec->thread_count;
+
}}}
At least this now prevents ffmpeg spawning 8 threads to process input
stream:
{{{
$ strace -e trace=clone ./ffmpeg -i a_video.avi -threads 1 -vf null
-af null -f mjpeg -vframes 1 -ss 00:00:10.000 -an -y a_video.jpg 2>&1 |
grep clone
$
# no output - no threads cloned.
}}}
But, alas the performance is still terrible WRT to 0.8.5 :
{{{
$ ./ffmpeg -i a_video.avi -threads 1 -vf null -af null -f mjpeg
-vframes 1 -ss 00:00:10.000 -an -y a_video.jpg
[elapsed]=0.206965 [cpu%]=99.72 [sys]=0.006971 [user]=0.199424
[rss]=20744 [csw]=1 [vcsw]=273 [fltmaj]=0 [fltmin]=4471 [inblk]=0
[outblk]=0 [exit]=0
}}}
Now
--
Ticket URL: <https://trac.ffmpeg.org/ticket/4901#comment:5>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list