对Apple的HTTP直播流使用openssl加密 [英] Using openssl encryption for Apple's HTTP Live Streaming

查看:125
本文介绍了对Apple的HTTP直播流使用openssl加密的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人有幸使用openssl加密流媒体与Apple的HTTP Live Streaming一起使用?看起来我差不多了,但我的视频没有播放,但我也没有在Safari中出现任何错误(比如视频无法播放或你没有权限播放此视频,当我拿到密钥时错误)。

Has anyone had any luck getting encrypted streaming to work with Apple's HTTP Live Streaming using openssl? It seems I'm almost there but my video doesn't play but I don't get any errors in Safari either (like "Video is unplayable" or "You don't have permission to play this video" when I got the key wrong).

#bash script:
keyFile="key.txt"
openssl rand 16 > $keyFile
hexKey=$(cat key.txt | hexdump -e '"%x"')
hexIV='0'
openssl aes-128-cbc -e -in $fileName -out $encryptedFileName -p -nosalt -iv ${hexIV}  -K ${hexKey}


#my playlist file:
#EXTM3U
#EXT-X-TARGETDURATION:000020
#EXT-X-MEDIA-SEQUENCE:0
#EXT-X-KEY:METHOD=AES-128,URI="key.txt"
#EXTINF:20, no desc
test.ts.enc
#EXT-X-ENDLIST



<我正在使用这些文档作为指南:

I was using these docs as a guide:

http://tools.ietf.org/html/draft-pantos-http-live-streaming

推荐答案

好的,我想通了......我的hexdump命令错了。它应该是:

Okay, I figured it out... My hexdump command was wrong. It should be:

hexKey=$(cat key.txt | hexdump -e '16/1 "%02x"')

这篇关于对Apple的HTTP直播流使用openssl加密的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆