Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
shenlebantongying opened this issue Aug 31, 2024 · 8 comments
Labels
bug Something isn't working

Comments

@shenlebantongying
Copy link
Collaborator

shenlebantongying commented Aug 31, 2024

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 shenlebantongying added the bug Something isn't working label Aug 31, 2024
@shenlebantongying
Copy link
Collaborator Author

shenlebantongying commented Aug 31, 2024

Workarounds:

  • uses VLC's no gui command line to play audio vlc --intf dummy --play-and-exit or cvlc
  • On linux, force QT_MEDIA_BACKEND=gstreamer and ensure both the qt6's gstreamer backend installed and GStreamer codecs packages are installed (no idea which one, but some distros names them good/bad/ugly....)

@shenlebantongying shenlebantongying changed the title Help wanted: Speex is currently broken in FFmpeg7.0 Help wanted: Speex (commonly used in mdx) is currently broken in FFmpeg7.0 Aug 31, 2024
@powerboat9
Copy link

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

@KonstantinDjairo

This comment was marked as off-topic.

@shenlebantongying
Copy link
Collaborator Author

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

@shenlebantongying
Copy link
Collaborator Author

shenlebantongying commented Nov 7, 2024

The "Invalid data found when processing input" like #1707 comes from FFmpeg

Simply applying these changes to the tip of FFmpeg's code doesn't work https://github.com/librempeg/librempeg/commits/master/libavcodec/speexdec.c

speexdec a.spx a.wav outputs valid audio file using the sample that I attached before.


Not sure if I compiled FFmpeg wrong. I only use 3 options.

./configure \
--disable-everything \
--enable-protocol=file \
--enable-libspeex

@shenlebantongying
Copy link
Collaborator Author

shenlebantongying commented Nov 7, 2024

Actually, I compiled the FFmpeg wrong.

./configure \
--enable-libspeex \
--enable-decoder=speex

make -j 8

./ffplay ~/Desktop/dsl/a.spx -loglevel 48 -autoexit

This patch for FFmpeg will fix the issue.

ffmpeg7-fix-speex.patch .

Now comes the real challenge. How to send this to FFmpeg's mailing list 😅😅😅?

Edit: https://ffmpeg.org//pipermail/ffmpeg-devel/2024-November/335743.html

Edit2: The author of speexdec.c quitted FFmpeg project btw, as according to

Edit3: Code copied from a GPLv2 fork, cannot be merged to FFmpeg.

@xiaoyifang
Copy link
Owner

@atauzki
Copy link
Collaborator

atauzki commented Nov 24, 2024

external player code seems have bug and just play a part of the sound sometimes. so I have to recompile qtmultimedia with ffmpeg 6.1 just follow qt's build param and it's the compiled binary:
https://cloud.freemdict.com/index.php/s/Y2DMdNRkRKooD2g

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants
@xiaoyifang @powerboat9 @atauzki @shenlebantongying @KonstantinDjairo and others