Eyevinn / mp4ff

Library and tools for parsing and writing MP4 files including video, audio and subtitles. The focus is on fragmented files. Includes mp4ff-info, mp4ff-encrypt, mp4ff-decrypt and other tools.
MIT License
460 stars 83 forks source link

support low latency hls (llhls) encrpytion #255

Closed fastfading closed 1 year ago

fastfading commented 1 year ago

I am working on llhls with this open source project https://github.com/bluenviron/mediamtx it works well, however missing llhls encrpytion feature. I wonder how to do that in llhls . llhls will generate normal segment.fmp4 and a smaller fragment.fmp4 shall we just encrypt segment.fmp4 fragment.fmp4 one by one ? witch encryption method shall we use ?

    METHOD=SAMPLE-AES    = SAMPLE-AES-CTR   ?? ['SAMPLE-AES', 'SAMPLE-AES-CTR', 'SAMPLE-AES-CENC'];
    METHOD=AES-128       = AES-128-CBC

I see there is an example decrypted example https://github.com/Eyevinn/mp4ff/tree/master/examples/decrypt-cenc could you provide an encrypt example ?

tobbee commented 1 year ago

Implementation of encrypting segments in mp4ff is not planned for the near future, but Eyevinn is a video consultancy company so you can contact us if you want to speed it up by sponsoring the implementation, see the bottom of the main README

Encryption of fMP4 should be done in cbcs format, and is clear from the HLS specification. Bento4 and MP4Box should both have support for generating such segments.