xiaoyifang / goldendict-ng

The Next Generation GoldenDict
https://xiaoyifang.github.io/goldendict-ng/
Other
1.68k stars 93 forks source link

Help wanted: Speex (commonly used in mdx) is currently broken in FFmpeg7.0 #1738

Open shenlebantongying opened 2 months ago

shenlebantongying commented 2 months ago

We need to delay Qt6.8 updates until these problems fixed. (Hopefully, the Qt6.7 doesn't bump major FFmpeg version yet.)

Help wanted to fix the bug in FFmpeg. (One reports says only a single line of change is needed.)

Furthermore, nobody else appears to use/care about this format anymore. FFmpeg could break silently again in future. Maybe we should implement/copy the speex decoder code to our source tree, as libspeex doesn't appear to be changing anymore (but other parts of FFmpeg keeps changing).

https://github.com/videolan/vlc/blob/master/modules/codec/speex.c


speex_mini.zip

Minimum dict to do test with a single entry “A” and 2 speex audios.

ffplay -> has exactly the same issue as GD

vlc -> no issue

shenlebantongying commented 2 months ago

Workarounds:

powerboat9 commented 2 months ago

Would https://fate.ffmpeg.org/ be useful?

KonstantinDjairo commented 1 month ago

Maybe we should implement/copy the speex decoder

that's a good idea, but then as you said:

FFmpeg could break silently again in future.

we can solve both with a single strategy, that is: transcoding

i'm quite familiar with the ffmpeg codebase since i've been working with VVC and needed to dig into their codebase, i think i can help with that, but my idea is to create a native transcoder inside of goldendict-ng, that takes a format X and transcodes to a more familiar format Y (let's say mp3 for example)

real-time transcoding is not a big task for nowaday's CPUs (btw the way that navidrome does that is quite interesting, it relies on ffmpeg but im quite sure we can write our own transcoder using some FOSS libs.)

shenlebantongying commented 1 month ago

There is no need to waste time on those things. They already exists in FFmpeg.

The task that needs to be performed is pretty much verify the 3 commits since April in the repo below, and put together a patch (with credit to the repo's author) and send it to FFmpeg's patch tracker.

https://github.com/librempeg/librempeg/commits/master/libavcodec/speexdec.c