Private
Public Access
Blender-Scanvorschau und Gruppenfoto ergänzen
This commit is contained in:
1 parent
f15ab1d399
commit
4adf927773
21 files changed
+453
-4
No files matched your search
@@ -14,7 +14,7 @@ def boxes(data):
|
||||
|
||||
def child(data,name):return next(body for kind,body in boxes(data) if kind==name)
|
||||
|
||||
def inspect(path):
|
||||
def inspect(path, expected_seconds=20):
|
||||
moov=child(Path(path).read_bytes(),'moov');result=[]
|
||||
for kind,trak in boxes(moov):
|
||||
if kind!='trak':continue
|
||||
@@ -27,9 +27,9 @@ def inspect(path):
|
||||
item={'type':kind,'codec':entry[0],'duration_seconds':seconds,'samples':count}
|
||||
if kind=='vide':
|
||||
width,height=struct.unpack_from('>HH',entry[1],24);item.update(width=width,height=height,fps=count/seconds)
|
||||
assert (width,height,count)==(1280,720,480),item
|
||||
assert abs(seconds-20)<.01,item
|
||||
assert (width,height,count)==(1280,720,round(expected_seconds*24)),item
|
||||
assert abs(seconds-expected_seconds)<.01,item
|
||||
result.append(item)
|
||||
assert any(t['type']=='soun' for t in result),'Missing audio track'
|
||||
return result
|
||||
if __name__=='__main__':print(json.dumps(inspect(sys.argv[1]),indent=2))
|
||||
if __name__=='__main__':print(json.dumps(inspect(sys.argv[1],float(sys.argv[2]) if len(sys.argv)>2 else 20),indent=2))
|
||||
Reference in new issue
Block a user