Changes between Version 15 and Version 16 of Concatenate
- Timestamp:
- Aug 14, 2013, 8:18:02 AM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Concatenate
v15 v16 8 8 == Concatenation of files with same codecs ==#samecodec 9 9 10 There are two methods within ffmpeg that can be used to concatenate files of the same type: [#demuxer the concat ''demuxer''] and [#protocol the concat ''protocol'']. The demuxer is more flexible - it requires the same codecs, but different container formats can be used; and it can be used with any container formats, while the protocol only works with a select few containers. However, the concat protocol is not available in older versions of ffmpeg.10 There are two methods within ffmpeg that can be used to concatenate files of the same type: [#demuxer the concat ''demuxer''] and [#protocol the concat ''protocol'']. The demuxer is more flexible - it requires the same codecs, but different container formats can be used; and it can be used with any container formats, while the protocol only works with a select few containers. However, the concat protocol is available in older versions of ffmpeg, where the demuxer isn't. 11 11 12 12 === Concat demuxer ===#demuxer … … 29 29 }}} 30 30 31 If your shell supports process substitution (like Bash and Zsh), you can create such a file on the fly, for example, to concatenate all WAV files in the current folder. This would be impossible with the concat protocol (see below): 32 33 {{{ 34 ffmpeg -f concat -i <( for f in *.wav; do echo "file '$(pwd)/$f'"; done ) output.wav 31 It is possible to generate this list file with a bash for loop, or using printf. Either one of the following would generate a list file containing every *.wav in the working directory: 32 33 {{{ 34 for f in ./*.wav; do echo "file '$f'" >> mylist.txt 35 printf "file '%s'\n" ./*.wav > mylist.txt 36 }}} 37 38 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. This would be impossible with the concat protocol (see below): 39 40 {{{ 41 ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c copy output.wav 42 ffmpeg -f concat -i <(printf "file '%s'\n" ./*.wav) -c copy output.wav 35 43 }}} 36 44
