我正在使用Windows Server Edition 2012,并且使用Powershell非常新.基本上,我试图将目录中的一堆视频文件转换为.flv.我使用的代码是这样的:
$inProcessPath = "E:\Random Videos\In Process\$env:username\"
$oldVideos = Get-ChildItem -Include @("*.mp4", "*.avi", "*.divx", "*.mov", "*.mpg", "*.wmv", "*.mkv") -Path $inProcessPath -Recurse #gets all of the videos
cd "E:\FFMPEG\bin\"
foreach ($oldVideo in $oldVideos) {
$newVideo = [io.path]::ChangeExtension($oldSong.FullName, '.flv')
.\ffmpeg.exe -i $oldVideo -y -async 1 -b 2000k -ar 44100 -ac 2 -v 0 -f flv -vcodec libx264 -preset superfast $newVideo
}
Run Code Online (Sandbox Code Playgroud)
每当我运行它时,我都没有收到任何错误消息,但ffmpeg也没有运行.我敢肯定我忽视了一些东西,但不知道那可能是什么.我搜索了网站,并将代码与其他人进行了比较,但仍然不知道.
任何帮助将非常感谢.