Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion. Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules. |
3rd June 2007, 19:31 | #1 | Link |
Registered User
Join Date: Sep 2006
Posts: 110
|
DecryptHD - Realtime decryption and streaming
Time to introduce a new tool called DecryptHD. While most other tools focus on 'backing up' an entire HD DVD, this one can be used for realtime decryption while streaming the decrypted movie to the player. It uses drive authentication to obtain the volume ID from it. This means it doesn't use a key database, but you do need a real drive. Without a real drive there's probably no point in realtime decryption anyway. Not wanting to watch all files on disc starting from A to Z, this also means it works on a per file basis. You have to specify the file you want to watch.
Atm this tool is Linux only for the simple reason that it's my normal desktop and development environment (Debian). So it's kinda obvious the targeted player is mplayer because of this. This is also where the streaming comes into the picture. The ffvc1 decoder not only works for normal playback from harddisk, but also supports streaming. The current status of the tool is that it works and runs stable. But I've only tested it with the Bourne Supremacy, but I'm hoping that it should with all HD DVDs released to date. Mind the "hoping" though since a 1 disc test is not a 100% guarantee. See this as a testrun. It's written in C++ and if there's demand I'll release the source once the rough edges are gone. Also need to improve the subset-difference stuff first, it's kinda sucky the way it's implemented right now. Also both currently discovered processing keys are in it (let's get this into the open right away). The advantage of this is that there's no fiddling with keys, but the downside is that when keys get revoked/discovered, this will require an update of the app. Maybe I'll make a different solution at a later time, who knows. If you run into trouble (so many things can go wrong), there's a log created called decrypthd.log in the same directory the tool is in. Please include it in any bug reports. Right, enough talk, how does the damn thing work? As you might have guessed it's console based (maybe a GUI in the future). It uses the following syntax: Code:
decrypthd <device> <mountpoint> <filename> -o | <player> In reality however, you need to know the filename of the evo you want to watch. On the disc I've got here this is FEATURE_1.EVO (case sensitive). So look this up in the HVDVD_TS directory. It uses OpenSSL for the signature calculations, so make sure you've got that. Now fire the entire thing up (I'm assuming you've got the latest mplayer). You need to specify the demuxer and decoder: Code:
decrypthd /dev/scd0 /mnt/hddvd/ FEATURE_1.EVO -o | mplayer -demuxer mpegps -vc ffvc1 - On a sidenote it's also possible to replace the -o and pipe stuff by a directory. In that case it doesn't stream to mplayer, but just outputs the decrypted content to that directory. PS, a huge thanks to arnezami for figuring out the ECDSA stuff (and the rest ). Interresting stuff to dive into, but not at this time. And thanks to all others who have contributed to the information available here. PS 2, in theory this approach should also work with a windows version of mplayer. This would require tweaking the code so it compiles under Windows, but it offers the possibility of banning that crappy PowerDVD ----------------------------- LATEST VERSION ----------------------- Links: sourcecode at www.decrypthd.org/ binaries Changelog v0.5 - 2008/01/08 - Fixed bug where Title Key 0 resulted in an invalid key exception - Split into libaacs and seperate tools - Fixed memoryleaks - Processingkeys are internal again - Added CMake build system v0.4 - 2007/11/28 - Added ACA file decryption - Added XPL file decryption - Rewrote logging code - Improved error handling - Improved utility usability - Improved filesystem code - HDDVDFS now detects files independant of case - Renamed classes to better reflect their purpose - External certificate/keys are used to overrule the internal ones - Minor bug/leak fixes throughout the code v0.3.1 - 2007/11/15 - Fixed bug that prevented Xbox 360 drive from authenticating - Reduced memory I/O - Minor fixes in HD DVD drive handling code v0.3 - 2007/11/15 - Made drive, harddisk and HDDVDFS version (huge thanks to pensivepuppy) - Keys/certificates/etc are replacable - Rewritten stream decryption code - Bug fixes - Probably more which I don't remember v0.2 - 2007/7/11 - Simultanious save to file while watching (use <output dir> -o) - CMAC AES (for Volume ID verification) - Code cleanup - Resets AGIDs so it's no longer needed to manually reset the drive v0.1 - 2007/6/3 - Initial release Last edited by Zotty; 14th January 2008 at 23:56. Reason: Updated url and changelog |
3rd June 2007, 20:31 | #3 | Link |
Registered User
Join Date: Sep 2006
Posts: 110
|
Yup, that's the idea.
Btw, a few things I just realised. I have no clue what the current state of audioplayback for VC-1 video is. Been running it on my server which has no audio. Maybe the peepz at MplayerHQ are still working on this? Another thing is that this doesn't need an expensive video card! It's running rather smooth on a build into the chipset thingy (Intel G965). Last edited by Zotty; 3rd June 2007 at 20:45. |
3rd June 2007, 21:02 | #4 | Link | |
Registered User
Join Date: Jan 2007
Posts: 15
|
Quote:
It would be nice if you could integrate this into mplayer directly. Something like `mplayer hddvd://' and it handles the decryption, reads the playlist, and starts playing tracks. Ideally it could even be made into a library, libaacs or something. That way any program (ffmpeg, mplayer, xine, etc) could just ask the library "open this disk" and "open this file" and the library does all the needed decryption. Kinda like libdvdcss. It's always nice to see open-source linux work going on. Be sure to post this to mplayer's user list, and the -dev list if you're interested in integrating it into mplayer. Just be warned that mplayer devs are quite against C++, but that shouldn't be too big of a deal. Last edited by Rufus210; 3rd June 2007 at 21:39. |
|
4th June 2007, 19:54 | #6 | Link | |
Registered User
Join Date: Sep 2006
Posts: 49
|
Hi Zotty
I get these errors: Quote:
|
|
4th June 2007, 20:42 | #8 | Link |
retired developer
Join Date: Oct 2002
Location: Canada
Posts: 8,978
|
@qubic
you are missing libcrypto
__________________
Detritus Software |
4th June 2007, 23:48 | #9 | Link |
Registered User
Join Date: May 2007
Posts: 11
|
Zotty this is awesome! I was wondering if I should bother with my Xbox 360 drive as ripping and playing was sort of a pain, but now....I will try this tonight with planet earth and king kong and let you know how well it works!
|
5th June 2007, 01:00 | #10 | Link | |
Registered User
Join Date: Jan 2007
Posts: 224
|
Quote:
|
|
5th June 2007, 07:49 | #11 | Link |
Resident DRM Hater
Join Date: Oct 2006
Location: International waters
Posts: 242
|
Very nice. Could it be made to output to both a file and mplayer at the same time? Then you save time by creating0 a backup as you watch.
For the keys, I'd just use a keys.ini or similar file, having one processing key per line. It would just try each key in order, so new keys can be added to the end. However, keep a list of known keys built in as well; this would allow it to fall back or re-create keys.ini if the file is missing or corrupt.
__________________
Because Moogles pwn. |
5th June 2007, 12:16 | #12 | Link |
Registered User
Join Date: Jan 2006
Posts: 14
|
"Could it be made to output to both a file and mplayer at the same time? Then you save time by creating0 a backup as you watch."
Alright... I know very little about linux (nothing about this subject) but because i wanted to do something "similar" once maybe I know the answer to this !! Isn't there a program that accepts input in stdio and outputs it both to stdout and a list of named files ???? tee ??? So it would be something like: decrypthd /dev/scd0 /mnt/hddvd/ FEATURE_1.EVO -o | tee <path><filename> | mplayer -demuxer mpegps -vc ffvc1 - (on a per-file basis, of course, if you mean backup the entire "set", i don't know,... but this program doesn't do that anyway, right) Hope it's helpful, like i said I'm just curious, not "knowledgeable"... |
5th June 2007, 12:23 | #13 | Link | |
Registered User
Join Date: Sep 2006
Posts: 49
|
no, it is installed. version 0.9.8b.
I get the "EC_KEY_new" error once, and then it continous with the "ioctl" error. I have to reconnect the drive, to get the "EC_KEY_new" error again. Unmounting and mounting the drive, is not enough. the log is: Quote:
regards qub |
|
5th June 2007, 20:26 | #15 | Link | |||||
Registered User
Join Date: Sep 2006
Posts: 110
|
Quote:
Quote:
Another option would be to make library of this like libcss. I haven't looked at how that one works, but the idea might be a potential possibility. However just image this would work. How about adding total menu functionality aswell. Would be nice to have complete playback and not only the movie itself. Just pop in the disc, navigate the menu (subtitles, audiotracks, scne selection, extra's, etc.) and have fun for the coming 2 hours. When I've got some spare time I'll see if I can compile the latest mplayer source using mingw. If that works and it plays evo files from harddisk, 'tweaking' the app and testing would be the next logical step. Very doable imho. Quote:
Quote:
Quote:
For the record, I'm using 0.9.8e (latest version available in my distro without building from source). About the reconnecting, this is something I've noticed aswell during testing. This happens when drive authentication fails. According the AACS spec this is drive behaviour to be expected when authentication fails. I've always been able to reset this by ejecting the disc and inserting it again. How about $HOME by default and the ability to specify an optional different directory? Place decrypthd in your bin directory and keep the log stuff out of the root stuff. Last edited by Zotty; 5th June 2007 at 20:39. |
|||||
7th June 2007, 19:15 | #16 | Link |
Registered User
Join Date: May 2007
Posts: 11
|
So I get the same error trying to play planet earth or king kong, I think I have something wrong with FFMPEG, but I don't know what. I tried it with FFMPEG installed from the synaptic manager, and by trying to compile the latest greatest svn then install
root@main:~# /home/stephan/decrypthd /dev/scd0 /media/KING_KONG/ FEATURE_1.EVO -o | mplayer -demuxer mpegps -vc ffvc1 - MPlayer 2:1.0~rc1-0ubuntu9 (C) 2000-2006 MPlayer Team CPU: Intel(R) Core(TM)2 CPU 6600 @ 2.40GHz (Family: 6, Model: 15, Stepping: 6) CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled with runtime CPU detection. Can't open joystick device /dev/input/js0: No such file or directory Can't init input joystick mplayer: could not open config files /root/.lircrc and /etc/lirc//lircrc mplayer: No such file or directory Failed to read LIRC config file ~/.lircrc. Playing -. Reading from stdin... demux: File doesn't contain the selected audio or video stream. MPEG: Missing video stream!? Contact the author, it may be a bug Exiting... (End of file) |
7th June 2007, 19:29 | #17 | Link |
Registered User
Join Date: May 2007
Posts: 11
|
Ok I update my Mplayer (I thought I already did that, guess not) so that got video working but audio is not working for King Kong=(, as already stated may happen. Planet Earth works perfectly!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Also I guess this might be known but I have to do this from root, not even sudo works. Is that what qubic meant by log into home? |
7th June 2007, 21:41 | #18 | Link | |
Registered User
Join Date: Sep 2006
Posts: 49
|
Quote:
--qub |
|
7th June 2007, 21:50 | #19 | Link | |
Registered User
Join Date: Sep 2006
Posts: 49
|
Quote:
Can anybody help? Zotty, could you please compile it statically. --qub |
|
7th June 2007, 22:52 | #20 | Link | |
Registered User
Join Date: Sep 2006
Posts: 110
|
Quote:
If I'm not mistaken the kernel is responsible for granting access to devices and it can't just grant access without valid rights. Would be a mess if this could easily be circumvented. The downside is that this restriction is kind of annoying in our situation. But the problem is caused by the way the discs are authored. Would be nice if this can be solved though. PS, working towards a weekend release... Last edited by Zotty; 8th June 2007 at 07:37. |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|