The demuxer is more flexible – it requires the same codecs, but different container formats can be used; and it can be used with any container formats, while the concat protocol only works with a select few containers.
The Concat Demuxer
create a text file named vidlist.txt in the following format:
The files will be stream copied in the order they appear in the vidlist.txt into the output container. the "copy codec" is blazing fast.
Edit: Note that although the docs say you don't need -safe 0 if the paths are relative, my testing indicates it's a requirement. It's possible that this may vary with your version of FFmpeg.
There are tips for auto generating the file available in the docs.
Note: All the clips must already exist or the command will fail because decoding won't start until the whole list is read.
Note: as mentioned above the concat protocol is severely limited in what streams and containers it supports so I never use it. The above is only included in an attempt to create a thorough answer. The concat demuxer is a far better choice for most projects.
An alternative suggestion: Personally I prefer using the Matroska container due to it's flexibility and low overhead and join videos with the same encoding using
mkvmerge -o output.mkv input1.mkv + input2.mkv
Concatenation of Files with Different Codecs
If your clips don't use the same codecs for audio and video and/or have different rates, your stuck re-encoding to intermediate files prior to joining which as we all know is both time and resource consuming.
There are two types of variables in batch files. One is for parameters which can be passed when the batch file is called and the other is done via the set command.
Command Line Arguments
Batch scripts support the concept of command line arguments wherein arguments can be passed to the batch file when invoked. The arguments can be called from the batch files through the variables %1, %2, %3, and so on.
The following example shows a batch file which accepts 3 command line arguments and echos them to the command line screen.
Ubuntu Advanced options for Ubuntu Windows 10 (loader) (on /dev/sda1) system setup
其中 Advananced options for Ubuntu 子菜单如下所示
1 2 3 4 5 6
Ubuntu, with Linux 4.13.0-26-generic Ubuntu, with Linux 4.13.0-26-generic (upstart) Ubuntu, with Linux 4.13.0-26-generic (recovery mode) Ubuntu, with Linux 4.10.0-42-generic Ubuntu, with Linux 4.10.0-42-generic (upstart) Ubuntu, with Linux 4.10.0-42-generic (recovery mode)
现在,第一个选项是索引 0 ,第二个是 1 ,第三个是 2 ,依此类推。
例如现在想选择 Advanced options for Ubuntu 子菜单中的 Ubuntu, with Linux 4.10.0-42-generic ,则将 GRUB_DEFAULT 设为: