![]() ![]() If you have MP4 files, these could be losslessly concatenated by first transcoding them to mpeg transport streams. Instructions ffmpeg -i "concat:input1.mpg|input2.mpg|input3.mpg" -c copy output.mpg This is analogous to using cat on UNIX-like systems or copy on Windows. Certain files (mpg and mpeg transport streams, possibly others) can be concatenated. While the demuxer works at the stream level, the concat protocol works at the file level. ffmpeg -f concat -i > mylist.txt doneįfmpeg -f concat -i mylist.txt -c copy output.mkv Make sure to generate absolute paths here, since ffmpeg will resolve paths relative to the list file your shell may create in a directory such as “/proc/self/fd/”. This would be impossible with the concat protocol (see below). If your shell supports process substitution (like Bash and Zsh), you can avoid explicitly creating a list file and do the whole thing in a single line. *.wav do echo "file '$f'" > mylist.txt done ![]() Either of the following would generate a list file containing every *.wav in the working directory: # with a bash for loopįor f in. It is possible to generate this list file with a bash for loop, or using printf. Then you can stream copy or re-encode your files: ffmpeg -f concat -i mylist.txt -c copy output ![]() Note that these can be either relative or absolute paths. ffmpeg -i "concat:/media/dvd/VIDEO_TS/VTS_01_1.VOB|/media/dvd/VIDEO_TS/VTS_01_2.VOB" -acodec libfaac -aq 100 -ac 2 -vcodec libx264 -vpre slow -crf 24 -threads 0 output.mp4Ĭreate a file mylist.txt with all the files you want to have concatenated in the following form (lines starting with a # are ignored): # this is a comment This example combines two vob files because the movie was split into several vobs. tested with ffmpeg version N-71718-gfa2d3b6-syslint If you have several videos that you need to combine into one video, here is a couple of tricks. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |