mirror of
https://github.com/master-of-zen/Av1an.git
synced 2024-11-25 10:40:51 +00:00
Ensure that ffms2/lsmash exists if specified
This commit is contained in:
parent
af87153259
commit
9897290f65
2 changed files with 24 additions and 2 deletions
|
@ -1,3 +1,4 @@
|
|||
use crate::vapoursynth::{is_ffms2_installed, is_lsmash_installed};
|
||||
use crate::{
|
||||
broker::{Broker, EncoderCrash},
|
||||
chunk::Chunk,
|
||||
|
@ -466,6 +467,19 @@ impl EncodeArgs {
|
|||
properly into a mkv file. Specify mkvmerge as the concatenation method by setting `--concat mkvmerge`.");
|
||||
}
|
||||
|
||||
if self.chunk_method == ChunkMethod::LSMASH {
|
||||
ensure!(
|
||||
is_lsmash_installed(),
|
||||
"LSMASH is not installed, but it was specified as the chunk method"
|
||||
);
|
||||
}
|
||||
if self.chunk_method == ChunkMethod::FFMS2 {
|
||||
ensure!(
|
||||
is_ffms2_installed(),
|
||||
"FFMS2 is not installed, but it was specified as the chunk method"
|
||||
);
|
||||
}
|
||||
|
||||
if let Some(vmaf_path) = &self.vmaf_path {
|
||||
ensure!(vmaf_path.exists());
|
||||
}
|
||||
|
|
|
@ -35,10 +35,18 @@ static VAPOURSYNTH_PLUGINS: Lazy<HashSet<String>> = Lazy::new(|| {
|
|||
.collect()
|
||||
});
|
||||
|
||||
pub fn is_lsmash_installed() -> bool {
|
||||
VAPOURSYNTH_PLUGINS.contains("systems.innocent.lsmas")
|
||||
}
|
||||
|
||||
pub fn is_ffms2_installed() -> bool {
|
||||
VAPOURSYNTH_PLUGINS.contains("com.vapoursynth.ffms2")
|
||||
}
|
||||
|
||||
pub fn best_available_chunk_method() -> ChunkMethod {
|
||||
if VAPOURSYNTH_PLUGINS.contains("systems.innocent.lsmas") {
|
||||
if is_lsmash_installed() {
|
||||
ChunkMethod::LSMASH
|
||||
} else if VAPOURSYNTH_PLUGINS.contains("com.vapoursynth.ffms2") {
|
||||
} else if is_ffms2_installed() {
|
||||
ChunkMethod::FFMS2
|
||||
} else {
|
||||
ChunkMethod::Hybrid
|
||||
|
|
Loading…
Reference in a new issue