#6451 closed defect (fixed)
ffmpeg not able to decrypt mp4 fragment files
Reported by: | jero3000 | Owned by: | |
---|---|---|---|
Priority: | normal | Component: | avformat |
Version: | git-master | Keywords: | mov |
Cc: | Blocked By: | ||
Blocking: | Reproduced by developer: | yes | |
Analyzed by developer: | no |
Description
I am trying to decrypt a mp4 fragment file with ffmpeg.
The mp4 fragment file (attached) has the first three segments unencrypted ('senc' box is not present in the first three segments).
Ffmpeg only parses the first 'senc' box and assumes that has the enough information to decrypt the entire content. When the first 'senc' box (owned by the fourth segment) is parsed, the subsample info is correctly added to the "cenc" structure (MOVStreamContext), but when the reader tries to get the first packet from the forth segment, it assumes that the current segment is the forth encypted, however it is just first one. As a result, the offsets accessing the "cenc" structure are incorrect and these errors are showed in the output:
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f82c00015a0] auxiliary info offset 4800 greater than auxiliary info size 1600 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f82c00015a0] auxiliary info offset 4816 greater than auxiliary info size 1600 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f82c00015a0] auxiliary info offset 4832 greater than auxiliary info size 1600 ...
How to reproduce:
- Start the playback with "ffplay" specifying the decryption key:
% ./ffplay ~/Descargas/cenc.mp4 -decryption_key "00112233445566778899AABBCDEEFF"
- Wait for the fourth segment (10 seconds aprox).
The problem was reproduced in the last stable version (3.3.1), but also in git-master SHA1 id: "35c76f2e138b713928a77a8aa5734bf5c8f9368f"
Attachments (2)
Change History (7)
by , 8 years ago
comment:1 by , 8 years ago
Priority: | critical → normal |
---|
comment:2 by , 8 years ago
The decryption key was wrong. This is the correct one:
./ffplay ~/Descargas/cenc.mp4 -decryption_key "00112233445566778899AABBCCDDEEFF"
comment:3 by , 7 years ago
Keywords: | mov added |
---|---|
Reproduced by developer: | set |
Status: | new → open |
comment:4 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | open → closed |
Fixed by Jacob Trimble in f7221d8e670ec05471a16cc4cc1cc8e0040b5b5f (4.0).
Seeking backwards breaks playback with ffplay.
comment:5 by , 2 years ago
Seeking backwards breaks playback with ffplay.
Not anymore.
MP4 fragment sample file