-# tmp chapter file used by handbrake when creating mkv
-$chapter_file = `tempfile`; chomp($chapter_file);
+# tmp chapter file used by handbrake when creating mkv, but remove the 0 byte file it creates, we'll create it if we need it
+$chapter_file = `tempfile`; chomp($chapter_file); unlink "$chapter_file";