Opened 19 months ago
Last modified 19 months ago
#11341 new enhancement
Utilize multi-threading like "fre:ac" for some audio encodings
| Reported by: | Iver Jordal | Owned by: | |
|---|---|---|---|
| Priority: | normal | Component: | avcodec |
| Version: | unspecified | Keywords: | |
| Cc: | MasterQuestionable | Blocked By: | |
| Blocking: | Reproduced by developer: | no | |
| Analyzed by developer: | no |
Description
Summary of the issue:
When encoding a 1-hour 48 kHz mono WAV file to OPUS, FFmpeg takes significantly longer than fre:ac under similar conditions. Even with standard settings, fre:ac is faster than FFmpeg’s libopus encoding, and using the --superfast option in fre:ac results in roughly a 10x speed improvement on my PC. This issue is not related to a specific version of ffmpeg - I tried ffmpeg v4, v5, v6 and v7. I used a modern nVME SSD and Intel i7-13700HX on Windows 11 during benchmarking, but I believe the issue applies to other storage devices, CPUs and operating systems as well.
How to reproduce:
FFmpeg (libopus @ 96k, execution time: ~19.1s):
ffmpeg -nostdin -n -i 1hourmono_48khz.wav -vn -c:a libopus -b:a 96K -ar 48000 -dash 1 -f opus output_ffmpeg_libopus.opus
fre:ac (opus @ 96k, standard, execution time: ~12.3s):
.\freaccmd.exe -o "output_freac.opus" --encoder=opus -- --bitrate 96 "1hourmono_48khz.wav"
fre:ac (opus @ 96k, superfast, execution time: ~1.66s):
.\freaccmd.exe -o "output_freac_superfast.opus" --encoder=opus --superfast -- --bitrate 96 "1hourmono_48khz.wav"
Patches should be submitted to the ffmpeg-devel mailing list and not this bug tracker.
Change History (1)
comment:1 by , 19 months ago
| Cc: | added |
|---|---|
| Component: | undetermined → avcodec |
| Keywords: | performance OPUS removed |
| Summary: | Fre:ac’s OPUS encoding outperforms FFmpeg by an order of magnitude → Utilize multi-threading like "fre:ac" for some audio encodings |



͏ This is some multi-threading hacking:
͏ https://old.reddit.com/r/linuxaudio/comments/6yfkv0/multithreaded_opus_and_aac_encoding_what_do_you/?sort=old