1
$\begingroup$

I would like to apply a function to each frame in a video. Because of the size, I cannot read all frames into memory. I would like to import each frame (I know how to do that), apply my function (ditto), and then append the result to an output file. How do I do that? Export does not seem to have an "append" option. Functions like ImageFileApply are almost what I want, but they operate on pixels, not frames. Any suggestions?

$\endgroup$
  • 2
    $\begingroup$ Share the code you have to apply the function to frames. Apart from that, I don't know that adding frames to video files is as simple as physically appending to the file. I suspect that some reformatting (headers, metadata) would be necessary for each frame added, which would make the process awfully inefficient. Perhaps you could cut the video into manageable chunks externally, apply function, then restitch the edited chunks, again using an external helper program. $\endgroup$ – MarcoB Feb 14 '17 at 18:51
  • 3
    $\begingroup$ Usually the simplest approach is to export all the frames as images and use something like ffmpeg to create a movie from those. If you're using Windows an alternative is my MathMF package, which lets you read and write frames one at a time. Check some of the Related links on the right of this page too. $\endgroup$ – Simon Woods Feb 14 '17 at 20:12