How download a MPEG Dash with DRM? - drm

Is possible download a MPEG Dash content with DRM?
How can I decrypt using the MPD file?
I tried download all M4S segments (audio and video) but when I join the segments the video doesn't work properly.
The site is using Widevine platform for DRM.
I tried too youtube-dl and dash-proxy but again unsuccessfully.
I searched on Google but I didn't succeed.

No because it's not part of the browser. The browser implements EME which allows to 'offload' decoding a video to a 3rd party software.
When you download chrome, you download another compiled "CDM" app which does the decoding and is a 'black box'. So you'd need to modify that black box CDM, not the browser. So only option is then the screen capture.
MS has a system that even prevents screen capture software (since windows controls OS) Chrome desktop CDM has weaknesses but not in the league of 'youtube downloader'.
Also Google doesn't provide CDM for modified browsers.
A researcher on twitter a couple years ago claimed to defeat the encryption by directly cracking the encryption itself, based on knowledge of what the CDM was doing. At this point though, it's beyond 'look the other way' and you would definitely be in legal jeopardy if you distributed such information or content.
In the future, Google would like all of this to be done in hardware further making it hard to defeat. Eg once they got several hardware manufacturers to put a chip in their monitors, they might literally say "if you want to watch google play or netflix, you need an 'secure monitor' (you know, so people don't spy on you...) ".
It's basic economics. If you can't live without netflix, they will lock it down and make you pay for each view. If you're 'meh' they will make it 9.99 and reel you in. If you literally prefer some 'open source movie website where everythings free, though lame' They will just try to track your interests, for a better day when they can make something irresistible you will pay for.
At this point people are pretty 'addicted' so encryption chips are being put into monitors, motherboards, video cards, even cables connecting the monitor to computer. But if they squeeze too hard, people will just walk away. But their data models now would warn them if people were getting to that limit, so it's unlikely.
EDIT: today I came across a code repository which is a chrome extension that will tell you the decryption key as it decrypts a video. I won't post the link here (but it's currently at github publicly). It contains the private key that is used by the Google Widevine CDM to decrypt the keys (which are sent encrypted from the license server). So if you have access to watch a video (eg you rent a video at google play) then you can see the key, download the mp4, then use ffmpeg to decrypt the mp4 with that key that was reported while you played the video. You would then have an unencrypted video. This is why Google tells their content providers to only provide 'low quality' versions for desktop browsers, and reserve high quality (eg 4K) content for environments where decryption is happening in a hardware chip.

I am assuming you are asking how you can handle the DRM part and that the download part is ok, using dash-proxy or similar?
The way the DRM works with DASH streaming is that the player streaming the video will recognise from the manifest and/or the video stream that the video is encrypted when you try to play it and will ask the DRM license server for the license.
For widevine it requires the URL of the license server to be configured or input into the player - see the the example at Shaka player: https://shaka-player-demo.appspot.com and choose custom asset from the drop down list and you will see how you have to enter the License Server URL.
If you have downloaded the video then the player will still need to recognise that the video is encrypted, that the DRM system is widevine and will need to be told the license server to request the license from.
The player can recognise the content is encrypted from the MP4 PSSH box - a header which indicates it is encrypted and the DRM system being used, in your case Widevine.
If you don't have authorisation or the video was originally a live stream or if it had some time constraints you may not be granted a license. Similarly, if you are planing to watch it offline, then you will need to receive a persistent license (one that is valid on the device for some time) which may not be available for the video you want to watch.

If you have the key used for encrypting the content, You can try the dashdownloader script from github hosted in Drm-Dash-stream-downloader repository. It uses ffmpeg for aes-128 encrypted content and mp4decrypt from Bento tools SDK for other cipher suites.

Related

what protocol must use for broadcast live video?

A server is in the middle
And we want you to send live video to it
And on the other hand, watch it through the HTTPS like https://server/live.pm4
What protocols can be used for this purpose?
I used to do this experimentally with nodejs dgram and ffmpeg on the raw UDP and it worked fine !
but stability and security is an issue that must be observed !
Most live (or VOD) video, for services where quality is important and/or there are a large number or users, use Adaptive Bit Rate streaming protocols at this time.
The two leading ones are HLS and MPEG DASH.
As a very high level general rule, noting that there are exceptions:
Android, Chrome Browser, Edge Browser - use MPEG DASH
iOS, Safari browser - use HLS
The introduction of CMAF () has consolidated the two formats making life for service provider easier, and the media streams can be the same for both and just tine manifest of index files to the streams are specific to DASH and HLS. Unfortunately, encrypted stream support for CMAF is not yet rolled out across all consumer devices so many services cannot use it fully yet.
On the security side, nearly all services use DRM to encrypt content and control entitlements. The leading DRM's are Google Widevine, Apple FairPlay and Microsoft PlayReady. Again, these are generally platform specific, with the usual use being:
Android, Chrome browser - Widevine
Edge Browser, X-Box - PlayReady
iOS, Safari - FairPlay

Create a video or folder which will be available for particular time only

We want to develop one video or folder containing videos/images/content to be played on TV (not smart TV) in offline mode. But it should be played for some particular time only lets say a year. After that user need to contact admin or subscribe to view the same again. Is it possible to do the same and if yes what are the ways to achieve that?
Most DRM systems, such as Widevine, PlayReady and FPS support what you are asking for - offline playback with a limit on the duration.
When the client requests the license, the response it receives includes the decryption key and some metadata about the entitlements. This metadata allows the client be granted entitlements such as offline playback and allows a time limit be set for that capability.
As an example, look at the PlayReady license template information here and at the linked 'Compliance Rules for PlayReady Products' document which is publicly available online:
https://learn.microsoft.com/en-us/azure/media-services/media-services-playready-license-template-overview

What are some ways to stream audio from a CDN so that it can't be downloaded?

I'm looking for a way to stream audio from a CDN server so that the end-user can't download the audio without first signing up for a special account, but so that they can preview the (entire) audio prior to setting up an account.
What are the best technologies to do this with?
Thanks!
As #dykeag mentioned, what you are asking for is technically impossible to do completely, since one could always just record the audio output, either via an analog device or via a special audio driver.
However, there are various barriers in place to make this more difficult, though they all essentially rely on having a dedicated client program, encrypting the audio-stream that is being downloaded, and decrypting it in your client.

How to apply DRM on a .mp3/.wav file

Can anyone help me to apply DRM on .mp3 or .wav. I know about DRM, but i have no idea about it's implementation process. If anyone has any idea on DRM's implementation(for .mp3/.wav) pleae help me. It would be great if this is for C#. It would be nice if any of you give me some Source/link.
Thanks
Pranab
To DRM any sort of file, all you are really doing is encrypting it in such a way that only authorized clients (programs) can retrieve the content from the file. Typically, this requires special client software. Depending on your requirements, it may also require a central server for these clients to call back to.
In general, you cannot simple "DRM an .mp3", because a generic MP3 player cannot read the data then. (if it could, it wouldn't be a DRMed file then, now would it?)
Possible, yes. Easy, not so much:
The "easiest" way is to drop the MP3 or WAV requirement and go with WMA (Windows Media Audio). In that case, you could use the Microsoft PlayReady Server SDK (expensive - several tens of thousand $) to do Windows Media DRM-compatible encryption. The resulting encrypted WMA can then be played by Windows Media Player and by a very large number of portable devices, after having received a "license" (essentially, decryption key + usage rights).
If you decide to go with WMA and you can't do large upfront investments, perhaps a hosted (SaaS) solution such as BuyDRM is for you.
Another possibility, which requires an even larger investment, if you want to stick with MP3 or WAV, is to use PlayReady itself with the "Envelope" format, or OMA 2 DRM with the "DCF" format, or Marlin DRM, or several other ones, which in addition to investing on the server side would also require you to write a custom media player.

Streaming audio to a browser

I have a large amount of audio stored on my web server in a very custom format that can't be replayed by anything other than my own application. That application is a Win32 app that can connect to my web server and stream and replay that audio.
I'd really like to be able to do the streaming and replaying from within a browser, but don't know where to start. Ideally I'd like the technology to be cross-platform (unlike my current Win32 app) and cross-browser (IE 6 and above and Firefox).
My current thoughts are to look at things like:
Flash, but doesn't that only replay mp3 audio?
Java, are VMs freely available still?
Converting the audio to a WAV file on the web server and then using someone else's plugin to replay that file. I'd rather keep the conversion off the web server for performance reasons, but is still an option.
Writing my own custom plugin to do the complete stream and replay operation.
Any guidance would be most useful.
Please note that the audio is not music and that simply converting to another audio format is not trivial. The audio that is stored also changes frequently (every minute) would need constant conversion.
Why are you using a proprietary music format? I'd probably not even bother downloading a program to listen to it.
I would suggest you convert it to mp3 and then use flash.
Building your own plugin would probably be hard, there are so many different platforms you'd have to cater for, something like flash is written for them already.
Apart from converting server-side: Implement a decoder for your format in ActionScript or Java. Then you can write a Flash movie or Java applet that plays it. Both languages/runtimes should be fast enough to decode in realtime unless your format is very complex. Flash would be the more accessible of the two, since nearly everyone has the plugin installed. (It's possible that playing a raw sound buffer isn't supported by older Flash versions than 10, I'm no expert on that.) The Java plugin is definitely free, but you'd require the users to install it.
I'd go with converting the audio to WAV (or MP3) on the server. Writing your own cross-platform browser component would be a lot of work, thanks to the different ways the major OSes handle their audio APIs.
Try taking a look at shoutcast.
Basically its a server app that will stream music to any client that connects to it through a browser (effectively your own radio station). I've never used it myself but should be straight forward.
Another idea is winamp remote. Again you install the app on the server but this time you can browse your music collection on their website and play individual songs.

Resources