I'm trying to accomplish a smart rendering workflow using ffmpeg/x264, which goes like this: get ffmpeg to segment the input file at keyframes. Locate the segment(s) with changes to be made. Re-encode altered segments with same parameters as source. Concatenate altered + original segments.
Problem: the resulting video turns garbage when it first traverses from an original to altered segment or vice-versa. Most likely, because the altered chunks and original chunks differ in some bitstream parameters, or possibly some GOP boundary issues are at play.