Closed ghost closed 2 years ago
Yes, this is entirely possible to do. The mp4encrypt
command line tool can be used for that (you'll have to write a script to sequence the calls to the tool, passing the appropriate arguments for each of the segments).
@barbibulle Thanks for that info! So I basically just have to setup a for loop, walk through all the m4s segments and encrypt each one after another using mp4encrypt? What about the .m3u8 files and the init-segments ?
Currently, my structure looks like this:
Each folder contains one .m3u8 file and one init segment besides the actual content segments. I guess that I don't have to encrypt the init segment nor the m3u8 files right?
What about the EXT-X-KEY line. Is it okay if I only reference this in the master.m3u8 or do I need a reference it at every of my m3u8 files within my subfolders like shown in the picture?
Many many thanks in advance
Mmm, if I run mp4encrypt against a single segment I get back a 96 byte large file from an 15 MB large input without any further message, this can't make any sense. Any idea what I'm doing wrong?
This is the command I run:
./mp4encrypt --method MPEG-CBCS f-0004.m4s f-0004.enc --key 1:00112233445566778899aabbccddeeff:random
You have also to specify the init segment through the --fragments-info
option.
@fadhlirahim Works like a charm, :D thanks! What about the master.m3u8 file(s), where do I have to place the EXT-X-KEY line? Is it fine if it's only located in the master.m3u8 at the roots directory like shown in the picture above, or do I have to place the key at every of my master.m3u8 file, so basically for every track/folder I have (each folder shown above contains a master.m3u8 file I mean) ?
Hey folks,
I'm using ffmpeg to build my HLS stream, sadly ffmpeg does not support fmp4 encryption, at least not for m4s segments, only for .ts segments. Anyway, I would like to know if bento4 is able to help me out here. I have a master.m3u8 file and lots of folders for ABR playback, is bento4 able to do the encryption here for me instead of ffmpeg?
So basically the flow would be to first use ffmpeg to create the HLS stream and then use bento4 to encrypt the segments generated previously by ffmpeg.
Thanks in advance