Mediainfo CLI batch to display total info of videos

5k views Asked by At

I have a folder with many videos with nearly same informations. Here my script:

mediainfo --Inform=file://C:\Users\Administrator\Desktop\Encode.tool\tem.txt *.mkv
pause

tem.txt

General;%FileName% * Size:%FileSize/String3% * %Duration/String%\r
Video; |Video: ID:%ID% * %Width%x%Height%\r
Audio; |Audio: ID:%ID% * %Language/String% * %Channel(s)% * %Codec/String%\r
Text; |Sub  : ID:%ID% * %Language/String% * %Codec%\r
\r\n
\r\n
File_End;\n

And here is my result:

[HorribleSubs] Action Heroine Cheer Fruits - 01 [720p] * Size:165 MiB * 24 min 21 s
 |Video: ID:1 * 1280x720
 |Audio: ID:2 *  * 2 * AAC LC
 |Sub  : ID:3 * English * S_TEXT/ASS

[HorribleSubs] Action Heroine Cheer Fruits - 02 [720p] * Size:157 MiB * 24 min 21 s
 |Video: ID:1 * 1280x720
 |Audio: ID:2 * Japanese * 2 * AAC LC
 |Sub  : ID:3 * English * S_TEXT/ASS

[HorribleSubs] Action Heroine Cheer Fruits - 03 [720p] * Size:193 MiB * 24 min 21 s
 |Video: ID:1 * 1280x720
 |Audio: ID:2 * Japanese * 2 * AAC LC
 |Sub  : ID:3 * English * S_TEXT/ASS

[HorribleSubs] Action Heroine Cheer Fruits - 04 [720p] * Size:183 MiB * 24 min 21 s
 |Video: ID:1 * 1280x720
 |Audio: ID:2 * Japanese * 2 * AAC LC
 |Sub  : ID:3 * English * S_TEXT/ASS

As you see, those videos have same informations. So i want to display a total info, like:

Nums of video: 4
4 video - (Video names) - Sub  :* English * S_TEXT/ASS
4 video - (Video names) - Video:* 1280x720
3 video - (Video names) - Audio:* Japanese *
1 video - (Video names) - Audio:*  *
0 video with 2 line audio

I do wanna focus on subtitle language and type (English and ass); Video resolusion (1280x720); Audio language (Japanese) and also display info about videos which have 2 line of audio (Example: 1 video with 2 line audio - (Video names) )

Please help :(

1

There are 1 answers

0
user3055439 On

I know this is old, but this might help you out go to https://mediaarea.net/en/MediaInfo/Download/Windows and download the CLI mediainfo, then you can just output the info to a text file, this is my code to get the information from video files and this is using a batch file

@Echo off SETLOCAL Set PrgF=%ProgramFiles% If Exist "%PrgF%\MediaInfo_CLI_21.03_Windows_x64\MediaInfo.exe" set File_Info="%PrgF%

\MediaInfo_CLI_21.03_Windows_x64\MediaInfo.exe" Set Fext=mkv

for %%i in ("*.mkv") do (set fname=%%~ni) & call :Lista_Subs

EndLocal Exit

:Lista_Subs

%File_Info% -i %fname%.%FExt% >>File_Information.txt

goto :eof

This batch was "adapted" from another batch but FExt just means file extension.