Fix for malformed mpeg4 video headers
This commit is contained in:
parent
9e832cf44f
commit
a3028136af
12
curator.py
12
curator.py
@ -201,9 +201,9 @@ def get_resolution(filename):
|
|||||||
|
|
||||||
# Dealing with malformed video chapters
|
# Dealing with malformed video chapters
|
||||||
if "Referenced QT chapter track not found" in output:
|
if "Referenced QT chapter track not found" in output:
|
||||||
args = ["ffprobe","-v","error","-select_streams","v:0", "-ignore_chapters", "1", "-show_entries","stream=width,height","-of","csv=s=x:p=0",str(filename)]
|
output = output.splitlines()[-1]
|
||||||
output = subprocess.check_output(args, stderr=subprocess.STDOUT)
|
elif "Error, header damaged or not MPEG-4 header" in output:
|
||||||
output = output.decode().strip()
|
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
|
||||||
@ -225,9 +225,9 @@ def get_codec(filename):
|
|||||||
|
|
||||||
# Dealing with malformed video chapters
|
# Dealing with malformed video chapters
|
||||||
if "Referenced QT chapter track not found" in output:
|
if "Referenced QT chapter track not found" in output:
|
||||||
args = ["ffprobe", "-v", "error", "-select_streams", "v:0", "-ignore_chapters", "1", "-show_entries", "stream=codec_name", "-of", "default=noprint_wrappers=1:nokey=1", str(filename)]
|
output = output.splitlines()[-1]
|
||||||
output = subprocess.check_output(args, stderr=subprocess.STDOUT)
|
elif "Error, header damaged or not MPEG-4 header" in output:
|
||||||
output = output.decode().strip()
|
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
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user