davisking/dlib

[Bug]: dlib doesn't build with FFmpeg 7

arrufat opened this issue · 8 comments

What Operating System(s) are you seeing this problem on?

Linux (x86-64)

dlib version

19.24

Python version

No response

Compiler

GCC 14.1.1

Expected Behavior

Build dlib successfully with FFmpeg support

Current Behavior

FFmpeg broke some APIs,
There are some fields that got renamed from channel_layouts to ch_layouts.

Steps to Reproduce

git clone https://github.com/davisking/dlib
cd dlib
cmake -B build -G Ninja
cmake --build build

Anything else?

It would be great if @pfeatherstone could take a look at this, since I don't have multiple FFmpeg installations, I might fix this and break other versions...

Yeah I can have a look later today

I won't be able to test with gcc14 though. Best I can do 13

Thank you! I don't think the compiler poses a problem.

I've started looking at this. I will finish this evening. I was relying on the macro FF_API_OLD_CHANNEL_LAYOUT to determine whether the new ch_layout API was available. They have now removed it so i'm working on some meta-programming to solve this. Luckily, the additions of is_detected and switch_() are proving to be useful.

Meta-programming not working. I'm replacing the FFMPEG macro with a custom one. Looks like it's working.

I can confirm it works now, thank you so much!

Awesome, thanks guys :D