dash-mpd-cli icon indicating copy to clipboard operation
dash-mpd-cli copied to clipboard

native decryption

Open 3052 opened this issue 1 year ago • 3 comments

running a command like this:

dash-mpd-cli --key 21b82dc2ebb24d5aa9f8631f04726650:602a9289bfb9b1995b75ac63f123fc86 `
http://example.com/v1/dash/196861183/manifest.mpd

I get this result:

Download failed: I/O error spawning mp4decrypt

I think it would be helpful if the tool here could just do the decryption itself. have you searched for any decryption crates?

3052 avatar Nov 22 '23 21:11 3052

Patches are welcome!

emarsden avatar Nov 23 '23 18:11 emarsden

have you searched for any decryption crates?

3052 avatar Nov 23 '23 18:11 3052

Decryption is not actually the most complicated aspect here. CENC content protection doesn't involve encrypting a full file, but rather encrypting media fragments. It requires reading and writing specific box types for MP4 containers, and specific Element types for WebM/Matroska containers. Unfortunately, there are currently no mature crates that I know of for reading and writing MP4 and WebM container formats. This is why external helper applications are used.

To simplify the process of installing a bunch of external dependencies (and for better internet hygiene!), I recommend you run dash-mpd-cli in a podman container; see

https://emarsden.github.io/dash-mpd-cli/container.html

emarsden avatar Nov 26 '23 09:11 emarsden

FYI if it helps I have a minimal implementation here

https://github.com/3052/sofia

1649 LOC using scc -n _test.go - its a different language but might be a good start point

3052 avatar Sep 16 '24 23:09 3052