MP4Box shell 脚本不工作

MP4Box shell script not working

我正在尝试使用 MP4Box 将多个 .mp4 文件连接到一个目录中。简单形式的基本命令如下所示:

mp4box -cat 'Film.mp4' -cat 'Credits.mp4' -new Total.mp4

我制作了这个脚本,但它不起作用:

#!/bin/bash
files='*.mp4'; for i in $files; do MP4Box -cat "'"$i"'" -new Total.mp4; done

它只是给出:

Error appending '01_Introduction.mp4': Requested URL is not valid or cannot be found
Error - 2 input names specified, please check usage
Error - 2 input names specified, please check usage
Error - 2 input names specified, please check usage
Error - 2 input names specified, please check usage
Error - 2 input names specified, please check usage
Error - 2 input names specified, please check usage
... etc.

我的表情有什么问题?

我决定:

#!/bin/bash

rm Total.mp4; files='*.mp4'; for i in $files; do
echo " -cat " "'"$i"'" >>input.txt; done

file="input.txt"; name=$(cat "$file"); 

eval "MP4Box " $name " -new Total.mp4"; 

我选择了:

#!/bin/bash

rm Total.mp4; files='*.mp4'; for i in $files; do
echo " -cat " "'"$i"'" >>input.txt; done

file="input.txt"; name=$(cat "$file"); 

eval "MP4Box " $name " -new Total.mp4";