-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix some custom build issues with ffmpeg #360
fix some custom build issues with ffmpeg #360
Conversation
Signed-off-by: Mark Reid <[email protected]>
Signed-off-by: Mark Reid <[email protected]>
Hello Mark, thanks for the fix ! |
It has been I while since I've attempted to build the windows version. I gave it a go, I've gotten it to build (though the exe always segfaults). This being in quotes was a issue when building ffmpeg. OpenRV/cmake/dependencies/ffmpeg.cmake Line 232 in aef2b06
cmake combines some of the args together with quotes. This messes up the configure script. I also haven't been able to get ffmpeg to build yet with multiple |
I had an unexpected need to build RV for Windows and a ton of time to kill, so I tried addressing the notes in my fork of Mark's fork here: https://github.com/meepzh/OpenRV/tree/al_ffmpeg_config_v1 RV_FFMPEG_CONFIG_OPTIONS QuotationsMark, your changes were really helpful and got me looking deeper into how CMake handles lists. To confirm, with the quotation marks retained, it seems that CMake for Visual Studio was kindly recording the spaces between lists under ...\cmake.exe -E env ... sh ./configure ... --disable-decoder=aac_latm "--disable-decoder=dvvideo --disable-encoder=dnxhd" --disable-encoder=prores ... leading to this error: ./configure: eval: line 582: syntax error near unexpected token `--disable-encoder=dnxhd_decoder' which your solution solves by removing the quotation marks, resolving #67 (comment). RV_FFMPEG_CONFIG_OPTIONS ArgsFor lists in CMake, I just learned that they're delimited by semicolons: cmake "-DRV_FFMPEG_CONFIG_OPTIONS=--enable-decoder=vp9;--enable-decoder=vp8;" ...
cmake "-DRV_FFMPEG_CONFIG_OPTIONS=--extra-cflags=-I/include/dir1;--extra-cflags=-I/include/dir2" ... so I suppose that it maybe isn't necessary to add RV_FFMPEG_PATCH_COMMAND_STEPHowever, using
cmake ... "-DRV_FFMPEG_PATCH_COMMAND_STEP=touch foobar && git cherry-pick -n 988f2e9eb063db7c1a678729f58aab6eba59a55b 031f1561cd286596cdb374da32f8aa816ce3b135 effadce6c756247ea8bae32dc13bb3e6f464f0eb 03823ac0c6a38bd6ba972539e3203a592579792f d2b46c1ef768bc31ba9180f6d469d5b8be677500" which addresses #15 (comment)! PKG_CONFIG_PATHThe 88>CUSTOMBUILD : error : dav1d >= 0.5.0 not found using pkg-config since there was no way to un-escape ...\cmake.exe -E env PKG_CONFIG_PATH="$"PKG_CONFIG_PATH:/C/OpenRV/_build/RV_DEPS_DAV1D/install/lib/pkgconfig sh ./configure ...
...\cmake.exe -E env PKG_CONFIG_PATH=%%PKG_CONFIG_PATH%%:/C/OpenRV/_build/RV_DEPS_DAV1D/install/lib/pkgconfig sh ./configure ... After using the PR, I noticed that CMake was treating ... env PKG_CONFIG_PATH=C:\msys64\mingw64\lib\pkgconfig C:\msys64\mingw64\share\pkgconfig:/C/OpenRV/_build3/RV_DEPS_DAV1D/install/lib/pkgconfig sh ./configure despite how MINGW itself was storing the values $ echo $PKG_CONFIG_PATH
/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig so my changes kind of awkwardly iterate through the paths and convert them back to POSIX and then join them into a single path string at the end: ... PKG_CONFIG_PATH=/C/msys64/mingw64/lib/pkgconfig:/C/msys64/mingw64/share/pkgconfig:/C/OpenRV/_build2/RV_DEPS_DAV1D/install/lib/pkgconfig sh ./configure though I'm keen to know if there's a better way to CMake it. TestingI was able to get a version built for both Windows 10.0.19045 and Arch Linux 6.6.8 and play the bird video again without issues. SubmissionHopefully that all looks okay! I'm not sure how to proceed with this, but since Mark already opened a PR, I'd be happy to put in a PR to his fork if that sounds good. Thanks! |
Just a quick comment on this topic. I ran into the FFmpeg problem last night on Windows. I didn't see this PR when I was looking for a fix, but I did find a several-month old issue that linked to this repo: https://github.com/ThomBern/OpenRV/tree/fix-build-ffmpeg I updated dav1d.cmake, ffmpeg.cmake and openssl.cmake since those three had the "Fixing Open RV FFMpeg multiplatform" note. Long story short, that did the trick and I was able to build successfully. |
<!-- Thanks for your contribution! Please read this comment in its entirety. It's quite important. When a contributor merges the pull request, the title and the description will be used to build the merge commit! ### Pull Request TITLE It should be in the following format: [ 12345: Summary of the changes made ] Where 12345 is the corresponding Github Issue OR [ Summary of the changes made ] If it's solving something trivial, like fixing a typo. --> ### Linked issues <!-- Link the Issue(s) this Pull Request is related to. Each PR should link to at least one issue, in the form: Use one line for each Issue. This allows auto-closing the related issue when the fix is merged. Fixes #12345 Fixes #54345 --> ### Summarize your change. This builds upon the work that Mark did to improve the configuration options for FFmpeg in #360 with Mark's [blessing](markreidvfx#1 (comment))! ### Describe the reason for the change. This fixes use of `PKG_CONFIG_PATH`, `RV_FFMPEG_COMMON_CONFIG_OPTIONS`, `RV_FFMPEG_PATCH_COMMAND_STEP` (#15 (comment)), and other Windows-specific build issues such as #67 (comment). ### Describe what you have tested and on which operating system. This has been tested on Arch Linux 6.6.8 and Windows 10.0.22631, running the same test from [here](#360 (comment)). ### Add a list of changes, and note any that might need special attention during the review. Specific details can be found [here](#360 (comment)). I did not include the change to apply `SEPARATE_ARGUMENTS` to `RV_FFMPEG_CONFIG_OPTIONS`, since `RV_FFMPEG_CONFIG_OPTIONS` did not seem applicable given the [CMake documentation](https://cmake.org/cmake/help/latest/command/separate_arguments.html), but I can include that change as well. ### If possible, provide screenshots. #360 (comment) Thanks! --------- Signed-off-by: Robert Zhou <[email protected]>
@markreidvfx : I believe meepzh's PR that was just merged, combined your PR with his fix on Windows. |
@bernie-laberge yes we can close this PR. Meepzh's PR solves my issues too. |
Linked issues
n/a
Summarize your change.
I had some difficulties building ffmpeg with custom configuration options and this is what resolved it for me.
RV_FFMPEG_CONFIG_OPTIONS
not being converted to a list was the issue. This can happen when you pass it as an option via cmake commandline like this.There could still be issue doing it this way. When passing an option via a commandline cmake does confusing things with escaping quotes that I don't entirely understand. If for example if you want to add a custom build option like
--extra-cflags="-I/include/dir1 -I/incude/dir2"
I still can't figure out how to get cmake to escape the quotes properly.The other issues was ffmpeg not finding the install packages because the script wasn't using the
PKG_CONFIG_PATH
env var.Describe the reason for the change.
Describe what you have tested and on which operating system.
I've only tested this on centos 7
Add a list of changes, and note any that might need special attention during the review.
If possible, provide screenshots.