ffmpeg-bitrate-stats icon indicating copy to clipboard operation
ffmpeg-bitrate-stats copied to clipboard

Performance

Open teb opened this issue 2 years ago • 2 comments

hi, is there a way to increase performance on this tool? I see on a 48core system that it uses 2% of the CPU, (1 core is using 50% = ffprobe), rest are sleeping. Is there a way to use ffprobe in multitreaded mode? or Use HW decoding instead? I also checked the IO performance. My 8xRAID SSD was mearly sleeping during the process..

teb avatar Mar 17 '23 10:03 teb

Thanks for raising this issue. I think the only way to avoid this right now is to do a file-based parallelization (e.g. with GNU parallel.

We ultimately depend on ffprobe here. It may be faster to parse just the container (which will be enough to get the type of frame and its size) with dedicated parsing libraries, and restrict ourselves to work with MKV and MP4 containers only.

slhck avatar Mar 17 '23 11:03 slhck

Out of curiosity, do you see a speed difference between setting threads for ffprobe?

Because I get:

 
Summary
  'ffprobe -threads 0 -loglevel error -select_streams v -show_packets -show_entries packet=pts_time,dts_time,duration_time,size,flags -of json test/test.mp4' ran
    1.07 ± 0.48 times faster than 'ffprobe -threads 1 -loglevel error -select_streams v -show_packets -show_entries packet=pts_time,dts_time,duration_time,size,flags -of json test/test.mp4'
    1.16 ± 0.10 times faster than 'ffprobe -threads 32 -loglevel error -select_streams v -show_packets -show_entries packet=pts_time,dts_time,duration_time,size,flags -of json test/test.mp4'

slhck avatar Mar 17 '23 11:03 slhck