用于使用 FFMPEG 编码视频的批处理文件 - "variable" : %%a



在这个表达式中'%%a'和'%%~na'是什么意思:http://www.pasteall.org/58875?

for %%a in ("*.*") do ffmpeg -i "%%a" "newfiles%%~na.mp4"pause

我想批量编码几个视频文件。所有文件都在同一个文件夹中,没有其他文件。我找到的解释告诉我这是一个变量。但是像这样的变量代表什么呢?

%%~na将返回文件名,而不包含for循环返回的文件的路径或扩展名。

for /?的输出:

%~I         - expands %I removing any surrounding quotes (")
%~fI        - expands %I to a fully qualified path name
%~dI        - expands %I to a drive letter only
%~pI        - expands %I to a path only
%~nI        - expands %I to a file name only
%~xI        - expands %I to a file extension only
%~sI        - expanded path contains short names only
%~aI        - expands %I to file attributes of file
%~tI        - expands %I to date/time of file
%~zI        - expands %I to size of file

%%a是一个特殊的参数,它将被FOR循环的值所替换,计算IN(....)子句,并在每次迭代中将%%a设置为不同的值。

% %的(" .mp4")做ffmpeg - y -"% % a"我,% % a"-filter_complex"[0 v: 0]垫= iw 2: ih (bg);(bg) [1: v: 0]覆盖= w"-预设超快输出"%%a".mp4

最新更新