VideoHelp Forum




+ Reply to Thread
Results 1 to 13 of 13
  1. Hello

    I followed the sticky threads here and finally got to the last step but I have encountered a problem that seems to be very unusual. Only 5 Google search results for 'mp4decrypt "unexpected argument"' and none of them help. Maybe I'm doing something very stupid but I'm out of ideas so any help would be appreciated.

    Code:
    mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f videoencrypted.mp4 videodecrypted.mp4
    ERROR: unexpected argument (videoencrypted.mp4)
    I have the same result on MacOS 14.3 and on Ubuntu 16. I downloaded the binaries from https://www.bento4.com/downloads/ (the appropriate one for each OS) and placed mp4decrypt in /usr/local/bin for each. I get the same version on both systems.

    I can provide .mp4 file if needed but it seems like there is something else wrong with my mp4decrypt since it doesn't even accept the input arguments.

    Code:
    mp4decrypt
    MP4 Decrypter - Version 1.4
    (Bento4 Version 1.6.0.0)
    videoencrypted.mp4 is video only. There is also an audio component but if I understand correctly that has to be decrypted separately.

    I have also tried these with same result:

    I've also tried using KID 0 and 1 and --show-progress option without any difference.

    More detail of how I got the files and the key, if needed:
    - yt-dlp --allow-unplayable-formats <url_for_mpd> to download the encrypted .mp4 and .m4a files
    - "Dumping Your own L3 CDM with Android Studio" thread in this forum to create CDM
    - pywidevine create-device to create WVD
    - pywidevine with the WVD, PSSH from MPD, license server with custom headers to obtain the key
    Quote Quote  
  2. Is the video really encrypted? And there's definitely no typo in the filename?

    You can perform a quick check and run
    Code:
    ffprobe videoencrypted.mp4
    to see, if it ffprobe does complain or not. If it doesn't, it is not encrypted. But you might as well simply try to play the video...
    Quote Quote  
  3. Member
    Join Date
    Dec 2021
    Location
    england
    Search Comp PM
    add "
    Code:
    mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f "videoencrypted.mp4" "videodecrypted.mp4"
    Quote Quote  
  4. picabuuu juan's Avatar
    Join Date
    May 2024
    Location
    Mars
    Search Comp PM
    Im assuming you already use N_m3u8DL-RE and didn't work .
    Maybe you should try this -m XstreamDL_CLI.cli --key yourkey --name xxx https://xxx.mpd

    or maybe this : shaka-packager.exe in=video.mp4,stream=video.mp4,output=video2.mp4 --enable_raw_key_decryption --keys key_id=912d29a03a0c406daa5190412b583a85:key=7b0542 319fac0266be4ef2fc89316c7f

    or this : mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266b e4ef2fc89316c7f c:/user/xx/videoencrypted.mp4 c:user/xx/videodecrypted.mp4

    Specify the full path of your encrypted video and the output decrypt video.
    Last edited by juan; 30th May 2024 at 14:04.
    Quote Quote  
  5. Originally Posted by videre View Post
    Hello

    I followed the sticky threads here and finally got to the last step but I have encountered a problem that seems to be very unusual. Only 5 Google search results for 'mp4decrypt "unexpected argument"' and none of them help. Maybe I'm doing something very stupid but I'm out of ideas so any help would be appreciated.

    Code:
    mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f videoencrypted.mp4 videodecrypted.mp4
    ERROR: unexpected argument (videoencrypted.mp4)
    I have the same result on MacOS 14.3 and on Ubuntu 16. I downloaded the binaries from https://www.bento4.com/downloads/ (the appropriate one for each OS) and placed mp4decrypt in /usr/local/bin for each. I get the same version on both systems.

    I can provide .mp4 file if needed but it seems like there is something else wrong with my mp4decrypt since it doesn't even accept the input arguments.

    Code:
    mp4decrypt
    MP4 Decrypter - Version 1.4
    (Bento4 Version 1.6.0.0)
    videoencrypted.mp4 is video only. There is also an audio component but if I understand correctly that has to be decrypted separately.

    I have also tried these with same result:

    I've also tried using KID 0 and 1 and --show-progress option without any difference.

    More detail of how I got the files and the key, if needed:
    - yt-dlp --allow-unplayable-formats <url_for_mpd> to download the encrypted .mp4 and .m4a files
    - "Dumping Your own L3 CDM with Android Studio" thread in this forum to create CDM
    - pywidevine create-device to create WVD
    - pywidevine with the WVD, PSSH from MPD, license server with custom headers to obtain the key

    I would try
    Code:
    mp4info --verbose videoencrypted.mp4
    to see if the KID:KEY is correct and the video has the same KID
    If I was in politics I make sure you drink plenty of beer
    and watch plenty of TV to keep you busy. | Data is the new oil.
    Quote Quote  
  6. Thanks for your replies. I have now tried shaka-packager and that works. You could say the problem is solved but really it's problem avoided. I would still like to know why mp4decrypt doesn't work on two of my computers with different OSes. I could learn something from that.

    So I used the same encrypted video file and same KID:KEY and these are the results:

    Code:
    shaka-packager in='videoencrypted.mp4',stream=video,output='videodecrypted.mp4' --enable_raw_key_decryption --keys key_id=912d29a03a0c406daa5190412b583a85:key=7b0542319fac0266be4ef2fc89316c7f
    I0531 09:10:46.167791 21128436 demuxer.cc:94] Demuxer::Run() on file 'videoencrypted.mp4'.
    I0531 09:10:46.168031 21128436 demuxer.cc:160] Initialize Demuxer for file 'videoencrypted.mp4'.
    I0531 09:10:46.383213 21128436 single_segment_segmenter.cc:111] Update media header (moov) and rewrite the file to 'videodecrypted.mp4'.
    I0531 09:10:46.428998 21128436 mp4_muxer.cc:193] MP4 file 'videodecrypted.mp4' finalized.
    Packaging completed successfully.
    Code:
    mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f --show-progress --verbose videoencrypted.mp4 videodecrypted.mp4                                                             
    ERROR: unexpected argument (--verbose)
    Note that the unexpected argument is now "--verbose" rather than "videoencrypted.mp4". I'm not sure that --verbose is an option for mp4decrypt. But --show-progress is an option because the unexpected argument is "videoencrypted.mp4" again when --verbose is omitted:

    Code:
    mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f --show-progress videoencrypted.mp4 videodecrypted.mp4
    ERROR: unexpected argument (videoencrypted.mp4)
    It seems like a problem with parsing arguments rather than anything to do with decryption. Since the same error appears in MacOS and Ubuntu, and I "installed" mp4decrypt in the same way for both, maybe that's the cause of the problem. In both cases I copied the file mp4decrypt into /usr/local/bin and gave it executable permission. (In MacOS I used the Settings > Security > Open Anyway method. In Ubuntu I used chmod +x method.) The file is obviously executable on both systems. But maybe there is a dependency issue. Am I supposed to install any other files from the bento4 package? I can't find any information about the installation of the bento4 files (if you don't use a package manager like Homebrew).

    So I also installed bento4 with Homebrew on MacOS. It reports as having exactly the same version as the other mp4decrypt (Version 1.4 (Bento4 Version 1.6.0.0)) and has exactly the same output:

    Code:
    /usr/local/Cellar/bento4/1.6.0-641/bin/mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f --show-progress videoencrypted.mp4 videodecrypted.mp4
    ERROR: unexpected argument (videoencrypted.mp4)
    If there was a dependency, Homebrew should have dealt with that. So maybe it's not a dependency problem. I'm out of ideas. Any suggestions?
    Quote Quote  
  7. Is the file really encrypted file? Yes it is. This is ffprobe output. Opening videoencrypted.mp4 with VLC shows no video but "plays" for the same duration as the decrypted video. All the other facts about how the file was obtained also show that it is definitely encrypted.

    Code:
    ffprobe videoencrypted.mp4
    ffprobe version 6.1.1 Copyright (c) 2007-2023 the FFmpeg developers
      built with Apple clang version 15.0.0 (clang-1500.1.0.2.5)
      configuration: --prefix=/usr/local/Cellar/ffmpeg/6.1.1_4 --enable-shared --enable-pthreads --enable-version3 --cc=clang --host-cflags= --host-ldflags='-Wl,-ld_classic' --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libaribb24 --enable-libbluray --enable-libdav1d --enable-libharfbuzz --enable-libjxl --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librist --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopenvino --enable-libspeex --enable-libsoxr --enable-libzmq --enable-libzimg --disable-libjack --disable-indev=jack --enable-videotoolbox --enable-audiotoolbox
      libavutil      58. 29.100 / 58. 29.100
      libavcodec     60. 31.102 / 60. 31.102
      libavformat    60. 16.100 / 60. 16.100
      libavdevice    60.  3.100 / 60.  3.100
      libavfilter     9. 12.100 /  9. 12.100
      libswscale      7.  5.100 /  7.  5.100
      libswresample   4. 12.100 /  4. 12.100
      libpostproc    57.  3.100 / 57.  3.100
    [h264 @ 0x7ff1e6b04940] top block unavailable for requested intra mode -1
    [h264 @ 0x7ff1e6b04940] error while decoding MB 4 0, bytestream 57549
    [h264 @ 0x7ff1e6b04940] concealing 3600 DC, 3600 AC, 3600 MV errors in I frame
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'videoencrypted.mp4':
      Metadata:
        major_brand     : isom
        minor_version   : 512
        compatible_brands: isomiso2avc1mp41iso5iso6
      Duration: 00:02:19.27, start: 0.000000, bitrate: 2029 kb/s
      Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709, progressive), 720x1280, 2020 kb/s, 30 fps, 30 tbr, 15360 tbn (default)
        Metadata:
          handler_name    : Bento4 Video Handler
          vendor_id       : [0][0][0][0]
          encoder         : Lavc60.31.102 libx264
        Side data:
          unknown side data type 24 (115 bytes)
    Quote Quote  
  8. Here is mp4info output:

    Code:
    mp4info --verbose videoencrypted.mp4
    File:
      major brand:      isom
      minor version:    200
      compatible brand: isom
      compatible brand: iso2
      compatible brand: avc1
      compatible brand: mp41
      compatible brand: iso5
      compatible brand: iso6
      fast start:       yes
    
    Movie:
      duration:   139272 (movie timescale units)
      duration:   139272 (ms)
      time scale: 1000
      fragments:  yes
    
    Found 1 Tracks
    Track 1:
      flags:        7 ENABLED IN-MOVIE IN-PREVIEW
      id:           1
      type:         Video
      duration: 139267 ms
      language: und
      media:
        sample count: 0
        timescale:    15360
        duration:     0 (media timescale units)
        duration:     0 (ms)
        bitrate (computed): 2020.454 Kbps
        sample count with fragments: 4178
        duration with fragments:     2139136
        duration with fragments:     139267 (ms)
      display width:  720.000000
      display height: 1280.000000
      Sample Description 0
        [ENCRYPTED]
          Coding:         encv
          Scheme Type:    cenc
          Scheme Version: 65536
          Scheme URI:     
        Protection System Details:
    [schi] size=8+32
      [tenc] size=12+20
        default_isProtected = 1
        default_Per_Sample_IV_Size = 16
        default_KID = [91 2d 29 a0 3a 0c 40 6d aa 51 90 41 2b 58 3a 85]
        Bytes: 00000000000000010000000000000000000000000000000002d005000048000000480000000000000001154c61766336302e33312e313032206c696278323634000000000000000000000018ffff00000037617663430164001fffe1001b6764001facd940b40a1a6a02020280000003008000001e078c18cb01000568ebecb22cfdf8f80000000013636f6c726e636c7800010001000100000000146274727400000000001ed46a001ed46a0000005073696e660000000c66726d6161766331000000147363686d0000000063656e630001000000000028736368690000002074656e630000000000000110912d29a03a0c406daa5190412b583a85
        Coding:       avc1 (H.264)
        Codec String: avc1.64001F
        AVC Profile:          100 (High)
        AVC Profile Compat:   0
        AVC Level:            31
        AVC NALU Length Size: 4
        AVC SPS: [6764001facd940b40a1a6a02020280000003008000001e078c18cb]
        AVC PPS: [68ebecb22c]
        Width:       720
        Height:      1280
        Depth:       24
    Quote Quote  
  9. I have also tried using the full path for the input and output files. Also with single and double quotation marks. Same result.

    And if the input and output file arguments are omitted, this is the result:

    Code:
    mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f --show-progress                                                                                                    
    ERROR: cannot open input file (-–key) -4
    And if I rearrange the arguments:

    Code:
    mp4decrypt videoencrypted.mp4 videodecrypted.mp4 -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f --show-progress 
    ERROR: unexpected argument (-–key)
    Again, seems like a problem with parsing the arguments.
    Quote Quote  
  10. mp4decrypt -key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266b e4ef2fc89316c7f videoencrypted.mp4 videodecrypted.mp4
    ERROR: unexpected argument (videoencrypted.mp4)
    Last edited by LZAA; 31st May 2024 at 05:07.
    Quote Quote  
  11. You typed:
    Code:
    -–key
    instead of
    Code:
    --key
    In other words, it needs to be two minus signs (-) and you typed a minus sign followed by an en dash (–).
    Quote Quote  
  12. That solved it! Well spotted. Thank you.

    I figured out why I had an en dash there at all. The first mention of mp4decrypt in the "Decryption and the Temple of Doom" thread (https://forum.videohelp.com/threads/404994-Decryption-and-the-Temple-of-Doom) uses an en dash. I copy/pasted it from there, without realising it was an en dash. When that didn't work I thought it needed two hypens, as I saw in other examples, so I added a hyphen. That's how I ended up with a hyphen and an en dash.

    I'll comment on that tread about this so maybe it can be edited and other people don't waste their time.

    What I learned is that copy/paste is sometimes a mistake, and check the hyphens.
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!