From 8e2b72c4317c69b77213ed79f4e81a1575acd27d Mon Sep 17 00:00:00 2001
From: Dominic <git@msrd0.de>
Date: Tue, 16 Jan 2024 00:24:12 +0100
Subject: [PATCH] allow specifying the start resolution for transcoding

---
 src/main.rs | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/main.rs b/src/main.rs
index 392a5ee..0b49c00 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -44,6 +44,10 @@ struct Args {
 	#[clap(short, long)]
 	transcode: Option<Resolution>,
 
+	/// Transcode starts at this resolution, or the source resolution, whichever is lower.
+	#[clap(short = 'T', long, default_value = "1440p")]
+	transcode_start: Resolution,
+
 	/// Treat the audio as stereo. By default, only one channel from the input stereo will
 	/// be used, assuming either the other channel is backup or the same as the used.
 	#[clap(short, long, default_value = "false")]
@@ -333,7 +337,8 @@ fn main() {
 	// rescale the video
 	if let Some(lowest_res) = args.transcode {
 		for res in Resolution::values().into_iter().rev() {
-			if res >= project.source.metadata.as_ref().unwrap().source_res
+			if res > project.source.metadata.as_ref().unwrap().source_res
+				|| res > args.transcode_start
 				|| res < lowest_res
 			{
 				continue;
-- 
GitLab