Add Avisynth video encoding workflow
This commit is contained in:
+3
-44
@@ -8,43 +8,12 @@ onto the script and choose which is the source.
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from tools.console import pause_if_interactive, prompt_input
|
||||
from tools.exiftool import require_exiftool
|
||||
|
||||
|
||||
EXCLUDED_COPY_TAGS = [
|
||||
"--File:all",
|
||||
"--ExifTool:all",
|
||||
"--Composite:all",
|
||||
"--SourceFile",
|
||||
"--Directory",
|
||||
"--FileName",
|
||||
"--FileSize",
|
||||
"--FileModifyDate",
|
||||
"--FileAccessDate",
|
||||
"--FileInodeChangeDate",
|
||||
"--FilePermissions",
|
||||
"--FileType",
|
||||
"--FileTypeExtension",
|
||||
"--MIMEType",
|
||||
"--ImageWidth",
|
||||
"--ImageHeight",
|
||||
"--ExifImageWidth",
|
||||
"--ExifImageHeight",
|
||||
"--PixelXDimension",
|
||||
"--PixelYDimension",
|
||||
"--RelatedImageWidth",
|
||||
"--RelatedImageHeight",
|
||||
"--ImageSize",
|
||||
"--Megapixels",
|
||||
"--XResolution",
|
||||
"--YResolution",
|
||||
"--ResolutionUnit",
|
||||
]
|
||||
from tools.metadata_copy import copy_meaningful_metadata
|
||||
|
||||
|
||||
def prompt_path(prompt: str) -> Path:
|
||||
@@ -93,18 +62,8 @@ def resolve_files(argv: list[str]) -> tuple[Path, Path] | None:
|
||||
def copy_metadata(exiftool: str, source: Path, destination: Path) -> int:
|
||||
print(f"Source: {source}")
|
||||
print(f"Destination: {destination}", flush=True)
|
||||
command = [
|
||||
exiftool,
|
||||
"-overwrite_original",
|
||||
"-TagsFromFile",
|
||||
str(source),
|
||||
"-all:all",
|
||||
*EXCLUDED_COPY_TAGS,
|
||||
"-charset",
|
||||
"filename=UTF8",
|
||||
str(destination),
|
||||
]
|
||||
return subprocess.run(command).returncode
|
||||
copy_meaningful_metadata(exiftool, source, destination)
|
||||
return 0
|
||||
|
||||
|
||||
def run(argv: list[str]) -> int:
|
||||
|
||||
Reference in New Issue
Block a user