Skip to content

Commit

Permalink
Update to FFmpeg 7.1 (#213)
Browse files Browse the repository at this point in the history
* Prepare for ffmpeg 7.1

* Add LCEVC

* Add LCEVC

* Update for 7.1

* Update versions
  • Loading branch information
AdrianEddy authored Sep 29, 2024
1 parent 5c7bb71 commit a7b50dd
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 9 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
container: jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu
strategy:
matrix:
ffmpeg_version: ["3.4", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1", "6.0", "6.1"]
ffmpeg_version: ["3.4", "4.0", "4.1", "4.2", "4.3", "4.4", "5.0", "5.1", "6.0", "6.1", "7.0"]
fail-fast: false
steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -106,22 +106,22 @@ jobs:
- name: Check format
run: |
cargo fmt -- --check
# Added only because there is no ffmpeg7.0 docker image here yet
# Added only because there is no ffmpeg7.1 docker image here yet
# https://github.com/jrottenberg/ffmpeg
build-test-lint-7-0:
name: FFmpeg 7.0 - build, test and lint
build-test-lint-7-1:
name: FFmpeg 7.1 - build, test and lint
runs-on: ubuntu-latest
strategy:
fail-fast: false
env:
FFMPEG_DIR: /home/runner/work/rust-ffmpeg/rust-ffmpeg/ffmpeg-7.0-linux-clang-default
FFMPEG_DIR: /home/runner/work/rust-ffmpeg/rust-ffmpeg/ffmpeg-7.1-linux-clang-default
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y --no-install-recommends clang curl pkg-config xz-utils libxv-dev
curl -L https://sourceforge.net/projects/avbuild/files/linux/ffmpeg-7.0-linux-clang-default.tar.xz/download -o ffmpeg.tar.xz
curl -L https://sourceforge.net/projects/avbuild/files/linux/ffmpeg-7.1-linux-clang-default.tar.xz/download -o ffmpeg.tar.xz
tar -xf ffmpeg.tar.xz
- name: Set up Rust
uses: actions-rs/toolchain@v1
Expand Down
7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ffmpeg-next"
version = "7.0.4"
version = "7.1.0"
build = "build.rs"

authors = ["meh. <meh@schizofreni.co>", "Zhiming Wang <i@zhimingwang.org>"]
Expand All @@ -27,6 +27,7 @@ ffmpeg41 = []
ffmpeg4 = []

static = ["ffmpeg-sys-next/static"]
non-exhaustive-enums = ["ffmpeg-sys-next/non-exhaustive-enums"]
build = ["static", "ffmpeg-sys-next/build"]

# licensing
Expand Down Expand Up @@ -106,12 +107,12 @@ rpi = []

[dependencies]
libc = "0.2"
bitflags = "2.5"
bitflags = "2.6"

[dependencies.image]
version = "0.25"
optional = true

[dependencies.ffmpeg-sys-next]
version = "7.0.2"
version = "7.1.0"
default-features = false
15 changes: 15 additions & 0 deletions src/codec/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,11 @@ pub enum Id {
QOA,
#[cfg(feature = "ffmpeg_7_0")]
LEAD,

#[cfg(feature = "ffmpeg_7_1")]
LC3,
#[cfg(feature = "ffmpeg_7_1")]
LCEVC,
}

impl Id {
Expand Down Expand Up @@ -1337,6 +1342,11 @@ impl From<AVCodecID> for Id {
AV_CODEC_ID_QOA => Id::QOA,
#[cfg(feature = "ffmpeg_7_0")]
AV_CODEC_ID_LEAD => Id::LEAD,

#[cfg(feature = "ffmpeg_7_1")]
AV_CODEC_ID_LC3 => Id::LC3,
#[cfg(feature = "ffmpeg_7_1")]
AV_CODEC_ID_LCEVC => Id::LCEVC,
}
}
}
Expand Down Expand Up @@ -2001,6 +2011,11 @@ impl From<Id> for AVCodecID {
Id::QOA => AV_CODEC_ID_QOA,
#[cfg(feature = "ffmpeg_7_0")]
Id::LEAD => AV_CODEC_ID_LEAD,

#[cfg(feature = "ffmpeg_7_1")]
Id::LC3 => AV_CODEC_ID_LC3,
#[cfg(feature = "ffmpeg_7_1")]
Id::LCEVC => AV_CODEC_ID_LCEVC,
}
}
}
15 changes: 15 additions & 0 deletions src/codec/packet/side_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ pub enum Type {
IAMF_RECON_GAIN_INFO_PARAM,
#[cfg(feature = "ffmpeg_7_0")]
AMBIENT_VIEWING_ENVIRONMENT,

#[cfg(feature = "ffmpeg_7_1")]
FRAME_CROPPING,
#[cfg(feature = "ffmpeg_7_1")]
LCEVC,
}

impl From<AVPacketSideDataType> for Type {
Expand Down Expand Up @@ -124,6 +129,11 @@ impl From<AVPacketSideDataType> for Type {
AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM => Type::IAMF_RECON_GAIN_INFO_PARAM,
#[cfg(feature = "ffmpeg_7_0")]
AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT => Type::AMBIENT_VIEWING_ENVIRONMENT,

#[cfg(feature = "ffmpeg_7_1")]
AV_PKT_DATA_FRAME_CROPPING => Type::FRAME_CROPPING,
#[cfg(feature = "ffmpeg_7_1")]
AV_PKT_DATA_LCEVC => Type::LCEVC,
}
}
}
Expand Down Expand Up @@ -187,6 +197,11 @@ impl From<Type> for AVPacketSideDataType {
Type::IAMF_RECON_GAIN_INFO_PARAM => AV_PKT_DATA_IAMF_RECON_GAIN_INFO_PARAM,
#[cfg(feature = "ffmpeg_7_0")]
Type::AMBIENT_VIEWING_ENVIRONMENT => AV_PKT_DATA_AMBIENT_VIEWING_ENVIRONMENT,

#[cfg(feature = "ffmpeg_7_1")]
Type::FRAME_CROPPING => AV_PKT_DATA_FRAME_CROPPING,
#[cfg(feature = "ffmpeg_7_1")]
Type::LCEVC => AV_PKT_DATA_LCEVC,
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/format/stream/disposition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,7 @@ bitflags! {
const CAPTIONS = AV_DISPOSITION_CAPTIONS;
const DESCRIPTIONS = AV_DISPOSITION_DESCRIPTIONS;
const METADATA = AV_DISPOSITION_METADATA;
#[cfg(feature = "ffmpeg_7_1")]
const MULTILAYER = AV_DISPOSITION_MULTILAYER;
}
}
21 changes: 21 additions & 0 deletions src/util/color/space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ pub enum Space {
ChromaDerivedNCL,
ChromaDerivedCL,
ICTCP,

#[cfg(feature = "ffmpeg_7_1")]
IPT_C2,
#[cfg(feature = "ffmpeg_7_1")]
YCGCO_RE,
#[cfg(feature = "ffmpeg_7_1")]
YCGCO_RO,
}

impl Space {
Expand Down Expand Up @@ -59,6 +66,13 @@ impl From<AVColorSpace> for Space {
AVCOL_SPC_CHROMA_DERIVED_NCL => Space::ChromaDerivedNCL,
AVCOL_SPC_CHROMA_DERIVED_CL => Space::ChromaDerivedCL,
AVCOL_SPC_ICTCP => Space::ICTCP,

#[cfg(feature = "ffmpeg_7_1")]
AVCOL_SPC_IPT_C2 => Space::IPT_C2,
#[cfg(feature = "ffmpeg_7_1")]
AVCOL_SPC_YCGCO_RE => Space::YCGCO_RE,
#[cfg(feature = "ffmpeg_7_1")]
AVCOL_SPC_YCGCO_RO => Space::YCGCO_RO,
}
}
}
Expand All @@ -82,6 +96,13 @@ impl From<Space> for AVColorSpace {
Space::ChromaDerivedNCL => AVCOL_SPC_CHROMA_DERIVED_NCL,
Space::ChromaDerivedCL => AVCOL_SPC_CHROMA_DERIVED_CL,
Space::ICTCP => AVCOL_SPC_ICTCP,

#[cfg(feature = "ffmpeg_7_1")]
Space::IPT_C2 => AVCOL_SPC_IPT_C2,
#[cfg(feature = "ffmpeg_7_1")]
Space::YCGCO_RE => AVCOL_SPC_YCGCO_RE,
#[cfg(feature = "ffmpeg_7_1")]
Space::YCGCO_RO => AVCOL_SPC_YCGCO_RO,
}
}
}
15 changes: 15 additions & 0 deletions src/util/frame/side_data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ pub enum Type {

#[cfg(feature = "ffmpeg_6_1")]
VIDEO_HINT,

#[cfg(feature = "ffmpeg_7_1")]
LCEVC,
#[cfg(feature = "ffmpeg_7_1")]
VIEW_ID,
}

impl Type {
Expand Down Expand Up @@ -132,6 +137,11 @@ impl From<AVFrameSideDataType> for Type {

#[cfg(feature = "ffmpeg_6_1")]
AV_FRAME_DATA_VIDEO_HINT => Type::VIDEO_HINT,

#[cfg(feature = "ffmpeg_7_1")]
AV_FRAME_DATA_LCEVC => Type::LCEVC,
#[cfg(feature = "ffmpeg_7_1")]
AV_FRAME_DATA_VIEW_ID => Type::VIEW_ID,
}
}
}
Expand Down Expand Up @@ -193,6 +203,11 @@ impl From<Type> for AVFrameSideDataType {

#[cfg(feature = "ffmpeg_6_1")]
Type::VIDEO_HINT => AV_FRAME_DATA_VIDEO_HINT,

#[cfg(feature = "ffmpeg_7_1")]
Type::LCEVC => AV_FRAME_DATA_LCEVC,
#[cfg(feature = "ffmpeg_7_1")]
Type::VIEW_ID => AV_FRAME_DATA_VIEW_ID,
}
}
}
Expand Down
9 changes: 9 additions & 0 deletions src/util/option/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ pub enum Type {
FlagArray,
c_ulong,
bool,

#[cfg(feature = "ffmpeg_7_1")]
UInt,
}

impl From<AVOptionType> for Type {
Expand Down Expand Up @@ -58,6 +61,9 @@ impl From<AVOptionType> for Type {
AV_OPT_TYPE_CHLAYOUT => Type::ChannelLayout,
#[cfg(feature = "ffmpeg_7_0")]
AV_OPT_TYPE_FLAG_ARRAY => Type::FlagArray,

#[cfg(feature = "ffmpeg_7_1")]
AV_OPT_TYPE_UINT => Type::UInt,
}
}
}
Expand Down Expand Up @@ -90,6 +96,9 @@ impl From<Type> for AVOptionType {
Type::ChannelLayout => AV_OPT_TYPE_CHLAYOUT,
#[cfg(feature = "ffmpeg_7_0")]
Type::FlagArray => AV_OPT_TYPE_FLAG_ARRAY,

#[cfg(feature = "ffmpeg_7_1")]
Type::UInt => AV_OPT_TYPE_UINT,
}
}
}

0 comments on commit a7b50dd

Please sign in to comment.