From 3881d37a9daf2181a881a22d07ad0dabddea85df Mon Sep 17 00:00:00 2001 From: Steve Dogiakos Date: Tue, 14 Nov 2023 13:09:49 -0700 Subject: [PATCH] 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. --- merge_split_AVIs.bat | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 merge_split_AVIs.bat 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