是否可以在ffmpeg中加密mpeg-dash清晰内容? [英] Is it possible to encrypt mpeg-dash clear content in ffmpeg?
问题描述
是否可以在ffmpeg中加密mpeg-dash透明内容?还是我们需要其他代码来处理加密?
Is it possible to encrypt mpeg-dash clear content in ffmpeg? or do we need to additional code to handle the encryption?
从ffmpeg dashenc.c代码看来,破折号没有加密内容.我们可以重复使用mp4混合器进行加密和使用破折号进行分段吗?
From ffmpeg dashenc.c code it appears that dash code does not encrypt the content. Can we reuse the mp4 muxer for encrypting and dash for segmenting?
推荐答案
如果满足您的需要,可以使用ffmpeg和openssl创建AES加密的HLS流-ffmpeg文档(
You can use ffmpeg and openssl to create an AES encrypted HLS stream if this meets your needs - the ffmpeg documentation (http://ffmpeg.org/ffmpeg-all.html#Options-34) includes this example script:
#!/bin/sh
BASE_URL=${1:-'.'}
openssl rand 16 > file.key
echo $BASE_URL/file.key > file.keyinfo
echo file.key >> file.keyinfo
echo $(openssl rand -hex 16) >> file.keyinfo
ffmpeg -f lavfi -re -i testsrc -c:v h264 -hls_flags delete_segments \
-hls_key_info_file file.keyinfo out.m3u8
您还可以使用mp4Box( https://gpac.wp.imt.fr/mp4box/encryption/common-encryption/)来创建基本的清除DASH加密:
You can also use mp4Box (https://gpac.wp.imt.fr/mp4box/encryption/common-encryption/) to create basic clear DASH encryptions:
MP4Box -crypt drm_file.xml movie.mp4 -out movie_encrypted.mp4
MP4Box -crypt drm_file.xml movie.mp4 -out movie_encrypted.mp4
drm信息包含在drm_file.xml中,并在上面的链接中进行了解释.
The drm info is included in the drm_file.xml and is explained at the link above.
这篇关于是否可以在ffmpeg中加密mpeg-dash清晰内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!