[FFmpeg-devel] Suggested change for encrypted video

Don Moir donmoir at comcast.net
Fri Oct 14 18:30:00 CEST 2011


Need a new flag in avformat.h

#define AVFMT_FLAG_ENCRYPTED 0x80000 ///<Stream is likely encrypted

This effects the code in asfdec.c and asf_read_header.

In asf_read_header there is:

..................

if (!s->keylen) {
    if (!ff_guidcmp(&g, &ff_asf_content_encryption)) {
        av_log(s, AV_LOG_WARNING, "DRM protected stream detected, decoding will likely fail!\n");
    } else if (!ff_guidcmp(&g, &ff_asf_ext_content_encryption)) {
        av_log(s, AV_LOG_WARNING, "Ext DRM protected stream detected, decoding will likely fail!\n");
    } else if (!ff_guidcmp(&g, &ff_asf_digital_signature)) {
        av_log(s, AV_LOG_WARNING, "Digital signature detected, decoding will likely fail!\n");
    }
}

..................

change to:

..................

if (!s->keylen) {
    if (!ff_guidcmp(&g, &ff_asf_content_encryption)) {
        s->flags |= AVFMT_FLAG_ENCRYPTED;
        av_log(s, AV_LOG_WARNING, "DRM protected stream detected, decoding will likely fail!\n");
    } else if (!ff_guidcmp(&g, &ff_asf_ext_content_encryption)) {
        s->flags |= AVFMT_FLAG_ENCRYPTED;
        av_log(s, AV_LOG_WARNING, "Ext DRM protected stream detected, decoding will likely fail!\n");
    } else if (!ff_guidcmp(&g, &ff_asf_digital_signature)) {
        s->flags |= AVFMT_FLAG_ENCRYPTED;
        av_log(s, AV_LOG_WARNING, "Digital signature detected, decoding will likely fail!\n");
    }
}

..................

First time submitting to you so if you want me to submit small changes like this differently in the future let me know. 

At present there is no real way to know this type of thing and it must be instance driven and not some global setting.

Don


More information about the ffmpeg-devel mailing list