From 2d00cb504d913fc7b84da3a3f2fdc3dd4bd859de Mon Sep 17 00:00:00 2001 From: devilish-crow Date: Sat, 25 Oct 2025 21:21:49 +0300 Subject: [PATCH 1/2] Updated ABI to FFMPEG 8 --- crates/ffmpeg/src/enums/av_fmt_flags.rs | 6 ++++-- crates/ffmpeg/src/frame.rs | 2 +- .../scuffle_ffmpeg__io__input__tests__receive_packet.snap | 2 +- ...put__tests__test_output_write_mp4_fragmented_header.snap | 3 +-- ...g__io__output__tests__test_output_write_mp4_trailer.snap | 3 +-- .../scuffle_ffmpeg__decoder__tests__test_decoder_audio.snap | 2 +- ...e_ffmpeg__encoder__tests__test_encoder_encode_video.snap | 3 +-- 7 files changed, 10 insertions(+), 11 deletions(-) diff --git a/crates/ffmpeg/src/enums/av_fmt_flags.rs b/crates/ffmpeg/src/enums/av_fmt_flags.rs index 4882553060..2c45209112 100644 --- a/crates/ffmpeg/src/enums/av_fmt_flags.rs +++ b/crates/ffmpeg/src/enums/av_fmt_flags.rs @@ -92,7 +92,8 @@ nutype_enum! { /// Allows flushing of buffered data. /// - **Used for**: Streaming formats that support mid-stream flushing. /// - **Equivalent to**: `AVFMT_ALLOW_FLUSH` - AllowFlush = AVFMT_ALLOW_FLUSH as _, + /// Deprecated in FFMPEG 8.0, see https://ffmpeg.org/pipermail/ffmpeg-devel/2023-September/314836.html + /// AllowFlush = AVFMT_ALLOW_FLUSH as _, /// The format does not require strict timestamp ordering. /// - **Used for**: Formats where out-of-order timestamps are common. @@ -231,7 +232,8 @@ nutype_enum! { /// - **Used for**: Ensuring synchronization in multi-stream files. /// - **Binary representation**: `0b0100000000000000` /// - **Equivalent to**: `AVFMT_FLAG_SHORTEST` - Shortest = AVFMT_FLAG_SHORTEST as _, + /// Deprecated in FFMPEG 8.0, see https://ffmpeg.org/pipermail/ffmpeg-devel/2023-August/313668.html + /// Shortest = AVFMT_FLAG_SHORTEST as _, /// **Automatically apply bitstream filters**. /// - **Used for**: Simplifying format conversions. diff --git a/crates/ffmpeg/src/frame.rs b/crates/ffmpeg/src/frame.rs index 075d6118bb..12a552e01c 100644 --- a/crates/ffmpeg/src/frame.rs +++ b/crates/ffmpeg/src/frame.rs @@ -376,7 +376,7 @@ impl VideoFrame { /// Returns true if the frame is a keyframe. pub const fn is_keyframe(&self) -> bool { - self.0.0.as_deref_except().key_frame != 0 + (self.0.0.as_deref_except().flags & AV_FRAME_FLAG_KEY as i32) != 0 } /// Returns the picture type of the frame. diff --git a/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__input__tests__receive_packet.snap b/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__input__tests__receive_packet.snap index 18e87a865d..312eeecc17 100644 --- a/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__input__tests__receive_packet.snap +++ b/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__input__tests__receive_packet.snap @@ -2172,7 +2172,7 @@ expression: packets 47104, ), duration: Some( - 992, + 1024, ), pos: Some( 247025, diff --git a/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__output__tests__test_output_write_mp4_fragmented_header.snap b/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__output__tests__test_output_write_mp4_fragmented_header.snap index 91df6cf1af..b05b1783e2 100644 --- a/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__output__tests__test_output_write_mp4_fragmented_header.snap +++ b/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__output__tests__test_output_write_mp4_fragmented_header.snap @@ -1,7 +1,6 @@ --- source: crates/ffmpeg/src/io/output.rs expression: get_boxes!(output) -snapshot_kind: text --- [ Ftyp( @@ -445,7 +444,7 @@ snapshot_kind: text BoxHeader { box_type: b"udta", }, - b"\0\0\0Ymeta\0\0\0\0\0\0\0!hdlr\0\0\0\0\0\0\0\0mdirappl\0\0\0\0\0\0\0\0\0\0\0\0,ilst\0\0\0$\xa9too\0\0\0\x1cdata\0\0\0\x01\0\0\0\0Lavf61.7.100", + b"\0\0\0Ymeta\0\0\0\0\0\0\0!hdlr\0\0\0\0\0\0\0\0mdirappl\0\0\0\0\0\0\0\0\0\0\0\0,ilst\0\0\0$\xa9too\0\0\0\x1cdata\0\0\0\x01\0\0\0\0Lavf62.3.100", ), ), ], diff --git a/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__output__tests__test_output_write_mp4_trailer.snap b/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__output__tests__test_output_write_mp4_trailer.snap index d784fec32e..e29739fc02 100644 --- a/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__output__tests__test_output_write_mp4_trailer.snap +++ b/crates/ffmpeg/src/io/snapshots/scuffle_ffmpeg__io__output__tests__test_output_write_mp4_trailer.snap @@ -1,7 +1,6 @@ --- source: crates/ffmpeg/src/io/output.rs expression: get_boxes!(output) -snapshot_kind: text --- [ Ftyp( @@ -1123,7 +1122,7 @@ snapshot_kind: text BoxHeader { box_type: b"udta", }, - b"\0\0\0Ymeta\0\0\0\0\0\0\0!hdlr\0\0\0\0\0\0\0\0mdirappl\0\0\0\0\0\0\0\0\0\0\0\0,ilst\0\0\0$\xa9too\0\0\0\x1cdata\0\0\0\x01\0\0\0\0Lavf61.7.100", + b"\0\0\0Ymeta\0\0\0\0\0\0\0!hdlr\0\0\0\0\0\0\0\0mdirappl\0\0\0\0\0\0\0\0\0\0\0\0,ilst\0\0\0$\xa9too\0\0\0\x1cdata\0\0\0\x01\0\0\0\0Lavf62.3.100", ), ), ], diff --git a/crates/ffmpeg/src/snapshots/scuffle_ffmpeg__decoder__tests__test_decoder_audio.snap b/crates/ffmpeg/src/snapshots/scuffle_ffmpeg__decoder__tests__test_decoder_audio.snap index 09e2f0bfea..2965004e2e 100644 --- a/crates/ffmpeg/src/snapshots/scuffle_ffmpeg__decoder__tests__test_decoder_audio.snap +++ b/crates/ffmpeg/src/snapshots/scuffle_ffmpeg__decoder__tests__test_decoder_audio.snap @@ -1118,7 +1118,7 @@ expression: audio_frames 47104, ), duration: Some( - 992, + 1024, ), best_effort_timestamp: Some( 47104, diff --git a/crates/ffmpeg/src/snapshots/scuffle_ffmpeg__encoder__tests__test_encoder_encode_video.snap b/crates/ffmpeg/src/snapshots/scuffle_ffmpeg__encoder__tests__test_encoder_encode_video.snap index 60310c8fbc..4ecf9bd47f 100644 --- a/crates/ffmpeg/src/snapshots/scuffle_ffmpeg__encoder__tests__test_encoder_encode_video.snap +++ b/crates/ffmpeg/src/snapshots/scuffle_ffmpeg__encoder__tests__test_encoder_encode_video.snap @@ -1,7 +1,6 @@ --- source: crates/ffmpeg/src/encoder.rs expression: "&boxes" -snapshot_kind: text --- [ Ftyp( @@ -742,7 +741,7 @@ snapshot_kind: text BoxHeader { box_type: b"udta", }, - b"\0\0\0Ymeta\0\0\0\0\0\0\0!hdlr\0\0\0\0\0\0\0\0mdirappl\0\0\0\0\0\0\0\0\0\0\0\0,ilst\0\0\0$\xa9too\0\0\0\x1cdata\0\0\0\x01\0\0\0\0Lavf61.7.100", + b"\0\0\0Ymeta\0\0\0\0\0\0\0!hdlr\0\0\0\0\0\0\0\0mdirappl\0\0\0\0\0\0\0\0\0\0\0\0,ilst\0\0\0$\xa9too\0\0\0\x1cdata\0\0\0\x01\0\0\0\0Lavf62.3.100", ), ), ], From 97e30e7c27109dcf7e683d9dac7db598c306c0ed Mon Sep 17 00:00:00 2001 From: devilish-crow Date: Sat, 25 Oct 2025 21:39:41 +0300 Subject: [PATCH 2/2] Added changelog --- changes.d/pr-641.toml | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 changes.d/pr-641.toml diff --git a/changes.d/pr-641.toml b/changes.d/pr-641.toml new file mode 100644 index 0000000000..e386c0682f --- /dev/null +++ b/changes.d/pr-641.toml @@ -0,0 +1,5 @@ +[[scuffle-ffmpeg]] +breaking = true +category = "feat" +description = "Added support for FFMPEG 8.0" +authors = ["@devilish-crow"]