Create merge_split_AVIs.bat

Initial commit at the .bat to merge my old movie files that  are split by CD1 and CD2, and use the .avi format. Names the file after the name of the folder it's in.
This commit is contained in:
Steve Dogiakos 2023-11-14 13:09:49 -07:00 committed by GitHub
commit 3881d37a9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 21 additions and 0 deletions

21
merge_split_AVIs.bat Normal file
View File

@ -0,0 +1,21 @@
@echo off
setlocal enabledelayedexpansion
:: Get the name of the current directory
for %%I in (.) do set "FolderName=%%~nI"
set "file1="
set "file2="
:: Find files containing 'cd1' and 'cd2' in the name
for %%F in (*cd1*.avi) do set "file1=%%F"
for %%F in (*cd2*.avi) do set "file2=%%F"
:: Concatenate if both files are found
if defined file1 if defined file2 (
ffmpeg -i "concat:!file1!|!file2!" -c copy "!FolderName!.avi"
) else (
echo Matching file pairs not found.
)
endlocal