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.
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.Code:mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f videoencrypted.mp4 videodecrypted.mp4 ERROR: unexpected argument (videoencrypted.mp4)
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.
videoencrypted.mp4 is video only. There is also an audio component but if I understand correctly that has to be decrypted separately.Code:mp4decrypt MP4 Decrypter - Version 1.4 (Bento4 Version 1.6.0.0)
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
+ Reply to Thread
Results 1 to 13 of 13
-
-
Is the video really encrypted? And there's definitely no typo in the filename?
You can perform a quick check and runCode:ffprobe videoencrypted.mp4
-
add "
Code:mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f "videoencrypted.mp4" "videodecrypted.mp4"
-
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.
-
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)
Code:mp4decrypt -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f --show-progress videoencrypted.mp4 videodecrypted.mp4 ERROR: unexpected argument (videoencrypted.mp4)
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)
-
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)
-
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
-
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
Code:mp4decrypt videoencrypted.mp4 videodecrypted.mp4 -–key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266be4ef2fc89316c7f --show-progress ERROR: unexpected argument (-–key)
-
mp4decrypt -key 912d29a03a0c406daa5190412b583a85:7b0542319fac0266b e4ef2fc89316c7f videoencrypted.mp4 videodecrypted.mp4
ERROR: unexpected argument (videoencrypted.mp4)Last edited by LZAA; 31st May 2024 at 05:07.
-
You typed:
Code:-–key
Code:--key
-
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.
Similar Threads
-
Everyone can help me fix error on mp4decrypt?
By kienkzz in forum Video Streaming DownloadingReplies: 79Last Post: 11th Apr 2025, 16:00 -
mp4decrypt for a Pi3
By mkjustuk in forum Video Streaming DownloadingReplies: 3Last Post: 12th Mar 2024, 11:12 -
Mp4decrypt error
By Av4K100 in forum Video Streaming DownloadingReplies: 5Last Post: 1st Feb 2023, 15:56 -
Mp4decrypt syntax
By dzigelbaum in forum Video Streaming DownloadingReplies: 5Last Post: 26th Mar 2022, 01:23 -
Avysinth plugins ClipBlend, ClipClop error: unexpected character ""
By CoralMan in forum EditingReplies: 2Last Post: 23rd Nov 2020, 16:26