feat: v0.1.3

refactor: everything now goes into a sub folder `dv_check`
refactor: updated the failure prints when detecting/not detecting FEL
This commit is contained in:
jlw4049 2024-07-23 13:20:06 -04:00
parent ad19fd94be
commit 85641b680d

@ -6,7 +6,7 @@ from pathlib import Path
from pymediainfo import MediaInfo
from typing import Optional, Tuple
__version__ = "0.1.2"
__version__ = "0.1.3"
def exit_print(message: Optional[str] = "", exit_code: Optional[int] = 0) -> None:
@ -66,7 +66,9 @@ def parse_arguments() -> Tuple[Path, Path, Path, bool, bool, Path]:
def data_path(file_input: Path, working_dir: Path) -> Path:
return working_dir / f"{file_input.stem}_el_data.json"
json_output = working_dir / "dv_check" / f"{file_input.stem}_el_data.json"
json_output.parent.mkdir(exist_ok=True, parents=True)
return json_output
def load_existing_data(file_input: Path, working_dir: Path) -> Optional[dict]:
@ -177,7 +179,9 @@ def create_fel(
return el_path
el_output_path = (
working_dir / file_input.with_name(f"{file_input.stem}_el.hevc").name
working_dir
/ "dv_check"
/ file_input.with_name(f"{file_input.stem}_el.hevc").name
)
el_mkv_output_path = el_output_path.with_suffix(".mkv")
@ -250,12 +254,19 @@ if __name__ == "__main__":
el_type = existing_data.get("EL")
if el_type:
if el_type != "FEL" and create_fel_mkv:
exit_print("EL layer is not FEL, select a different template", 1)
exit_print(
"You have loaded a Dolby Vision source file that does NOT have a Full "
"Enhancement Layer (FEL). You must load a standard template to continue "
"processing this file.",
1,
)
print(f"Data loaded, EL type: {el_type}")
if el_type == "FEL":
if prompt:
exit_print(
"You are required to use a FEL template to process this file",
"You have loaded a Dolby Vision source file with a Full Enhancement "
"Layer (FEL). You must load a FEL-enabled template to continue "
"processing this file.",
1,
)
if create_fel_mkv:
@ -267,13 +278,20 @@ if __name__ == "__main__":
rpu = read_rpu(file_input, ffmpeg, dovi_tool, working_dir)
if rpu:
if rpu != "FEL" and create_fel_mkv:
exit_print("EL layer is not FEL, select a different template", 1)
exit_print(
"You have loaded a Dolby Vision source file that does NOT have a Full "
"Enhancement Layer (FEL). You must load a standard template to continue "
"processing this file.",
1,
)
if rpu == "MEL":
exit_print("EL layer is MEL, no processing needed", 0)
elif rpu == "FEL":
if prompt:
exit_print(
"You are required to use a FEL template to process this file",
"You have loaded a Dolby Vision source file with a Full Enhancement "
"Layer (FEL). You must load a FEL-enabled template to continue "
"processing this file.",
1,
)
if create_fel_mkv: