diff --git a/export-video.py b/export-video.py index 7d57ddb..2fe0582 100755 --- a/export-video.py +++ b/export-video.py @@ -90,6 +90,7 @@ def list_file(directory, pattern, recursive): return for i in dirs: + logging.debug(' working on file / dir %s', i) if os.path.isdir(directory + "/" + i) and recursive: logging.info('directory found : %s', i) files_list.extend(list_file( @@ -110,7 +111,7 @@ def get_file_name(path): path (string) : complete path + file """ return os.path.splitext(os.path.basename(path))[0] - + def process_arg(sysarg): """ @@ -187,7 +188,9 @@ def encode_h264(src, dest): ] + params["h264_acommand"] + [ dest+".mp4" ] + logging.debug("First Pass command %s", firstpass) execute(firstpass) + logging.debug("Second pass command %s", secondpass) execute(secondpass) else: logging.debug("one pass encoding started ...") @@ -226,14 +229,19 @@ if __name__ == "__main__": ) for f in video_files: logging.info('batch encode | file %s', f) - encode_h264(f, params["file_output"] + get_file_name(f)) + encode_h264(f, os.path.join( + params["file_output"], get_file_name(f) + )) else: if os.path.isfile(params["file_input"]): if not params["file_output"]: params["file_output"] = get_file_name(params["file_input"]) else: if os.path.isdir(params["file_output"]): - params["file_input"] += get_file_name(params["file_input"]) + params["file_input"] = os.path.join( + params["file_input"], + get_file_name(params["file_input"]) + ) logging.info('%s is a file', params["file_input"]) encode_h264(params["file_input"], params["file_output"]) else: