← Back to context

Comment by LocalPCGuy

3 days ago

I was excited to see this as just last night I was using FFmpeg to combine digital (legally owned) movies with multiple parts into a single MKV file. It worked great, the one thing (and this is undoubtedly just a knowledge problem on my part), is I could not get it to copy/include subtitles from both parts. I have a feeling I might need to extract the subtitle files and combine them and then re-include the combined version, but was hoping there would be a solution in this site for doing something like that. Unfortunately, I didn't even see the combine as one of the examples.

For reference:

One-liner:

> ffmpeg -loglevel info -f concat -safe 0 -i <(for f in *.mkv; do echo "file '$(pwd)/$f"; done) -c copy output.mkv

Or the method I ended up using, create a files.txt file with each file listed[0]

> ffmpeg -f concat -safe 0 -i files.txt -c copy output.mkv

files.txt

> file 'file 1.mkv' > file 'file 2.mkv' > # list any additional files

0: https://ma.ttias.be/use-ffmpeg-combine-multiple-videos/