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
decryptSegment: no senc box in traf #298
Comments
Thanks for posting this. For DASH and HLS, the normal place to put the encryption information in the segments is in a |
A second look reveals that this is a PIFF encrypted file according to the uuid: |
I've looked a bit more into this and the uuid box essentially contains a The PIFF 1.1 spec describes the boxes. I cannot find it on the net any longer, although it says on page https://learn.microsoft.com/en-us/iis/media/smooth-streaming/protected-interoperable-file-format that it should be available. |
OK I had written an implementation of PIFF based on: https://github.com/yapingcat/gomedia but I found out that module cannot read a segment file by itself, which means that it must parse init for every single segment, which is really wasteful. I also looked at https://github.com/abema/go-mp4, but it doesnt even support case "uuid":
decode := func() bool {
if head.Extended_Type() == "a2394f525a9b4f14a2446c427c648df4" {
if b.Senc.Sample_Count == 0 {
return true
}
}
return false
}
if decode() {
b.Senc.BoxHeader = head
err := b.Senc.Decode(r)
if err != nil {
return err
}
} else {
value := Box{Header: head}
value.Payload = make([]byte, size)
_, err := io.ReadFull(r, value.Payload)
if err != nil {
return err
}
b.Boxes = append(b.Boxes, value)
} |
here is audio init, audio segment, video init, video segment (230 KB total): https://github.com/Eyevinn/mp4ff/files/13777792/PIFF.zip also I have the keys if you need |
Yes, it would be nice to have the keys. Then I could include both the encrypted and decrypted versions and make a test that the decryption is reproducible. |
OK it should be |
confirmed fixed - thanks |
using this file (106 MB): http://0x0.st/Hwbc.mp4
I can decrypt like this:
https://github.com/shaka-project/shaka-packager/releases
but these both fail:
result:
The text was updated successfully, but these errors were encountered: