Hope you are doing well. I am new to video encoding and am investigating a frame drop problem that I think has to do with group of pictures structure. If I have encoded frames with I frames, P frames, and B frames. If I do not end on an I-frame, will the B frames before it not be written to disk? Additionally, if I want to write exactly N frames, how do I ensure the Nth frame will be an I-frame so that I may write exactly N frames?