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

Compiling for Windows #28

Open DataPlusProgram opened 4 years ago

DataPlusProgram commented 4 years ago

I am having trouble understanding how you would compile this solely for Windows.

The build instructions refer using build_gdnative.sh but that seems to build for all platforms and has various dependencies.

If I were to compile just for x64 windows how would I go about that? Thanks

jamie-pate commented 4 years ago

The dependencies boil down to 'bash, docker, and the x-code sdk', but It should be possible to modify the build script to skip the Linux and OSX containers. (I use the bash built in to the git for Windows install)

Might need to run inside WSL or a Linux VM? Not sure on the compatibility of running an Ubuntu docker container directly in Windows

Or just run the docker commands for Windows only:

docker build ./ -f Dockerfile.ubuntu-bionic -t "godot-videodecoder-ubuntu-bionic" 
docker build ./ -f Dockerfile.win64 --build-arg JOBS=4 -t "godot-videodecoder-win64"
id=$(docker create godot-videodecoder-win64)
docker cp $id:/opt/target/win64 $ADDON_BIN_DIR/
docker rm -v $id

PRs are welcome if you update the script to be able to select specific targets :)

DataPlusProgram commented 3 years ago

I'm still getting errors when compiling with docker on windows.

Would you ever consider distributing the binaries on github releases?

jamie-pate commented 3 years ago

It's a good idea, but I've currently got no extra time to implement it.

If you got it going on GitHub actions on a fork we'd welcome the PR

DataPlusProgram commented 3 years ago

I was finally able to compile to binaries by using Linux. I still have a few issues though.

World.tscn in the test project references "res://samples/2Thursday-FortiMonitor-vp9.webm" which doesn't exist.

I've set the path of the video stream to be "res://samples/big_buck_bunny.mp4" but I get the error: "load: No loader found for resource: res://samples/big_buck_bunny.mp4. <C++ Error> Method failed. Returning: RES() <C++ Source> core/io/resource_loader.cpp:285 @ _load()"

Thanks

jamie-pate commented 3 years ago

.mp4 is not a vp9 file :)

The default build is basically only vp9 at the moment.

DataPlusProgram commented 3 years ago

In that case the .mp4 file in the example project is should probably not be there.

I would also suggest editing the README.md to mention that this project provides support for only the vp9 codec for clarity.

jamie-pate commented 3 years ago

I added a way to specify specific platforms here: https://github.com/jamie-pate/godot-videodecoder/commit/c3c270d75b59cb9be4fd532258143950eea37e45

Working towards automatic release builds via github actions. see https://github.com/jamie-pate/godot-videodecoder/releases/tag/0.0.1-draft.3

jamie-pate commented 3 years ago

In that case the .mp4 file in the example project is should probably not be there.

I would also suggest editing the README.md to mention that this project provides support for only the vp9 codec for clarity.

The sample project's media is pulled from another project alltogether and those haven't been converted to supported formats unfortunately.