[FFmpeg-user] Turn Off Multi-Threading

Paul B Mahol onemda at gmail.com
Wed Jul 31 15:51:15 CEST 2013


On 7/31/13, James Board <jpboard2 at yahoo.com> wrote:
>>> I'm not using any other filters.  Anyway, does anyone know
>>> how to turn off multi-threading?  I tried "-threads 1" and
>>> I see see CPU usage at almost 200 percent for ffmpeg
>
>>please post complete command line if you
>>want help instead "i did this and that"
>
> Here is an example command
>     ffmpeg -i IN.avi -threads 1 -vf select='-between(n, 1, 1000)',setpts=N/FRAME_RATE/TB -c:v ffvhuff -af aselect='-between(n, 1, 1000)',asetpts=N/SR/TB -c:a wmav2 OUT.avi


Perhaps something like this will improve situation:

ffmpeg -threads 1 -i IN.avi -vf select='-between(n, 1,
1000)',setpts=N/FRAME_RATE/TB -threads 1 -c:v ffvhuff -af
aselect='-between(n, 1, 1000)',asetpts=N/SR/TB -threads 1 -c:a wmav2
OUT.avi

> There are several more between(n, x, y) segments.  I'm thinking that the
> select filter is using a single thread and
> the ffvhuff is using a thread, but that's only a guess.  Also, I typed that
> command into this email (not cut and paste)
> so it's possible I'm off by one or two characters.
>
> Why do I want to do this?  My machine has 6 cores and I have dozens of
> segments to encode.  I tried
> setting -threads 6 for the mpeg4 encoding and it only improved by 2x the
> overall run time.  However, if I
> encode 6 segments at a time on 6 different cores, I think I can get closer
> to 6x speedup.  But the current
> problem is that's it's spawning so many threads, the process slows to a
> halt, runs out of memory and that's
> it.
>
> Thank you for helping.
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>


More information about the ffmpeg-user mailing list