[FFMPEG] support ffmpeg 7 (#2987)

* support ffmpeg 7

* you need assembler

---------

Co-authored-by: pfeatherstone <pfeatherstone@pf>
This commit is contained in:
pfeatherstone 2024-08-01 13:48:47 +01:00 committed by GitHub
parent 58b50552fe
commit 3ca155da68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 40 additions and 3 deletions

View File

@ -195,6 +195,39 @@ jobs:
- name: Build examples, etc
run: cmake --build build --config Release --parallel 2
ubuntu-latest-ffmpeg7:
runs-on: 'ubuntu-latest'
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install make yasm
- name: Cache FFmpeg 7
uses: actions/cache@v3
id: cache-ffmpeg7
with:
path: /home/runner/ffmpeg-n7.0.1_installation
key: ffmpeg-n7.0.1_try2
- name: Build FFmpeg 7
if: steps.cache-ffmpeg7.outputs.cache-hit != 'true'
run: |
wget https://github.com/FFmpeg/FFmpeg/archive/refs/tags/n7.0.1.tar.gz
tar -xf n7.0.1.tar.gz
cd FFmpeg-n7.0.1
./configure --prefix=/home/runner/ffmpeg-n7.0.1_installation --disable-doc --disable-programs
make -j4
make install
cd ..
- name: Configure
run: cmake . -B build -DCMAKE_PREFIX_PATH=/home/runner/ffmpeg-n7.0.1_installation
- name: Build ffmpeg example
run: cmake --build build --config Release --target ffmpeg_video_muxing_ex --parallel 4
windows-latest:
runs-on: 'windows-latest'
steps:

View File

@ -64,6 +64,10 @@ extern "C" {
#include <memory>
#include "../logger.h"
#if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(59, 24, 100)
#define FFMPEG_HAS_CH_LAYOUT 1
#endif
namespace dlib { namespace ffmpeg { namespace details
{
@ -156,7 +160,7 @@ namespace dlib { namespace ffmpeg { namespace details
}
}
#if FF_API_OLD_CHANNEL_LAYOUT
#if FFMPEG_HAS_CH_LAYOUT
inline AVChannelLayout convert_layout(const uint64_t channel_layout)
{

View File

@ -788,7 +788,7 @@ namespace dlib
}
}
#if FF_API_OLD_CHANNEL_LAYOUT
#if FFMPEG_HAS_CH_LAYOUT
if (pCodec->ch_layouts)
{
bool channel_layout_supported = false;

View File

@ -775,7 +775,7 @@ namespace dlib
if (std::tie(src_sample_rate, src_channel_layout, src_fmt) !=
std::tie(dst_sample_rate, dst_channel_layout, dst_fmt))
{
#if FF_API_OLD_CHANNEL_LAYOUT
#if LIBSWRESAMPLE_VERSION_INT >= AV_VERSION_INT(4, 5, 100)
AVChannelLayout layout_src = convert_layout(src_channel_layout);
AVChannelLayout layout_dst = convert_layout(dst_channel_layout);