AirenSoft / OvenMediaEngine

OvenMediaEngine (OME) is a Sub-Second Latency Live Streaming Server with Large-Scale and High-Definition. #WebRTC #LLHLS
https://airensoft.com/ome.html
GNU Affero General Public License v3.0
2.61k stars 1.06k forks source link

ffmpeg 7.0 Update: Use new channel layout #1626

Open hashworks opened 6 months ago

hashworks commented 6 months ago

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 commented 6 months ago

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 commented 4 months ago

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 commented 1 month ago

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 commented 1 month ago

(ffmpeg_conv.h#L958)

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

Keukhan commented 1 month ago

(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.

hashworks commented 3 weeks ago

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

dx314 commented 2 days ago

Is this still going to be merged in?