Skip to content

Commit 39b5f73

Browse files
committed
Adapt for FFmpeg 8.0
1 parent 63699f4 commit 39b5f73

3 files changed

Lines changed: 6838 additions & 4464 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
libopus-dev
7272
7373
- run: |
74-
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/7.1
74+
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/8.0
7575
cd ffmpeg
7676
mkdir build
7777
cd build
@@ -84,7 +84,7 @@ jobs:
8484
- run: |
8585
FFMPEG_INCLUDE_DIR=${HOME}/ffmpeg_build/include \
8686
FFMPEG_PKG_CONFIG_PATH=${HOME}/ffmpeg_build/lib/pkgconfig \
87-
cargo clippy -- -D warnings
87+
cargo clippy --features ffmpeg8 -- -D warnings
8888
8989
rust_clippy_check_windows:
9090
runs-on: windows-latest
@@ -290,7 +290,7 @@ jobs:
290290
# Disable exr,phm to workaround "multiple definition of 'ff_init_half2float_tables'"
291291
# Ref: `https://github.com/larksuite/rsmpeg/pull/98#issuecomment-1467511193`
292292
- run: |
293-
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/7.1
293+
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/8.0
294294
cd ffmpeg
295295
mkdir build
296296
cd build
@@ -304,7 +304,7 @@ jobs:
304304
run: |
305305
FFMPEG_INCLUDE_DIR=${HOME}/ffmpeg_build/include \
306306
FFMPEG_PKG_CONFIG_PATH=${HOME}/ffmpeg_build/lib/pkgconfig \
307-
cargo test --verbose
307+
cargo test --features ffmpeg8 --verbose
308308
309309
- name: Run Slice Example
310310
run: |
@@ -452,7 +452,7 @@ jobs:
452452
453453
- name: Build FFmpeg dylib
454454
run: |
455-
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/7.1
455+
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/8.0
456456
cd ffmpeg
457457
mkdir build
458458
cd build
@@ -462,7 +462,6 @@ jobs:
462462
--enable-small \
463463
--disable-debug \
464464
--disable-programs \
465-
--disable-postproc \
466465
--disable-doc \
467466
--disable-hwaccels \
468467
--disable-parsers \
@@ -508,8 +507,8 @@ jobs:
508507
LD_LIBRARY_PATH: ${{ github.workspace }}/ffmpeg_prebuilt/lib/
509508
run: |
510509
cp -r ~/ffmpeg_prebuilt ${{ github.workspace }}/ffmpeg_prebuilt
511-
cargo build --example slice
512-
cargo run --example slice
510+
cargo build --example slice --features ffmpeg8
511+
cargo run --example slice --features ffmpeg8
513512
514513
build_dynamic_and_test_macos:
515514
runs-on: macos-latest
@@ -535,7 +534,7 @@ jobs:
535534
536535
- name: Build FFmpeg dylib
537536
run: |
538-
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/7.1
537+
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/8.0
539538
cd ffmpeg
540539
mkdir build
541540
cd build
@@ -545,7 +544,6 @@ jobs:
545544
--enable-small \
546545
--disable-debug \
547546
--disable-programs \
548-
--disable-postproc \
549547
--disable-doc \
550548
--disable-hwaccels \
551549
--disable-parsers \
@@ -591,9 +589,9 @@ jobs:
591589
FFMPEG_DLL_PATH: ${{ github.workspace }}/ffmpeg_prebuilt/lib/libffmpeg.dylib
592590
run: |
593591
cp -r ~/ffmpeg_prebuilt ${{ github.workspace }}/ffmpeg_prebuilt
594-
cargo build --example slice
592+
cargo build --example slice --features ffmpeg8
595593
cp ${{ github.workspace }}/ffmpeg_prebuilt/lib/libffmpeg.dylib .
596-
cargo run --example slice
594+
cargo run --example slice --features ffmpeg8
597595
598596
build_dynamic_and_test_windows_pre:
599597
runs-on: ubuntu-latest
@@ -622,7 +620,7 @@ jobs:
622620
cd ../..
623621
- name: Build FFmpeg
624622
run: |
625-
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/7.1
623+
git clone https://github.com/ffmpeg/ffmpeg --depth 1 --single-branch --branch release/8.0
626624
cd ffmpeg
627625
mkdir build
628626
cd build
@@ -631,7 +629,6 @@ jobs:
631629
--enable-small \
632630
--disable-debug \
633631
--disable-programs \
634-
--disable-postproc \
635632
--disable-doc \
636633
--disable-hwaccels \
637634
--disable-parsers \
@@ -663,6 +660,8 @@ jobs:
663660
-lgdi32 \
664661
-lpsapi \
665662
-lole32 \
663+
-lcrypt32 \
664+
-lncrypt \
666665
-lstrmiids \
667666
-luuid \
668667
-loleaut32 \
@@ -717,9 +716,9 @@ jobs:
717716
LIBCLANG_PATH: ${{ github.workspace }}/clang/lib
718717
LLVM_CONFIG_PATH: ${{ github.workspace }}/clang/bin/llvm-config
719718
run: |
720-
cargo build --target i686-pc-windows-msvc --example slice
719+
cargo build --target i686-pc-windows-msvc --example slice --features ffmpeg8
721720
copy ${{ github.workspace }}/ffmpeg_prebuilt_cross/lib/libffmpeg.dll .
722-
cargo run --target i686-pc-windows-msvc --example slice
721+
cargo run --target i686-pc-windows-msvc --example slice --features ffmpeg8
723722
724723
# Check if correct documentation can be generated by docs.rs
725724
docs_rs_check:

examples/slice/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,11 @@ fn decode_packet(
176176
));
177177
} else {
178178
println!(
179-
"Frame {} (type={}, size={} bytes) pts {} key_frame {}",
179+
"Frame {} (type={}, size={} bytes) pts {}",
180180
codec_context.frame_num,
181181
unsafe { ffi::av_get_picture_type_char(frame.pict_type) },
182-
frame.pkt_size,
182+
frame.linesize[0] * frame.height,
183183
frame.pts,
184-
frame.key_frame,
185184
);
186185

187186
let frame_filename = format!(

0 commit comments

Comments
 (0)