Note: I'd originally erroneously referred to an h.264 stream by the more common parlance of being an MP4 file, sorry
I'm aware of the usual need to start splitting an h.264 on a keyframe, so that the result video starts with a keyframe, but I'm wondering what it is about the stream structure/spec that makes it so?
Must a keyframe occur every X frames as a fixed parameter of the entire file, or can there be a varying interval between keyframes? If the player is just taking frames as they appear and drawing the whole thing (keyframe) or updating part of it (non keyframe), why does it matter about the keyframe interval?
If it doesn't matter about the interval, and we wanted to cut on frame 87 of a keyframe-every-100 stream, could we not use the 86 preamble frames to calculate a new keyframe for the new file, put the remaining 12 non key frames from the original file to get us to the next keyframe, then the next original keyframe (frame 100) and go from there?
i.e. The file ends up with "new key, 12 original non keys, original key, 99 original non keys, original key .."