def check_subprocess(cmd, source, outname):
logger = logging.getLogger(__name__)<EOL>try:<EOL><INDENT>res = subprocess.run(cmd, stdout=subprocess.PIPE,<EOL>stderr=subprocess.PIPE)<EOL><DEDENT>except KeyboardInterrupt:<EOL><INDENT>logger.debug('<STR_LIT>', outname)<EOL>if os.path.isfile(outname):<EOL><INDENT>os.remove(outname)<EOL><DEDENT>raise<EOL><DEDENT>if res.returncode:<EOL><INDENT>logger.debug('<STR_LIT>', res.stdout.decode('<STR_LIT:utf8>'))<EOL>logger.debug('<STR_LIT>', res.stderr.decode('<STR_LIT:utf8>'))<EOL>if os.path.isfile(outname):<EOL><INDENT>logger.debug('<STR_LIT>', outname)<EOL>os.remove(outname)<EOL><DEDENT>raise SubprocessException('<STR_LIT>' + source)<EOL><DEDENT>
Run the command to resize the video and remove the output file if the
    processing fails.