Page 1 of 1

Compile error with new ffmpeg

Posted: Sun Apr 27, 2025 2:36 pm
by stevenfalco
I just downloaded a new copy of the ffmpeg snapshot (2025-04-27).

ffmpeg built properly, but when I tried building makemkv-oss-1.18.1 I got a few errors. I attached the build log, but here are the highlights:

Code: Select all

libffabi/src/ffabi.c:214:9: error: implicit declaration of function ‘avcodec_close’; did you mean ‘avcodec_license’? [-Wimplicit-function-declaration]
  214 |         avcodec_close(ctx->avctx);
      |         ^~~~~~~~~~~~~

Code: Select all

libffabi/src/ffabi.c:377:25: error: ‘FF_PROFILE_UNKNOWN’ undeclared (first use in this function); did you mean ‘FFM_PROFILE_UNKNOWN’?
  377 |         info->profile : FF_PROFILE_UNKNOWN;
      |                         ^~~~~~~~~~~~~~~~~~
I then went back to an older copy of ffmpeg from 2024-10-04 and I was able to build makemkv-oss-1.18.1 without any problems.

Apparently, ffmpeg has changed its API recently, and makemkv-oss-1.18.1 cannot build using the new API.

Re: Compile error with new ffmpeg

Posted: Sun Apr 27, 2025 2:50 pm
by stevenfalco
I looked at the ffmpeg git repo, and found that avcodec_close() was deprecated, and now has been removed. Please see commit 0d48da2db in the ffmpeg source git:

Code: Select all

    avcodec: remove deprecated FF_API_AVCODEC_CLOSE
    
    Deprecated since 2024-02-09.
    
    Signed-off-by: James Almer <jamrial@gmail.com>
There is also this note describing the API change to avcodec_close():

Code: Select all

* @deprecated Do not use this function. Use avcodec_free_context() to destroy a
* codec context (either open or closed). Opening and closing a codec context
* multiple times is not supported anymore -- use multiple codec contexts
* instead.
Regarding FF_PROFILE_UNKNOWN, I found commit 822432769 which removes it:

Code: Select all

    avcodec: remove deprecated FF_API_FF_PROFILE_LEVEL
    
    Deprecated since 2023-09-06.
    
    Signed-off-by: James Almer <jamrial@gmail.com>
And there is this note:

Code: Select all

/** @deprecated The following define is deprecated; use AV_LEVEL_UNKOWN
 * in defs.h instead. */