Hello
I use the following commands to split an MP4 file:
Problem is, when viewing the parts in VLC, the second part doesn't seem to start at a keyframe: The picture is crappy, and the viewer has to wait a few seconds until it looks OK; I assume ffmpeg doesn't split at keyframes.Code:ffmpeg -ss 00:00:00 -i input.mp4 -t 1:00:00 -c copy input.part1.mp4 ffmpeg -ss 00:59:50 -i input.mp4 -c copy input.part2.mp4
Is there a way to tell ffmpeg to split on the closest keyframe a few seconds before?
Thank you.
+ Reply to Thread
Results 1 to 13 of 13
-
-
Group of Pictures , used in temporal compression
https://en.wikipedia.org/wiki/Group_of_pictures -
If that is the reason, the problem is your original video . You won't get errors from splitting with closed GOPs . ffmpeg will automatically "jump" to the nearest I-frame (or i-frame) it doesn't distinguish between them as mentioned earlier . If GOP's are closed, the all I frames are IDR frames or true keyframes
Another option is mp4box, but you will have the same problems if you split on non IDR frames -
Near as I remember, it depends on where you place the -ss parameter. I believe before your input seeks to the exact frame and after your input seeks to key frame.
https://trac.ffmpeg.org/wiki/Seeking
Similar Threads
-
FFMPEG error: first frame is not keyframe
By marcorocchini in forum Newbie / General discussionsReplies: 0Last Post: 29th Sep 2013, 15:37 -
Can't navigate video files after I split them with ffmpeg
By mkvbob in forum Video ConversionReplies: 4Last Post: 24th Apr 2013, 10:32 -
FFmpeg video split frame missing
By mrahmet in forum EditingReplies: 2Last Post: 5th Dec 2012, 01:40 -
FFMpeg - warning: first frame is no keyframe - Encode to nearest keyframe?
By mh2011 in forum EditingReplies: 0Last Post: 3rd Nov 2011, 15:58 -
Keyframe intervals
By mario595 in forum Video ConversionReplies: 9Last Post: 17th Dec 2010, 10:00