BrettSheleski / comchap

Commercial detection script to add chapters into video file
MIT License
136 stars 26 forks source link

Additional error checking and cleanup #11

Closed Reed97123 closed 7 years ago

Reed97123 commented 7 years ago

Items Changed: 1) Changed not finding commercials to informational. The exit code is 0, but it displays an informational message to stderr regardless of whether verbose is set or not. 2) Improved the error checking for comskip output. No edl file present is considered a failure in running comskip and it sets a -1 exit code, cleans up comskip files and then properly resets LD_LIBRARY_PATH and removes the lockfile before exiting. 3) Empty edl file processing is now more discerning. An empty edl is now considered a successful run but without commercials and skips ffmpeg processing and outputs like above (#1). 4) Non-empty edl checking is enhanced by testing whether the variables read in from the edl are empty before deciding there is a commercial and doing the processing. This could be the case when the file exists but has whitespace/garbage instead of proper values. This could be enhanced a little more in the future to make sure the values read in make sense. 5) Cleanup for comskip, ffmpeg and the main script are now functions to avoid re-writing the same code in multiple places and to ensure the same proper cleanup is done in all potential circumstances.

Reed97123 commented 7 years ago

I'm going to merge back to the main and readd these.