Video segmentation and merging are common in application scenarios, such as video clips, go ads, and more.
This article takes the MP4 file as the target, splits the merge
I. VLC pre-processing
If you need to highlight, sharpen, contrast, you can use VLC to achieve,
cvlc nikita.mp4--sout= "#transcode {vfilter={adjust{}:sharpen{sigma=0.12}: deinterlace{mode=mean}},vcodec=h264 , scale=0,acodec=mp4a}:file{dst=./0.mp4} "--sout-all--sout-keep
second, using FFmpeg for MP4 file segmentation
1. From 30 seconds, cut out the shard of 60 seconds long
./ffmpeg-ss 30-t 60-i nikita.mp4-same_quant seg1.mp4
Note:
1. The FFmpeg 2.4.3 version of the command is as follows
./ffmpeg-ss 30-t 60-i nikita.mp4-qscale 0-y seg1.mp4
2. Issues with the copy parameter
./ffmepg-i nikita.mp4-ss 30-t 60-vcodec copy-acodec copy-y seg1.mp4
can cause audio and video to be out of sync
third, the use of mencoder for slicing
./MENCODER-OVC X264-OAC facc-ss 30-t nikita.mp4-o seg1.mp4
it uses less memory than FFmpeg, always starts with the first IFRAME after 30s, and generates the MP4 format
or
./MENCODER-OVC COPY-OAC facc-ss 0.mp4-o 2.avi
It's a little faster than the above command,
or:
./MENCODER-OVC COPY-OAC facc-ss 0.mp4-of lavf-o 2.mp4
Iv. Segmentation MP4 merger
If this is a MP4 file, use mp4box merge directly
./mp4box-cat seg1.mp4-cat seg2.mp4-new merge.mp4
Video segmentation and Merging