Can HTML5 videos be protected against downloading ?

Downloading: the HTML5 Taboo

Never wondered why there is no easy “download” link or button on HTML5-experimenting video platforms ? Downloading content may well be the taboo part of the HTML5 crusade (yes, google dares it for the sake of ubiquity on devices — but not on featured videos — and Vimeo requires an account) and possibly it’s weakest point against Flash streaming from the broadcast industry’s point of view.

I remember seeing a “download video” button when right clicking video players on early Firefox releases proof of concepts, but this kind of convenience subrepticely disappeared when big players started doing real life HTML5 deployments — especially mp4/h264 ones.

Video Downloading Uses

Common cases :

piracy

offline use

browser performance limitations (the initial reason of this post)

I recently tried watching a video on vimeo, but my computer is too slow to render h264 with Flash (damn Linux binary — uses OpenGL but can’t even do hw colorspace conversion … or, on the other side of the mirror,, could it be because of the Linux Video Acceleration APIs ?), and it was also too slow to play it using google chrome’s integrated HTML5 codecs (or Firefox’s).

On one hand, i could’nt find an obvious download link or right-click option, on another one this short movie would have looked so much better in all it’s HD-ness inside mplayer (and at 30 fps)…

With HTML5 and it’s <video> tag coming, one could expect downloading videos do get easier, or security strategies to emerge in the faster-moving (now that’s going http-centric) CDN field. Let’s take a look at major video websites which offer HTML5 deployments and still manage to attract high quality content providers by implementing downloading prevention strategies. Downloading videos can’t be this simple, can it ? Short answear could be, sometimes.

Mp4/h264 desktop playback

Vimeo

HTML5’s all about the source, right luke ? Let’s check it out, there should be an obvious http link pointing to an mp4 or webm (or ogg?) file.

No link, no fancy mp4 extension. Just sadness (and hiccups, and low framerate). There might well be javascript voodoo behind this.

However, let’s rejoice, there are useful tools built right into google chrome’s core which hopefully can help. The resource tracker (right click -> inspect element -> resources tab) is a small wonder, because it shows you http requests with loading time and file size of elements.

Thanks to the nature of html, http GETs are everywhere, especially when there’s downloading involved (although it might be possible to send video over HTML5 websockets – image transfer example).

Enabling resource tracking, then hitting play will let us find the redirecting url call which will let the embedded (and hungry) video player access the right file:

It seems not to be the only method experimented by Vimeo, since other (older) pages will show you a large url whose resource tracking shows a continuously growing size item over time (in fact an mp4 file):

Even if the url suggests some form of referrer-based tracking, you can still download this using wget or curl.

Youtube

After activating experimental HTML5 support, some of Youtube’s featured (== protected) videos are available with an HTML5 player, and you will find a more scary “videoplayback” request, which ends up in a 403 Forbidden http error (when trying it on the command line using e.g. wget) quickly after the browser starts downloading. You can even find the Flash player’s file download request (and it’s exactly the same type) on a regular non-HTML5 page using chrome’s resource tracker.

There is an epoch format timestamp in the ‘expire’ variable, an associated (unique?) signature, and the url design clearly suggests that per-ip limiting could be implemented in a close future. In short, this makes it much harder to save it out of the browser, and it looks like it’s only the beginning. Youtube is investing heavily on this field.

The loner Ogg/Theora example: Dailymotion

Chrome clearly not being big fans of Ogg, since Dailymotion still uses ogg/theora/vorbis, native playback requires using another browser such as Firefox ; you’ll find the media URL in the source code of their openvideodemo webpage. [edit : now this page has been replaced by a shining h264-powered html5 support]

This was downloadable without even without faking the user agent to the iPhone/iPad Safaris’ at any step. There seems to be some expiration timestamp, but it did not restrict the download after some minutes.

“Promotional Content: The HTML5 video tag doesn’t have DRM (Microsoft Play Ready or Flash Token-based Authentication), so even if you have an encrypted m3u8, any user who downloads the video will have an unencrypted version of it on their hard drive. This is why we think HTML5 should be used only for promotional content where content protection is not a requirement.”

So, can it be secure even without encryption ?

Offering no encryption (yet?), none of these strategies could resist Wireshark (that’s what the follow tcp stream feature can do) or other network sniffers, but some software editors already provide implementations of DRM over http streaming (Apple, Adobe, Microsoft). If the HTML5 standard did specify a standard/open securing scheme, HTML5 video could start being called “secure” but currently available encryption implementations are too vendor -specific to spread into the browsers themselves. Meaning, just regular token and/or expiration-based CDN security can be used until then for HTML5 video. Of course, expiration tokens will only be useful if the webserver properly restricts downloading after their expiration.

On the desktop side, again, Youtube leads the way by exposing real HTML5 technology without sacrificing security too much. Large corporate players prefer not to get exposed and stick to traditional DRM security (Flash, Silverlight).

In other terms, there’s still time for some mplayer (or any other excellent standalone player) happiness on most others HTML5-capable video websites 🙂

2 Comments

Thanks! This was exactly what I needed for liberating some video from Ooyala. I was on the right track (I was spoofing iPhone user agent in Firefox, and planning to watch it while running Wireshark), but only the first video (not the playlist) wanted to run. I dug into the source a bit, but I had neither the time nor the knowhow to go dredging through javascript files looking for the playlist. Once I found it, I just had to modify it a bit and use the list of URLs that it contained to feed to a bulk downloader program. I’m on chunk 12 of 180, but they seem to play just fine. (Each chunk is 1.8ish mb.) I don’t think I’d have ever gotten this done without your help. Thanks again! (Even if this isn’t exactly what you intended to do with this blog post.)