![]() N=2 is specifying there are two input sources Now after we declared what streams we are using, we have a normal filter syntax: concat=n=2:v=1:a=1 Those of us with experience in programming will understand why the index starts at 0 and not 1 This translates in plain English to: Use the video stream of the first input source, use the audio stream from the first input source, use the video stream from the second input source, and use the audio stream from the second input source. Unlike using filters normally with FFmpeg using -vf or -af, when using a complex filter graph, we have to tell FFmpeg what streams of data we are operating on per filter.Īt the start you see: ![]() This one is probably pretty confusing, so let me explain the complex filter graph syntax: The example for the file level concatenation would look like this: ffmpeg -i "concat:video1.ts|video2.ts" -c copy out.tsĪnd the last example would be like so: ffmpeg -i video1.mp4 -i video2.flv -filter_complex \ Unlike most FFmpeg commands, this one takes in a text file containing the files we want to concatenate, the text file would look something like this: file 'video1.mp4' ![]() Let's look at the examples, first the concat demuxer approach: ffmpeg -f concat -i list.txt -c copy out.mp4 The syntax is hard to understand if you've never written complex filter graphs before for FFmpeg.This will cause transcoding to occur, so it takes time and may degrade the quality.This method can concat videos with different encodings.Using a complex filter graph with the concat filter There are very few encodings that can do this, the only one I've used is MPEG-2 Transport Stream codec (.ts). ![]()
0 Comments
Leave a Reply. |