Bento4 icon indicating copy to clipboard operation
Bento4 copied to clipboard

key.bin creation in mp4-dash.py?

Open SimoneCarnio opened this issue 3 years ago • 5 comments

Hello, there is a specific reason for not adding the --output-encryption-key option also to mp4-dash.py as in mp4-hls.py ?

I'm referring to these lines:

https://github.com/axiomatic-systems/Bento4/blob/d02ef8230a8fee4904a750eb912521c5f1c74e0b/Source/Python/utils/mp4-hls.py#L254-L256

I trying to use mp4-dash.py instead of mp4-hls.py to integrate subtitles management and this option would make the scripts migration easy.

For testing purpose I'm using the --hls-key-url to point to a url with a test key and all works correct, just wondering if I'm missing the reason for not having the same behavior

Thanks

SimoneCarnio avatar May 12 '22 03:05 SimoneCarnio

The HLS specification states that the encryption key should be available through a URI and defines the corresponding syntax (URI attribute of #EXT-X-KEY tag), which allows simple and straightforward applications like dropping the key into a binary file and making it available through a file://key.bin URL, hence this feature of mp4-hls.py , I guess.

AFAIK, the DASH standard does not specify anything equivalent. It specifies encryption key material identification through 16-byte keyIds and signalization (through PSSH descriptors) but leaves it to proprietary key systems to determine how to retrieve key values from keyIds.

lfaureyt avatar May 12 '22 10:05 lfaureyt

Yes but when you use the --hls option the script also create the hls playlist, so I think it should create also the file as mp4-hls.py do

SimoneCarnio avatar May 12 '22 10:05 SimoneCarnio

OK, since mp4-dash.py can produce HLS output by activating the --hls option, this actually makes sense.

lfaureyt avatar May 12 '22 15:05 lfaureyt

Upvote for this... It should really be added, couldn't find a way of doing so

MarianoFacundoArch avatar Jun 17 '22 13:06 MarianoFacundoArch

@MarianoFacundoArch if you want to try, this is a modified version of the script that I was using for my use case, maybe it's ok also for you. Please note that I've ended up to removed the hls encryption for the moment form my workflow because of some incompatibilities with some players with the fMP4 encapsulation. mp4-dash.py.zip

SimoneCarnio avatar Jun 17 '22 14:06 SimoneCarnio