You can simply use the cat or similar tools to complete this task:
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, you can use the following command:
cat init.mp4 $(ls -vx segment-*.m4s) > source.mp4
The -v option for ls sorts the output naturally (e.g. 1, 2, ..., 10, ..., 100), otherwise it sorts lexically (i.e. 1, 10, 100, 2, ... ) The -x option places the output in a row instead of columns.
source share