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

ffmpegdecklink: x264 not found using pkg-config #362

Open
pjotrek-b opened this issue Aug 29, 2023 · 17 comments
Open

ffmpegdecklink: x264 not found using pkg-config #362

pjotrek-b opened this issue Aug 29, 2023 · 17 comments
Labels

Comments

@pjotrek-b
Copy link

pjotrek-b commented Aug 29, 2023

Hi everyone! 😃

I keep running into the following error brewing ffmpegdecklink on Xubuntu 20.04.6:

ERROR: x264 not found using pkg-config

The current brew-recipe downloads ffmpeg v5.1.2:
(

url "https://ffmpeg.org/releases/ffmpeg-5.1.2.tar.xz"
)

It worked flawlessly on my previous Ubuntu 20.04 setup (ffmpeg v4.4).
I'm guessing it may be related to an issue posted on ffmpeg-user "ffmpeg > 5.0 refuses to build with x264-static"?

I'm currently trying to adjust the brew-recipe with the workaround/fix mentioned in the above post:

  • Add --pkg-config-flags="--static" to ./configure

I've never edited brew-recipes before, so it may take a while, but I thought I'd post this here in case someone else also runs into this 😄

@pjotrek-b
Copy link
Author

Here's the complete and partially cut 😉 commandline and console output:

$ brew install ffmpegdecklink --with-iec61883

==> Fetching amiaopensource/amiaos/ffmpegdecklink
==> Downloading https://ffmpeg.org/releases/ffmpeg-5.1.2.tar.xz
Already downloaded: /home/arkthis/.cache/Homebrew/downloads/7f8448ac2cf8ab4812d1b22a41a9e768f7b2c537f9a79a74bde1e0a91752a54c--ffmpeg-5.1.2.tar.xz
==> Installing ffmpegdecklink from amiaopensource/amiaos
==> ./configure --disable-shared --enable-version3 --cc=gcc-13 --host-cflags= --host-ldflags= --enable-gpl --enable-libfreetype --enab
Last 15 lines from /home/arkthis/.cache/Homebrew/Logs/ffmpegdecklink/01.configure:
--disable-libjack
--disable-indev=jack
--enable-libiec61883
--enable-nonfree
--enable-decklink
--extra-cflags=-I/home/linuxbrew/.linuxbrew/include
--extra-ldflags=-L/home/linuxbrew/.linuxbrew/include

ERROR: x264 not found using pkg-config
[...]

@retokromer
Copy link
Member

@pjotrek-b Thank you for reporting! This should be resolved in #349. Could you possibly test?

@pjotrek-b
Copy link
Author

Hi Reto!
Thanks. will test.

btw: I've also tried using the ffmpeg-v4.4 recipe (from git history) - same "libx264 not found" error.
Anyways: I'll test with #349.

Cheers!

@retokromer retokromer changed the title ERROR: x264 not found using pkg-config (ffmpeg v5.1.2) ffmpegdecklink: x264 not found using pkg-config Aug 29, 2023
@retokromer retokromer added the bug label Aug 29, 2023
@pjotrek-b
Copy link
Author

@retokromer: Unfortunately, ffmpeg v6 has the same issue:

ERROR: x264 not found using pkg-config
😢

The following codecs are all not found by pkg-config (disabled them one by one in the brew-recipe), until configure is happy and it start to run "make":

--enable-libx264
--enable-libx265
--enable-libxvid

But build fails with quite nasty errors (ffmpeg v5 and v6):

==> make
Last 15 lines from /home/arkthis/.cache/Homebrew/Logs/ffmpegdecklink/02.make:
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr' ./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr' ./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr' ./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr' ./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr' ./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr' ./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr'
./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr' ./libavcodec/x86/mathops.h:125: Error: operand type mismatch for shr'
make: *** [ffbuild/common.mak:81: libavformat/adtsenc.o] Error 1

@pjotrek-b
Copy link
Author

Is there something like "make clean" for brew?

@pjotrek-b
Copy link
Author

btw, here's the output of pkg-config --debug x264:

no output option set, defaulting to --exists
Error printing disabled by default due to use of output options --exists, --atleast/exact/max-version, --list-all or no output option at all. Value of --print-errors: 0
Error printing disabled
Adding virtual 'pkg-config' package to list of known packages
Looking for package 'x264'
Looking for package 'x264-uninstalled'
Reading 'x264' from file '/home/linuxbrew/.linuxbrew/lib/pkgconfig/x264.pc'
Parsing package file '/home/linuxbrew/.linuxbrew/lib/pkgconfig/x264.pc'
line>prefix=/home/linuxbrew/.linuxbrew/Cellar/x264/r3095
Variable declaration, 'prefix' has value '/home/linuxbrew/.linuxbrew/Cellar/x264/r3095'
line>exec_prefix=${prefix}
Variable declaration, 'exec_prefix' has value '/home/linuxbrew/.linuxbrew/Cellar/x264/r3095'
line>libdir=${exec_prefix}/lib
Variable declaration, 'libdir' has value '/home/linuxbrew/.linuxbrew/Cellar/x264/r3095/lib'
line>includedir=${prefix}/include
Variable declaration, 'includedir' has value '/home/linuxbrew/.linuxbrew/Cellar/x264/r3095/include'
line>
line>Name: x264
line>Description: H.264 (MPEG4 AVC) encoder library
line>Version: 0.164.3095
line>Libs: -L${exec_prefix}/lib -lx264
line>Libs.private: -lpthread -lm -ldl
Unknown keyword 'Libs.private' in '/home/linuxbrew/.linuxbrew/lib/pkgconfig/x264.pc'
line>Cflags: -I${prefix}/include -DX264_API_IMPORTS
Path position of 'x264' is 1
Adding 'x264' to list of known packages

@retokromer
Copy link
Member

Is there something like "make clean" for brew?

brew cleanup or even brew cleanup --prune=all

@retokromer
Copy link
Member

We also modified the troubleshooting page.

@pjotrek-b
Copy link
Author

Thanks for the quick reply! Something is "dirty" in my install - because now the v4.4 build also fails with the same mathops.h errors. Will try cleaning up first 😄

@retokromer
Copy link
Member

Try also a brew upgrade before reinstalling ffmpegdecklink.

@pjotrek-b
Copy link
Author

pjotrek-b commented Aug 29, 2023

Not sure if this is related, but Mozilla devs ran into the "mathops" issue less than a month ago:
https://bugzilla.mozilla.org/show_bug.cgi?id=1846703

And here on FFmpeg's tracker:
https://fftrac-bg.ffmpeg.org/ticket/10405

both seem to conclude:

"It's a change in binutils that has worked its way through."

@retokromer:
Seems you already addressed that patch?
(https://github.com/amiaopensource/homebrew-amiaos/blob/b81dbb4dead96b775cbdd4f31f7f15a47c6d2fc1/ffmpegdecklink.rb)

Disabled x264,x265,xvid - and crossing fingers for successful build!

@retokromer
Copy link
Member

@pjotrek-b Please test again with the again patched formula.

@pjotrek-b
Copy link
Author

The "x264-x265-xvid not found by pkg-config" issue is still present, but now "make" runs successfully.

@privatezero
Copy link
Member

@pjotrek-b, does running pkg-config --print-errors x264 give you any useful output?

@bravoalphatango
Copy link

Wanted to add to this thread since the issue was still open. Not sure which patches are being referred to toward the end of this post since a lot had been discussed, but I was running into a similar issue as @pjotrek-b. When trying to reinstall vrecord on my work laptop (M1 Mac running MacOS Monterey 12.6.5) and I was getting the following error:

Last 15 lines from /Users/tothba/Library/Logs/Homebrew/ffmpegdecklink/02.make:
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavutil/macros.h:53:34: note: expanded from macro 'FF_ARRAY_ELEMS'
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
^~~
libavutil/hwcontext_vulkan.c:1444:29: error: invalid application of 'sizeof' to
an incomplete type 'const VulkanOptExtension[]'
for (int j = 0; j < FF_ARRAY_ELEMS(optional_device_exts); j++) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libavutil/macros.h:53:34: note: expanded from macro 'FF_ARRAY_ELEMS'
#define FF_ARRAY_ELEMS(a) (sizeof(a) / sizeof((a)[0]))
^~~
4 errors generated.
CC libavutil/lzo.o
make: *** [libavutil/hwcontext_vulkan.o] Error 1
make: *** Waiting for unfinished jobs....
CC libavutil/mastering_display_metadata.o
If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrewcore):
https://github.com/amiaopensource/homebrew-amiaos/issues
These open issues may also help:
ffmpegdecklink: fontconfig not found using pkg-config https://github.com/amiaope
nsource/homebrew-amiaos/issues/360
ffmpegdecklink: x264 not found using pkg-config https://github.com/amiaopensourc
e/homebrew-amiaos/issues/362

Seems like whatever the issues were, they were preventing vrecord from compiling. Downloaded ffmpegdecklink.rb and took out “fontconfig” and “x264” from the Ruby source code and told it to disable VulkanOptExtension (since it seems to be for 3D rendering???) and vrecord seems to be working now.

Added

--disable-vulkan

Removed

depends_on "x264"
depends_on "fontconfig"
--enable-libx264
--enable-libfontconfig

I know this is not best practice but it allowed me to continue with brew install ./ffmpegdecklink.rb.

@bravoalphatango
Copy link

What is strange is that even though I got vrecord to install with the help of @cajunjoel on all our computers (Intel and M1) I am now getting errors on the Intel Mac Mini but NOT the M1 Macbook Pro:

2018 Intel Core i7 Mac Mini running Monterey 12.7.2:

  • Deck is not recognized by avfctl command and does not appear on DVRescue tab of vrecord GUI
tothba@SIA-3118AV-1 ~ % avfctl --list_devices
avfctl - control and capture from DV tape players via AVFoundation
version 0.21.11

Usage: avfctl [Options...] [OutputFile]

"avfctl -h" for displaying more information.
  • Can capture with the following command but not preview window appears during transfer and logs are not created.
avfctl -cmd capture avfctlTest03.dv

2021 M1 MacBook Pro running Moneterey 12.6.5:

  • Deck is not recognized by avfctl command and am getting the same error message as the Intel, BUT does appear on DVRescue tab of vrecord GUI and I am able to capture using it.
 ~  avfctl --list_devices
avfctl - control and capture from DV tape players via AVFoundation
version 0.21.11
 
Usage: avfctl [Options...] [OutputFile]
 
"avfctl -h" for displaying more information.
  • Can capture with the avfctl -cmd capture filename.dv command but not preview window appears during transfer and logs are not created.

These issues seem similar to what @libbyhopfauf and I were experiencing recently that is explained in more depth here: mipops/dvrescue#760

@libbyhopfauf
Copy link
Member

@bravoalphatango this does sound similar to the issue I was experiencing! @dericed can correct me if I am wrong, but I believe that the new DVRescue release will be rolled into vrecord to replace avfctl, so it could possibly resolve this on your end?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants