
We should note that re-encoding takes time depending on the size and the type of codec used. Moreover, to limit errors, we should avoid adding lots of keyframes. Therefore, we forced FFmpeg to add keyframes at the first and last frames to ensure we encode a perfect clip. However, if the first frame is not a keyframe, then the frames before the first keyframe in the clip will not be playable. We used the -force_key_frames option because video clipping occurs at keyframes.

Finally, it will carry out an audio correction to match the timestamp and re-encode the video with the original my_video.mp4 codec.Īlternatively, if we need a more time-accurate cut, we can manually add the keyframes to the start and end of the clipped video: $ ffmpeg -i my_video.mp4 -force_key_frames 00:00:15,00:00:25 clip.mp4 The value of -t is added to the sought timestamp, which is 15 seconds. The command above will process the my_video.mp4 input file and seek 15 seconds forward in the video. The value 1 will correct the start of the stream without any later correction.

Shift->Left or Right changes the zoom level.Change the starting position using the Left or Right key.


This application reads multiple MTS (common camcorder recording format) and a MP3 file using FFMPEG library and and present them as wave forms for easier alignment. So, it is necessary to synchronize the video with the audio. For high audio quality, sound is separately recorded with an audio recorder when video is taken.
