Changes between Version 15 and Version 16 of Concatenate


Ignore:
Timestamp:
Aug 14, 2013, 11:18:02 AM (5 years ago)
Author:
evilsoup
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Concatenate

    v15 v16  
    88== Concatenation of files with same codecs ==#samecodec 
    99 
    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. 
     10There 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. 
    1111 
    1212=== Concat demuxer ===#demuxer 
     
    2929}}} 
    3030 
    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 
     31It 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{{{ 
     34for f in ./*.wav; do echo "file '$f'" >> mylist.txt 
     35printf "file '%s'\n" ./*.wav > mylist.txt 
     36}}} 
     37 
     38If 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{{{ 
     41ffmpeg -f concat -i <(for f in ./*.wav; do echo "file '$f'"; done) -c copy output.wav 
     42ffmpeg -f concat -i <(printf "file '%s'\n" ./*.wav) -c copy output.wav 
    3543}}} 
    3644