如何通过FFmpeg API设置解密密钥打开采样加密AAC文件?
问题:使用FFmpeg API打开采样加密AAC文件时的解密密钥设置问题
我正尝试使用FFmpeg API打开一个采样加密的AAC封装音频文件。
我可以正常打开未加密的AAC文件,代码如下:
AVFormatContext* iContext = nullptr; avformat_open_input(&iContext, mediaFileName.c_str(), nullptr, nullptr);
也能通过设置decryption_key选项打开采样加密的fmp4片段,代码如下:
AVDictionary *options = nullptr; av_dict_set(&options, "decryption_key", ssKey.str().c_str(), 0); AVFormatContext* iContext = nullptr; int ret = avformat_open_input(&iContext, mediaFileName.c_str(), nullptr, &options);
但打开采样加密AAC文件时,找不到设置解密密钥的方法。用上述代码时,decryption_key选项未被解复用器消耗,说明AAC解复用器不识别该选项。
带有采样加密AAC音轨的HLS资源可以在ffplay中正常播放,说明FFmpeg本身支持这种格式,求解决思路。
内容的提问来源于stack exchange,提问作者rdrmntn
相关产品推荐
相关产品推荐

