Set Global and "local" Counter [SOLVED]
Posted: 06 Aug 2021 04:56
Hello everybody,
I have created a template for MediaInfo to output specific information about the video files inside a specific folder. The output will then be written to a txt-file.
This is the command I Use:
the template (template1.txt) for MKV's looks like this:
And the template (template2.txt) for JPGs looks like this:
Now i want to expand this by setting different counters. I want the script to count for all files (it should just go File 1, File 2, File 3, etc.) and also the different audio and text-information but for those two, the counter should be reset after every file. I thought about something like this but I'm not sure how to do:
But that specific code did not work (it outputs the file and leves everything empty where my counters have been set, probably because the mediainfo template uses this kind of syntax.
I have created a template for MediaInfo to output specific information about the video files inside a specific folder. The output will then be written to a txt-file.
This is the command I Use:
Code: Select all
for %%A in (*.mkv) do C:\System\Mediainfo\MediaInfo.exe --Inform=file://C:\System\Mediainfo\template1.txt %%A >> Output1.txt
for %%A in (*.jpg) do C:\System\Mediainfo\MediaInfo.exe --Inform=file://C:\System\Mediainfo\template2.txt %%A >> Output2.txt
Code: Select all
General;--------------------------------------------------------------------\n%fileCounter%\n--------------------------------------------------------------------\n\nFile-Name...............: %CompleteName%\nFile-Size...............: %FileSize/String%\nDuration................: %Duration/String%\nOverall-Bitrate.........: %OverallBitRate/String%\n
Video;Video-Codec.............: %Format/String%\nVideo-Bitrate...........: %BitRate_Maximum/String%\nVideo-Auflösung.........: %Width%x%Height%\nVideo-Size..............: %StreamSize/String%\n
Audio;Audio-Langauge %audioCounter%........: %Language/String%\nAudio-Format %audioCounter%..........: %Format/String% (%CodecID%)\nAudio-Bitrate %audioCounter%.........: %BitRate/String% (%SamplingRate/String%)\nAudio-Size %audioCounter%............: %StreamSize/String%\n
Text;Text-Bitrate %textCounter%..........: %Language/String%\nText-Codec %textCounter%............: %Format/String%\nText-Bitrate %textCounter%..........: %BitRate/String%\nText-Size %textCounter%.............: %StreamSize/String%\n
File_End;\n
Code: Select all
General;--------------------------------------------------------------------\n%fileCounter%\n--------------------------------------------------------------------\n\nFile-Name...............: %CompleteName%\nPhoto-Codec.............: %Format/String%\n
Image;Photo-Auflösung.........: %Width%x%Height%\nPhoto-Size..............: %StreamSize/String%\n
File_End;\n
Code: Select all
set /A fileCounter=0 for
set /B audioCounter=0
set /C textCounter=0
for %%A in (*.mkv) do C:\System\Mediainfo\MediaInfo.exe --Inform=file://C:\System\Mediainfo\template1.txt %%A >> Output1.txt
set /B audioCounter=0
set /C textCounter=0
for %%A in (*.jpg) do C:\System\Mediainfo\MediaInfo.exe --Inform=file://C:\System\Mediainfo\template2.txt %%A >> Output2.txt
set /B audioCounter=0
set /C textCounter=0