Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#1257 closed enhancement (needs_more_info)

ffmpeg multithread decoding,the rate is not improved

Reported by: xiaoyu 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 Changed 4 years ago by cehoyos

  • Keywords h264 added; multithread decode removed

Please provide complete, uncut console output.

comment:2 Changed 4 years ago by cehoyos

  • Resolution set to needs_more_info
  • Status changed from new to closed

Please reopen if you can add the missing information.

comment:3 Changed 4 years ago by jeroenost

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 Changed 4 years ago by heleppkes

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.