Skip to content
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

ffmpeg: Enable avfilter and avformat for gst-libav #1533

Merged
merged 3 commits into from
Feb 14, 2025

Conversation

Biswa96
Copy link
Contributor

@Biswa96 Biswa96 commented Feb 10, 2025

Previously, gst-libav failed to build due to absence of avfilter and avformat libraries from ffmpeg. This commit enables those libraries by fixing the build error with unistd.h. This imports a patch for zlib from vcpkg1 to fix the unistd.h check.

In gvsbuild, zlib is build using nmake which copies the zconf.h file. So, the imported patch file was modified for zconf.h only.

Footnotes

  1. https://github.com/microsoft/vcpkg/blob/master/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch

@Biswa96
Copy link
Contributor Author

Biswa96 commented Feb 10, 2025

  • gst-libav build detects the libraries correctly.
Run-time dependency libavfilter found: YES 10.4.100
Run-time dependency libavformat found: YES 61.7.100
Run-time dependency libavcodec found: YES 61.19.100
Run-time dependency libavutil found: YES 59.39.100
Checking if "libav is provided by FFmpeg" with dependencies libavfilter, libavformat, libavcodec, libavutil compiles: YES
Has header "unistd.h" : NO
  • List of avfilter and avformat files.
$ find gtk-build/gtk/x64/debug/bin/avf*
gtk-build/gtk/x64/debug/bin/avfilter-10.dll
gtk-build/gtk/x64/debug/bin/avfilter-10.pdb
gtk-build/gtk/x64/debug/bin/avformat-61.dll
gtk-build/gtk/x64/debug/bin/avformat-61.pdb

$ find gtk-build/gtk/x64/release/bin/avf*
gtk-build/gtk/x64/release/bin/avfilter-10.dll
gtk-build/gtk/x64/release/bin/avformat-61.dll

Previously, gst-libav failed to build due to absence of avfilter and
avformat libraries from ffmpeg. This commit enables those libraries by
fixing the build error with unistd.h. This imports a patch for zlib
from vcpkg[^1] to fix the unistd.h check.

In gvsbuild, zlib is build using nmake which copies the zconf.h file.
So, the imported patch file was modified for zconf.h only.

[^1]: https://github.com/microsoft/vcpkg/blob/master/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch
@danyeaw
Copy link
Member

danyeaw commented Feb 13, 2025

Hi @Biswa96, thanks so much for thinking of us! This looks great. Do you know if someone tried to submit this upstream to the zlib repo?

@Biswa96
Copy link
Contributor Author

Biswa96 commented Feb 13, 2025

No.

@danyeaw
Copy link
Member

danyeaw commented Feb 13, 2025

Ok, let me at least try to see if I can get it accepted upstream.

@Biswa96
Copy link
Contributor Author

Biswa96 commented Feb 13, 2025

There is an old upstream issue with same problem madler/zlib#787

@danyeaw
Copy link
Member

danyeaw commented Feb 14, 2025

Hi @Biswa96, I simplified the patch syntax to improve readability and submitted a PR upstream to zlib.

@danyeaw danyeaw requested a review from pbor February 14, 2025 02:57
@danyeaw danyeaw merged commit 4f2801d into wingtk:main Feb 14, 2025
8 checks passed
@danyeaw
Copy link
Member

danyeaw commented Feb 14, 2025

Thanks again @Biswa96, this is now fixed upstream with zlib and I brought in the exact patch to Gvsbuild.

@Biswa96 Biswa96 deleted the fix-gst-libav branch February 14, 2025 18:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix gst-libav build
2 participants