libgdx/gdx-video

MP4, Could not find a suitable audio decoder! even with --enable-decoder=h264 or --enable-libx264

roiniti opened this issue · 9 comments

Hello, I followed the instructions in #22 to get mp4 files working I can build the natives but when I try to use it, I get "Could not find a suitable audio decoder!" error. I may have failed in some step but I don't know where:
-I downloaded all the required libraries and the gdx-video sources
-I changed the ffmpeg configure and added --enable-decoder=h264 --enable-decoder=h265
-I run ./gradlew buildFFmpeg jnigen jnigenBuild jnigenJarNativesDesktop --info and get the natives
in #22 I saw that I have to change something in build-platform-{platform}.xml and add the decoder, but I don't know what and where I supose it referes to the --enable-decoder=264 that i added in the ffmpeg configure, is anything that im doing wrong?

The issues you linked are pretty old. We changed some time ago to our jnigen gradle plugin.
I think you have to enable the decoder in this lines:

commandLine '../configure', '--enable-pic', '--enable-cross-compile', '--disable-symver', '--disable-doc', '--enable-memalign-hack', '--arch=x86', '--target-os=mingw32', '--cross-prefix=i686-w64-mingw32-', '--pkg-config=pkg-config', '--disable-shared', '--enable-static', '--disable-everything', '--enable-filter=deshake', '--enable-protocol=file', '--enable-filter=aresample', '--enable-demuxer=ogg', '--enable-demuxer=matroska', '--enable-decoder=vorbis', '--enable-decoder=vp8', '--enable-decoder=vp9', '--enable-decoder=theora'

commandLine '../configure', '--enable-pic', '--enable-cross-compile', '--disable-symver', '--disable-doc', '--enable-memalign-hack', '--arch=x86_64', '--target-os=mingw32', '--cross-prefix=x86_64-w64-mingw32-', '--pkg-config=pkg-config', '--disable-shared', '--enable-static', '--disable-everything', '--enable-filter=deshake', '--enable-protocol=file', '--enable-filter=aresample', '--enable-demuxer=ogg', '--enable-demuxer=matroska', '--enable-decoder=vorbis', '--enable-decoder=vp8', '--enable-decoder=vp9', '--enable-decoder=theora'

commandLine '../configure', '--enable-pic', '--enable-cross-compile', '--disable-symver', '--disable-doc', '--extra-cflags="-m32"', '--extra-cxxflags="-m32"', '--extra-ldflags="-m32"', '--arch=i686', '--target-os=linux', '--enable-static', '--disable-shared', '--disable-everything', '--enable-protocol=file', '--enable-filter=aresample', '--enable-demuxer=ogg', '--enable-demuxer=matroska', '--enable-decoder=vorbis', '--enable-decoder=vp8', '--enable-decoder=vp9', '--enable-decoder=theora', '--enable-filter=deshake'

commandLine '../configure', '--enable-pic', '--enable-cross-compile', '--disable-symver', '--disable-doc', '--arch=x86_64', '--target-os=linux', '--enable-static', '--disable-shared', '--disable-everything', '--enable-protocol=file', '--enable-filter=aresample', '--enable-demuxer=ogg', '--enable-demuxer=matroska', '--enable-decoder=vorbis', '--enable-decoder=vp8', '--enable-decoder=vp9', '--enable-decoder=theora', '--enable-filter=deshake'

commandLine '../configure', '--enable-pic', '--enable-cross-compile', '--disable-symver', '--disable-doc', '--arch=arm', '--target-os=linux', '--cross-prefix=arm-linux-gnueabihf-', '--enable-static', '--disable-shared', '--disable-everything', '--enable-protocol=file', '--enable-filter=aresample', '--enable-demuxer=ogg', '--enable-demuxer=matroska', '--enable-decoder=vorbis', '--enable-decoder=vp8', '--enable-decoder=vp9', '--enable-decoder=theora', '--enable-filter=deshake'

commandLine '../configure', '--enable-pic', '--enable-cross-compile', '--disable-symver', '--disable-doc', '--arch=aarch64', '--target-os=linux', '--cross-prefix=aarch64-linux-gnu-', '--enable-static', '--disable-shared', '--disable-everything', '--enable-protocol=file', '--enable-filter=aresample', '--enable-demuxer=ogg', '--enable-demuxer=matroska', '--enable-decoder=vorbis', '--enable-decoder=vp8', '--enable-decoder=vp9', '--enable-decoder=theora', '--enable-filter=deshake'

commandLine '../configure', '--enable-pic', '--disable-symver', '--disable-doc', '--arch=x86_64', '--pkg_config="pkg-config --static"', '--enable-static', '--disable-shared', '--disable-everything', '--enable-protocol=file', '--enable-filter=aresample', '--enable-demuxer=ogg', '--enable-demuxer=matroska', '--enable-decoder=vorbis', '--enable-decoder=vp8', '--enable-decoder=vp9', '--enable-decoder=theora', '--enable-filter=deshake'

depending what platforms you need.
Then you can execute your mentioned gradlew command.
I this works, I'm not very familiar with jnigen

Yeah, i added the decoders there, my win64 line is
commandLine '../configure', '--enable-pic', '--enable-cross-compile', '--disable-symver', '--disable-doc', '--enable-memalign-hack', '--arch=x86_64', '--target-os=mingw32', '--cross-prefix=x86_64-w64-mingw32-', '--pkg-config=pkg-config', '--disable-shared', '--enable-static', '--disable-everything', '--enable-filter=deshake', '--enable-protocol=file', '--enable-filter=aresample', '--enable-demuxer=ogg', '--enable-demuxer=matroska', '--enable-decoder=vorbis', '--enable-decoder=vp8', '--enable-decoder=vp9', '--enable-decoder=theora',, '--enable-decoder=h264',, '--enable-decoder=h265' and im getting another error: "Could not open file", any ideas?

I may have to put --enable-libx264 but i get that libx264 not found in all ffmpeg builds except linux 64, i need to take a win32 win64 linux32 machines to get this built?

I solved my error with libx264, but I still can't get mp4 working, i added --enable-gpl --enable-libx264 --enable-decoder=h264 to the ffmpeg configure, i get [ant:patch] 'patch' failed with exit code 1 on patchFFmpeg, this matters? im still getting "Could not open file!" error

I get the problem i need to add --enable-decoder=aac to the ffmpeg, now i having sync with audio and video, #53 but that's other problem

I understand there are licensing restrictions which prevent a build with mp4 support to be widely distributed, but is there a chance you could share the Win64 build to a small audience? I have no idea about the build process, so would take me a long time to get into this, but I also need mp4 support... in either case, thanks for fixing those issues.

I understand there are licensing restrictions which prevent a build with mp4 support to be widely distributed, but is there a chance you could share the Win64 build to a small audience? I have no idea about the build process, so would take me a long time to get into this, but I also need mp4 support... in either case, thanks for fixing those issues.

Yeah, i can send you my natives but at the time I only have the dll for win64, now im trying to fix the sync issue, send me a mail to roiniti@gmail.com and if you want it I can send you the natives of linux 64/32 and windows32 when i have it

I'm glad you've found out how how to build the natives with mp4. Now we have an issue to point at how to build it yourself.
Do you know how much bigger the natives are with mp4 compared to without? That's also one thing to have in mind. I also would love to include mp4's. I will have to ask around with the license. But if there's no problem and the size is not much bigger I'm happy to include mp4's!

I don't know exactly how much bigger is the natives in total but the windows 64 dll its 4,6 MB i think without the mp4 its 4,1 MB, definitely not much bigger