How do I include swscale.h in ffmpeg?

2019-08-17 06:03发布

I'm trying to compile ffmpeg from source, but when I try to compile a program dependent on it (from a tutorial), I get the error:

fatal error: ffmpeg/swscale.h: No such file or directory

I have cloned the github repository and followed the install instructions, but still get the same error.

I have also tried make install-libs and make config.h, but I'm kind of out of my depth here, because I'm not really a C programmer.

标签: ffmpeg
2条回答
再贱就再见
2楼-- · 2019-08-17 06:47

It's actually now located in swscale/swscale.h, so I guess the tutorial is just outdated.

查看更多
冷血范
3楼-- · 2019-08-17 06:58

you can use #include <libswscale/swscale.h> if ffmpeg installed correctly (with sudo make install) and your makefile has these below:

Note: I'm using/used ffmpeg API's too, this is tested. Oh and for c++ projects you may want to use extern "C" before include.

Makefile (for c++):

LIBAV_PATH = /set_correct_pathto/ffmpeg/lib/pkgconfig/
PKG_DEPS = libavcodec libavformat libswscale libswresample libavutil
CXXFLAGS += `PKG_CONFIG_PATH=$(LIBAV_PATH) pkg-config --cflags $(PKG_DEPS)`
LDFLAGS  += `PKG_CONFIG_PATH=$(LIBAV_PATH) pkg-config --libs $(PKG_DEPS)`

For C, change CXXFLAGS to CFLAGS.
Hope that helps.

查看更多
登录 后发表回答