From e6789fc33840ae4940d1a81385a8c28bdc6f5ebc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 1 Dec 2022 15:59:44 +0200 Subject: [PATCH] rav1e: Update to rav1e 0.6 Part-of: --- video/rav1e/Cargo.toml | 2 +- video/rav1e/src/rav1enc/imp.rs | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/video/rav1e/Cargo.toml b/video/rav1e/Cargo.toml index 5a95b707..ca906690 100644 --- a/video/rav1e/Cargo.toml +++ b/video/rav1e/Cargo.toml @@ -11,7 +11,7 @@ rust-version = "1.63" [dependencies] gst = { package = "gstreamer", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.19", version = "0.19.1" } gst-video = { package = "gstreamer-video", git = "https://gitlab.freedesktop.org/gstreamer/gstreamer-rs", branch = "0.19", version = "0.19" } -rav1e = { version = "0.5", default-features = false } +rav1e = { version = "0.6", default-features = false } once_cell = "1.0" atomic_refcell = "0.1" diff --git a/video/rav1e/src/rav1enc/imp.rs b/video/rav1e/src/rav1enc/imp.rs index f349c186..21ceec00 100644 --- a/video/rav1e/src/rav1enc/imp.rs +++ b/video/rav1e/src/rav1enc/imp.rs @@ -166,6 +166,7 @@ impl Context { rav1e::prelude::FrameTypeOverride::No }, opaque: Some(rav1e::prelude::Opaque::new(frame_number)), + t35_metadata: Box::default(), }), )) } @@ -199,6 +200,7 @@ impl Context { rav1e::prelude::FrameTypeOverride::No }, opaque: Some(rav1e::prelude::Opaque::new(frame_number)), + t35_metadata: Box::default(), }), )) } @@ -581,6 +583,10 @@ impl VideoEncoderImpl for Rav1Enc { .with_encoder_config(config::EncoderConfig { width: video_info.width() as usize, height: video_info.height() as usize, + sample_aspect_ratio: rav1e::data::Rational { + num: video_info.par().numer() as u64, + den: video_info.par().denom() as u64, + }, bit_depth: video_info.format_info().depth()[0] as usize, chroma_sampling: match video_info.format() { gst_video::VideoFormat::I420 @@ -748,7 +754,7 @@ impl VideoEncoderImpl for Rav1Enc { None } }, - speed_settings: config::SpeedSettings::from_preset(settings.speed_preset as usize), + speed_settings: config::SpeedSettings::from_preset(settings.speed_preset as u8), time_base: if video_info.fps() != gst::Fraction::new(0, 1) { data::Rational { num: video_info.fps().numer() as u64, @@ -767,11 +773,6 @@ impl VideoEncoderImpl for Rav1Enc { tile_cols: settings.tile_cols, tile_rows: settings.tile_rows, tiles: settings.tiles, - rdo_lookahead_frames: if settings.rdo_lookahead_frames < 0 { - config::SpeedSettings::rdo_lookahead_frames(settings.speed_preset as usize) - } else { - settings.rdo_lookahead_frames as usize - }, tune: match settings.tune { Tune::Psnr => rav1e::prelude::Tune::Psnr, Tune::Psychovisual => rav1e::prelude::Tune::Psychovisual,