pixop / video-compare

Split screen video comparison tool using FFmpeg and SDL2

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

compile failing on Debian/SID w/ FFMPEG 5

callahan-44 opened this issue · comments

It seems that FFMPEG 5 has deprecated the av_register_all() command, which causes demuxer.cpp to fail to make. Removing that function call corrected the issue on my system.

Also, there are two dependencies on Debian not mentioned in the readme: libavformat-dev, libswscale-dev. You might also consider noting SDL2 and SDL2-tiff are libsdl2-dev and libsdl2-ttf-dev for linux users.

Great tool, thank you!

Hey @callahan-44,

I'm glad to hear you find the tool useful!

Thanks for your bug report and comments - much appreciated. I'll see if I can find some time in the near future to make the necessary changes.

So I have just been looking into the av_register_all() issue you mentioned, @callahan-44. It turns out @thomasbachem already made a commit some months ago which should prevent the av_register_all() call from being included (because the libavcodec major version has been bumped from 58 to 59 in FFmpeg 5):

#if (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 6, 102))
	av_register_all();
#endif

Could you check the value of your LIBAVCODEC_VERSION_INT, please? It can be found in libavcodec/version.h.

With the caveat that I don't really know c/cpp, yes it looks like it should have skipped that call. After digging, no idea why I got those make errors -- but commenting out that exact snippet of code is what fixed the compile for me.

Looking in /usr/include/x86_64-linux-gnu/libavcodec

version_major.h has:

#ifndef AVCODEC_VERSION_MAJOR_H
#define AVCODEC_VERSION_MAJOR_H

/**
 * @file
 * @ingroup libavc
 * Libavcodec version macros.
 */

#define LIBAVCODEC_VERSION_MAJOR  59

and version.h is:

#include "libavutil/version.h"

#include "version_major.h"

#define LIBAVCODEC_VERSION_MINOR  37
#define LIBAVCODEC_VERSION_MICRO 100

#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                               LIBAVCODEC_VERSION_MINOR, \
                                               LIBAVCODEC_VERSION_MICRO)

So, if my understanding is correct LIBAVCODEC_VERSION_INT should be 59, 37, 100; which shouldn't trigger that if statement.

I did not further check other FFMPEG code files.

Your understanding is correct, thanks for digging in to this. You have an FFmpeg 5.1.x release installed on your system, right? In 5.0.x the major version was included directly in version.h (i.e. no version_major.h).

I've just pushed a commit which fixes this. It turns out we now need to include libavcodec/version.h explicitly for this compiler conditional to work with the FFmpeg 5.1 header files.

I'm closing this issue for now. Thanks for reporting it, @callahan-44.

BTW, I've updated the README with your suggestions for Debian Linux users.

Great, thanks! Glad I could help.