libgdx / gdx-video

A libGDX cross platform video rendering extension
Apache License 2.0
145 stars 50 forks source link

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

Closed roiniti closed 3 years ago

roiniti commented 3 years ago

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?

SimonIT commented 3 years ago

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: https://github.com/libgdx/gdx-video/blob/74b978fdf4b4b4ebd09c3238bda5fe7e96432ecc/gdx-video-desktop/build.gradle#L45 https://github.com/libgdx/gdx-video/blob/74b978fdf4b4b4ebd09c3238bda5fe7e96432ecc/gdx-video-desktop/build.gradle#L60 https://github.com/libgdx/gdx-video/blob/74b978fdf4b4b4ebd09c3238bda5fe7e96432ecc/gdx-video-desktop/build.gradle#L75 https://github.com/libgdx/gdx-video/blob/74b978fdf4b4b4ebd09c3238bda5fe7e96432ecc/gdx-video-desktop/build.gradle#L90 https://github.com/libgdx/gdx-video/blob/74b978fdf4b4b4ebd09c3238bda5fe7e96432ecc/gdx-video-desktop/build.gradle#L105 https://github.com/libgdx/gdx-video/blob/74b978fdf4b4b4ebd09c3238bda5fe7e96432ecc/gdx-video-desktop/build.gradle#L120 https://github.com/libgdx/gdx-video/blob/74b978fdf4b4b4ebd09c3238bda5fe7e96432ecc/gdx-video-desktop/build.gradle#L135 depending what platforms you need. Then you can execute your mentioned gradlew command. I this works, I'm not very familiar with jnigen

roiniti commented 3 years ago

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?

roiniti commented 3 years ago

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?

roiniti commented 3 years ago

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

roiniti commented 3 years ago

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

anigart commented 3 years ago

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.

roiniti commented 3 years ago

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

SimonIT commented 3 years ago

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!

roiniti commented 3 years ago

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