commit 3881d37a9daf2181a881a22d07ad0dabddea85df Author: Steve Dogiakos Date: Tue Nov 14 13:09:49 2023 -0700 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. diff --git a/merge_split_AVIs.bat b/merge_split_AVIs.bat new file mode 100644 index 0000000..913c124 --- /dev/null +++ b/merge_split_AVIs.bat @@ -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