Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/bash/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux Bash脚本不适用于ffmpeg+;图像_Linux_Bash_Ffmpeg - Fatal编程技术网

Linux Bash脚本不适用于ffmpeg+;图像

Linux Bash脚本不适用于ffmpeg+;图像,linux,bash,ffmpeg,Linux,Bash,Ffmpeg,我按照以下说明创建了一个名为“run.sh”的bash文件: ffmpeg -i texture/texture%03d.bmp -vf "scale='min(1920,iw)':min'(1080,ih)':force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" pad_texture/pad_texture%03d.bmp ffmpeg -i depth/depth%03d.bmp -vf "scale

我按照以下说明创建了一个名为“run.sh”的bash文件:

ffmpeg -i texture/texture%03d.bmp -vf "scale='min(1920,iw)':min'(1080,ih)':force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" pad_texture/pad_texture%03d.bmp
ffmpeg -i depth/depth%03d.bmp -vf "scale='min(1920,iw)':min'(1080,ih)':force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" ../pad_depth/pad_depth%03d.bmp
但是,当我运行bash文件时,会出现以下错误:

Input #0, image2, from 'texture/texture%03d.bmp':
  Duration: 00:00:20.00, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: bmp, bgr24, 1024x768, 25 fps, 25 tbr, 25 tbn, 25 tbc
[NULL @ 0x1defec0] Unable to find a suitable output format for 'pad_texture/pad_'exture%03d.bmp
: Invalid argumentxture%03d.bmp

我无法理解为什么当我将命令逐行复制并粘贴到命令提示符中时,它们会被接受,但在bash脚本中却不是。非常感谢您的反馈

您确定您的
run.sh
没有包含一些无法打印的字符吗?像
\r
或一些转义序列之类的<代码>cat-vet run.sh可以帮助检查。不,没有类似的。。。就这两个命令,第一个命令有错误吗?您可以临时删除第二个。尝试使用另一个输入文件
cp pad\u texture/pad\u texture%03d.bmp pad\u texture/so\u test.bmp
并使用
pad\u texture/so\u test.bmp
尝试该命令。您是在bourne shell还是在bash模式下运行bash脚本?也就是说,hashbang行看起来像:
#/bin/sh
#/bin/bash