0

According to the answer in this post, about MediaInfo to read subtitles.

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

thanks slhck, I've done this. (Sorry for my English.)

The target is I want to get the info texts (ID, Format & Language) of all subtitles in all video files (*.m*) in folder.

SET informParams=%%ID%%+%%Format%%+%%Language/String%% FOR /F "delims=" %%Z IN ('DIR /B /S "*.m*"') DO ( echo .................................................................... echo %%Z&echo. FOR /F "usebackq delims=" %%B IN (`mediainfocli.exe "--Inform=Text;%informParams%\r\n" "%%Z"`) DO ( echo %%B FOR /F "tokens=1-3 delims=+" %%C IN ("%%B") DO ( echo ID: %%C echo Format: %%D echo Lang: %%E echo. ) ) )

The output be like....

.................................................................... F:\MOVIES\The Long Ships.mkv 4+PGS+English ID: 4 Format: PGS Lang: English .................................................................... F:\MOVIES\The Vikings.mkv 4+UTF-8+English ID: 4 Format: UTF-8 Lang: English 5+VobSub+Thai ID: 5 Format: VobSub Lang: Thai 6+PGS+Thai ID: 6 Format: PGS Lang: Thai 7+PGS+Thai ID: 7 Format: PGS Lang: Thai 8+VobSub+Thai ID: 8 Format: VobSub Lang: Thai

Could you please tell me how to use this in batch file? (Windows)

A. Renato
  • 3
  • 3
  • This is not a PM, there is no such feature on Stack Exchange. Anyway, have you tried to write a loop? There is plenty of information out there on batch scripting. – slhck Jul 19 '17 at 07:14
  • PM lol. i'm new with this kind of forum. yes i've tried using loop, like this.... FOR /F "usebackq delims=" %%B IN ('MediaInfo.exe --Inform="Text;%ID%: %Format%$if(%Language/String%, SUBTiTLE: .............. %Language/String%)\r\n" "%%Z"') DO ( for /f "xxx xxx=" %%C in %%B DO( ..... ) ) I think my problem is using "tokens and delims". – Na Nonthasen Jul 19 '17 at 10:26
  • Please edit your question and add the code youve tried. Also show any errors you get. Make sure that you use proper formatting (see the code button in the editor). Thanks – slhck Jul 19 '17 at 10:35

0 Answers0