kidrigger / godot-videodecoder

GDNative Video Decoder libraries for Godot Game Engine, using FFmpeg library for codecs. A Google Summer of Code Project, 2018
MIT License
84 stars 22 forks source link

Test project doesn't work/addon doesn't load #15

Closed ocdmonkey closed 4 years ago

ocdmonkey commented 4 years ago

I'm on Windows 10 using MSYS2. Built FFMPEG without much issue, but had to move the .a files to the compiler's lib directory in order to get the Godot addon to compile with scons.

After that, I start up the test project in Godot 3.1, and I get an error window "Load failed due to missing dependencies" for big_buck_bunny.mp4. Closing that window and going to the output tab on the botton I can see the following errors:

 core/io/resource_loader.cpp:285 - Method/Function Failed, returning: RES()
 No loader found for resource: res://samples/big_buck_bunny.mp4
 scene/resources/resource_format_text.cpp:175 - Couldn't load external resource: res://samples/big_buck_bunny.mp4
 editor/editor_data.cpp:564 - Index p_idx=1 out of size (edited_scene.size()=1)

I've already redownloaded godot-videodecoder and went through the process again (didn't re-compile ffmpeg, but did run make install), with the exact same result. The only two files in addons/bin/win64 are libgdnative_videodecoder.dll.a and msys-gdnative_videodecoder.dll.

kidrigger commented 4 years ago

Hey, @ocdmonkey You haven't initialized the git submodule. I'm sorry about that - I must have forgotten to add that part in the README. Will fix. Meanwhile, please do git submodule update --init --recursive

ocdmonkey commented 4 years ago

Still doesn't work (and that part is in the readme, just without the recursive part). Everything still happens exactly the same. Here's the MSYS2 console from this session (I already built ffmpeg yesterday and all its files are still in the thirdparty folder):

Peter@PETER-DESKTOP MINGW64 /h/proj/godot_ffmpeg/godot-videodecoder
# git submodule update --init --recursive

Peter@PETER-DESKTOP MINGW64 /h/proj/godot_ffmpeg/godot-videodecoder
# scons platform=win64
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: `.' is up to date.
scons: done building targets.

Peter@PETER-DESKTOP MINGW64 /h/proj/godot_ffmpeg/godot-videodecoder
# scons --clean platform=win64
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Cleaning targets ...
Removed src/gdnative_videodecoder.os
Removed bin/win64/msys-gdnative_videodecoder.dll
Removed bin/win64/libgdnative_videodecoder.dll.a
Removed test/addons/bin/win64/libgdnative_videodecoder.dll.a
Removed test/addons/bin/win64/msys-gdnative_videodecoder.dll
scons: done cleaning targets.

Peter@PETER-DESKTOP MINGW64 /h/proj/godot_ffmpeg/godot-videodecoder
# scons platform=win64
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o src/gdnative_videodecoder.os -c -g -Ithirdparty/include -Igodot_include src/gdnative_videodecoder.c
gcc -o bin/win64/msys-gdnative_videodecoder.dll -Wl,-no-undefined -shared -Wl,--out-implib=bin/win64/libgdnative_videodecoder.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive src/gdnative_videodecoder.os -Wl,--no-whole-archive -Lbin/win64 -lavformat -lavcodec -lavutil -lswscale -lswresample
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lavformat
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lavcodec
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lavutil
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lswscale
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lswresample
collect2.exe: error: ld returned 1 exit status
scons: *** [bin/win64/msys-gdnative_videodecoder.dll] Error 1
scons: building terminated because of errors.

Peter@PETER-DESKTOP MINGW64 /h/proj/godot_ffmpeg/godot-videodecoder
# git submodule update --init --recursive

Peter@PETER-DESKTOP MINGW64 /h/proj/godot_ffmpeg/godot-videodecoder
# scons platform=win64
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
gcc -o bin/win64/msys-gdnative_videodecoder.dll -Wl,-no-undefined -shared -Wl,--out-implib=bin/win64/libgdnative_videodecoder.dll.a -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--whole-archive src/gdnative_videodecoder.os -Wl,--no-whole-archive -Lbin/win64 -lavformat -lavcodec -lavutil -lswscale -lswresample
Install file: "bin/win64/libgdnative_videodecoder.dll.a" as "test/addons/bin/win64/libgdnative_videodecoder.dll.a"
Install file: "bin/win64/msys-gdnative_videodecoder.dll" as "test/addons/bin/win64/msys-gdnative_videodecoder.dll"
scons: done building targets.

Peter@PETER-DESKTOP MINGW64 /h/proj/godot_ffmpeg/godot-videodecoder
#

The first time scons failed was because I didn't manually put the ffmpeg .a files into my compiler's lib folder. After Scons successfully rebuilt, I started the test project in Godot and got the exact same error.