Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compilation fails with ffmpeg 7.0 #953

Closed
VVD opened this issue May 6, 2024 · 9 comments
Closed

compilation fails with ffmpeg 7.0 #953

VVD opened this issue May 6, 2024 · 9 comments

Comments

@VVD
Copy link

VVD commented May 6, 2024

FreeBSD 14.0 amd64, ffmpeg 7.0.

Part of build log:

FAILED: src/CMakeFiles/openshot.dir/FFmpegReader.cpp.o 
/usr/bin/c++ -DHAVE_ISFINITE=1 -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DUSE_BABL=1 -DUSE_HW_ACCEL=1 -DUSE_IMAGEMAGICK=1 -DUSE_LEGACY_TRACKER=1 -DUSE_OPENCV=1 -Dopenshot_EXPORTS -I/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/.build/src/openshot_autogen/include -I/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src -I/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/.build/src -isystem /usr/local/include/libopenshot-audio -isystem /usr/local/include/ImageMagick-7 -isystem /usr/local/include -isystem /usr/local/include/qt5 -isystem /usr/local/include/qt5/QtCore -isystem /usr/local/lib/qt5/mkspecs/freebsd-clang -isystem /usr/local/include/qt5/QtGui -isystem /usr/local/include/qt5/QtWidgets -isystem /usr/local/include/qt5/QtSvg -isystem /usr/local/include/babl-0.1 -isystem /usr/local/include/opencv4 -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing   -std=c++17 -O2 -pipe  -fstack-protector-strong -fno-strict-aliasing   -std=c++17  -DNDEBUG -std=c++17 -fPIC -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16 -DMAGICKCORE_CHANNEL_MASK_DEPTH=32 -fPIC -fopenmp=libomp -pthread -MD -MT src/CMakeFiles/openshot.dir/FFmpegReader.cpp.o -MF src/CMakeFiles/openshot.dir/FFmpegReader.cpp.o.d -o src/CMakeFiles/openshot.dir/FFmpegReader.cpp.o -c /wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp
/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp:676:51: error: no member named 'channel_layout' in 'AVCodecParameters'
        if (AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channel_layout == 0)
            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp:677:48: error: no member named 'channel_layout' in 'AVCodecParameters'
                AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channel_layout = av_get_default_channel_layout(AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channels);
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp:677:140: error: no member named 'channels' in 'AVCodecParameters'
                AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channel_layout = av_get_default_channel_layout(AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channels);
                                                                                                            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp:688:63: error: no member named 'channels' in 'AVCodecParameters'
        info.channels = AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channels;
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp:689:85: error: no member named 'channel_layout' in 'AVCodecParameters'
        info.channel_layout = (ChannelLayout) AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channel_layout;
                                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp:1599:60: error: no member named 'channels' in 'AVCodecParameters'
                                                                                           AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channels,
                                                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp:1604:91: error: no member named 'channels' in 'AVCodecParameters'
                packet_samples = audio_frame->nb_samples * AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channels;
                                                           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp:1667:88: error: no member named 'channel_layout' in 'AVCodecParameters'
        av_opt_set_int(avr, "in_channel_layout", AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channel_layout, 0);
                                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
/wrkdirs/usr/ports/multimedia/libopenshot/work-py39/libopenshot-0.3.2/src/FFmpegReader.cpp:1668:89: error: no member named 'channel_layout' in 'AVCodecParameters'
        av_opt_set_int(avr, "out_channel_layout", AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channel_layout, 0);
                                                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
9 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Full build log is here: https://pkg-status.freebsd.org/beefy22/data/140amd64-default-foo/2024-05-04_07h10m46s/logs/errors/py39-libopenshot-0.3.2_3.log

Maybe this can help: https://code.videolan.org/videolan/vlc/-/merge_requests/5304/diffs
AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->channels => AV_GET_CODEC_ATTRIBUTES(aStream, aCodecCtx)->ch_layout.nb_channels

@eclipseo
Copy link
Contributor

eclipseo commented May 8, 2024

Oh I was working on this for Fedora Linux: here's my PR #954

eclipseo added a commit to eclipseo/libopenshot that referenced this issue May 8, 2024
channel_layout has been replaced with ch_layout

Fix OpenShot#953
eclipseo added a commit to eclipseo/libopenshot that referenced this issue May 8, 2024
channel_layout has been replaced with ch_layout

Fix OpenShot#953
@VVD
Copy link
Author

VVD commented May 8, 2024

Oh I was working on this for Fedora Linux: here's my PR #954

Thanks.
But this patch need rework to apply to release version.

Or apply this commit from repo before your patch: 9aa3713

@eclipseo
Copy link
Contributor

eclipseo commented May 8, 2024

Oh I was working on this for Fedora Linux: here's my PR #954

Thanks. But this patch need rework to apply to release version.

Or apply this commit from repo before your patch: 9aa3713

What do you mean, my patch is on top of the develop branch, so it already includes this commit in the history?

If you want the version to apply on top of the current stable version: https://src.fedoraproject.org/fork/eclipseo/rpms/libopenshot/blob/07481b00585dfa14a2a3aa8986892a9f88002338/f/0001-Add-compatibility-with-FFMPEG-7.0.patch

@jonoomph
Copy link
Member

jonoomph commented May 9, 2024

I've left some feedback on #954. Hopefully we can get this merged version soon, and get it into a new production release of OpenShot.

@VVD
Copy link
Author

VVD commented May 9, 2024

What do you mean, my patch is on top of the develop branch, so it already includes this commit in the history?

If you want the version to apply on top of the current stable version: https://src.fedoraproject.org/fork/eclipseo/rpms/libopenshot/blob/07481b00585dfa14a2a3aa8986892a9f88002338/f/0001-Add-compatibility-with-FFMPEG-7.0.patch

Yes, I mean on top of the last release.
But if new release is soon then we can wait.

eclipseo added a commit to eclipseo/libopenshot that referenced this issue May 9, 2024
channel_layout has been replaced with ch_layout

Fix OpenShot#953
eclipseo added a commit to eclipseo/libopenshot that referenced this issue May 9, 2024
channel_layout has been replaced with ch_layout

Fix OpenShot#953
eclipseo added a commit to eclipseo/libopenshot that referenced this issue May 9, 2024
channel_layout has been replaced with ch_layout

Fix OpenShot#953
eclipseo added a commit to eclipseo/libopenshot that referenced this issue May 9, 2024
channel_layout has been replaced with ch_layout

Fix OpenShot#953
@antonio-rojas
Copy link

This fixes build, but the are many test failures when compiled against ffmpeg 7, such as

 92/188 Test  #92: FrameMapper:resample_audio_48000_to_41000 ......................***Failed    0.84 sec
[SWR @ 0x5582654a9a80] Input channel layout "" is invalid or unsupported.
[SWR @ 0x5582654a9a80] Context has not been initialized
Filters: "resample_audio_48000_to_41000"

@lfos
Copy link

lfos commented May 31, 2024

@eclipseo Are you able to take a look at the test failures? I created a separate issue for tracking, #954.

@VVD
Copy link
Author

VVD commented Jun 25, 2024

Is this fixed in OpenShot 3.2.0?

@antonio-rojas
Copy link

Is this fixed in OpenShot 3.2.0?

If you mean libopenshot 0.3.3, no.

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue Jul 2, 2024
Release notes:
https://www.openshot.org/blog/2024/06/24/new_openshot_release_320/
Compatibility with FFMPEG 7.0 improved: build without errors, but there is
an issue in the upstream bug-tracker related to the work of the software:
OpenShot/libopenshot#953 (comment)

PR:	278857
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants