FFmpeg tricks for concatenation and splicing video
Posted By : Mohit Shakya | 30-Jun-2017
Video Splicing and Concatination using FFmpeg
We'll learn about some of ffmpeg tricks for video splicing and concatenation, first of all I want to let you know about FFmpeg
FFmpeg is a most usable tool for video editing world-wide either it is directly used or using various application.
Mostly transcoding based and platforms uses ffmpeg as core solution for video modification and manipulation.
It's available in all OS variant binaries.
This programme is completely written in C language, due to this feature it's somewhat CPU intensive but extremly fast and durable in context for video manipulation and transcoding.
There are various usage of this tool in video domain except Cancatenation and Splicing of video.
Let me tell you about concatenation and splicing of video using ffmpeg.
Splicing of Video using FFmpeg:
For splicing of video we'll use following command:
$ ffmpeg -i output.mp4 -map 0 -segment_time 36 -f segment -c copy delta%03d.mp4
In above command following arameters are used:
* '-i': it's used to provide input file
* '-map': it's used to provide target stream.
* '-segment_time': this option is used to provide segment time duration in seconds.
* 'dalta%03d.mp4': this is the output segment name with '%03d' index till 3 digit places.
* '-c copy': this is used to copy the complete stream as it is to segment file.
Concatenation of Video using FFmpeg:
For concatenation of Video we use following command:
* first convert your stream to a mediator stream 'mpg' using following command:
$ ffmpeg -i "concat:delta000.mp4|delta001.mp4|delta002.mp4" -c copy -y output.mp4
In above command following parameters are used:
* '-i "concat:delta000.mp4|delta001.mp4" : in this input files are supplied using concat protocol of ffmpeg to merge as output.mp4