Skip to content
This repository has been archived by the owner on Apr 18, 2024. It is now read-only.

error: 'libavcodec/avcodec.h' file not found #11

Open
dht-hedaihua opened this issue May 4, 2022 · 7 comments
Open

error: 'libavcodec/avcodec.h' file not found #11

dht-hedaihua opened this issue May 4, 2022 · 7 comments

Comments

@dht-hedaihua
Copy link

Hi,i wonder to use reisen on my Mac,but unfortunately i encountered some problems :
image
image

Looking forward to your reply, thank you!

@zergon321
Copy link
Owner

I'm sorry, but I really can't solve any problem related to the ffmpeg installation on Mac. A couple of months ago my friend tried to resolve it but didn't succeed even with some alternative methods. I suppose just executing brew install libav is not enough. Or may be it's required to specify the path to the include files in the -ldflags option of the go build command.

@daniel-orlov
Copy link

I fixed that one - Link to SO

However the problem is that one cannot run brew install libav anymore - it's unmaintained and therefore disabled

@zergon321
Copy link
Owner

@daniel-orlov is that the correct instruction now? (You could do your own PR with this fix if you'd like to).

@kibab
Copy link
Contributor

kibab commented Oct 31, 2022

Hi, the above PR alone is not sufficient, it allows the project to compile but not link.
You have to specify LDFLAGS as well to make linking pass:

CGO_LDFLAGS="-L/opt/homebrew/Cellar/ffmpeg/5.1.2/lib"

@kibab
Copy link
Contributor

kibab commented Oct 31, 2022

that being said, with these CPPFLAGS and LDFLAGS the project compiled on Mac (OS X Monterey on M1 Mac) and works like a charm :-)

@kibab
Copy link
Contributor

kibab commented Oct 31, 2022

Actually, even easier would be to use a CGO pkg-config directive:
// #cgo pkg-config: libavutil libavformat libavformat libswscale

Sending a PR soon.

@zergon321
Copy link
Owner

@dht-hedaihua please check if v0.1.6 resolves your issue.

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

No branches or pull requests

4 participants