Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
![]() |
#2 | Link |
Registered User
Join Date: May 2011
Posts: 372
|
You might not need to create many scripts, because vspipe can load an argument, which in your case would be your source. So you can have only one script saved.
Example running this batch file: Code:
@echo off set "script=E:\scripts\script.vpy" set "vspipe=C:\Program Files\VapourSynth\core\vspipe.exe" set "ffmpeg=E:\tools\ffmpeg.exe" set "directory=E:\videos" set "encoded_directory=E:\new" for %%i in (%directory%\*.*) do call :encode "%%i" pause exit :encode <encoded filepath> if /i "%~x1"==".ffindex" goto :eof echo encoding file: %1 "%vspipe%" "%script%" --outputindex 0 --container y4m --arg "source=%~1" - | "%ffmpeg%" -y -f yuv4mpegpipe -i - -c:v libx264 -crf 18 "%encoded_directory%\%~n1.mp4" goto :eof Code:
from vapoursynth import core clip = core.ffms2.Source(source) clip.set_output() %1 ir your current filepath in that batch script or specify more what you are doing if this is not working for you ... Last edited by _Al_; 27th October 2024 at 03:03. |
![]() |
![]() |
![]() |
#3 | Link |
Registered User
Join Date: May 2011
Posts: 372
|
Also you are a python programmer now using vapoursynth, so this simple python script would batch create scripts for you, if you'd want to go that way,
give this script name "batch_creator.py" and run it: Code:
from pathlib import Path SCRIPT_TEMPLATE = f"""from vapoursynth import core source = "{{}}" video = core.lsmas.LWLibavSource(source) video.set_output() """ SOURCE_DIRECTORY = r'E:\videos' SCRIPT_DIRECTORY = r'E:\scripts' sources = Path(SOURCE_DIRECTORY).glob('*.mkv') # loading using wild cards, possible select patterns or extension for source in sources: script_path = Path(SCRIPT_DIRECTORY) / f'{source.stem}.vpy' source = source.as_posix() # to print proper slashes (for windows) script_text = SCRIPT_TEMPLATE.format(source) with open(str(script_path), "w") as f: f.write(script_text) you can run this script in any python editor or just as a batch command: python batch_creator.py Last edited by _Al_; 27th October 2024 at 17:46. |
![]() |
![]() |
![]() |
Tags |
scripts, vapoursynth |
Thread Tools | Search this Thread |
Display Modes | |
|
|