> I have tried to do what you have suggested. Somehow, it still cause > ffmpeg to crash at the exact moment the file is being renamed. > > By the way, I am running in Windows environment. Not sure, if in > Linux will this issue occurs.
It works fine for me but I'm on Linux. If renaming doesn't work, have you tried copying the new file over the top of the old one? I'm not familiar enough with Windows to know how to atomically overwrite a file. But I searched Google and found this: https://stackoverflow.com/questions/167414/is-an-atomic-file-rename-with-overwrite-possible-on-windows It suggests there is a Windows API function called MoveFileTransacted() that you could use. I'm surprised just opening the file in read-write mode, seeking to the start, then writing your content doesn't work though. You might get a frame here or there with incomplete data but it won't cause ffmpeg to exit with an error. Cheers, Adam. _______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".