Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#1257 closed enhancement (needs_more_info)

ffmpeg multithread decoding,the rate is not improved

Reported by: zhuxiaoyu Owned by:
Priority: wish Component: avcodec
Version: git-master Keywords: h264
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


I'm trying to decode .264 file using ffmpeg with -threads option,i'm using a dual-core computer and build ffmpeg using the pthread option,but the rate is not improved,i wonder what is the reason.
my command line is:
time ./ffmpeg -y -threads 2 -thread_type slice -i test.264 test.yuv
time ./ffmpeg -y -threads 1 -i test.264 test.yuv
the time is close,i didn't see any improvement.
i tried to encode and transcode video using -threads option,i can see great improvment about twice speed improvent ,why does the multithread decode is not good?
i hope that someone can help me solve the problem!

Change History (4)

comment:1 by Carl Eugen Hoyos, 12 years ago

Keywords: h264 added; multithread decode removed

Please provide complete, uncut console output.

comment:2 by Carl Eugen Hoyos, 12 years ago

Resolution: needs_more_info
Status: newclosed

Please reopen if you can add the missing information.

comment:3 by Jeroen Ost, 11 years ago

I can confirm this issue. The culprit might be this commit:;h=59297ad63dbd7f9a587e742e1d5b0e94ae125fff

Multithreaded decoding is disabled for H264.
That is a problem for high resolution H264 videos that need to reencoded realtime to another format by a multicore CPU with a relative low clock freq, where a single core cannot decode the entire video fast enough.

comment:4 by Hendrik, 11 years ago

Slice threading implies your file actually has multiple slices.
You can try frame threading instead.

The commit you mentioned is only relevant during opening of the file, not for actual decoding.

Note: See TracTickets for help on using tickets.