Add film grain parameter to video encoding with configurable amount

This commit is contained in:
Esa Kataja
2025-04-17 12:42:44 +03:00
parent a30791a036
commit c7a381c4b9
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -30,7 +30,8 @@ def main(
nosubtitles: bool = typer.Option(False, "-ns", "--nosubtitles", help="Remove subtitles"),
preset: int = typer.Option(2, "-p", "--preset", help="Encoding preset"),
crf: int = typer.Option(30, "-c", "--crf", help="CRF value"),
original_media_type: str = typer.Option("DVD", "-o", "--original-media-type", help="Set the ORIGINAL_MEDIA_TYPE metadata")
original_media_type: str = typer.Option("DVD", "-o", "--original-media-type", help="Set the ORIGINAL_MEDIA_TYPE metadata"),
film_grain: int = typer.Option(20, "-fg", "--film-grain", help="Film grain amount (default: 20)")
):
video_details = VideoFile(
imdb=imdb, video_path=filename, allow_subtitle=not nosubtitles
@@ -53,6 +54,7 @@ def main(
stream.preset = preset
stream.crf = crf
stream.original_media_type = original_media_type
stream.film_grain = film_grain
export_data = " ".join(data.cmd())
export_path = Path(filename).parent / "encode.sh"
write_shell_script(export_data, export_path)