【问题标题】:Invoking ffmpeg through bash through command prompt通过命令提示符通过 bash 调用 ffmpeg
【发布时间】:2021-01-31 08:21:14
【问题描述】:

我有一个 ffmpeg 命令,我试图在 python 中运行。在 wsl 或 bash 中调用它可以正常工作。

命令:

ffmpeg -y -i C:/Users/joel/src/tldr-dw/src/test/video_editor/input.mp4 -lavfi '[0:v]scale=ih*16/9:-1,boxblur=luma_radius=min(h\,w)/20:luma_power=1:chroma_radius=min(cw\,ch)/20:chroma_power=1[bg];[bg][0:v]overlay=(W-w)/2:(H-h)/2,crop=h=iw*9/16,scale=1920x1080' -vb 5m C:/Users/joel/src/tldr-dw/src/test/video_editor/input_output.mp4

但是,我试图让它在 python 中运行。我这样调用它:

subprocess.check_output([r'C:\Windows\SysNative\bash.exe', '-c', bash_command], shell=True)

但收到一条错误消息:

C:/Users/joel/src/tldr-dw/src/test/video_editor/input.mp4: Protocol not found Did you mean file:C:/Users/joel/src/tldr-dw/src/test/video_editor/input.mp4?

我尝试将“文件”附加到输入/输出路径,甚至切换到 Windows 行尾。当我做后者时,它似乎逃脱了斜线。我收到此错误消息:

C:Usersjoelsrctldr-dwsrctestvideo_editorinput.mp4: Protocol not found Did you mean file:C:Usersjoelsrctldr-dwsrctestvideo_editorinput.mp4?

本质上,我要做的只是从命令提示符在 ffmpeg 中运行 bash 命令。我在那里收到类似的错误消息。文件路径是怎么回事?

【问题讨论】:

    标签: windows bash shell ffmpeg


    【解决方案1】:

    事实证明,我需要使用以 /mnt/... 开头的 POSIX 样式路径

    /mnt/c/Users/joel/src/tldr-dw/temp/input.mp4
    

    希望这对某人有所帮助。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-06
      • 1970-01-01
      • 2012-05-22
      • 2021-08-20
      • 1970-01-01
      • 2020-08-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多