Once ffmpeg complete, if all went well, that temp file is copied into destination.
Copying is very safe (considering we could be on different filesystems) but it's unnecessarily slow if on the same filesystem. We should first attempt to move and only copy as fallback.
encoding is not just CPU intensive, it can consume a lot of space and is subject to disk speed to some extent. For those reasons, we should be able to provide a temp folder to use and only fallback to system's should it not be provided.
reencode()
uses a temporary file to encode into.Once ffmpeg complete, if all went well, that temp file is copied into destination.