VideoHelp Forum

+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 31
Thread
  1. I'm trying to download a demo video from https://bitmovin.com/demos/drm

    and I found https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/mpds/11331.mpd

    The known key:
    Code:
      kid: 'eb676abbcb345e96bbcf616630f1a3da',
      key: '100b6c20940f779a4589152b57d2dacb'
    I've tried to download the video by using:
    Code:
    ffmpeg -i https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/mpds/11331.mpd -codec copy e1.mp4
    streamlink https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/mpds/11331.mpd best -o e1.mp4
    
    youtube-dl https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/mpds/11331.mpd e1.mp4
    youtube-dl download failed, showing:
    Code:
    [generic] 11331: Requesting header
    WARNING: Falling back on generic information extractor.
    [generic] 11331: Downloading webpage
    [generic] 11331: Extracting information
    ERROR: No video formats found; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; type
    youtube-dl -U  to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
    ffmpeg and streamlink successfully downloaded the file, but the decrypted video is wrong.
    Here is what I've tried:
    Code:
    mp4decrypt --key eb676abbcb345e96bbcf616630f1a3da:100b6c20940f779a4589152b57d2dacb "e1.mp4" "d1.mp4"
    mp4decrypt --key 100b6c20940f779a4589152b57d2dacb:eb676abbcb345e96bbcf616630f1a3da "e1.mp4" "d1.mp4"
    
    ffmpeg -decryption_key 100b6c20940f779a4589152b57d2dacb -i e1.mp4 -codec copy d1.mp4
    1. mp4decrypt decrypt streamlink download version produces 0 bytes video files.
    2. mp4decrypt decrypt ffmpeg download version, didn't work as expected. Cannot watch video content.
    3. ffmpeg decrypt showing "Option decryption_key not found."


    Any idea how to download and decrypt the video, any help would be much appreciated
    Quote Quote  
  2. Member
    Join Date
    Jan 2019
    Location
    hawaii
    Search PM
    Code:
    ffmpeg -decryption_key 100b6c20940f779a4589152b57d2dacb -i encrypted_media.mp4 -codec copy decrypted_media.mp4
    Quote Quote  
  3. I think you just need a build of ffmpeg with the -decryption_key option enabled.
    Quote Quote  
  4. Originally Posted by jagabo View Post
    I think you just need a build of ffmpeg with the -decryption_key option enabled.
    I'm using full build version of ffmpeg, please try to download the demo video from https://bitmovin.com/demos/drm and decrypt it with provided key. I have tried many times with different of method to decrypt the video content.
    Quote Quote  
  5. Member
    Join Date
    Mar 2019
    Location
    Germany
    Search PM
    The key is correct and it decrypts the stream.
    ffmpeg and streamlink successfully downloaded the file
    No they didn't. That's where the error is. The file you download is corrupt.

    Download this file and decrypt with: mp4decrypt --key 1:100b6c20940f779a4589152b57d2dacb 11331-11331.mp4 decrypted.mp4
    Last edited by hvq; 23rd Jan 2021 at 06:36.
    Quote Quote  
  6. The file decrypted properly using mp4decrypt.exe. But using the latest build of ffmpeg (from VideoHelp.com) I got an error:

    Code:
    G:\Program Files\Bento4 Examples>"G:\Program Files\ffmpeg64\bin\ffmpeg" -decryption_key 100b6c20940f779a4589152b57d2dacb -i encrypted.mp4 -c copy ffmpeg_decrypted.mp4
    ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
      built with gcc 10.2.1 (GCC) 20200726
      configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libgsm --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
      libavutil      56. 51.100 / 56. 51.100
      libavcodec     58. 91.100 / 58. 91.100
      libavformat    58. 45.100 / 58. 45.100
      libavdevice    58. 10.100 / 58. 10.100
      libavfilter     7. 85.100 /  7. 85.100
      libswscale      5.  7.100 /  5.  7.100
      libswresample   3.  7.100 /  3.  7.100
      libpostproc    55.  7.100 / 55.  7.100
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000001fac494d680] Incorrect number of samples in encryption info
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000001fac494d680] Could not find codec parameters for stream 0 (Video: h264 (avc1 / 0x31637661), none, 1920x1080, 4851 kb/s): unspecified pixel format
    Consider increasing the value for the 'analyzeduration' and 'probesize' options
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'encrypted.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 1
        compatible_brands: isomavc1iso5iso6
      Duration: 00:03:30.28, bitrate: 4860 kb/s
        Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 1920x1080, 4851 kb/s, 25 fps, 25k tbr, 25k tbn, 50k tbc (default)
        Metadata:
          handler_name    : Bento4 Video Handler
        Side data:
          unknown side data type 24 (897 bytes)
    Output #0, mp4, to 'ffmpeg_decrypted.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 1
        compatible_brands: isomavc1iso5iso6
        encoder         : Lavf58.45.100
        Stream #0:0(und): Video: h264 (avc1 / 0x31637661), none, 1920x1080, q=2-31, 4851 kb/s, 25 fps, 25k tbr, 25k tbn, 25k tbc (default)
        Metadata:
          handler_name    : Bento4 Video Handler
        Side data:
          unknown side data type 24 (897 bytes)
    Stream mapping:
      Stream #0:0 -> #0:0 (copy)
    Press [q] to stop, [?] for help
    [mov,mp4,m4a,3gp,3g2,mj2 @ 000001fac494d680] Incorrect number of samples in encryption info
    encrypted.mp4: Invalid data found when processing input
    frame=    0 fps=0.0 q=-1.0 Lsize=       0kB time=00:00:00.00 bitrate=N/A speed=   0x
    video:0kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
    Any ideas?
    Quote Quote  
  7. Member
    Join Date
    Jan 2019
    Location
    hawaii
    Search PM
    try with ffmpeg full version from this site: https://www.gyan.dev/ffmpeg/builds/
    Quote Quote  
  8. Originally Posted by lomero View Post
    try with ffmpeg full version from this site: https://www.gyan.dev/ffmpeg/builds/
    Will do. But I think I see what's wrong with the version I have -- it only supports aes 128 (16 byte key), not aes 256 (32 byte key).

    <edit>
    I get the same error with the latest gyan full build.
    </edit>
    Last edited by jagabo; 23rd Jan 2021 at 09:36.
    Quote Quote  
  9. Member
    Join Date
    Jan 2019
    Location
    hawaii
    Search PM
    ok. try with bento decrypt
    Quote Quote  
  10. Yes, I already tried with bento4's mp4decrypt as mentioned in post #6 -- that worked as expected. But I'd prefer to use ffmpeg. Does your ffmpeg command line work for you with that particular video and key?
    Quote Quote  
  11. Originally Posted by fvh78870 View Post
    3. ffmpeg decrypt showing "Option decryption_key not found."
    https://www.codesd.com/item/ffmpeg-how-to-produce-mp4-videos-cenc-common-encryption.html

    These options and their values should be placed after all the inputs and before the output filename.
    try

    Code:
    ffmpeg -i e1.mp4 -decryption_key 100b6c20940f779a4589152b57d2dacb -codec copy d1.mp4
    Quote Quote  
  12. I've been experimenting with encrypting and decrypting videos with ffmpeg. Here's a batch file that encrypts a video file with ffmpeg, plays the encrypted video file with ffplay, then creates an unencrypted version of the file from the encrypted version:

    Code:
    ffmpeg -y -i Sample.mp4 -vcodec copy -acodec copy -encryption_scheme cenc-aes-ctr -encryption_key 76a6c65c5ea762046bd749a2e632ccbb -encryption_kid ffffffffffffffffffffffffffffffff Sample_encrypted.mp4
    
    ffplay -decryption_key 76a6c65c5ea762046bd749a2e632ccbb Sample_encrypted.mp4
    
    ffmpeg -y -decryption_key 76a6c65c5ea762046bd749a2e632ccbb -i Sample_encrypted.mp4 -codec copy Sample_decrypted.mp4
    
    pause
    Sample.mp4 is a normal mp4 file with no encryption. It only contains an AVC video stream. The encrypted file made by ffmpeg, Sample_encrypted.mp4, does not play with a normal player -- it has successfully been encrypted. Using ffplay.exe with the decryption key works, the video plays normally. The decrypted video created by ffmpeg, Sample_decrypted.mp4, plays normally in any player -- it has successfully been decrypted.

    Notes:

    The value of -encryption_key can be any valid 32 byte hexadecimal number.

    ffplay accepts the -decryption_key both before and after the filename.

    The ffmpeg decryption command line must have the -decryption key before the -i filename.


    I still have not figured out why the same command line doesn't work for the encrypted sample in post #5. We know that the given key is valid because bento4's mp4decrypt works with that key.

    <edit>

    Another hint: mp4decrypt gave no complaints but it did not successfully decrypt the encrypted file created by ffmpeg.

    Code:
    mp4decrypt --key 1:76a6c65c5ea762046bd749a2e632ccbb Sample_encrypted.mp4 Sample_decrypted_by_mp4decrypt.mp4
    A file is created that's the right size but it doesn't play properly (messed up image). So there appears to be some difference in the encryption.

    </edit>
    Last edited by jagabo; 24th Jan 2021 at 20:44.
    Quote Quote  
  13. Originally Posted by hvq View Post
    The key is correct and it decrypts the stream.
    ffmpeg and streamlink successfully downloaded the file
    No they didn't. That's where the error is. The file you download is corrupt.

    Download this file and decrypt with: mp4decrypt --key 1:100b6c20940f779a4589152b57d2dacb 11331-11331.mp4 decrypted.mp4
    oh, your file works perfectly, I think the problem should be my download method.

    May I know how did you download the 11331.mpd file?

    I using the following software and commands, which downloaded a corrupted file...

    Code:
    ffmpeg -i https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/mpds/11331.mpd -codec copy e1.mp4
    streamlink https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/mpds/11331.mpd best -o e1.mp4
    youtube-dl https://bitmovin-a.akamaihd.net/content/art-of-motion_drm/mpds/11331.mpd e1.mp4
    Quote Quote  
  14. I've managed to see DRM protected video keys with well known chrome extension. But don't know what to do next? How to download the protected video after finding keys (at least I think so)

    It shows like this:

    Image
    [Attachment 57207 - Click to enlarge]


    I think it's done through ffmpeg but I don't have any experience or knowledge about this issue except I a few days ago learned about youtube-dl and I used it in non protected videos.

    Please could you explain what to do next after finding these keys one by one.
    Quote Quote  
  15. There is a script that I came along in Github. It is called, Drm-Dash-stream-downloader. It can be used to retrieve Cenc Drm content.
    Quote Quote  
  16. Hi, could you please explain to me how you found the kid and the key?
    I m trying to do by myself but without success.. thank you

    Code:
      kid: 'eb676abbcb345e96bbcf616630f1a3da',
      key: '100b6c20940f779a4589152b57d2dacb'
    Quote Quote  
  17. How to find key for a protected video, i was use to to download video and decrypt them and then join audio and video, but from today video is not watchable all green, i think key is changed so is there anyway to find new key?
    Quote Quote  
  18. Originally Posted by Yamiraan View Post
    How to find key for a protected video, i was use to to download video and decrypt them and then join audio and video, but from today video is not watchable all green, i think key is changed so is there anyway to find new key?
    Did you find the key? I have the same problem. The video is being downloaded, but the colors are mixed. There are colors, no sound.
    Quote Quote  
  19. The video is being downloaded, but the colors are mixed. There are colors, no sound.
    Clear sign that the video is encrypted. Video and possible audio needs to be decrypted. "How to" has been explained to death. Kindly use the search function and read. Also, Google is your friend.
    Quote Quote  
  20. Originally Posted by jack_666 View Post
    The video is being downloaded, but the colors are mixed. There are colors, no sound.
    Clear sign that the video is encrypted. Video and possible audio needs to be decrypted. "How to" has been explained to death. Kindly use the search function and read. Also, Google is your friend.
    Thanks for answer.Of course I did research. Can I decode this video? Does the address of the downloaded file have to be different? I couldn't understand this.
    Quote Quote  
  21. Lets reinvent the wheel every day with every new question.
    Discord codehound#0348
    Quote Quote  
  22. Originally Posted by codehound View Post
    Lets reinvent the wheel every day with every new question.
    ok. don't comment if you can't help.
    Quote Quote  
  23. Originally Posted by jack_666 View Post
    The video is being downloaded, but the colors are mixed. There are colors, no sound.
    Clear sign that the video is encrypted. Video and possible audio needs to be decrypted. "How to" has been explained to death. Kindly use the search function and read. Also, Google is your friend.
    I can decrypt alright but, what alternatives are there for a mpd that doesn't even playback properly in stream tests?
    Eg: This one plays the first few seconds alright after which the visual goes bonkers!
    https://m-storagellnw-j2apps.s.llnwi.net/content/fb0b6da51b614f407ea255a6f3bb6b2a/dash...4_baseline.mpd

    Source: https://www.mxplayer.in/movie/watch-nagamandala-movie-online-c05763d1d66e94398dfc96b6c1c3ef11?

    Things tried that didn't help are:
    yt-dlp - (using the switch --allow-unplayable-formats grabs the encrypted av streams, but decrypting them gives the same result as in stream tests),
    drm-Dash-stream-downloader - (ModuleNotFoundError: No module named 'requests'),
    streamlink - (streamlink no plugin can handle url),
    wvdumper - (MediaDrmBridge creation failed).
    Quote Quote  
  24. Member
    Join Date
    Jan 2019
    Location
    hawaii
    Search PM
    yt-dlp work fine; and use all 3 keys

    Image
    [Attachment 64274 - Click to enlarge]
    Last edited by lomero; 15th Apr 2022 at 04:08.
    Quote Quote  
  25. Originally Posted by lomero View Post
    and this for decrypt
    Code:
    4bc409f039da5539aa6cab945d12a787:eb6300f86e0d493bad2314487e120b0d
    a5482a952e7b5a21882b3050ca6e5845:20fb6801b3ec44073c1d4b942bc92cd8
    a719fd644d4d5b2ba914bc3b7aa7c724:9b73a522cb849021d233a831ce2e7f92
    Still the same result, after 5 seconds. I'm now convinced that something is wrong at my end rather the mpd itself.
    I used the kid = a5482a952e7b5a21882b3050ca6e5845 and your key = eb6300f86e0d493bad2314487e120b0d

    Can you find what's wrong with my input? Thanks.
    Code:
    mp4decrypt.exe --key a5482a952e7b5a21882b3050ca6e5845:eb6300f86e0d493bad2314487e120b0d "D:\ytdlp\h264_baseline [h264_baseline].f3.mp4" "D:\ytdlp\f3.mp4"
    Quote Quote  
  26. try all 3 keys on both audio and video, follow by a merge of the two files.
    Quote Quote  
  27. Member
    Join Date
    Jan 2019
    Location
    hawaii
    Search PM
    yes you need to use all 3 keys, not only one!

    Code:
    mp4decrypt --key xx:xx --key xx:xx --key xx:xx vid.mp4 vid_2.mp4
    and don't mix keys, but use them as they were written
    Quote Quote  
  28. Originally Posted by jack_666 View Post
    try all 3 keys on both audio and video, follow by a merge of the two files.
    Done. Thanks.

    Originally Posted by lomero View Post
    yes you need to use all 3 keys, not only one!

    Code:
    mp4decrypt --key xx:xx --key xx:xx --key xx:xx vid.mp4 vid_2.mp4
    and don't mix keys, but use them as they were written
    Didn't realise kid is optional while decrypting. Thank you. Also, I found that I was getting the same keys as I got for another video, which could be another reason for the bad decryption earlier.
    Quote Quote  
  29. Hi, first post here, but important question , is there any way to download a personal copy of Udemyt DRM encoded videos with any of the tools commented here? don't know how DRM works, any way to get the keys from the browser?
    Thanks!
    Quote Quote  



Similar Threads