![使用 MediaInfo 通过 Windows 批处理文件读取字幕信息](https://linux22.com/image/1536036/%E4%BD%BF%E7%94%A8%20MediaInfo%20%E9%80%9A%E8%BF%87%20Windows%20%E6%89%B9%E5%A4%84%E7%90%86%E6%96%87%E4%BB%B6%E8%AF%BB%E5%8F%96%E5%AD%97%E5%B9%95%E4%BF%A1%E6%81%AF.png)
根据这个帖子,关于MediaInfo读取字幕。
MediaInfo.exe "--Output=Text;%ID%: %Format%$if(%Language/String%, SUBTiTLE: .....%Language/String%)\r\n" File.mkv
谢谢 slhck,我已经这样做了。(抱歉我的英语不好。)
目标是我想要获取文件夹中所有视频文件(*.m*)中所有字幕的信息文本(ID、格式和语言)。
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. ) ) )
输出如下....
.................................................................... 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
您能告诉我如何在批处理文件中使用它吗?(Windows)