Log ffmpeg command and handle errors better

This commit is contained in:
Ivan Habunek 2020-09-03 09:11:23 +02:00
parent 04ddadef26
commit 772faa5901
No known key found for this signature in database
GPG Key ID: CDBD63C43A30BB95

View File

@ -104,13 +104,13 @@ def _select_playlist_interactive(playlists):
def _join_vods(directory, file_paths, target): def _join_vods(directory, file_paths, target):
input_path = "{}/files.txt".format(directory) input_path = "{}files.txt".format(directory)
with open(input_path, 'w') as f: with open(input_path, 'w') as f:
for path in file_paths: for path in file_paths:
f.write('file {}\n'.format(os.path.basename(path))) f.write('file {}\n'.format(os.path.basename(path)))
result = subprocess.run([ command = [
"ffmpeg", "ffmpeg",
"-f", "concat", "-f", "concat",
"-i", input_path, "-i", input_path,
@ -118,9 +118,12 @@ def _join_vods(directory, file_paths, target):
target, target,
"-stats", "-stats",
"-loglevel", "warning", "-loglevel", "warning",
]) ]
result.check_returncode() print_out("<dim>{}</dim>".format(" ".join(command)))
result = subprocess.run(command)
if result.returncode != 0:
raise ConsoleError("Joining files failed")
def _video_target_filename(video, format): def _video_target_filename(video, format):