crash in parsing file
fastfading opened this issue · 0 comments
generate mp4
MP4Box -crypt drm.xml output.mp4 -out output_enc.mp4
MP4Box -dash 5000 -url-template -bs-switching no -out output.mpd -rap output_enc.mp4
#parse mp4
with BufferedReader(inp) as reader:
while reader.peek(1):
box = Box.parse_stream(reader)
#crash
python3 decrypt.py -k 63cb5f7184dd4b689a5c5ff11ee6a328 -i output_enc_dashinit.mp4 -o output_enc_pydec.mp4 ─╯
Traceback (most recent call last):
File "/Users/userxxx/Downloads/dash_one/decrypt.py", line 134, in
main()
File "/Users/userxxx/Downloads/dash_one/decrypt.py", line 50, in main
decrypt(args.key, args.input, args.output)
File "/Users/userxxx/Downloads/dash_one/decrypt.py", line 85, in decrypt
box = Box.parse_stream(reader)
File "/usr/local/lib/python3.9/site-packages/construct/core.py", line 186, in parse_stream
return self._parse(stream, context, "parsing")
File "/usr/local/lib/python3.9/site-packages/pymp4/parser.py", line 46, in _parse
obj = self.subcon._parse(stream2, context, path)
File "/usr/local/lib/python3.9/site-packages/construct/core.py", line 855, in _parse
subobj = list(sc._parse(stream, context, path).items())
File "/usr/local/lib/python3.9/site-packages/construct/core.py", line 297, in _parse
return self.subcon._parse(stream, context, path)
File "/usr/local/lib/python3.9/site-packages/construct/core.py", line 1544, in _parse
obj = self.cases.get(key, self.default)._parse(stream, context, path)
File "/usr/local/lib/python3.9/site-packages/construct/core.py", line 859, in _parse
subobj = sc._parse(stream, context, path)
File "/usr/local/lib/python3.9/site-packages/construct/core.py", line 2696, in _parse
return self.subcon._parse(stream, context, path)
File "/usr/local/lib/python3.9/site-packages/construct/core.py", line 297, in _parse
return self.subcon._parse(stream, context, path)
File "/usr/local/lib/python3.9/site-packages/construct/core.py", line 427, in _parse
return stream.read()
File "/usr/local/lib/python3.9/site-packages/construct/lib/bitstream.py", line 158, in read
raise IOError("could only read %s bytes, requested %s" % (len(data),count))
OSError: could only read 92845772 bytes, requested 4260952056