I’m recording video from a live stream. The format we’re recording in requires the number of frames to be in the initial header. Obviously when we begin recording we don’t know the size of the video and it can get into the 10s of GBs fairly easily. My question is, how does one overwrite a specific set of bytes in a binary file using C# without having to deal with the whole file?
I’m recording video from a live stream. The format we’re recording in requires the
Share
You use a
FileStream– it will let you set the position in the file and overwrite at that location.You will need to ensure at this point that the file is closed and no video is still being written to it as you could get a lock violation otherwise.