olive-editor / olive

Free open-source non-linear video editor
https://olivevideoeditor.org/
GNU General Public License v3.0
8.26k stars 558 forks source link

Error during compiling olive with FFmpeg 7 #2325

Closed dacorsa closed 6 months ago

dacorsa commented 6 months ago

Commit Hash latest code on github

Platform Ubuntu 24.04 noble with ffmpeg 7.0

Summary during compiling i receive this error:

/app/olive/ext/core/src/render/audioparams.cpp: In member function ‘void olive::core::AudioParams::calculate_channel_count()’:
/app/olive/ext/core/src/render/audioparams.cpp:162:20: error: ‘av_get_channel_layout_nb_channels’ was not declared in this scope
  162 |   channel_count_ = av_get_channel_layout_nb_channels(channel_layout());
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [ext/core/CMakeFiles/olivecore.dir/build.make:97: ext/core/CMakeFiles/olivecore.dir/src/render/audioparams.cpp.o] Errore 1
gmake[2]: *** Attesa per i processi non terminati....
[  6%] Building CXX object ext/KDDockWidgets/src/CMakeFiles/kddockwidgets.dir/private/widgets/FloatingWindowWidget.cpp.o
[  6%] Building CXX object ext/KDDockWidgets/src/CMakeFiles/kddockwidgets.dir/private/widgets/FrameWidget.cpp.o
gmake[1]: *** [CMakeFiles/Makefile2:3569: ext/core/CMakeFiles/olivecore.dir/all] Errore 2
gmake[1]: *** Attesa per i processi non terminati....
[  6%] Building CXX object ext/KDDockWidgets/src/CMakeFiles/kddockwidgets.dir/private/widgets/TabWidgetWidget.cpp.o
[  6%] Building CXX object ext/KDDockWidgets/src/CMakeFiles/kddockwidgets.dir/private/widgets/TitleBarWidget.cpp.o
[  6%] Building CXX object ext/KDDockWidgets/src/CMakeFiles/kddockwidgets.dir/private/widgets/QWidgetAdapter_widgets.cpp.o
[  7%] Building CXX object ext/KDDockWidgets/src/CMakeFiles/kddockwidgets.dir/private/indicators/SegmentedIndicators.cpp.o
[  7%] Linking CXX static library libkddockwidgets.a
[ 13%] Built target kddockwidgets
gmake: *** [Makefile:136: all] Errore 2

Additional Information / Output

Maybe is the new ffmpeg 7.0 on latest ubuntu noble? sudo add-apt-repository ppa:ubuntuhandbook1/ffmpeg7

Simran-B commented 6 months ago

FFmpeg 4.x and 5.0 should work but any more recent versions may not. Especially the major versions (like 6 and 7) usually contain breaking changes and it looks like they now removed certain functions that were deprecated for a long time - I've seen deprecation warnings for this particular function with FFmpeg 5.

dacorsa commented 6 months ago

Hi, untill ffmpeg 6.0 worked, but now with ffmpeg 7.0 not works anymore, thanks for your reply. Someone can update the code to support ffmpeg 7.0? Best regards.

Simran-B commented 6 months ago

I guess FFmpeg 6 didn't break anything that Olive used then, but it hasn't been tested with this version and the automated builds use FFmpeg 5. There are no plans to update the current code base, therefore, please use an older FFmpeg version.

dacorsa commented 6 months ago

thanks @Simran-B , i have downloaded the source of ffmpeg 6.0, how can i pass it to olive? can i add this line before the cmake?: export PATH=/temp/buildCore/ffmpeg/build:$PATH or i have to pass it in the cmake? cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_RPATH=/temp/buildCore/ffmpeg/build

Thanks, best regards

Simran-B commented 6 months ago

It should be sufficient to point CMake to the FFmpeg root folder like cmake .. -DFFMPEG_ROOT=/path/to/ffmpeg. That folder should be one that is the result of compiling and installing FFmpeg (the libraries avutil, avcodec, etc.), not the raw source code.

dacorsa commented 6 months ago

Hi @Simran-B , i did how you explain to me, but continue to find only ffmpeg of the system:

-- Found FFMPEG: /usr/include/x86_64-linux-gnu (found suitable version "7.0", minimum required is "3.0") found components: avutil

i have run this: cmake .. -DFFMPEG_DIR=/app/ffmpeg/build

made in this way:

immagine

immagine

seems all ok, but not take FFmpeg i declare in cmake, why? best regards

dacorsa commented 6 months ago

16:56:31 root@NanoKDE /app/olive/build master# export PATH=/app/ffmpeg/build:$PATH export LD_LIBRARY_PATH=/app/ffmpeg/build:$LD_LIBRARY_PATH 16:56:38 root@NanoKDE /app/olive/build master# cmake .. -- The CXX compiler identification is GNU 14.0.1 -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ - skipped -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so -- Found OpenColorIO: /usr/lib/x86_64-linux-gnu/libOpenColorIO.so.2.1 (found suitable version "2.1.3", minimum required is "2.1.1") -- Found OpenImageIO: /usr/lib/x86_64-linux-gnu/libOpenImageIO.so;/usr/lib/x86_64-linux-gnu/libOpenImageIO_Util.so (found suitable version "2.4.17", minimum required is "2.1.12") -- Performing Test CMAKE_HAVE_LIBC_PTHREAD -- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success -- Found Threads: TRUE -- Found CONFIG for OpenEXR 3 (OPENEXR_VERSION=3.2.4) -- Found FFMPEG: /usr/include/x86_64-linux-gnu (found suitable version "7.0", minimum required is "3.0") found components: avutil avcodec avformat avfilter swscale swresample -- Found PortAudio: /usr/lib/x86_64-linux-gnu/libportaudio.so -- Looking for C++ include pa_jack.h -- Looking for C++ include pa_jack.h - found -- Could NOT find OpenTimelineIO (missing: OTIO_LIBRARIES OTIO_INCLUDE_DIRS OTIO_DEPS_INCLUDE_DIR) OpenTimelineIO interchange will be disabled. -- Could NOT find GoogleCrashpad (missing: CRASHPAD_CLIENT_LIB CRASHPAD_COMMON_LIB CRASHPAD_UTIL_LIB CRASHPAD_BASE_LIB BREAKPAD_BIN_DIR CRASHPAD_BUILD_INCLUDE_DIR CRASHPAD_CLIENT_INCLUDE_DIR CRASHPAD_BASE_INCLUDE_DIR CRASHPAD_COMPAT_LIB) Automatic crash reporting will be disabled. -- Found Git: /usr/bin/git (found version "2.43.3") -- Found FFMPEG: /usr/include/x86_64-linux-gnu (found suitable version "7.0", minimum required is "3.0") found components: avutil -- Could NOT find OpenTimelineIO (missing: OTIO_LIBRARIES OTIO_INCLUDE_DIRS OTIO_DEPS_INCLUDE_DIR) OpenTimelineIO interchange will be disabled. -- Setting build type to Debug as none was specified. -- The following OPTIONAL packages have been found:

-- The following REQUIRED packages have been found:

-- The following OPTIONAL packages have not been found:

-- Configuring done (0.7s) -- Generating done (0.1s) -- Build files have been written to: /app/olive/build 16:56:48 root@NanoKDE /app/olive/build master# which ffmpeg /app/ffmpeg/build/ffmpeg

Simran-B commented 6 months ago

The folder doesn't look correct. The FFmpeg root path is expected to contain an include directory or the CMake script will check other paths instead, like /usr/include. You seem to be pointing to the build directory, but you need to point to an install directory.

For example, when you configure FFmpeg, you can specify a prefix like ./configure --prefix="/app/ffmpeg/install" .... Then you need to build FFmpeg with make and finally install it with make install. With the shown prefix, the files won't go to the normal system folders but to the specified path. You should then be able to specify the path like -DFFMPEG_ROOT=/app/ffmpeg/install. Accordingly, you should use export LD_LIBRARY_PATH=/app/ffmpeg/install/lib:$LD_LIBRARY_PATH.

dacorsa commented 6 months ago

Thanks @Simran-B , i will try today and update you! You're a gentleman, thanks.

dacorsa commented 6 months ago

OK WORKED! :) ;) :*

immagine

Now we can close!, thanks.