Video Glitching: DRM Encryption

I will start just by saying that I’m not a person that has practiced the glitch art form, but having been exposed to some examples of it, it’s not hard to recognize it. The difference is that this particular glitch was not one that I actively had to partake in – it was already done for me thanks to the mastering and encoding processes. Let me explain.

The Source

Just recently, our suburb had a council-organized clean-up day where people disposed of their rubbish on the kerbside on a Sunday evening awaiting for collection on the following Monday morning. This is often a great opportunity for a salvage run, and I couldn’t help myself. Of course, I always had to compete with the people in utes, vans and those doing it for commercial scrap-metal or garage-sale value which was an annoyance which I couldn’t do much about.

In my luck, I came across a disposed original copy of Finding Nemo – an Australian market release with two discs. The second disc was the Disney Digital Copy, with the authorization key (which I didn’t use nor care about).

2016120611499963

The supply of such DRM-locked media really irritates me, because there usually isn’t really a good reason for the consumer to use it. Instead, it provokes frustration due to further DRM on the digital copy and the need for activation, and it’s often used as a justification to shove even more complex and problematic DRM on the DVD that accompanies it to stop it from being ripped (and consequently, being played on certain less-forgiving DVD players). Finally, it is another piece of plastic which is an environmental disaster, especially considering that the offered digital copies might require internet connection to decrypt and activate, the activation may be limited to one copy limiting resale value and making the disc otherwise useless, and the quality offered is typically less than that on the DVD in the first place.

2016120611519965

Knowing all of this, I had no intention of actually using the disc for its original intent – namely activating and receiving a digital copy of the movie. Instead, I tried to analyze the files on the disc to see what was there.

It was clear from a quick walk that there was a wrapper program that helped users import the media, and several versions of the media itself totalling about 3.6Gb. This was curious, as the disc was double-layered – it turns out there’s a second Mac-only HFS partition likely with yet another copy of the media … hence the need for a dual layer disc.

One version was prepared for iTunes, with a filename of FeatureMovie with no extension. The file itself was an .mp4/.m4v container file, and MediaInfo had the following to say about it:

Complete name               : FeatureMovie
Format                      : MPEG-4
Codec ID                    : M4V  (M4V /mp42/isom)
File size                   : 1.46 GiB
Duration                    : 1h 40mn
Overall bit rate mode       : Variable
Overall bit rate            : 2 076 Kbps
Encoded date                : UTC 2012-08-06 06:48:26
Tagged date                 : UTC 2012-08-06 06:49:16

Video #1
ID                          : 1
Format                      : AVC
Format/Info                 : Advanced Video Codec
Format profile              : [email protected]
Format settings, CABAC      : No
Format settings, ReFrames   : 1 frame
Codec ID                    : drmi / avc1 / c608
Duration                    : 1h 40mn
Bit rate                    : 1 550 Kbps
Width                       : 640 pixels
Height                      : 480 pixels
Display aspect ratio        : 16:9
Frame rate mode             : Constant
Frame rate                  : 23.976 (23976/1000) fps
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Bits/(Pixel*Frame)          : 0.210
Stream size                 : 1.09 GiB (75%)
Language                    : English
Encoded date                : UTC 2012-08-06 06:48:21
Tagged date                 : UTC 2012-08-06 06:49:16
Color range                 : Limited
Color primaries             : BT.601 NTSC
Transfer characteristics    : BT.709
Matrix coefficients         : BT.601

Video #2
ID                          : 6
Format                      : JPEG
Codec ID                    : jpeg
Duration                    : 1h 40mn
Bit rate mode               : Variable
Bit rate                    : 9 442 bps
Width                       : 640 pixels
Height                      : 360 pixels
Display aspect ratio        : 1.85:1
Frame rate mode             : Variable
Frame rate                  : 0.005 fps
Minimum frame rate          : 0.002 fps
Maximum frame rate          : 0.024 fps
Color space                 : YUV
Chroma subsampling          : 4:4:4
Bit depth                   : 8 bits
Compression mode            : Lossy
Bits/(Pixel*Frame)          : 8.196
Stream size                 : 7.20 MiB (0%)
Language                    : English
Default                     : No
Encoded date                : UTC 2012-08-06 06:48:22
Tagged date                 : UTC 2012-08-06 06:49:16
Menu For                    : 2,3

Audio #1
ID                          : 2
Format                      : AAC
Format/Info                 : Advanced Audio Codec
Format profile              : LC
Codec ID                    : 40
Duration                    : 1h 40mn
Source duration             : 1h 40mn
Bit rate mode               : Constant
Bit rate                    : 128 Kbps
Channel(s)                  : 2 channels
Channel positions           : Front: L R
Sampling rate               : 44.1 KHz
Frame rate                  : 43.066 fps (1024 spf)
Compression mode            : Lossy
Stream size                 : 91.4 MiB (6%)
Source stream size          : 91.4 MiB (6%)
Language                    : English
Default                     : Yes
Alternate group             : 1
Encoded date                : UTC 2012-08-06 06:48:22
Tagged date                 : UTC 2012-08-06 06:49:16
Encryption                  : iTunes
Fallback From               : 3
Menus                       : 5,6

Audio #2
ID                          : 3
Format                      : drms
Codec ID                    : drms
Duration                    : 1h 40mn
Source duration             : 1h 40mn
Bit rate mode               : Constant
Bit rate                    : 384 Kbps
Sampling rate               : 48.0 KHz
Bit depth                   : 16 bits
Stream size                 : 277 MiB (18%)
Source stream size          : 277 MiB (18%)
Language                    : English
Default                     : Inherited From: 2
Alternate group             : 1
Encoded date                : UTC 2012-08-06 06:48:22
Tagged date                 : UTC 2012-08-06 06:49:16
Encryption                  : iTunes
Fallback To                 : 2
Menus                       : 5,6

Text
ID                          : 4
Format                      : p608
Codec ID                    : p608
Duration                    : 1h 33mn
Source duration             : 1h 33mn
Bit rate mode               : Variable
Bit rate                    : 132 bps
Stream size                 : 90.3 KiB (0%)
Source stream size          : 90.3 KiB (0%)
Language                    : English
Forced                      : No
Encoded date                : UTC 2012-08-06 06:48:22
Tagged date                 : UTC 2012-08-06 06:49:16

Menu
ID                          : 5
Codec ID                    : tx3g
Duration                    : 1h 40mn
Language                    : English
Encoded date                : UTC 2012-08-06 06:48:22
Tagged date                 : UTC 2012-08-06 06:49:16
Menu For                    : 2,3
Source duration             : 6053511
Source frame count          : 32
Source stream size          : 428
Frame count                 : 32
Stream size                 : 428
00:00:00.000                : New Parents
[Other chapters listed but removed for brevity]
01:33:24.000                : End Credits
Bit rate mode               : VBR

It seems this file has a number of streams. The video stream is encrypted, the ID being drmi. The second video stream is a JPEG stream, which is not encrypted, and only contains the chapter images.  Two audio streams are encrypted with iTunes drms. There is also a subpictures stream and a chapter stream.

Despite the encryption, the file metadata is relatively intact, and we can see the encoding is only at [email protected] with a 640×480 pixel frame size and a bitrate of 1.55Mbit/s. The audio is provided in both 384kbit/s and 128kbit/s formats. The quality provided is hence only very basic, and likely inferior to the DVD it is based upon that has 720×576 resolution at a higher bitrate, although using MPEG-2 instead. Unfortunately due to the encryption and the abiding nature of the decoders, only the still JPEGs can be seen.

Two versions were supplied in Windows Media format .wmv containers. One had the suffix PC for computer playback, the other had PT for portable playback. The MediaInfo data showed the following:

General
Complete name               : Finding_Nemo_EN_PC.wmv
Format                      : Windows Media
File size                   : 1.65 GiB
Duration                    : 1h 40mn
Overall bit rate mode       : Variable
Overall bit rate            : 2 337 Kbps
Maximum Overall bit rate    : 6 756 Kbps
Encryption                  : http://www.microsoft.com/isapi/redir.dll?prd=wmdrm&pver=2&os=win&sbp=newclient
Encoded date                : UTC 2012-08-08 05:16:08.867

Video
ID                          : 2
Format                      : VC-1
Format profile              : [email protected]
Codec ID                    : WMV3
Codec ID/Info               : Windows Media Video 9
Codec ID/Hint               : WMV3
Description of the codec    : Windows Media Video 9
Duration                    : 1h 40mn
Bit rate mode               : Variable
Bit rate                    : 2 200 Kbps
Width                       : 640 pixels
Height                      : 360 pixels
Display aspect ratio        : 16:9
Frame rate                  : 23.976 (23976/1000) fps
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Compression mode            : Lossy
Bits/(Pixel*Frame)          : 0.398
Stream size                 : 1.55 GiB (94%)
Language                    : English (US)
Encryption                  : Encrypted

Audio
ID                          : 1
Format                      : WMA
Format version              : Version 2
Codec ID                    : 161
Codec ID/Info               : Windows Media Audio
Description of the codec    : Windows Media Audio 9.2 - 128 kbps, 48 kHz, stereo (A/V) 2-pass CBR
Duration                    : 1h 40mn
Bit rate mode               : Constant
Bit rate                    : 128 Kbps
Channel(s)                  : 2 channels
Sampling rate               : 48.0 KHz
Bit depth                   : 16 bits
Stream size                 : 92.4 MiB (5%)
Language                    : English (US)
Encryption                  : Encrypted

-------------------------------------------------------------------
General
Complete name               : Finding_Nemo_EN_PT.wmv
Format                      : Windows Media
File size                   : 452 MiB
Duration                    : 1h 40mn
Overall bit rate mode       : Constant
Overall bit rate            : 627 Kbps
Maximum Overall bit rate    : 706 Kbps
Encryption                  : http://www.microsoft.com/isapi/redir.dll?prd=wmdrm&pver=2&os=win&sbp=newclient
Encoded date                : UTC 2012-08-08 05:02:04.217

Video
ID                          : 2
Format                      : VC-1
Format profile              : Simple
Codec ID                    : WMV3
Codec ID/Info               : Windows Media Video 9
Codec ID/Hint               : WMV3
Description of the codec    : Windows Media Video 9
Duration                    : 1h 40mn
Bit rate mode               : Constant
Bit rate                    : 600 Kbps
Width                       : 320 pixels
Height                      : 176 pixels
Display aspect ratio        : 16:9
Frame rate                  : 23.976 (23976/1000) fps
Nominal frame rate          : 29.970 fps
Color space                 : YUV
Chroma subsampling          : 4:2:0
Bit depth                   : 8 bits
Scan type                   : Progressive
Compression mode            : Lossy
Bits/(Pixel*Frame)          : 0.444
Stream size                 : 433 MiB (96%)
Language                    : English (US)
Encryption                  : Encrypted

Audio
ID                          : 1
Format                      : WMA
Format version              : Version 2
Codec ID                    : 161
Codec ID/Info               : Windows Media Audio
Description of the codec    : Windows Media Audio 9.2 -  96 kbps, 44 kHz, stereo (A/V) 2-pass CBR
Duration                    : 1h 40mn
Bit rate mode               : Constant
Bit rate                    : 96.0 Kbps
Channel(s)                  : 2 channels
Sampling rate               : 44.1 KHz
Bit depth                   : 16 bits
Stream size                 : 69.3 MiB (15%)
Language                    : English (US)
Encryption                  : Encrypted

Both Windows Media versions also have intact metadata, although the encoding varies. The PC version is WMV9 at 640×360 (suggesting the black bars top and bottom have been cropped), and at 2.2Mbit/s with 128kbit/s WMA 9.2 audio. The portable version drops it to 320×176 at 600kbit/s with 96kbit/s audio.

The point of encryption is to scramble the data to make it very difficult to reconstruct. Many properties of good encryption result in a datastream that resembles pure noise. By pure chance, I discovered the intact metadata on the WMV files resulted in decoders which ignored the encrypted flag and attempted decoding anyway, thus resulting in a glitch output.

The Result

To create the result, I first used ffmpeg to convert the PC version .wmv file to an FFV1 lossless coded .avi. This resulted in a lot of error concealment and decoder errors, however, an .avi was produced. From this file, a 15-minute segment was direct-stream cut using VirtualDub and encoded by Handbrake for upload. Because every third frame or so was a drop frame (indicating a repetition of the last frame) and Handbrake doesn’t handle this correctly, the output video is only 10 minutes and 13 seconds, dropping all the dropped frames. Unfortunately, the audio handled the glitched data less gracefully, resulting in only a few seconds of blips before it packed up decoding entirely. The clip below hence has no audio. Warning – this clip is potentially seizure inducing due to flashing colours.

It’s not particularly artistic or pretty, but it’s a representation of Finding Nemo, pre-glitched thanks to the engineers at Disney/Technicolour and Microsoft. Think of this as them glitching their own work.

Conclusion

DRM is a nasty consequence of the whole “need” to protect one’s work to maximise commercial exploitation, but interestingly, in this case it ended up producing a form of “art” in the sense of a glitched video.

About lui_gough

I'm a bit of a nut for electronics, computing, photography, radio, satellite and other technical hobbies. Click for more about me!
This entry was posted in Computing and tagged , , . Bookmark the permalink.

Error: Comment is Missing!