如何检查文件是否受 DRM 保护?

如何检查文件是否受 DRM 保护?

如何检查给定文件(例如音频文件)是否受 DRM 保护?

答案1

音频 DRM 主要针对特定​​格式,因为大多数支持 DRM 的格式都可以通过其容器轻松识别,而容器通常反映在其扩展名中。这是为了让播放器知道它正在处理什么,而无需分析文件。一个常见的例子是您可能从 iTunes 购买的 AAC 文件。如果它受 FairPlay DRM 保护,则文件命名为.m3p(与不受保护的文件相对.m4a)。

没有什么可以阻止公司加密.mp3并保持扩展名不变 - 这只会在用户切换到十亿个可用的 MP3 播放器中的一个而它不起作用时惹恼用户。

对于视频来说,事情可能稍微复杂一些。一些视频容器格式支持 DRM,因此它们的扩展名不一定会改变。我建议尝试获取ffmpegthemonospot分析每个文件。

这是我刚刚编写的一个小 Bash 函数,它可以从文件中获取编解码器:

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

实际操作:

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

您可以进一步减少这个数字,但请尝试使用一些已知的 DRM 媒体,看看会发生什么。它要么会爆炸,要么会告诉您有关 DRM 的信息。

无论如何,一旦您知道会发生什么,您就可以进行批处理或类似操作,以快速告诉您哪些文件具有 DRM。

答案2

要确定视频上的 DRM,您可以使用ffmpeg -i <filename>

例如,对于从 Apple 购买的电影,可以在输出中看到:

[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

相关内容