![]() ![]() But when I try commands like: ffmpeg -f concat -i filelist.txt -c copy output.mp4 I'd like to combine them into a single mp4 container. I know they are all encoded the same way. I've got a bunch of ts segments described by a single index.m3u8 file: index.m3u8 Using Juan Aquino's answer (and correcting the first command to be compatible with Bash and using the natural ordering of files), plus 7vujy0f0hy's answer, a simple working script for a Linux Bash shell is: #!/bin/bashįor i in `\ls *.ts | sort -V` do echo "file '$i'" done > mylist.txtįfmpeg -f concat -i mylist.txt -c copy -bsf:a aac_adtstoasc video.mp4 ![]() From here, you can transmux to mp4 as usual if you like: ffmpeg -i all.ts -acodec copy -vcodec copy all.mp4 txt file you just made.Ĭheck if the resultant file plays video correctly. txt file looks good and is formatted correctly!Īfter this, on commandline run: ffmpeg -f concat -i mylist.txt -c copy all.ts Here's a copy paste from my first link on one way to create a text file if you have Windows on commandline for instance but obviously you can make the file manually or however you want: (for %i in (*.ts) do file '%i') > mylist.txtĭouble check that your. txt file listing all the files you want to combine like so (which my first link gives instructions on how to do easily) in the folder where you're doing the concatenation: file '/path/to/file1' ![]() If you're too lazy to read my first link, you basically have to create a. (Install ffmpeg here if you don't already have it. Instead, to combine these files properly use ffmpeg as instructed in. Using copy or cat to combine the files like szatmary's current top answer might leave you with a file that plays far past the limit and can't seek along with playback issues. Under GNU/Linux, using bash: cat segment1_0_av.ts segment2_0_av.ts segment3_0_av.ts > all.ts Under windows: copy /b segment1_0_av.ts segment2_0_av.ts segment3_0_av.ts all.tsįfmpeg -i all.ts -acodec copy -vcodec copy all.mp4 Then, once you have a single ts, transmux to mp4. However ts is one of the few formats that can simply be concatenated. I'm not sure why ffmpeg is giving you an error.
0 Comments
Leave a Reply. |