Fix for videos with no frame

This commit is contained in:
Fabrice Quenneville 2020-11-15 23:07:18 -05:00
parent 506e5a6cc5
commit 44c58b988d

View File

@ -208,6 +208,13 @@ def get_resolution(filename):
output = output.splitlines()[-1] output = output.splitlines()[-1]
elif "SEI type" in output: elif "SEI type" in output:
output = output.splitlines()[-1] output = output.splitlines()[-1]
elif "no frame!" in output:
output = output.splitlines()[-1]
# elif "no frame" in output:
# print(str(filename))
# print(output)
# output = output.splitlines()[-1]
# exit()
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
print(f"{bcolors.FAIL}There seams to be an error with {filename}{bcolors.ENDC}") print(f"{bcolors.FAIL}There seams to be an error with {filename}{bcolors.ENDC}")
return False return False
@ -236,6 +243,8 @@ def get_codec(filename):
output = output.splitlines()[-1] output = output.splitlines()[-1]
elif "SEI type" in output: elif "SEI type" in output:
output = output.splitlines()[-1] output = output.splitlines()[-1]
elif "no frame!" in output:
output = output.splitlines()[-1]
except subprocess.CalledProcessError: except subprocess.CalledProcessError:
print(f"{bcolors.FAIL}There seams to be an error with {filename}{bcolors.ENDC}") print(f"{bcolors.FAIL}There seams to be an error with {filename}{bcolors.ENDC}")
return False return False