5

How do I check whether a given file, such as an audio file, is DRM protected or not?

1

Audio DRM is mostly format specific in that most DRM-capable formats are readily identifiable by their container which is usually reflected in their extension. This is to let the player know what it's dealing with, without having to analyse the file. A common example is an AAC file that you might buy from iTunes. If it's protected with FairPlay DRM the file is named as .m3p (vs the unprotected .m4a).

There's nothing to stop companies encrypting a .mp3 and leaving the extension the same - it's just going to annoy users when they switch to one of the billion available MP3 players and it doesn't work.

For video things can be a little more complicated. Some video container formats support DRM so their extension doesn't neccessarily change. I'd suggest trying to get ffmpeg or themonospot to analyse each file.

Here's a little bash function I've just written that can get the codecs from a file:

function codec() {
    ffmpeg -i "$1" 2>&1 | grep Stream | grep -Eo '(Audio|Video)\: [^ ,]+'
}

In action:

oli@bert:~/Desktop$ codec "The Beatles - 01 - Back In The U.S.S.R.mp3"
Audio: mp3

You could trim that down even more but give it a shot on some known DRM-laden media and see what happens. It'll either explode or will tell you about the DRM.

Anyway, once you know what to expect, you can batch that, or something like it to quickly tell you which files have DRM.

2
  • On some files I want to check I get Audio: mp3, 44100 Hz, stereo, s16, 320 kb/s. Does that mean it's not DRM protected?
    – N.N.
    Feb 27 '12 at 18:30
  • 1
    I would assume so but I don't have anything DRM'd to test it with.
    – Oli
    Feb 28 '12 at 17:44
0

To determine DRM on video, you can use ffmpeg -i <filename>

E.g. On a movie purchased from Apple, this can be seen in the output:

[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc22d005600] ignoring 'frma' atom of 'mp4a', stream format is 'drms'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc22d005600] ignoring 'frma' atom of 'avc1', stream format is 'drmi'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc22d005600] ignoring 'frma' atom of 'ac-3', stream format is 'drms'
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc22d005600] stream 0, timescale not set
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc22d005600] Could not find codec parameters for stream 1 (Video: none (drmi / 0x696D7264), none, 1920x1032, 5234 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc22d005600] Could not find codec parameters for stream 2 (Audio: none (drms / 0x736D7264), 48000 Hz, 5.1(side), 384 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x7fc22d005600] Could not find codec parameters for stream 4 (Subtitle: none (p608 / 0x38303670), 1920x1032, 0 kb/s): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.