1

尝试使用下面的代码在 .bat 文件中运行以下命令

c:\program files (x86)\Team Mediaportal\Mediaportal\TV Thumbnailer\ffmpeg.exe -ss 720 -itsoffset -5 -i "c:\tv recordings\sample recording.mpg" -vframes 1 -y "C:\tv recordings\sample recording.jpg"

Set "FFMpeg_Location=c:\Program Files (x86)\Team Mediaportal\Mediaportal\TV Thumbnailer"

rem or Set "FFMpeg_Location=c:\Program Files (x86)\Team Mediaportal\Mediaportal\TV Thumbnailer\ffmpeg.exe" , whichever is easier :D

Set "Video_Path=c:\tv recordings\"

Set "Video_File=sample recording"

%FFMpeg_Location%\FFMpeg.exe -ss 720 -itsoffset -5 -i "%Video_Path%%Video_File%.mpg" -vframes 1 -y "%Video_Path%%Video_File%.jpg"

PS。我希望 .bat 在 ffmpeg 完成运行后继续,因为我正在使用 ffmpeg 在 for 循环中处理大量文件。另外,我不希望通过执行 cd c:\pro...\tv thumbnailer\ 来更改 .bat 文件的工作目录,因为这会破坏我的脚本。


编辑:我通过使用调用语句解决了我的问题:D

call "%FFMpeg_Location%\FFMpeg.exe" -ss 720 -itsoffset -5 -i "%Video_Path%%Video_File%.mpg -vframes 1 -y "%Video_Path%%Video_File%.jpg"
4

1 回答 1

2

调用 "%FFMpeg_Location%\FFMpeg.exe" -ss 720 -itsoffset -5 -i "%Video_Path%%Video_File%.mpg -vframes 1 -y "%Video_Path%%Video_File%.jpg"

于 2012-11-01T10:56:26.220 回答