[FFmpeg-user] What is the correct way to cut the video with ffmpeg?

桃源老師 xanadu6291 at dream.jp
Tue Jun 21 11:28:18 CEST 2016


Hello, 

I have some videos which downloaded from internet.  
Those video have approximately 30 second advertisement (ad) on start.  

I can remove this ad using the following ffmpeg command:

$ ffmpeg -ss 00:00:30.666 -i INPUT.mp4 -ss 0 -c: copy OUTPUT.mp4

But here, I have one question.

The cut point "00:00:30.666" is not keyframe.  The nearest keyframe is 
"00:00:25.058" or "00:00:33.400".
And If I cut the video on keyframe, the ad remain or run over the video contents.

I have learned from the net that the video should be edit on unit of keyframe or 
can not be edit on unit of keyframe.  This is my poor knowledge about video editing.  

But as above, ffmpeg seems allows to cut video not on keyframe.  The resulting video 
playbacks fine with ffplay and VLC except QuickTime Player have approx. 2 seconds 
black screen on start.

So, I'd like to confirm my way to remove ad is correct or not.  i.e. cutting video not on 
keyframe is correct or not.  
And if my way is not correct, please teach me the correct way...


Best Regards,


// Miya aka. TougenRoushi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3577 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-user/attachments/20160621/22e45274/attachment.bin>


More information about the ffmpeg-user mailing list