I an interfacing with a type of video stream that is about 30fps of video that is mostly static (like a still picture). I only get updates from the stream when there is movement in the video. So if the video is static for 5 minutes, I only get the data for those 5 minutes as a single frame of data. Then if there is movement on the video stream for 5 seconds, I get each of those frame's data as well (about 150 frames, for example). Then if it is still for another 5 minutes, I will get 1 single frame's data for that entire time. So the video would be 10 minutes and 5 seconds, but I would get 152 frames of data for that time period.
I'm trying to create a realtime video file from this data but when I encode it, the first and last 5 minutes of video only exist as a single frame, so instead of 5 minutes of still video, it goes straight to the 2 seconds where I had that actual realtime frames.
What would be the best approach to creating an actual, full length/real time video from this information? I'm currently using C++.