Refactor the function to work like vidjil works. Write the output to a file with the suffix vidjil.extra