Closed jamie-pate closed 4 years ago
The -lavformat
option is looking for avformat in your system's lib directory and the same for the other libraries ld can't find. The -L flag is adding a folder for ld to look for your libraries. Since you installed FFmpeg with --prefix=../godot-videodecoder/thirdparty
, that is where the FFmpeg lib files are and why adding the -L flag worked.
The SConstruct file works fine for me since I installed FFmpeg through my system package manager but will not work if you follow the FFmpeg install instructions listed in the readme, as you found out. Removing the --prefix
option should install FFmpeg to your system directory and allow you to build FFmpeg without adding the -L flag. Alternatively, since you're on linux, just use your system package manager to install FFmpeg. The readme should be updated to reflect one of these two options @kidrigger.
It's a regression in the SCons file I think, since it's supposed to copy from the third-party folder and then link. But yes, it seems I have missed to do a system installed option. I'll get it done soon!
Ideally this works with a custom build of ffmpeg that links all it's dependencies statically. I don't think linking against system libraries is a viable long term strategy.
I'm working on that now since you can't rely on the user to have them installed on their system can you?
With --disable-everything, --enable-vp9 and --enable-opus I've got the whole thing down to 5mb! See https://github.com/jamie-pate/ffmpeg-static/blob/master/build.sh#L284
I think it should also be convenient to cross compile this? Which means each platform's dependencies should also be stored in a separate directory: https://github.com/jamie-pate/godot-videodecoder/blob/master/SConstruct#L13
Still shaking this all out in my fork...
When I try to build with the instructions in the readme it cannot find the shared lib files.
I added
env.Append(SHLINKFLAGS=['-Lthirdparty/lib'])
toSConstruct
in thex11
section and it was able to build.Am I doing something wrong here? I have pulled ffmpeg and godot-videodecoder into my project using git submodules
The command to build ffmpeg was