hamoid / video_export_processing

Processing library that interfaces with ffmpeg to export video files
http://funprogramming.org/VideoExport-for-Processing/
GNU General Public License v2.0
114 stars 18 forks source link

Videos become corrupted minutes/hours/days later?? #42

Closed ffd8 closed 1 year ago

ffd8 commented 7 years ago

I'm still trying to isolate the problem to see if it's an issue with the way in which I'm building movies or a bug I've discovered (most likely my fault), but in a tool I've recently updated with the latest version of VE (was using 0.1.6), we've discovered that a handful of videos randomly went from working to becoming 0bytes and having the data corrupt or disappear.. sometimes a day+ later.

To counter this, I started duplicating the videos immediately after calling the endMovie() with a loadByte()/saveByte() technique to a different folder and that's keeping them safe (the original export location of videos, is occasionally still corrupting files.. I'm guessing overwriting/referencing somehow) – but the duplicated copies stay intact.

My order of events in building movies without audio is such:

– user clicks export, I take file location/name they selected and I overwrite the instant of videoExport like such (also insert timestamp in name, to avoid overwrites): videoExport = new VideoExport(this, *videoPath*, *PGraphics layer*);

– to double check I'm not overwriting any other file, I also implemented your new functions for filename: videoExport.setMovieFileName(*videoPath*); `videoExport.setFrameRate(25);

– I add the various frames normally with: videoExport.saveFrame();

– When done, I wrap it up with both an endMovie and dispose to see if that would fix it too: videoExport.endMovie(); videoExport.dispose();

If the user is exporting a clip with synchronized audio, before the first saveFrame() I first render the clip once with audio exporting a wav file, then use your audioToTextFile() function to process text, tell VE to use the audio file: videoExport.setAudioFileName(vidPathFile);

Then repeat the process for adding frames and ending as above. To my knowledge, both clips with/without audio are still occasionally corrupting. This has happened to people on both MacOS 10.11 and 10.12

I hadn't experienced this happening at all on my older 10.9.5 system... and now try to recreate it.. but the only thing I can imagine, is if I should stop re-declaring videoExport (something I had to do back in version 0.1.6 because the setMovieFileName() function existed?

Have you seen this happen? Anything else I should test or tips for debugging this? Thanks!

hamoid commented 6 years ago

Hi! Excuse my slowness replying. Did you figure this out? I've never heard of something like this... One question: if the file size becomes 0, does this happen when running the program again? Maybe you could use inotifywait (command line tool to watch for disk activity) to notice when this happens.

hamoid commented 1 year ago

I'll close this as it's 5 years old and I haven't heard further mentions about it.