I'm trying to decrypt a .m3u8
playlist, I followed these steps :
my.key
, and place it in the dir. Note
that keys can be rotated, if the playlist has multiple keys copy all
of them to different files..ts
segments to the same dirplaylist.m3u8
and use just the filename(s) for the
key(s) URI(s) and segments.and using this command to decrypt the playlist
ffmpeg -i playlist.m3u8 -c copy output.ts
but I got this error : Invalid data found when processing input
here is my m3u8 :
#EXTM3U
#EXT-X-TARGETDURATION:12
#EXT-X-ALLOW-CACHE:YES
#EXT-X-PLAYLIST-TYPE:VOD
#EXT-X-KEY:METHOD=AES-128,URI="my.key"
#EXT-X-VERSION:3
#EXT-X-MEDIA-SEQUENCE:1
#EXTINF:6.000,
s-1-v1-a1.ts
#EXTINF:6.000,
s-2-v1-a1.ts
#EXTINF:6.000,
s-3-v1-a1.ts
#EXTINF:12.000,
s-4-v1-a1.ts
#EXTINF:12.000,
s-5-v1-a1.ts
#EXTINF:6.000,
s-6-v1-a1.ts
#EXT-X-ENDLIST
.TS
file? I want to decrypt files separtlyTry specifying the full local path in your manifest so make the KEY like:
#EXT-X-KEY:METHOD=AES-128,URI="file://path/to/local/my.key"
and the TS chunks all like:
file://path/to/local/s-6-v1-a1.ts
If that doesn't work then ffmpeg could need the input for a m3u8 to be served over HTTP. So put your m3u8 file and the key and all your chunks on some web dir and rerun your ffmpeg command using the URL for the m3u8 so it'd be like:
ffmpeg -i http://mytestwebserver.com/playlist.m3u8 -c copy output.ts
If you don't have access to a webserver you can install some local and free like MAMP. I have had no issues using the above command to copy a HLS stream locally when the input is a HLS URL.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With