据我所知,命令参数的顺序无关紧要,但在这里我看到了其他东西:
ffmpeg -f avi -i "s02e01.mkv" vcodec mpeg4 -b 4000k -acodec libmp3lame -ab 320k "converted.avi"
这是结果:
s02e01.mkv: Operation not permitted
但是在更改“-f”和“-i”的位置后一切正常:
ffmpeg -i "s02e01.mkv" -f avi vcodec mpeg4 -b 4000k -acodec libmp3lame -ab 320k "converted.avi"
这里有什么问题?
最佳答案
由程序决定如何处理给定的命令行输入。大多数程序并不关心它们的顺序,因为它们在功能上是不同的。但是在某些标志可以选择性地影响其他标志的情况下,最简单的实现方法是通过输入排序。 ffmpeg 就是这样一个程序。它的手册页说:
As a general rule, options are applied to the next specified file. Therefore, order is important, and you can have the same option on the command line multiple times.
gcc 是另一个可以捕获你的程序;它的手册页说:
You can mix options and other arguments. For the most part, the order you use doesn't matter. Order does matter when you use several options of the same kind; for example, if you specify -L more than once, the directories are searched in the order specified. Also, the placement of the -l option is significant.
关于shell - 为什么参数的顺序在这里很重要?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16981296/