Enhance Avisynth video workflow and metadata tools
This commit is contained in:
@@ -4,6 +4,7 @@ import subprocess
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
from tools.avisynth_paths import avs_path
|
||||
from tools.console import clear_screen
|
||||
from tools.avisynth_runner import AvisynthRunnerSet
|
||||
from tools.avisynth_render import AvisynthClipInfo, run_validation_script
|
||||
@@ -161,7 +162,7 @@ def _run_import_diagnostics(
|
||||
),
|
||||
(
|
||||
"import-helper",
|
||||
f'Import("{_avs_path(str(helper.resolve()))}")\n'
|
||||
f'Import("{avs_path(str(helper.resolve()))}")\n'
|
||||
'BlankClip(length=1, width=16, height=16, pixel_type="YV12")\n',
|
||||
),
|
||||
]
|
||||
@@ -169,7 +170,7 @@ def _run_import_diagnostics(
|
||||
cases.append(
|
||||
(
|
||||
"load-ffms2",
|
||||
f'LoadPlugin("{_avs_path(str(Path(plugin_path).resolve()))}")\n'
|
||||
f'LoadPlugin("{avs_path(str(Path(plugin_path).resolve()))}")\n'
|
||||
'BlankClip(length=1, width=16, height=16, pixel_type="YV12")\n',
|
||||
)
|
||||
)
|
||||
@@ -178,19 +179,19 @@ def _run_import_diagnostics(
|
||||
(
|
||||
"ffvideo",
|
||||
_optional_load_plugin(plugin_path)
|
||||
+ f'FFVideoSource("{_avs_path(str(Path(source_path).resolve()))}", '
|
||||
+ f'cachefile="{_avs_path(str((source_dir / (stem + ".diag.ffindex")).resolve()))}")\n',
|
||||
+ f'FFVideoSource("{avs_path(str(Path(source_path).resolve()))}", '
|
||||
+ f'cachefile="{avs_path(str((source_dir / (stem + ".diag.ffindex")).resolve()))}")\n',
|
||||
),
|
||||
(
|
||||
"hidden-source",
|
||||
"mbt_video_only = true\n"
|
||||
f'Import("{_avs_path(str(hidden_source.resolve()))}")\n'
|
||||
f'Import("{avs_path(str(hidden_source.resolve()))}")\n'
|
||||
"last\n",
|
||||
),
|
||||
(
|
||||
"editable",
|
||||
"mbt_video_only = true\n"
|
||||
f'Import("{_avs_path(str(visible.resolve()))}")\n'
|
||||
f'Import("{avs_path(str(visible.resolve()))}")\n'
|
||||
"last\n",
|
||||
),
|
||||
]
|
||||
@@ -228,11 +229,7 @@ def _remove_validation_artifacts(csv_path: Path) -> None:
|
||||
def _optional_load_plugin(plugin_path: str | None) -> str:
|
||||
if not plugin_path:
|
||||
return ""
|
||||
return f'LoadPlugin("{_avs_path(str(Path(plugin_path).resolve()))}")\n'
|
||||
|
||||
|
||||
def _avs_path(path: str) -> str:
|
||||
return path.replace("\\", "/").replace('"', '\\"')
|
||||
return f'LoadPlugin("{avs_path(str(Path(plugin_path).resolve()))}")\n'
|
||||
|
||||
|
||||
def _indent(text: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user