From 22281844bbd2fb1cf8e7cfcc3bbfde8fcc6f10c5 Mon Sep 17 00:00:00 2001 From: Y0ba <1163958+Y0ba@users.noreply.github.com> Date: Sun, 5 Jun 2022 21:42:36 +0000 Subject: [PATCH] Fix x265 2-pass params (#636) * Fix x265 2-pass params * Add --level-idc in x265 default params --- av1an-core/src/encoder.rs | 41 ++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/av1an-core/src/encoder.rs b/av1an-core/src/encoder.rs index 3b84617..23464ba 100644 --- a/av1an-core/src/encoder.rs +++ b/av1an-core/src/encoder.rs @@ -208,16 +208,23 @@ impl Encoder { Self::x265 => chain!( into_array![ "x265", - "--stitchable", + "--repeat-headers", "--log-level", "error", "--pass", "1", - "--demuxer", - "y4m", + "--y4m", ], params, - into_array!["--stats", format!("{}.log", fpf), "-", "-o", NULL] + into_array![ + "--stats", + format!("{}.log", fpf), + "--analysis-reuse-file", + format!("{}_analysis.dat", fpf), + "-", + "-o", + NULL + ] ) .collect(), } @@ -283,16 +290,23 @@ impl Encoder { Self::x265 => chain!( into_array![ "x265", - "--stitchable", + "--repeat-headers", "--log-level", "error", "--pass", "2", - "--demuxer", - "y4m", + "--y4m", ], params, - into_array!["--stats", format!("{}.log", fpf), "-", "-o", output] + into_array![ + "--stats", + format!("{}.log", fpf), + "--analysis-reuse-file", + format!("{}_analysis.dat", fpf), + "-", + "-o", + output + ] ) .collect(), } @@ -395,7 +409,16 @@ impl Encoder { } } Encoder::x264 => into_vec!["--preset", "slow", "--crf", "25"], - Encoder::x265 => into_vec!["-p", "slow", "--crf", "25", "-D", "10"], + Encoder::x265 => into_vec![ + "-p", + "slow", + "--crf", + "25", + "-D", + "10", + "--level-idc", + "5.0" + ], } }