Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash in parsing file #12

Open
fastfading opened this issue Oct 14, 2021 · 0 comments
Open

crash in parsing file #12

fastfading opened this issue Oct 14, 2021 · 0 comments

Comments

@fastfading
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant