mirror of
https://github.com/crunchy-labs/crunchy-cli.git
synced 2026-01-21 04:02:00 -06:00
Remove duplicated subtitles on archive audio merge
This commit is contained in:
parent
bd20c5a7b6
commit
c97adb3ce7
2 changed files with 25 additions and 3 deletions
|
|
@ -446,7 +446,15 @@ impl Filter for ArchiveFilter {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|d| (d.audio.clone(), d.format.audio.clone()))
|
.map(|d| (d.audio.clone(), d.format.audio.clone()))
|
||||||
.collect(),
|
.collect(),
|
||||||
subtitles: data.iter().map(|d| d.subtitles.clone()).flatten().collect(),
|
// mix all subtitles together and then reduce them via a map so that only one
|
||||||
|
// subtitle per language exists
|
||||||
|
subtitles: data
|
||||||
|
.iter()
|
||||||
|
.flat_map(|d| d.subtitles.clone())
|
||||||
|
.map(|s| (s.locale.clone(), s))
|
||||||
|
.collect::<HashMap<Locale, Subtitle>>()
|
||||||
|
.into_values()
|
||||||
|
.collect(),
|
||||||
}),
|
}),
|
||||||
MergeBehavior::Auto => {
|
MergeBehavior::Auto => {
|
||||||
let mut download_formats: HashMap<Duration, DownloadFormat> = HashMap::new();
|
let mut download_formats: HashMap<Duration, DownloadFormat> = HashMap::new();
|
||||||
|
|
|
||||||
|
|
@ -285,7 +285,14 @@ impl FFmpegPreset {
|
||||||
if let Some(hwaccel) = hwaccel_opt {
|
if let Some(hwaccel) = hwaccel_opt {
|
||||||
match hwaccel {
|
match hwaccel {
|
||||||
FFmpegHwAccel::Nvidia => {
|
FFmpegHwAccel::Nvidia => {
|
||||||
input.extend(["-hwaccel", "cuda", "-hwaccel_output_format", "cuda", "-c:v", "h264_cuvid"]);
|
input.extend([
|
||||||
|
"-hwaccel",
|
||||||
|
"cuda",
|
||||||
|
"-hwaccel_output_format",
|
||||||
|
"cuda",
|
||||||
|
"-c:v",
|
||||||
|
"h264_cuvid",
|
||||||
|
]);
|
||||||
output.extend(["-c:v", "h264_nvenc", "-c:a", "copy"])
|
output.extend(["-c:v", "h264_nvenc", "-c:a", "copy"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -303,7 +310,14 @@ impl FFmpegPreset {
|
||||||
if let Some(hwaccel) = hwaccel_opt {
|
if let Some(hwaccel) = hwaccel_opt {
|
||||||
match hwaccel {
|
match hwaccel {
|
||||||
FFmpegHwAccel::Nvidia => {
|
FFmpegHwAccel::Nvidia => {
|
||||||
input.extend(["-hwaccel", "cuda", "-hwaccel_output_format", "cuda", "-c:v", "h264_cuvid"]);
|
input.extend([
|
||||||
|
"-hwaccel",
|
||||||
|
"cuda",
|
||||||
|
"-hwaccel_output_format",
|
||||||
|
"cuda",
|
||||||
|
"-c:v",
|
||||||
|
"h264_cuvid",
|
||||||
|
]);
|
||||||
output.extend(["-c:v", "hevc_nvenc", "-c:a", "copy"])
|
output.extend(["-c:v", "hevc_nvenc", "-c:a", "copy"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue