From 0115730d608c68d4b54095166d1fabafbf02c476 Mon Sep 17 00:00:00 2001 From: bytedream Date: Tue, 9 Apr 2024 18:36:18 +0200 Subject: [PATCH] Add archive `--sync-start` flag documentation to README --- README.md | 12 +++++++++++- crunchy-cli-core/src/archive/command.rs | 23 ++++++++++++----------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 5463e30..b30852b 100644 --- a/README.md +++ b/README.md @@ -468,7 +468,7 @@ The `archive` command lets you download episodes with multiple audios and subtit - Merge behavior - Due to censorship, some episodes have multiple lengths for different languages. + Due to censorship or additional intros, some episodes have multiple lengths for different languages. In the best case, when multiple audio & subtitle tracks are used, there is only one *video* track and all other languages can be stored as audio-only. But, as said, this is not always the case. With the `-m` / `--merge` flag you can define the behaviour when an episodes' video tracks differ in length. @@ -492,6 +492,16 @@ The `archive` command lets you download episodes with multiple audios and subtit Default are `200` milliseconds. +- Sync start + + If you want that all videos of the same episode should start at the same time and `--merge` doesn't fit your needs (e.g. one video has an intro, all other doesn't), you might consider using the `--sync-start`. + It tries to sync the timing of all downloaded audios to match one video. + This is done by downloading the first few segments/frames of all video tracks that differ in length and comparing them frame by frame. + The flag takes an optional value determines how accurate the syncing is, generally speaking everything over 15 begins to be more inaccurate and everything below 6 is too accurate (and won't succeed). + When the syncing fails, the command is continued as if `--sync-start` wasn't provided for this episode. + + Default is `7.5`. + - Language tagging You can force the usage of a specific language tagging in the output file with the `--language-tagging` flag. diff --git a/crunchy-cli-core/src/archive/command.rs b/crunchy-cli-core/src/archive/command.rs index 234bf68..1c18133 100644 --- a/crunchy-cli-core/src/archive/command.rs +++ b/crunchy-cli-core/src/archive/command.rs @@ -89,17 +89,6 @@ pub struct Archive { #[arg(value_parser = crate::utils::clap::clap_parse_resolution)] pub(crate) resolution: Resolution, - #[arg(help = "Tries to sync the timing of all downloaded audios to match one video")] - #[arg( - long_help = "Tries to sync the timing of all downloaded audios to match one video. \ - This is done by downloading the first few segments/frames of all video tracks that differ in length and comparing them frame by frame. \ - The value of this flag determines how accurate the syncing is, generally speaking everything over 15 begins to be more inaccurate and everything below 6 is too accurate (and won't succeed). \ - If you want to provide a custom value to this flag, you have to set it with an equals (e.g. `--sync-start=10` instead of `--sync-start 10`). \ - When the syncing fails, the command is continued as if `--sync-start` wasn't provided for this episode - " - )] - #[arg(long, require_equals = true, num_args = 0..=1, default_missing_value = "7.5")] - pub(crate) sync_start: Option, #[arg( help = "Sets the behavior of the stream merging. Valid behaviors are 'auto', 'audio' and 'video'" )] @@ -121,6 +110,18 @@ pub struct Archive { help = "Specified which language tagging the audio and subtitle tracks and language specific format options should have. \ Valid options are: 'default' (how Crunchyroll uses it internally), 'ietf' (according to the IETF standard)" )] + #[arg(help = "Tries to sync the timing of all downloaded audios to match one video")] + #[arg( + long_help = "Tries to sync the timing of all downloaded audios to match one video. \ + This is done by downloading the first few segments/frames of all video tracks that differ in length and comparing them frame by frame. \ + The value of this flag determines how accurate the syncing is, generally speaking everything over 15 begins to be more inaccurate and everything below 6 is too accurate (and won't succeed). \ + If you want to provide a custom value to this flag, you have to set it with an equals (e.g. `--sync-start=10` instead of `--sync-start 10`). \ + When the syncing fails, the command is continued as if `--sync-start` wasn't provided for this episode + " + )] + #[arg(long, require_equals = true, num_args = 0..=1, default_missing_value = "7.5")] + pub(crate) sync_start: Option, + #[arg( long_help = "Specified which language tagging the audio and subtitle tracks and language specific format options should have. \ Valid options are: 'default' (how Crunchyroll uses it internally), 'ietf' (according to the IETF standard; you might run in issues as there are multiple locales which resolve to the same IETF language code, e.g. 'es-LA' and 'es-ES' are both resolving to 'es')"