0

我正在尝试使用 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"; 
4

1 回答 1

0

我解决了:

#!/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";
于 2015-12-30T12:16:01.917 回答