Open diogoazevedos opened 7 months ago
When encrypting a segment by itself, you need to pass in a reference to the unit segment, where some of the encryption parameters are stored (that info is only in the init segment and not repeated in each individual segment).
@barbibulle Yup, the attached file above is the concat of the init and fragment.
@barbibulle the original segment is in TS, which is remuxed into MP4 using FFmpeg. During the remuxing the PTS is also adjusted so we've an homogenous timeline provider-agnostic.
The remuxing is essentially the following FFmpeg:
ffmpeg -i video-stream-4_144979815.ts -c:v copy \
-fflags '-autobsf' \
-movflags 'frag_custom+dash+delay_moov' \
154023527127780.mp4
Original TS segment: video-stream-4_144979815.ts.log
It's not allowed to attach
.ts
files, but appending a.log
did the trick.
Worth mentioning that this issue happens only when we encrypt segments coming from partners which are using Synamedia encoders.
I’m trying to encrypt the attached segment using
mp4encrypt
usingMPEG-CENC
method, but the resulting segment becomes unplayable:Shaka Player throws
MediaError(3,,CHUNK_DEMUXER_ERROR_APPEND_FAILED: Incorrect CENC subsample size.)
. Decrypting the encrypted segment usingmp4decrypt
and checking the integrity using FFmpeg, results into:https://github.com/axiomatic-systems/Bento4/assets/1440785/ec6946b1-0825-4745-9c7c-d8e513c6a0a4