Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
192b879
Add AVUtilPart
Jan 25, 2026
7264aa1
Add the rest of the code.
Jan 26, 2026
7401a7e
Missing include for gcc
Jan 26, 2026
1cf17f0
Unit test fix
Jan 26, 2026
539cafb
Update the CI to new OSs and ffmpeg versions compiled in Github.
Feb 6, 2026
22866cb
Try again with updated token
Feb 6, 2026
12bc957
Missing questionmark before token
Feb 6, 2026
2a45f71
Merge branch 'updateCIPipeline' into version/8
Feb 11, 2026
e181f8f
Update path for windows 8.0.1
Feb 11, 2026
61fd47f
Also test FFmpeg 8
Feb 12, 2026
a06091d
C++20
Feb 12, 2026
4a0ead1
New profile for AAC in FFmpeg 8. Also the intraOnly flag is false aga…
Feb 12, 2026
d2ba351
Remove native install test for ffmpeg on windows-11-arm. There seems …
Feb 12, 2026
5c23354
Removed the wrong test
Feb 12, 2026
7f37cfa
Fix some test code and add a test for the new and old audio channel l…
Feb 17, 2026
e1806ac
Move avChannel things to its own file
Feb 17, 2026
81e34d7
Move audio channel things to its own class
Feb 17, 2026
4aa59f9
Move audio types defninition for test, add test for CodecParameters
Feb 17, 2026
10e98dd
Add check for audio codec parameters (especially the channel layout).
Feb 17, 2026
d034b8d
Continue on error
Feb 17, 2026
8e69f58
This seems to be None ... ?
Feb 17, 2026
f877e9c
Update test again
Feb 17, 2026
f65eb7c
Add operator << for ChannelInfo for better test case error reporting.
Feb 18, 2026
62fb9e0
Add .cache to gitignore
Feb 18, 2026
d6fe9d7
Codec parameters are supported starting with FFmpeg 3
Feb 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 34 additions & 20 deletions .github/workflows/BuildAndTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ jobs:
build:
strategy:
matrix:
config: [ {os: windows-latest, copyCommand: copy, artifactName: integrationTestWindows, buildPath: Release/, dummyLib: dummyLib.dll, integrationTest: integrationTest.exe},
{os: ubuntu-latest, copyCommand: cp, artifactName: integrationTestUbuntu, buildPath: , dummyLib: libdummyLib.so, integrationTest: integrationTest},
{os: macos-13, copyCommand: cp, artifactName: integrationTestMacIntel, buildPath: , dummyLib: libdummyLib.dylib, integrationTest: integrationTest},
{os: macos-14, copyCommand: cp, artifactName: integrationTestMacM1, buildPath: , dummyLib: libdummyLib.dylib, integrationTest: integrationTest} ]
config: [ {os: windows-2025, copyCommand: copy, artifactName: integrationTestWindows, buildPath: Release/, dummyLib: dummyLib.dll, integrationTest: integrationTest.exe},
{os: windows-11-arm, copyCommand: copy, artifactName: integrationTestWindowsArm, buildPath: Release/, dummyLib: dummyLib.dll, integrationTest: integrationTest.exe},
{os: ubuntu-24.04, copyCommand: cp, artifactName: integrationTestUbuntu, buildPath: , dummyLib: libdummyLib.so, integrationTest: integrationTest},
{os: ubuntu-24.04-arm, copyCommand: cp, artifactName: integrationTestUbuntuArm, buildPath: , dummyLib: libdummyLib.so, integrationTest: integrationTest},
{os: macos-15, copyCommand: cp, artifactName: integrationTestMacArm, buildPath: , dummyLib: libdummyLib.dylib, integrationTest: integrationTest},
{os: macos-15-intel, copyCommand: cp, artifactName: integrationTestMacIntel, buildPath: , dummyLib: libdummyLib.dylib, integrationTest: integrationTest} ]
runs-on: ${{ matrix.config.os }}

steps:
Expand All @@ -40,25 +42,35 @@ jobs:
needs: build
strategy:
matrix:
config: [ {os: windows-latest, artifactName: integrationTestWindows, azureFolder: windows, unzipCommand: 7z x },
{os: ubuntu-latest, artifactName: integrationTestUbuntu, azureFolder: ubuntu-22.04, unzipCommand: unzip },
{os: macos-13, artifactName: integrationTestMacIntel, azureFolder: macos-intel, unzipCommand: unzip },
{os: macos-14, artifactName: integrationTestMacM1, azureFolder: macos-m1, unzipCommand: unzip } ]
ffmpegVersions: ["2.8.22", "3.4.13", "4.4.4", "5.1.4", "6.1.1", "7.0"]
config: [ {os: windows-2025, artifactName: integrationTestWindows, unzipCommand: 7z x },
{os: windows-11-arm, artifactName: integrationTestWindowsArm, unzipCommand: 7z x },
{os: ubuntu-24.04, artifactName: integrationTestUbuntu, unzipCommand: unzip },
{os: ubuntu-24.04-arm, artifactName: integrationTestUbuntuArm, unzipCommand: unzip },
{os: macos-15, artifactName: integrationTestMacArm, unzipCommand: unzip },
{os: macos-15-intel, artifactName: integrationTestMacIntel, unzipCommand: unzip } ]
ffmpegVersions: ["2.8.22", "3.4.14", "4.4.6", "5.1.8", "6.1.4", "7.0.3", "8.0.1"]
exclude:
# I did not manage to compile the older ffmpeg versions an windows ARM
# Let me know if you manage to do so.
- ffmpegVersions: "2.8.22"
config: {os: windows-11-arm, artifactName: integrationTestWindowsArm, unzipCommand: 7z x }
- ffmpegVersions: "3.4.14"
config: {os: windows-11-arm, artifactName: integrationTestWindowsArm, unzipCommand: 7z x }
runs-on: ${{ matrix.config.os }}
continue-on-error: true
steps:
- uses: actions/download-artifact@master
with:
name: ${{ matrix.config.artifactName }}

- name: Make integrationTest executable
run: chmod a+x integrationTest
if: ${{ matrix.config.os }} != windows-latest
if: runner.os == 'Linux' || runner.os == 'macOS'

- name: Download FFmpeg
run: |
curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}ffmpeg/${{ matrix.config.azureFolder }}/ffmpeg-${{ matrix.ffmpegVersions }}.zip${{ secrets.AZURE_BLOB_TOKEN }}" -o ffmpeg.zip
curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}bitstream-testfiles/TestFile_h264_aac_1s_320x240.mp4${{ secrets.AZURE_BLOB_TOKEN }}" -o TestFile_h264_aac_1s_320x240.mp4
curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}ffmpeg/github/ffmpeg-${{ matrix.ffmpegVersions }}-${{ matrix.config.os }}.zip?${{ secrets.AZURE_BLOB_TOKEN }}" -o ffmpeg.zip
curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}bitstream-testfiles/TestFile_h264_aac_1s_320x240.mp4?${{ secrets.AZURE_BLOB_TOKEN }}" -o TestFile_h264_aac_1s_320x240.mp4
${{ matrix.config.unzipCommand }} ffmpeg.zip
rm ffmpeg.zip

Expand All @@ -69,11 +81,13 @@ jobs:
needs: build
strategy:
matrix:
config: [ {os: windows-latest, artifactName: integrationTestWindows},
{os: ubuntu-latest, artifactName: integrationTestUbuntu},
{os: macos-13, artifactName: integrationTestMacIntel},
{os: macos-14, artifactName: integrationTestMacM1} ]
config: [ {os: windows-2025, artifactName: integrationTestWindows},
{os: ubuntu-24.04, artifactName: integrationTestUbuntu},
{os: ubuntu-24.04-arm, artifactName: integrationTestUbuntuArm},
{os: macos-15, artifactName: integrationTestMacArm},
{os: macos-15-intel, artifactName: integrationTestMacIntel} ]
runs-on: ${{ matrix.config.os }}
continue-on-error: true
steps:
- uses: actions/download-artifact@master
with:
Expand All @@ -87,14 +101,14 @@ jobs:

- name: Make integrationTest executable
run: chmod a+x integrationTest
if: matrix.config.os != 'windows-latest'
if: runner.os == 'Linux' || runner.os == 'macOS'

- name: Add ffmpeg to path
run: echo "C:\ProgramData\chocolatey\lib\ffmpeg-shared\tools\ffmpeg-7.0.2-full_build-shared\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: matrix.config.os == 'windows-latest'
run: echo "C:\ProgramData\chocolatey\lib\ffmpeg-shared\tools\ffmpeg-8.0.1-full_build-shared\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
if: runner.os == 'Windows'

- name: Download Test files
run: curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}bitstream-testfiles/TestFile_h264_aac_1s_320x240.mp4${{ secrets.AZURE_BLOB_TOKEN }}" -o TestFile_h264_aac_1s_320x240.mp4
run: curl -L "${{ secrets.AZURE_BLOB_ROOT_PATH }}bitstream-testfiles/TestFile_h264_aac_1s_320x240.mp4?${{ secrets.AZURE_BLOB_TOKEN }}" -o TestFile_h264_aac_1s_320x240.mp4

- name: Run integration tests
run: ./integrationTest
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.vscode
.cache
build
buildFFmpeg
*.mp4
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ if(NOT CMAKE_BUILD_TYPE)
endif()
message(STATUS "Build type " ${CMAKE_BUILD_TYPE})

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

project(LibFFmpeg++)
Expand Down
122 changes: 122 additions & 0 deletions src/lib/AVCodec/Channel.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
/* Copyright (c) 2023 Christian Feldmann [christian.feldmann@gmx.de].
* All rights reserved.
* This work is licensed under the terms of the MIT license.
* For a copy, see <https://opensource.org/licenses/MIT>.
*/

#pragma once

#include "common/EnumMapper.h"

#include <ostream>

namespace libffmpeg::avcodec
{

enum class Channel
{
Unused,
FrontLeft,
FrontRight,
FrontCenter,
LowFrequency,
BackLeft,
BackRight,
FrontLeftOfCenter,
FrontRightOfCenter,
BackCenter,
SideLeft,
SideRight,
TopCenter,
TopFrontLeft,
TopFrontCenter,
TopFrontRight,
TopBackLeft,
TopBackCenter,
TopBackRight,
StereoLeft,
StereoRight,
WideLeft,
WideRight,
SurroundDirectLeft,
SurroundDirectRight,
LowFrequency2,
TopSideLeft,
TopSideRight,
BottomFrontCenter,
BottomFrontLeft,
BottomFrontRight,
SideSurroundLeft,
SideSurroundRight,
TopSurroundLeft,
TopSurroundRight,
BinauralLeft,
BinauralRight,
Ambisonic
};

const EnumMapper<Channel>
channelMapper({{Channel::FrontLeft, "FL", "Front Left"},
{Channel::FrontRight, "FR", "Front Right"},
{Channel::FrontCenter, "FC", "Front Center"},
{Channel::LowFrequency, "LFE", "Low Frequency"},
{Channel::BackLeft, "BL", "Back Left"},
{Channel::BackRight, "BR", "Back Right"},
{Channel::FrontLeftOfCenter, "FLC", "Front Left of Center"},
{Channel::FrontRightOfCenter, "FRC", "Front Right of Center"},
{Channel::BackCenter, "BC", "Back Center"},
{Channel::SideLeft, "SL", "Side Left"},
{Channel::SideRight, "SR", "Side Right"},
{Channel::TopCenter, "TC", "Top Center"},
{Channel::TopFrontLeft, "TFL", "Top Front Left"},
{Channel::TopFrontCenter, "TFC", "Top Front Center"},
{Channel::TopFrontRight, "TFR", "Top Front Right"},
{Channel::TopBackLeft, "TBL", "Top Back Left"},
{Channel::TopBackCenter, "TBC", "Top Back Center"},
{Channel::TopBackRight, "TBR", "Top Back Right"},
{Channel::StereoLeft, "SLT", "Stereo Left"},
{Channel::StereoRight, "SRT", "Stereo Right"},
{Channel::WideLeft, "WL", "Wide Left"},
{Channel::WideRight, "WR", "Wide Right"},
{Channel::SurroundDirectLeft, "SDL", "Surround Direct Left"},
{Channel::SurroundDirectRight, "SDR", "Surround Direct Right"},
{Channel::LowFrequency2, "LFE2", "Low Frequency 2"},
{Channel::TopSideLeft, "TSL", "Top Side Left"},
{Channel::TopSideRight, "TSR", "Top Side Right"},
{Channel::BottomFrontCenter, "BFC", "Bottom Front Center"},
{Channel::BottomFrontLeft, "BFL", "Bottom Front Left"},
{Channel::BottomFrontRight, "BFR", "Bottom Front Right"},
{Channel::SideSurroundLeft, "SSL", "Side Surround Left"},
{Channel::SideSurroundRight, "SSR", "Side Surround Right"},
{Channel::TopSurroundLeft, "TSL", "Top Surround Left"},
{Channel::TopSurroundRight, "TSR", "Top Surround Right"},
{Channel::BinauralLeft, "BL", "Binaural Left"},
{Channel::BinauralRight, "BR", "Binaural Right"},
{Channel::Ambisonic, "AMB", "Ambisonic"}});

struct ChannelInfo
{
std::optional<Channel> channel;
std::optional<int> ambisonicIndex;
std::string name;

bool operator==(const ChannelInfo &other) const
{
return this->channel == other.channel && this->ambisonicIndex == other.ambisonicIndex &&
this->name == other.name;
}

friend std::ostream &operator<<(std::ostream &stream, const ChannelInfo &channelInfo)
{
stream << "{ Channel "
<< (channelInfo.channel ? channelMapper.getName(*channelInfo.channel) : "nullopt")
<< ", ambisonicIndex: "
<< (channelInfo.ambisonicIndex ? std::to_string(*channelInfo.ambisonicIndex) : "nullopt")
<< ", name: \"" << channelInfo.name << "\"}";
return stream;
}
};

using ChannelLayout = std::vector<ChannelInfo>;

} // namespace libffmpeg::avcodec
Loading