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 | #7 | Link | |
Registered User
Join Date: Sep 2006
Posts: 49
|
Hi Zotty
I get these errors: Quote:
|
|
4th June 2007, 20:42 | #9 | Link |
retired developer
Join Date: Oct 2002
Location: Canada
Posts: 8,978
|
@qubic
you are missing libcrypto
__________________
Detritus Software |
5th June 2007, 12:23 | #10 | 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 | #12 | 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, 21:50 | #13 | Link | |
Registered User
Join Date: Sep 2006
Posts: 49
|
Quote:
Can anybody help? Zotty, could you please compile it statically. --qub |
|
8th June 2007, 00:31 | #14 | Link | |
Registered User
Join Date: May 2007
Posts: 11
|
Quote:
|
|
4th June 2007, 23:48 | #15 | 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 | #16 | Link | |
Registered User
Join Date: Jan 2007
Posts: 224
|
Quote:
|
|
25th December 2007, 13:59 | #18 | Link | ||
Registered User
Join Date: Sep 2006
Posts: 110
|
Quote:
Quote:
A major problem could be hddvdfs. This is based on FUSE which is part of the Linux kernel. I have no idea if there's something similair under Windows and if so how to implement it. Nor do I have the ability (and interest) to test it properly. I've only got Linux with Windows running using VMware. This allows me to use Visual Studio, but does not offer a good way for playing HD discs. If someone feels like diving into this, feel free to do so. I'll provide help where I can. I'm thinking of using CMake. Would give some better control over installed packages such as openSSL and it becomes easy to use the GNU make tools under Linux and vcproj files under Windows. Update: Gave it a spin today and it's a bit more work than expected. Installed the MS platform SDK and VS updates (which took ages...) and the result was not that bad. CMake shouldn't be a problem (got most working, just need additional tweaks to get it all right), but I totally forgot about the IOCTL calls used to communicate with the drive. Also the filesystem stuff isn't recognised by VS. So for Windows these part need to be rewritten. On the other hand openssl and stdint was solved within 5 mins, so that's good. Final thought is that compiling it under Windows has a very low priority for me. I've also started working on some other HD DVD stuff which is much more fun to do and doesn't exist yet for Linux (e.g. a HDi player). To be blunt, Windows users have PowerDVD and AnyDVD, so I'd much rather spend my spare time making something new on a platform that has no decent HD DVD support yet. Last edited by Zotty; 26th December 2007 at 01:48. |
||
30th December 2007, 01:26 | #19 | Link | |
Registered User
Join Date: Dec 2007
Posts: 2
|
Quote:
you rock! |
|
2nd January 2008, 18:44 | #20 | Link |
Registered User
Join Date: Feb 2007
Posts: 15
|
Any idea what the difficulty level would be to get this working for blu-ray?
The PS3 linux guys have accelerated graphics partially working; it would be nice to be able to play blu-ray discs on a PS3 under linux with mplayer + a decyptHD plug in. N |
Thread Tools | Search this Thread |
Display Modes | |
|
|