gpt4 book ai didi

windows - 使用 FFmpeg Video Conversor 为 Windows 构建 CLI 批处理

转载 作者:行者123 更新时间:2023-12-04 23:33:35 24 4
gpt4 key购买 nike

这是我为 WINDOWS 用户所做的:
但如果有任何帮助,就会出现错误!
校验码:

@echo off
set /P file="Say the FILE EXTENTION.: "

(for %i in (*.%file%) do (
@echo ffmpeg.exe -i %i -vf scale=480:320 %i-.mp4 > %file%-em-lista.bat

))

echo Now wait Batch File Created Started Convert, make sure having ffmpeg installed at system32
start %file%-em-lista.bat
我还注意到我被卡住了,它确实可以在 CMD 中直接输入:
进行检查,此命令将枚举您文件夹中的所有 txt 文件:
FOR %f in (dir /b *.txt) do (echo %f)
猜猜它是一个不知道的代码声明或连接,我已经在第 3 天尝试了几种方式。
@echo off

set /P fext="SAY VIDEO FORMAT.: "
set /P xpath="SAY FOLDER OR VIDEO LOCATION FOR BATCH CREATION.: "
set current_dir=%xpath%

echo "Your Current Directory IS: %current_dir%"

FOR /f %i in (dir /b *.%fext%) do (

@echo ffmpeg.exe -i %i -vf scale=480:320 -v error -hwaccel cuda -hwaccel_device 0 %i.mp4 > %xext%-em-lista.bat

)
echo "Starting Conversions"
start %fext%-em-lista.bat
echo Wait Conversions Finish
end
从昨天开始:更新的代码在视频文件夹中工作稳定 2020 年 7 月 24 日
@echo off

echo ###Set the VideoExample.Ext you are going to converto to MP4####

set /P file="Say the FILE EXTENTION.: "


REM going to make a if later for not Nvidia GC cuz of CUDA Aceleration not found in any Freeware Software REM

(for %%i in (*.%file%) do @echo ffmpeg.exe -v error -hwaccel cuda -hwaccel_device 0 -i %%i -acodec copy -f mp4 -ac 2 -vf scale=480:320 %%i.mp4) > %file%-to-mp4-em-lista2.bat

echo Wait Process Finish *-*
start %file%-to-mp4-em-lista2.bat
到目前为止,需要改进
选项:
[1] 为 IN 和 OUT 转换的视频创建一个默认文件夹
[2] 使嵌入的 DIR-PATH 可以使用 IN 和 OUTPUT 视频
视频到音频和我们喜欢的 FFMPEG 选项。

最佳答案

当您在 FOR 中引用变量时在批处理脚本中循环,您必须使用双 %:

FOR /f %%i in (dir /b *.%fext%) do
一些 documentation :

Use a single percent sign (%) to carry out the for command at thecommand prompt. Use double percent signs (%%) to carry out the forcommand within a batch file. Variables are case sensitive, and theymust be represented with an alphabetical value such as %a, %b, or %c.

关于windows - 使用 FFmpeg Video Conversor 为 Windows 构建 CLI 批处理,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63064853/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com