Thomas Ayoub
Thomas Ayoub

Reputation: 29431

ffmpeg include issue - some functions are missing

I try to follow and adapt this example to convert a video thanks to FFMPEG but some function seems to be missing like :

int avcodec_open ( AVCodecContext * avctx, AVCodec * codec)     

When I go in the doc to see where it come from, I find it in the file libavcodec/avcodec.h which is included in my program #include "libavcodec/avcodec.h" (in the top of my .h file).

Given this, I don't understand why Qt throw me this error :

../../Dev/Joker/libs/PhVideo/PhVideoEncoder.cpp:360:6: error: use of undeclared identifier 'avcodec_open'
    if (avcodec_open(c, codec) < 0) {

Upvotes: 2

Views: 1041

Answers (1)

Sergei Nikulov
Sergei Nikulov

Reputation: 5110

avcodec_open was deprecated and replaced with avcodec_open2 in newer versions of FFMPEG.

Refer to latest documentation, here and here

Upvotes: 3

Related Questions