axiomatic-systems / Bento4

Full-featured MP4 format, MPEG DASH, HLS, CMAF SDK and tools
http://www.bento4.com
2.03k stars 483 forks source link

After using mp4encrypt to encrypt an MP4 file with MPEG-CENC, the video cannot be played by dragging the progress bar. #985

Open cderfv1 opened 1 month ago

cderfv1 commented 1 month ago

The source video needs to be a fragmented MP4 file. so first I convert mp4 to a fragmented file.mp4fragment: ./mp4fragment --index /mnt/c/test/zhz1.mp4 /mnt/c/test/zhz1-f.mp4

then: ./mp4encrypt --method MPEG-CENC --key 1:a0a1a2a3a4a5a6a7a8a9aaabacadaeaf:0123456789abcdef --property 1:KID:121a0fca0f1b475b8910297fa8e0a07e --key 2:a0a1a2a3a4a5a6a7a8a9aaabacadaeaf:aaaaaaaabbbbbbbb --property 2:KID:121a0fca0f1b475b8910297fa8e0a07e /mnt/c/test/zhz1-f.mp4 /mnt/c/test/zhz1-cenc.mp4

After dragging the progress bar, it will play for a long time. It looks like it's must decrypted from the first frame until the current frame.

I find the difference between the encrypted stream's sidx and the clear stream is very large.

20241024152427

HELP!

cderfv1 commented 2 weeks ago

why mp4encrypt required source video needs to be a fragmented MP4 file?