2

I frequently use the following command:

MediaInfo.exe "--Output=Text;%ID%: %Format%$if(%Language/String%, SUBTiTLE: .............. %Language/String%)\r\n" File.mkv

This will output the subtitle streams of a video vile in the format:

5: UTF-8
6: VobSub SUBTiTLE: .............. French
7: VobSub SUBTiTLE: .............. English
8: VobSub SUBTiTLE: .............. French

Source: Get subtitle list using mediainfo in Windows

However I would like to run the same command for all files in a folder.

I have tried

for %%a in (%*) do  (
MediaInfo.exe "--Output=Text;%ID%: %Format%$if(%Language/String%, SUBTiTLE: .............. %Language/String%)\r\n"
)

but it does not seem to work and I am not sure why.

1 Answer 1

0

In your test code I don't see "%%a" (the file name to use) in the MediaInfo call and also I don't see "%" escaped ("%%") in the MediaInfo parameters (without percentage escaping, MediaInfo receives empty strings due to "%" converted by the batch processor).

I successfully did what you try to do with:

>dir test
06/09/2017  14:02         2 869 248 MOV001 - Copy.MOD
06/09/2017  14:02         2 869 248 MOV001.MOD

>more a.bat
@echo off
for %%f in (%*) do (
MediaInfo.exe "--Output=General;%%FileName%%, %%Format%%" "%%f"
)

>MediaInfo.exe "--Output=General;%FileName%, %Format%\r\n" test\*
MOV001 - Copy, MPEG-PS
MOV001, MPEG-PS

a.bat test\*.*
MOV001 - Copy, MPEG-PS
MOV001, MPEG-PS
1
  • 1
    Thanks but this batch file reruns nothing on my computer...
    – Arete
    Sep 6, 2017 at 16:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .