MI_COMPARE.BAT
Displays "media information" of audio, video files.
Can display/compare 1 or 2 or 3 files' data.
Way, way, way back, I was good with dealing with pairs of files.
Then I up'd it to handle 3 files...
For 2, (Altap Salamander's) Compare worked fine. (Salamander required & must be running).
For 3, WinMerge can handle 3 (or 2).
Salamander's Compare & WinMerge display, differently.
And one can replace either with their own "compare"...
And you can set up a hotkey in Everything to compare sets of files.
MI_COMPARE.bat:
Code: Select all
:: MediaInfo _ command_com line COMPARATOR with CALL to Salamander's File Comparator
:: or, if 3 files passed, use WinMerge SjB 10-30-2024
@echo off
:: check for 3 files passed, & if 3, then run MI_COMPARE3.bat (WinMerge) instead
if NOT [%3]==[] (
MI_COMPARE3.bat %*
goto :EOF
)
:: you do NOT want to use, START "MI3" MI_COMPARE3.BAT... (or cmd /c start), above!
:: doing so, will cause the MI3 window to hang around !
set X_TEMP_PATH=%PATH%
path %PATH%;C:\DEV\CODECS\MediaInfo_CL\;
set OUT1=C:\OUT\MI_COMPARE1.TXT
set OUT2=C:\OUT\MI_COMPARE2.TXT
echo FILE 1: > %OUT1%
echo %1 >> %OUT1%
echo. >> %OUT1%
echo FILE 2: > %OUT2%
echo %2 >> %OUT2%
echo. >> %OUT2%
:: originally, the above echo were not there, & if for some reason the MI failed,
:: like from a too long PATH, kind of thing
:: both the files ending up with nothing in them, so they would compare as
:: "equal", & they "were", except it was comparing against "nothing" instead
:: of actually returned valid results of the MI command
:: anyhow, MI does have exit codes; 0=success, 1=failure, but for some reason
:: depending on, not sure, file order (which one "first") or whatever, again
:: valid result may not have been given
:: with the echo's, at the least there will be some diffs to the files, so the
:: compare, while still not of relevant data, at least will "not compare" &
:: so will point out diffs, & then it's like, ah, what's going on here
:: so at least you know something is up, instead of "falsely" being told, oh,
:: your files compare, exactly [wrong]
C:\DEV\CODECS\MediaInfo_CL\MediaInfo_CL.exe %1 >> %OUT1%
:: if errorlevel 1 echo FILE 1: MEDIAINFO DETECTED FAILURE, %1 >> %OUT1%
:: set errorlevel=
C:\DEV\CODECS\MediaInfo_CL\MediaInfo_CL.exe %2 >> %OUT2%
if errorlevel 1 echo FILE 2: MEDIAINFO DETECTED FAILURE, %2 >> %OUT2%
:: for some reason, these (TWO) errorlevel checks were not always returning
:: expected results, so i changed to the 'echo' method (above) which "forces"
:: diffs into %OUT_%, so a failure won't compare equally
"C:\WLIB\Altap Salamander 40\plugins\filecomp\fcremote.exe" %OUT1% %OUT2%
:: "C:\WLIB\Altap Salamander 304\plugins\filecomp\fcremote.exe" C:\OUT\MI_COMPARE1.TXT C:\OUT\MI_COMPARE2.TXT
set PATH=%X_TEMP_PATH%
set X_TEMP_PATH=
Code: Select all
:: MediaInfo _ command_com line COMPARATOR with CALL to [Salamander's File Comparator] WinMerge
@echo off
set X_TEMP_PATH=%PATH%
path %PATH%;C:\DEV\CODECS\MediaInfo_CL\;
set OUT1=C:\OUT\MI_COMPARE1.TXT
set OUT2=C:\OUT\MI_COMPARE2.TXT
set OUT3=C:\OUT\MI_COMPARE3.TXT
echo FILE 1: > %OUT1%
echo %1 >> %OUT1%
echo. >> %OUT1%
echo FILE 2: > %OUT2%
echo %2 >> %OUT2%
echo. >> %OUT2%
echo FILE 3: > %OUT3%
echo %3 >> %OUT3%
echo. >> %OUT2%
:: originally, the above echo were not there, & if for some reason the MI failed,
:: like from a too long PATH, kind of thing
:: both the files ending up with nothing in them, so they would compare as
:: "equal", & they "were", except it was comparing against "nothing" instead
:: of actually returned valid results of the MI command
:: anyhow, MI does have exit codes; 0=success, 1=failure, but for some reason
:: depending on, not sure, file order (which one "first") or whatever, again
:: valid result may not have been given
:: with the echo's, at the least there will be some diffs to the files, so the
:: compare, while still not of relevant data, at least will "not compare" &
:: so will point out diffs, & then it's like, ah, what's going on here
:: so at least you know something is up, instead of "falsely" being told, oh,
:: your files compare, exactly [wrong]
C:\DEV\CODECS\MediaInfo_CL\MediaInfo_CL.exe %1 >> %OUT1%
:: if errorlevel 1 echo FILE 1: MEDIAINFO DETECTED FAILURE, %1 >> %OUT1%
:: set errorlevel=
C:\DEV\CODECS\MediaInfo_CL\MediaInfo_CL.exe %2 >> %OUT2%
if errorlevel 1 echo FILE 2: MEDIAINFO DETECTED FAILURE, %2 >> %OUT2%
:: for some reason, these (TWO) errorlevel checks were not always returning
:: expected results, so i changed to the 'echo' method (above) which "forces"
:: diffs into %OUT_%, so a failure won't compare equally
if [%3]==[] goto doit2:
C:\DEV\CODECS\MediaInfo_CL\MediaInfo_CL.exe %3 >> %OUT3%
if errorlevel 1 echo FILE 3: MEDIAINFO DETECTED FAILURE, %3 >> %OUT3%
goto doit:
:: with this _3 can compare either 2 (now, more properly) or 3 files
:: (2, would be via drag_n_drop, and without a "bogus" 3rd entry showing up)
:: and also, with the change to MI_COMPARE, i can interactively select 3 files
:: in Everything, & using *existing* (Everything) shortcut to MI_COMPARE Alt+I
:: that will run _3 instead, so i can now (10-30-2024) do either 2 or 3,
:: directly, instead of having to "manually" drag 3 files into _3.bat :-)
:doit2
start "" "WinMergeU.exe" %OUT1% %OUT2%
goto cleanup:
:doit
start "" "WinMergeU.exe" %OUT1% %OUT2% %OUT3%
:: "C:\WLIB\Altap Salamander 304\plugins\filecomp\fcremote.exe" C:\OUT\MI_COMPARE1.TXT C:\OUT\MI_COMPARE2.TXT
:cleanup
set PATH=%X_TEMP_PATH%
set X_TEMP_PATH=
:: the START itself, PLUS the quotes in, start "" are NECESSARY, to avoid an
:: "extraneous" ("CMD") window from hanging around until WinMerge is closed!
.
Salamander: WinMerge:
Oh, in my above batch files, I use a "MediaInfo_CL.exe".
MediaInfo_CL.exe is simply the file, "MediaInfo.exe" found in the command-line version of MediaInfo, MediaInfo_CLI_##.##_Windows_x64.zip, that I simply renamed to "MediaInfo_CL.exe".