nareix / joy4

Golang audio/video library and streaming server
MIT License
2.66k stars 501 forks source link

fatal error: libavresample/avresample.h: No such file or directory #127

Open zengqingfa opened 2 years ago

zengqingfa commented 2 years ago

I have ffmpeg installed. I want to test the code in joy4/examples/audio_decode/main.go when the program reported the following error:

# github.com/nareix/joy4/cgo/ffmpeg
In file included from /root/go/pkg/mod/github.com/nareix/joy4@v0.0.0-20200507095837-05a4ffbb5369/cgo/ffmpeg/audio.go:4:0:
./ffmpeg.h:5:10: fatal error: libavresample/avresample.h: No such file or directory
 #include <libavresample/avresample.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

when I execute go get github.com/nareix/joy4/cgo/ffmpeg ,the error appears again.

Then execute the following commands.

sudo apt-get -y install autoconf automake build-essential libass-dev libfreetype6-dev libsdl1.2-dev libtheora-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev pkg-config texi2html zlib1g-dev

sudo apt install -y libavdevice-dev libavfilter-dev libswscale-dev libavcodec-dev libavformat-dev libswresample-dev libavutil-dev

But the program still reports errors, so what can I do?

cedricve commented 1 year ago

From ffmpeg 5.x, avresample is no longer available, you might need to downgrade. We are working on modifying it to work with later ffmpeg versions. https://github.com/kerberos-io/joy4