OvenMediaEngine icon indicating copy to clipboard operation
OvenMediaEngine copied to clipboard

ffmpeg 7.0 Update: Use new channel layout

Open hashworks opened this issue 1 year ago • 5 comments

Context: At Arch Linux I build OvenMediaEngine against the system libraries. Since we currently rebuild stuff for ffmpeg 7.0 this patch is required.

Please bear with me here, I don't really code in C++.

Note: There was a flag FF_API_OLD_CHANNEL_LAYOUT, which has been dropped in v7.

hashworks avatar May 25 '24 17:05 hashworks

This compiles with ffmpeg 7.0 and is currently used in the Arch Linux extra-staging repository: https://gitlab.archlinux.org/archlinux/packaging/packages/ovenmediaengine/-/commit/3a029703f7f9ce35d31487848efd9524516bf220

It is however entirely untested and will remain a draft until then.

hashworks avatar May 25 '24 20:05 hashworks

I'm marking this as ready - I've been using this for a few weeks now, including transcoding with ffmpeg v7 openh264.

The Arch Linux package is now using this patch directly.

hashworks avatar Jul 18 '24 14:07 hashworks

ffmpeg 7.1 changed the API again: https://github.com/FFmpeg/FFmpeg/commit/7f17e0e6dd0b28b29295c1eeb1a38546eebc3946

AVFilterLink no longer has access to hw_frames_ctx, which moved to the internal FilterLink. I'm not sure what I should do with SetHWFramesCtxOfAVFilterLink (ffmpeg_conv.h#L958):

context->hw_frames_ctx = av_buffer_ref(hw_frames_ref);

av_buffer_unref(&hw_frames_ref);

Any ideas?

hashworks avatar Oct 05 '24 14:10 hashworks

(ffmpeg_conv.h#L958)

@Keukhan you added this in 1de467eb6136a7c195fb1424fb6ab6f87045ceaf, can you take a look?

hashworks avatar Oct 06 '24 13:10 hashworks

(ffmpeg_conv.h#L958)

@Keukhan you added this in 1de467e, can you take a look?

First of all, thank you for the PR. I will internally discuss changing FFmpeg to 7.x, and after that, I will modify the code related to hw_frames_ctx of AVFilterList.

Keukhan avatar Oct 06 '24 14:10 Keukhan

Since this blocks the ffmpeg 7.1 release on Arch I've moved the package to our ffmpeg4.4 dependency: https://gitlab.archlinux.org/archlinux/packaging/packages/ovenmediaengine/-/commit/d58322c814222a09ceb6d731905efe5bc3b632f5

hashworks avatar Nov 06 '24 12:11 hashworks

Is this still going to be merged in?

dx314 avatar Nov 27 '24 14:11 dx314

The dependency on ffmpeg 5.0.1 is currently also preventing OvenMediaEngine from building on Ubuntu 24.04 LTS because it does not build with binutils >= 2.41. Would love this patch to ship and also to move misc/prerequisites.sh to a recent ffmpeg.

Right now I've locally applied a workaround by changing the ffmpeg version in misc/prerequisites.sh to 5.1.6, which also required removing the --disable-lzo flag.

Remboooo avatar Jan 02 '25 21:01 Remboooo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 04 '25 04:03 stale[bot]