Remove files if command not sucessful
0
I mux mp4 videos and webm videos with srt (subtitles) files. All the files have the same filenames but different extensions. Like this: Video1.mp4 Video1.srt or Video2.webm Video2.srt Sometimes the muxing (merge video with subtitles) is not successful because the srt file is empty. The command line tool I use to merge video with subtitles is called MKVMerge and has 3 exit codes: 0 -- This exit codes means that muxing has completed successfully. 1 -- In this case mkvmerge(1) has output at least one warning, but muxing did continue. A warning is prefixed with the text 'Warning:'. Depending on the issues involved the resulting file might be ok or not. The user is urged to check both the warning and the resulting file. 2 -- This exit code is used after an error occurred. mkvmerge(1) aborts r