Detecting DRM protected files

Lukáš Lalinský lalinsky at gmail.com
Tue Mar 29 15:43:59 CEST 2011


On Tue, Mar 29, 2011 at 2:28 PM, Martijn van Rheenen <rheenen at gmail.com> wrote:
> MP4 DRM protection:
> Something with a 'drms' atom should be detected, if it's present, the file
> is DRM protected. But I can not find proper documentation on the MP4
> fileformats to know where to find this atom (I know it should be in the
> 'moov' atom, but then the info I found stops...)

It seems to be at moov.trak.mdia.minf.stbl.stsd.drms. Just checking
for the presence of the atom should be probably enough. I've tried it
on a file that I found somewhere and it seems to work.

https://github.com/lalinsky/taglib/commit/97cd58bc

> WMA DRM protection:
> In TagLib's asffile.cpp you could add to the list of ByteVector's at the
> near-top of the file:
> static ByteVector
> asfContentEncryptionGuid("\x22\x11\xB3\xFB\xBD\x23\x11\xD2\xB4\xB7\x00\xA0\xC9\x55\xFC\x6E");
> static
> ByteVector asfExtendedContentEncryptionGuid("\x29\x8A\xE6\x14\x26\x22\x4C\x17\xB9\x35\xDA\xE0\x7E\xE9\x28\x9C");
> Then in ASF::File::read():
> Change:
> else {
>   obj = new UnknownObject(guid);
> }
> To:
> else {
>   if (guid == contentEncryptionGuid || guid ==
> extendedContentEncryptionGuid) {
>     d->tag->setDRMProtected(true);
>   }
>   obj = new UnknownObject(guid);
> }

This part seems fine, but I think that the information should go into
ASF::Properties, not ASF::Tag (especially not defining a new WM
attribute). Any chance you have a file I can test this against?

Lukas


More information about the taglib-devel mailing list