-
-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decrypt without ffmpeg #130
Comments
Hi @snowskeleton. Very good work. I'll take a deeper look on your project. Do you have some speed comparison against ffmpeg or AAXClean? |
snowcrypt is about 3 times slower ffmpeg in real time. Below are the times for my server decrypting a 424MB file. snowcrypt: real 0m26.349s snowcrypt is superior to ffmpeg in that all metadata is preserved. No chapters need updating or renaming. I haven't tested AAXClean, so I can't compare against that. (Although I found it invaluable as a reference while writing snowcrypt. The AES key derivation took me several days of frustration.) |
I've been thinking about this some more for the past few days. I'm going to make snowcrypt a drop-in replacement for ffmpeg, specifically for converting aax/aaxc. That way, you can easily implement a toggle for whether ffmpeg is installed, and fallback to snowcrypt if you need to without changing any other code. On a different note, I've spent the past couple days poring over the decryption code (which I didn't write, so I have to learn it). There are a few places I think I could make it faster, so I'm gonna play with that a bit too. On another other note, if nothing else, you could steal the key derivation so you can use the same methods for decrypting aax vs aaxc. |
What do you mean with these? |
My suggestion is that, if you want to keep using ffmpeg, you can get the key/iv from either the voucher or from snowcrypt. Then, instead of having two methods in this file
you could just have the one function for both files types. Here's an example. After importing
this code block
is equivalent to
I hope I was able to explain it a bit better that time. |
@snowskeleton |
Basically no time at all. It takes longer to launch the python interpreter than to actually do the computation. |
I'm thinking about adding a fallback to your Python implementation if ffmpeg is not installed on the target system. I'll have to compare the time difference between your package and ffmpeg. I'll see you use the threading module. Maybe this speed up some things. |
I experimented with multithreading for decrypting the same book faster, but ended up only being able to decrypt multiple books at once. In terms of speed compared to ffmpeg, snowcrypt is about half as fast. In exchange for this slowdown, you get much simpler code (you don't have to pass a bunch of flags to FFMPEG) and easier dependencies (you don't have to make sure the right version of FFMPEG is installed). |
I just recently completed this project to decrypt aax and aaxc files in (mostly) pure python, without ffmpeg. In terms of speed, it can decrypt a 400MB book in less than 1 minute. Is this functionality you're interested in integrating into audible-cli? I see there's already a plugin command to remove encrypting using ffmpeg, and I'm thinking it might be nice to remove ffmpeg as a dependency. It may even be possible to decrypt in sync with downloading, but that would take a lot more work and re-architecture.
The text was updated successfully, but these errors were encountered: