You can just use the cat
command or similar tools to do this job:
cat init.mp4 > source.mp4
cat segment-1.m4s >> source.mp4
cat segment-2.m4s >> source.mp4
...
To do this automatically for all segments in the current folder, the following command can be used:
cat init.mp4 $(ls -vx segment-*.m4s) > source.mp4
The -v parameter for ls
sorts the output naturally (i.e. 1, 2, ..., 10, ..., 100), otherwise it sorts lexically (i.e. 1, 10, 100, 2, ...).
The -x parameter puts the output on a line instead of columns.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…