Fix issue with source and destination paths

The paths need to be different or ffmpeg is not able to process the
input file completely because it will get destroyed as soon as the
output file gets created at the same path.

This change will use a temporary file and then replace the original
file.
1.0.2