对某些人来说,这应该很容易,但是我是一个脚本初学者,所以对我来说,这很复杂。
我正在尝试创建一个Windows批处理脚本:
到目前为止,我已经设法创建了一个批处理脚本:
这是当前脚本:
CALL :treeProcess
GOTO :eof
:treeProcess
FOR %%F IN (*.mkv, *.mp4, *.avi, *.wmv, *.mpg, *.ts) DO (
ECHO "@" : "%%F", >> index.txt
"C:\Program Files\FFmpeg\bin\ffprobe.exe" "%%F" -v error -of flat=s=_ -select_streams v:0 -show_entries stream=width -print_format xml >> index.txt
"C:\Program Files\FFmpeg\bin\ffprobe.exe" "%%F" -v error -of flat=s=_ -select_streams v:0 -show_entries stream=height -print_format xml >> index.txt
)
FOR /D %%d IN (*) DO (
CD %%d
CALL :treeProcess
CD ..
)
EXIT /b
然后,我只使用Ecobyte的“替换文本”来消除脚本生成的无用的东西,最后得到干净的“ index.txt”文件。
这是干净的“ index.txt”文件之一。该文件夹中的3行条目与视频文件一样多(在此示例中,该文件夹中有4个视频文件):
"@" : "Creating Nerve.mkv",
"WIDTH" : "1920",
"HEIGHT" : "1080",
"@" : "Player Profiles.mkv",
"WIDTH" : "1920",
"HEIGHT" : "1080",
"@" : "The Fat Jewish Gets Tattewish - Outtakes.mkv",
"WIDTH" : "1920",
"HEIGHT" : "1080",
"@" : "The Governor's Ball Takeover.mkv",
"WIDTH" : "1920",
"HEIGHT" : "1080",
您明白了。
现在我需要的是另一个脚本:
示例:
以下是“!.tags”文件开头的样子:
[
{
"@" : "Creating Nerve.mkv",
"CREATION_TIME" : "2016-10-16T15:51:50.000000Z",
"DATE" : "2016",
"DURATION" : "1606.3550000",
"ENCODER" : "libebml v1.3.3 + libmatroska v1.4.4",
"GENRE" : "Featurettes",
"TITLE" : "Creating Nerve",
},
{
"@" : "Player Profiles.mkv",
"CREATION_TIME" : "2016-10-16T16:03:56.000000Z",
"DURATION" : "347.6030000",
"TITLE" : "Player Profiles"
},
{
"@" : "The Fat Jewish Gets Tattewish - Outtakes.mkv",
"CREATION_TIME" : "2016-10-16T16:11:23.000000Z",
"DURATION" : "168.1040000",
"TITLE" : "The Fat Jewish Gets Tattewish - Outtakes"
},
{
"@" : "The Governor's Ball Takeover.mkv",
"CREATION_TIME" : "2016-10-16T16:24:23.000000Z",
"DURATION" : "165.4590000",
"TITLE" : "The Governor's Ball Takeover"
}
]
这是它的最终外观:
[
{
"@" : "Creating Nerve.mkv",
"WIDTH" : "1920",
"HEIGHT" : "1080",
"CREATION_TIME" : "2016-10-16T15:51:50.000000Z",
"DATE" : "2016",
"DURATION" : "1606.3550000",
"ENCODER" : "libebml v1.3.3 + libmatroska v1.4.4",
"GENRE" : "Featurettes",
"TITLE" : "Creating Nerve",
},
{
"@" : "Player Profiles.mkv",
"WIDTH" : "1920",
"HEIGHT" : "1080",
"CREATION_TIME" : "2016-10-16T16:03:56.000000Z",
"DURATION" : "347.6030000",
"TITLE" : "Player Profiles"
},
{
"@" : "The Fat Jewish Gets Tattewish - Outtakes.mkv",
"WIDTH" : "1920",
"HEIGHT" : "1080",
"CREATION_TIME" : "2016-10-16T16:11:23.000000Z",
"DURATION" : "168.1040000",
"TITLE" : "The Fat Jewish Gets Tattewish - Outtakes"
},
{
"@" : "The Governor's Ball Takeover.mkv",
"WIDTH" : "1920",
"HEIGHT" : "1080",
"CREATION_TIME" : "2016-10-16T16:24:23.000000Z",
"DURATION" : "165.4590000",
"TITLE" : "The Governor's Ball Takeover"
}
]
有人可以帮我吗?谢谢!
答案 0 :(得分:0)
没关系。我找到了另一种解决方案。 我错误地认为这是一个帮助委员会。谢谢你。