Opened 5 years ago

Closed 5 years ago

#485 closed defect (needs_more_info)

libx264 does a hidden renice when running multi-threaded !?!

Reported by: rkbwde Owned by: michael
Priority: normal Component: undetermined
Version: 0.8.3 Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no


I've been using e.g. "ffmpeg -y -i blue_sky_1080p25.y4m -r 15.14 -b 3600k -vcodec libx264 -threads 0 tst.avi".

On a quad core Phenom, top showed some 360% CPU usage, so four threads were running nicely.

However, I noticed that cpufreqs governor "ondemand" failed to increase cpu clock frequency as expected - resulting in three times higher computing time than with cpufreqs governor "performance".

After doing some experiments, I noticed that disabling ignore_nice_load (echo 0 >/sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load) fixed the issue.

This would mean that these "background" threads run on lower priority than the main thread, wouldn't it ?

To me this was quite surprising as I started ffmpeg with normal priority and expected all its threads to run on the same priority level.


P.S. My own multi-threaded test software (computing faculties of large numbers) didn't expose this behaviour.

P.P.S. Version info (packages from packman repository):
ffmpeg version 0.8.3, Copyright (c) 2000-2011 the FFmpeg developers

built on Sep 8 2011 19:02:07 with gcc 4.5.1 20101208 [gcc-4_5-branch revision 167585]
configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64 --enable-shared --disable-static --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex --enable-libxvid --enable-postproc --enable-gpl --enable-x11grab --extra-cflags='-fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -g -fPIC -I/usr/include/gsm' --enable-debug --disable-stripping --enable-libgsm --enable-libschroedinger --enable-libdirac --enable-avfilter --enable-libvpx --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libdc1394 --enable-pthreads --enable-librtmp
libavutil 51. 9. 1 / 51. 9. 1
libavcodec 53. 7. 0 / 53. 7. 0
libavformat 53. 4. 0 / 53. 4. 0
libavdevice 53. 1. 1 / 53. 1. 1
libavfilter 2. 23. 0 / 2. 23. 0
libswscale 2. 0. 0 / 2. 0. 0
libpostproc 51. 2. 0 / 51. 2. 0

Change History (2)

comment:1 Changed 5 years ago by cehoyos

  • Component changed from FFmpeg to undetermined

Is this reproducible with one of the native FFmpeg encoders (without x264)?

Please test latest git head.

comment:2 Changed 5 years ago by cehoyos

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

Please reopen if you can provide the missing information.

Note: See TracTickets for help on using tickets.