How to modify this MediaInfo CLI Batch?
Posted: 04 Mar 2019, 15:11
Hi guys,
I would like to create a list which contains filename and formatted time (mp4 files).
So far, I've been able to retrieve a list whose result is acceptable:
Batch file:
.
The result is for example this:
.
I know there are different types of duration, but I prefer to have milliseconds because I can modify it afterwards as I want.
My aim would be that the final list looks like this:
.
I already created an AHK script which reads in data and change the format, like:
.
I would only need to merge 2 text files, but I wonder, can I probably just modify the batch file so that I save all this additional work?
Unfortunately, I have 0 clue regarding that programing language.
My idea was something like:
.
However, that failed completely:
Thanks for any help!
Cheers!
I would like to create a list which contains filename and formatted time (mp4 files).
So far, I've been able to retrieve a list whose result is acceptable:
Batch file:
Code: Select all
@ECHO off
CLS
C:\Users\USER\Downloads\MediaInfo_CLI_18.12_Windows_x64\MediaInfoCLI.exe --output=General;%%FileName%%^|%%Duration%%\r\n *.mp4 --LogFile=MP4_NameAndDuration.txt
PAUSE
The result is for example this:
Code: Select all
01. Schwert|1485311
02. Pfeile|1335798
03. Bogen|1675808
I know there are different types of duration, but I prefer to have milliseconds because I can modify it afterwards as I want.
My aim would be that the final list looks like this:
Code: Select all
01. Schwert (25 Min)
02. Pfeile (22 Min)
03. Bogen (28 Min)
I already created an AHK script which reads in data and change the format, like:
Code: Select all
F8::
FileRead, all, C:\Users\USER\Documents\Lernmaterial\Videos\MP4_Duration.txt ; Read whole file and assign its data to variable "all"
Loop, Parse, all, `n, `r ; Parse the freshly read in data on each line-break
{
formatedTime := A_LoopField / 1000 / 60 ; Make Minuntes out of milliseconds
saveLine .= " (" . Round(formatedTime) . " Min)`r`n" ; Add formated string + rounded number + string to variable (e.g. from 1000000 -> (17 Min))
}
Clipboard := saveLine ; Assign all merged lines to the Clipboard
ClipWait, 0.1 ; Wait 100 ms until Clipboard contains data
return
I would only need to merge 2 text files, but I wonder, can I probably just modify the batch file so that I save all this additional work?
Unfortunately, I have 0 clue regarding that programing language.
My idea was something like:
Code: Select all
@ECHO off
formatedDuration = Duration / 1000 / 60
CLS
C:\Users\USER\Downloads\MediaInfo_CLI_18.12_Windows_x64\MediaInfoCLI.exe --output=General;%%FileName%%^(%%formatedDuration%% Min)\r\n *.mp4 --LogFile=MP4_NameAndDuration.txt
PAUSE
However, that failed completely:
Code: Select all
01. Schwert(02. Pfeile(03. Bogen
Cheers!