问题描述
我正在使用Zeranoes FFmpeg Builds for Windows,我可以启动ff-prompt而不安装任何东西。但是如何使用Windows PowerShell启动 ff-prompt.bat
?我已经尝试了一些东西,如 Invoke-Expression
或更改 $ env:Path
,但似乎没有任何效果,因为我所得到的是消息
I am using Zeranoes FFmpeg Builds for Windows and I can start the ff-prompt without installing anything. But how do I start ff-prompt.bat
with Windows PowerShell? I have tried a few things like Invoke-Expression
or changing the $env:Path
but nothing seems to work, because all I get is the message
bin\ffmpeg.exe找不到。
bin\ffmpeg.exe could not be found."
甚至可以启动ff-prompt电源外壳?每个建议/解决方案都比较受欢迎。
Is it even possible to start ff-prompt with PowerShell? Every suggestion / solution is more than welcome.
My goal is to have a solution that works like this here:http://spreadys.wordpress.com/2012/12/03/ffprobe-and-windows-powershell/
但是我想为自己的所有剪辑自动执行,这就是为什么我需要启动ffprobe与powershell。
but I want to do that automatically for all my clips, thats why I need to start ffprobe with powershell.
ECHO OFF
REM FF Prompt 1.1
REM Open a command prompt to run ffmpeg/ffplay/ffprobe
REM Copyright (C) 2013 Kyle Schwarz
TITLE FF Prompt
IF NOT EXIST bin\ffmpeg.exe (
CLS
ECHO bin\ffmpeg.exe could not be found.
GOTO:error
)
CD bin || GOTO:error
PROMPT $G
CLS
ffmpeg -version
SET PATH=%CD%;%PATH%
ECHO.
ECHO For help run: ffmpeg -h
ECHO For formats run: ffmpeg -formats ^| more
ECHO For codecs run: ffmpeg -codecs ^| more
ECHO.
ECHO Current directory is now: "%CD%"
ECHO The bin directory has been added to PATH
ECHO.
CMD /F:ON /Q /K
GOTO:EOF
:error
ECHO.
ECHO Press any key to exit.
PAUSE >nul
GOTO:EOF
这次有点不同:
$env:Path = ';C:\Users\Administrator\bin\'
$title = "A_Day_for_Cake_and_Accidents"
Start-Process ff-prompt.bat -ArgumentList "ffprobe -show_streams -select_streams v -print_format xml -count_frames C:\Users\Administrator\Desktop\dcp_bearbeitet\$title\$title.mov > C:\Users\Administrator\Desktop\dcp_bearbeitet\$title\totalframes.xml"
这将创建一个名为totalframes.xml的文件,但没有必要的信息,我唯一得到的是:
This creates a file called "totalframes.xml" but without the needed information, the only thing I get is:
C:\Users\Administrator> ECHO OFF
ffmpeg版本N-60959-g669043d
建立于2014年2月27日22:01:58与gcc 4.8。 2(GCC)
配置:--enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --en能够bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm - enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable -libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable- libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-zlib
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.1 00
有关帮助运行:ffmpeg -h
对于运行的格式:ffmpeg -formats |更多
对于编解码器运行:ffmpeg -codecs |更多
当前目录是:C:\Users\Administrator\bin
bin目录已添加到PATH中
所以基本上控制台弹出,写这个标准文本,不使用我在 -Argument-List
中指出的命令。我不知道为什么忽略我的大部分命令,除了将所有内容写在XML文件中。
So basically the console pops up, writes this standard text and does not use my commands which I stated in -Argument-List
. I do not have a clue why it is ignoring most of my commands, except for writing everything in a XML file.
推荐答案
你可以从PowerShell启动ff-prompt.bat,如下所示。首先,将工作目录设置为包含ff-prompt.bat的工作目录。 C:\users\administrator\ffmpeg。其次,键入以下内容,然后按Enter键: .\ff-prompt.bat
。我从Zeranoe下载的文件集进行了测试,CMD会话打开并显示如下:
You can launch ff-prompt.bat from PowerShell as follows. Firstly, set the working directory to that which contains ff-prompt.bat e.g. c:\users\administrator\ffmpeg. Secondly, type the following and press enter: .\ff-prompt.bat
. I tested this with file set downloaded from Zeranoe and the CMD session opened and displayed as follows:
ffmpeg version N-61143-g64e4bd7
built on Mar 7 2014 00:01:08 with gcc 4.8.2 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig
--enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype
--enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore
-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspee
x --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libv
orbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-z
lib
libavutil 52. 66.101 / 52. 66.101
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.101 / 55. 33.101
libavdevice 55. 11.100 / 55. 11.100
libavfilter 4. 3.100 / 4. 3.100
libswscale 2. 5.101 / 2. 5.101
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
For help run: ffmpeg -h
For formats run: ffmpeg -formats | more
For codecs run: ffmpeg -codecs | more
Current directory is now: "C:\Users\Andy\Downloads\ffmpeg-20140307-git-64e4bd7-win32-static\ffmpeg-20140307-git-64e4bd7-
win32-static\bin"
The bin directory has been added to PATH
>
这篇关于如何使用Windows PowerShell启动ffprobe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!