web media frontend

I have always wanted to tweak my HTPC frontend quite a lot to add extra functionality, but the entry barrier to learning a GUI language has been way too high for me.  I’ve had success though, in patching MythFrontend to do some things a little better for me, but I’ve always wanted to get my own going if I could.

Recently, I was thinking about how LIRC can capture IR events and map them to X keyboard events.  Basically, you can control X applications with your remote control.  I started to reason that if that were possible, then I could just use my web development skills and create a webpage frontend for my HTPC that would run on a lightweight browser, and listen for keystrokes.

Just playing around with it tonight, I actually made some really great progress thanks to a combination of a good friend, my humble jQuery beginnings, and my laughable CSS skills.  This is the result so far. :)

I’m really stoked about the implementation so far.  You’ll most likely need Firefox to get that working properly.  It will capture the arrow key presses (up, down, left, right) and use that for navigation.  I realize that the beginnings are rather crude, but the fact that I could throw this together, so quickly, while I’m just barely learning my way around jQuery seems pretty impressive to me.  I’m actually quite proud, though, that I got the navigation to work properly, too, so wrapping around rows and columns works. :)

This is certainly going to be a fun project to hack on.  If I could get this working, this would open up all kinds of possibilities for me for displaying metadata and new options for navigation.

For comparison, here’s a screenshot of what my frontend looks like right now.  As you can see, I’m trying to imitate the style as closely as possible.

There’s a lot of advantages to having it web-based — not that I’m going to serve up anything remotely or anything, this is solely for my LAN.  It’ll just allow me to build out stuff much faster.

The hard part is going to be doing testing on the frontends.  They are both running off of tiny installations, and it’s not easy building and porting software to run on them.  Sounds like a challenge that’s extremely hard, going to take a lot of time, and will have marginal benefit and at the same time increase my workload and opportunity to own more of my software stack when things go wrong.  That’s just right up my alley. :)

handbrake ebuild

My life has been uncharacteristically busy lately, which is a really new experience for me, because I usually have so much free time that I don’t know what to do with myself.  Anyway.  As a result of lack of time, it’s been interesting to see how I deal with the crunches when there’s stuff I want to work on.  So far though, my adaptation has been nothing more than watching tasks I want to do be ignored for weeks on end.

So, in an attempt to get one task of many moved forward, I’m just going to do a brain dump of my thoughts into a blog post and hope that someone can take it running from here.

To start with, I totally love the video encoding tool Handbrake.  It is an aboslute godsend, one that makes it possible for me to actually encode all my DVDs to MPEG4 using x264, and have me happy on every count.  (If I’ve talked about this already before … oh well.  I can’t remember these things anymore.)

There’s a lot of reasons for it’s awesomeness, but I’ll write those up in a later post.  The simplest summary is probably to say that it passed the Star Trek test with flying colors — which was always assumed to be an impossible task.  So, saying I’m happy is putting it mildly.  It’d be more accurate to say I feel like a schoolgirl on crack who is dancing on the rain.  Or something.

Anyway.  I’d like to roll an ebuild for it and get it into portage, if possible, but because of the build system, there’d be some things that need to change first.

The build system used in Handbrake downloads sources from their website and unpacks them during the building stage.  While that’s fine if you’re building it yourself, and if you wanted to roll your own ebuild (which, in fact, there are some already in our multimedia overlay), it wouldn’t be good from a QA stand for Gentoo.

So, what needs to be done (this is where I start whining about how busy I am, and how this is your job to fill in the gap) is the Makefile needs to be modified so it won’t download and unpack the remote sources.  It can still access them, but it needs to be up to the ebuild to do those in its own stages — like moving the tarballs into SRC_URI and using src_unpack to unpack them.

I haven’t looked closely at the build system, but I imagine it wouldn’t be too difficult to patch.  If someone wanted to take it from there, I could run the last few legs and see about cleaning up the ebuild and possibly getting it included in the tree.

If anyone’s up for the challenge, follow this bug.  Thanks :D

mplayer + libbluray support

MPlayer just very recently got support for playback of unencrypted Blu-Ray discs using libbluray.  (Thanks to all the devs and testers! :) )  Apparently development for the library is being hosted on VLC’s git servers now, something I had no idea about.  I thought the project was dead upstream.

I’m adding an ebuild for libbluray to the gentoo multimedia overlay if someone wants to access it.  It’s something I plan on pushing into the mainline tree soon enough, once it’s properly finished.

If you are building MPlayer from SVN, it will automatically detect the new library, and build against it.  You can use the -9999 ebuild in the portage tree.

To playback some of your Blu-Ray content, you will first need to extract it to your harddrive.  I use MakeMKV, also in the multimedia overlay, to accomplish that.

Here’s a simple way using the CLI to dump the contents:

$ makemkvcon backup –decrypt disc:/mnt/bluray/ <location to dump content>

The syntax for playback is:

$ mplayer br:// -bluray-device <path to dumped content>

By default, it will play the longest playlist (I think).  If you can get the list of playlists available, you can pass that as an optional parameter to br:// (fex: list_titles /home/steve/bluray/src; mplayer br://5 -bluray-device /home/steve/bluray/src).

libbluray also ships with a few example programs that do basic stuff like listing the titles (list_titles), dumping information about the playlists (mpls_dump), and a few more (sound_dump, index_dump, mobj_dump, libbluray_test, bdsplice, clpi_dump).

Have fun with it. :)

gentoo + youtube – flash + mplayer

So, if you’re getting a little tired of Flash and it’s silly security hiccups, but still can’t live without the YouTubey goodness that is the awesome sauce of life, here’s a simple solution I stumbled onto: use mplayer to watch the videos!

I haven’t found a way to embed this in my browser yet, but I haven’t really looked either, so this is for all the CLI geeks.

$ mplayer $(youtube-dl -b -g http://www.youtube.com/watch?v=9IfEInQ7aic)

And thar ya go. :)

Oh, and did you know that Flash Gordon is on Blu-Ray now?  Flash!  Aaaaaa-ah!

blu-ray on gentoo

I’m pretty excited because I got my first BD-ROM drive last night from NewEgg, a LITE-ON iHOS104-06.  That means I can do some real testing, ripping and playing around.

Decrypting Blu-Ray discs is a really confusing process … I’m still not even sure of all the steps that are involved.  Everything I understand has been cobbled together from posts on the doom9 forums.  While the forums are a great resource, it’s not a comprehensive one at times.

I was playing around with aacskeys (from doom9 forums, available in portage), and it managed to decrypt / find the keys / whatever it’s doing / work successfully on most of my movies.  I’m not sure how to get them off after that, though, or why that’s important yet, but I do know it’s a good sign. :)

For now I’m taking the simple route of using shareware to access my movies.  There’s two programs I’ve used so far to rip my Blu-Rays, AnyDVDHD and MakeMKV.  They are both nice programs with some good features, but MakeMKV is the only one that has a Linux port.

The last time I tried MakeMKV, it couldn’t decrypt all my discs, so I had to use my PS3 to rip the ISOs, and then use AnyDVDHD.  This time, though, using the most recent version (1.5.6), it managed to decrypt all of my discs.  I was going through my Blu-Rays to see if it could handle all of them, but I gave up after the 15th one, since it was working on every single one. :)

While AnyDVDHD will extract the original, unencrypted files to your harddrive, MakeMKV will additionally mux them at the same time into Matroska.  I kinda wish I could still have the originals, but I’m not going to be picky. (Edit: you can, see comments)

So, no real plans after this except to play around and post my results.  I really don’t have that much interest in playing with Blu-Rays on Linux other than curiosity.  I don’t wanna rip them and stream them to my HTPC just yet since I don’t have the storage space, and because my frontend isn’t quite as HD-ready as I’d like it to be (I still need to update some software and tweak settings … lots of testing, meh).

I am going to be looking at some other tools and see if I can get them in portage or our multimedia overlay, which reminds me, I just added MakeMKV to there this morning if someone else wants to try it out.

google vp8 fud

I don’t usually like chiming in on matters like this, but I’m going to say this time that I’m disappointed in Ars Technica’s recent FUD-provoking article on Google’s VP8 codec being open sourced.

Specifically, and I’m not picking on Ars in general, I notice in popular journalism a technique to claim that many people are supporting a view, but then to provide only *one* source that supports that view.  That doesn’t mean that many people support it … it means that at least one person does.

For example:

Some critics of VP8 contend that its design is sufficiently similar to H.264 to warrant concern. One such critic is Jason Garrett-Glaser, a software developer who works on x264, a well-known open source implementation of H.264. In a lengthy analysis of VP8, he attacks On2’s claim that the format is superior to H.264 and says that the format’s legal status is too dubious for companies to trust.”

There are no other references to “some critics” anywhere else in the article.

Again, here’s a second example:

MPEG LA’s threats at this stage appear to be little more than self-serving saber rattling, but others who have analyzed the technology seem to believe that there could be serious patent risks on the horizon.”

There is a reference earlier to MPEG LA’s own remarks, the original piece of which makes its own conclusions as well.

Looking at that piece, the whole article is based around *one* question that he shared:

He writes:

Here’s an excerpt from my email exchange with him:

JP: Let me ask you this: Are you creating a patent pool license for VP8 and WebM? Have you been approached about creating one?

Larry Horn: Yes, in view of the marketplace uncertainties regarding patent licensing needs for such technologies, there have been expressions of interest from the market urging us to facilitate formation of licenses that would address the market’s need for a convenient one-stop marketplace alternative to negotiating separate licenses with individual patent holders in accessing essential patent rights for VP8 as well as other codecs, and we are looking into the prospects of doing so.”

That’s the other thing I don’t like about journalism … I would call it a pet peeve, but really it’s just a matter of not being able to trust the reporting when all we get is excerpts.  His entire article is written around one excerpt of an email exhange.  Why don’t journalists ever post the entire exchange?  Lack of transparency, to me, just gives the impression that they are trying to present a biased view.

I realize, of course, that in only including excerpts here that I’m doing the same thing in a sense, but at least I’m providing references to the full sources I have available so that anyone else can do their own analysis and come to their own conclusion.

If you wanted to see his own conclusions, just read the article.  First of all, the headline is: “Google’s “Royalty-Free” WebM Video May Not Be Royalty-Free for Long”.  There’s no way to draw that conclusion from the article.

I wonder if the editors come up with the titles of the articles themselves.  It  could easily have said “MPEG LA may create a patent pool for VP8”, and that would be more accurate.  Compare that possible title to the other one when reading the author’s assumption after the excerpt:

“It would seem, then, that VP8 may end up subject to the same licensing issues as H.264. If MPEG LA does create a patent pool license for the standard, the free lunch Google promised yesterday may not be free after all.”

That’s an obvious conclusion, and I could come to the same one as well — If this, then that.

We can see again, even in this article, that he uses the same tactic of using one source and pretending it’s many:

“As a number of observers have already noted VP8 isn’t free from patent liability.”

Again, it’s not a number of observers … it’s one blog post … the same one that Ars referenced as well!  Jason is a great multimedia dev, but he’s not a patent lawyer last I checked.  I’d be equally bothered if someone took my opinion, on any piece of my blog, and quoted me as the expert who knows which way the industry in Linux is going to go, or what legal battles it has to deal with in the future.

My take on the whole thing is this — first of all, I thought Jason’s original piece was very well written, and it was exactly what he set it out to be: a technical write-up of the codec.  He made some comments in passing about patents, but the focus of his post was how VP8 is better than Theora, not as good as x264 (and I would agree).  I would imagine that the poor guy didn’t expect his blog post to get as much attention as it did, and that it will probably affect future blog posts, if any.

My opinion on the MPEG LA stance, reading just the excerpt above — and not the author’s own conclusion — is that their business stance is completely normal and reasonable.  The way I read it is not that MPEG LA is claiming anything, but that some other companies might be wanting their own assurances of patent protection, and looking to their company to make sure they have their licensing ducks in a row.  That could be it, maybe not.  Either way, we don’t have any information from them to really speculate.

Personally, I’m not too worried about the whole thing.  I think VP8 will emerge just fine, there may be *some* licensing involved somewhere, but in the end, open source tools will go on just like it has for years and support the standards, and consumers will still win out with more options.

As far as journalism goes, I think we’re going to see more FUD pieces about the whole thing.  It’s a common tactic used by big bullies (anyone remember SCO?).  I’m not saying the concerns are illegitimate, but I sure wish people would use critical thinking and analysis when writing their articles, instead of trying to spin up hype and paranoia for .. whatever reasons they may have.

It’s obvious that my attitude is that modern journalism has completely lost its credibility, and that’s the reason I don’t like writing about it — is because I get into rant mode. And I apologize for that.  Also, sorry that the post kinda bounces back and forth between my points … it’s the nature of a rant, I suppose. :)

One last comment (this is one of those posts that has the misfortune of never ending), that I wanna make sure I clarify is that it’s not my intention to disprove, stir controversy or anything like that … my only goal is to encourage critical thinking which seems to be a missing element in reporting these days.  I’m personally tired of how research becomes whittled down to conclusions.  It’s like statistics — you can often make the numbers say anything you want.  But, yah, not trying to hand out pitchforks or anything, I just think it’s a good idea to be honest in reporting, present the facts, and let people come to their own conclusions.  That’s all. :)  Have a donut.

random dvd roundup

I’ve been shuffling stuff around lately with my DVD collection, and one thing I’ve been doing is cleaning up my DVD ripper and web frontend to catalogue my entire collection (todo: put in git, trac).  I finally finished archiving this weekend all the cartoons I have, and I actually finished ripping all of them that I want to archive, too.  They’re not all in one place yet, but by the estimates I’m running (one nice feature of my new code) is that it’s gonna take about 750 gigs of storage.  Whee!  It’s all worth it to have 8 seasons of Super Friends on demand (seriously).

I found a few bugs in my ripper this weekend, one of them was that I was only storing one possible subtitle type in my Matroska rips.  If a DVD had both VobSub and Closed Captioning, it’d only mux the first one I added.  Fixing it was fun, since it was one of those moments where you open up the code trying to find the reason for it, and you find a big comment labeled “FIXME: Add this feature here.”  Heh.  So, now it muxes both, if available.  Woots.

There is still one DVD subtitle format that I am having absolutely zero luck in finding anything about — English SDH (Subtitled for the Deaf and Hard of hearing).  According to Wikipedia, it’s basically closed captioning with color.  I can play / watch / rip closed captioning just fine (watching: mplayer -subcc dvd://, ripping: ccextractor), but not SDH.  And I haven’t seen anything that can even play them yet, although in fairness I’ve only been playing with Linux applications.  And everytime I try to explain to someone what I’m trying to do, they think I’m talking about VobSub subtitles.  Usually I get tired of trying to explain the difference and give up searching.  I could try finding some Windows apps to rip / play them, but if I can’t get something in Linux that’s scriptable to access them, then it doesn’t matter anyway.  So, if someone knows of something … plz to drop me a line, kthx.

Speaking of subtitles and MPlayer, I’ve come to the conclusion that MPlayer’s support for them is just plain sub-par.  The options to play them back (or force them off) are buggy and inconsistent across the bar.  For example, here’s a small roundup:

– Flagging a subtitle track as “default” when muxing a Matroska stream means that, if you turn on subtitles in the viewer, that should be the first one to show up.  It does not mean “these are forced subtitles, so display them automatically.”  That’s why Matroska has a “forced” tag.  default != forced.  If you’re still lost, look at the original audio and video tracks, and you’ll see they are also muxed with the “default” flag fipped on.  It’s purpose makes more sense with video with multiple audio tracks — if there’s more than one, which one do you play by default?  The one with the “default” flag!  Same principle should apply with subtitles when you turn them on.

– MPlayer can’t load Matroska subtitles externally.  You can, if you wish, mux just subtitle streams into a Matroska wrapper (ex: mkvmerge subtitles.{idx,srt} -o subtitles.mks).  But using “mplayer -sub subtitles.mks” won’t work.  Bummer. :(  I understand that in this case, the Matroska stream could contain more than one subtitle stream (VobSubs and CC in my example), and it generally expects just one (-sub subtitles.idx, fex), but still, it’d be a fancy feature. :)

– MPlayer can’t dump CC to SRT, even though it can play them (mplayer -subcc).  Bummer.

– Random rant about -noforcedsub and -nosub and -sub are conflicting / confusing, but too lazy to put together data about it, and it’s mostly related to the Matroska one above.

I just had to get that stuff off my chest. :)  I have faith in MPlayer eventually improving in said areas, and filing bugs would probably be good on my part.  I generally don’t deal with subtitles much anyway, so for me it’s kind of a “would be nice to have” set of features.  Meaning, I’ve already worked around the bugs and they don’t bother me as much anymore.  I would be curious to get SDH read support though.

I’m starting to notice a general trend here — I complain a lot about certain issues and bugs in detail, but never go out of my way to report them.  I’m becoming the kind of user that as a developer I totally hate!  Oh noes!

In reality, I like being able to be on both sides of the coin, and I’d have to agree with the assessment of most user complaints I see, that are: the barrier to entry to reporting bugs is too hard.  I could go into detail about that, but I don’t really want to, as I don’t wanna focus on the negative.  But generally speaking, sometimes it’s too much of a hassle to easily report a bug.  If it means me creating yet another user account on a bug tracker or subscribing to a mailing list, I weigh that against the strain of just ignoring or working around the bug.

I am, of course, to blame for my laziness, and I completely understand that developers (such as myself) need a detailed report with contact information along with the ability to quickly index reports.  I wonder if there’s some magical middle ground, though, where users who aren’t regular bug reporters can just easily report their issues and be on their way.  I know in Gentoo, we tend to use the forums as a poor-man’s bugzilla sometimes, and maybe that’s one way to do it.  Interesting stuff to think about.  Drive-by bug reporters, kinda thing.  They’ll come by once or twice, but not regularly.

Anyway, I can’t think of any other interesting DVD stuff I ran into this weekend.  Other than I bought season three of Taxi and it wasn’t as entertaining as I remembered it to be.  Oh well.  You win some, you lose some.

ripping blu-ray discs on linux … and windows, and ps3

I’ve finally found a way to rip some of my Blu-Ray discs, kinda.  I’ve had to manage a few workarounds because I’m missing a pretty common piece of hardware in the setup: a BD-ROM drive.  I do have a PS3, though, that I’m running Linux on, and I can get to the media just fine that way.  I also have to use shareware, both on Windows and Linux … but, it works, and the files look great. :)

So, the backstory is that the other day I was making a note of all the projects I have to do,  creating what I call my project tree.  It’s basically an ordered list of general projects (Gentoo, home theater system, etc.), and then abstract projects underneath that.  It’s nice because I can get a birds eye view of all the stuff I’m working on without going into specifics about any of them.  One of the home theater ones was to get at least ISO disc rips of the Blu-Ray movies I already have, even if I can’t decrypt them yet, so I can at least play around with my options as they become available.

Well, I had moved my server setup around not too long ago, so I had two 750 GB harddrives just collecting dust.  I put one of them in an external USB drive, and plugged it into my PS3, which was already running Linux (see this pervious post for all the fun details).

I formatted my external USB drive as NTFS, so that I could read/write to it with Windows as well, and then I would insert a disc and just dump it to an ISO file.  That’s easy enough:

$ cat /dev/sr0 > KFP.iso

I grabbed a couple of them (which took awhile, don’t let me kid you on that part) so that I could get a good sampling in case I had more luck with one than another.

Once that was done, I trotted the little drive and plugged it into my netbook, running Windows XP, and installed both Virtual CloneDrive and AnyDVDHD.  The first one lets me mount an ISO as an actual disc drive, and the second actually decrypts the disc for me and dumps the contents back to the harddrive.  So, that’s two passes now on all the data, which is making this take a long time.  But that’s okay, it’s fun.

Now that I have the actual contents, the MPEG2 transport streams, I can play it back with MPlayer, ffplay or whatever.  I’m having limited success with latest MPlayer on the files with VDPAU playback support, but it could just be my video card (GeForce 8600 GTS).  On my HTPC frontend, it works almost perfectly on there, with a nicer video card (GeForce 9300).  My desktop just craps out, though.  I can still watch it with Xv video out, though.

mkvtoolnix doesn’t support m2ts files right now, so I don’t have many options if I wanna change things around.  I’m still in a proof-of-concept stage, so I don’t really care all that much.  Plus, my options are already limited.  AnyDVDHD is shareware that will expire in 21 days, and while it’s amazing and works great, it’s really expensive — something like $200 for a lifetime license.  Eek.  With that, I’ll keep trying my options on Linux.

The second piece of shareware I ran into (which also has a limited evaluation license, though this time for 30 days) is MakeMKV.  The Linux port is always a little more difficult to find, so here’s a direct link to the details on the lastest version.  Boy, I never thought I’d be talking about shareware on my blog.

MakeMKV works really nice, too.  It’s supposed to be able to do the same job as AnyDVDHD, I believe, but since I don’t have the actual Blu-Ray drive, everything I’ve tried has never worked when just mounting the ISO direcly and trying to access that.  I believe that part of cracking the key involves having access to the drive.  I’m really not sure.  I’ve read a bit about the whole process, but it’s still really confusing to me still.

Anyway, the software will let you access it directly through the decrypted contents, and that’s what I did.  The interface is actually really simple and nice, and I would actually consider buying this one (it’s much cheaper, at $50 for a lifetime license).  I’m trying to remember the last time I paid for a software license.  One that comes to mind, is that I actually have a valid registration key for Legend of the Red Dragon, the *really* old BBS door game.  Wow.  I think it cost me something like $15.

MakeMKV is pretty nice, though.  It snags the subtitles I select, and already includes the chapters as well as the HD audio formats.

So, that’s it.  The whole process is pretty tedious, but it works, and I’m happy.  I don’t really care about decrypting it *too* much right now, since I don’t wanna go through the pain of trying to play them back over my HTPC just yet.  I’d need to do a lot of tweaks and upgrades to my system, and I really don’t care that much.  It’s not worth the hassle.  Especially, uh, since I just bought a new Blu-Ray player last month. :D

Really, though, I’m just doing this for the exercise since when I get bored, often times I’ll want to play around with media files and formats and see what I can do with them.

Eventually I’ll buy a BD-ROM drive and see what I can do, but for now I’m trying to save some $$$ and the whole point of this was to see if I could rip some discs with just the hardware available, and I could. :)  Woots.

On a sidenote, I posted aacskeys to the portage tree today, which is one of the tools users need to decrypt the keys on their discs.  Hopefully we can get some more hackers interested in poking at it.  That’s always good.

Last but not least, here’s an actual screenshot from the final rip. :)

I love TMNT. :D  Boy that’s a post for another day … which reminds me, I should get a copy of my home-made videos some day, that I made with my action figures.  Oh man, that’d be awesome.

closed captioning on dvds (and ripping them)

In ripping my DVDs, I try to future-proof it as much as I can, by putting in as many elements as I *think* I might need or want someday down the road.  One of those elements is subtitles.  There are three types of subtitles that can be on DVDs — VobSub, closed captioning and SDH — and the first two can be extracted fairly easily.  I have no idea how to access the SDH ones.  I think you need either a newer DVD player or a Blu-Ray one.

I’ve been ripping my TV shows, and so far I haven’t seen any really hard and fast rules on what to expect with them on DVD.   Part of the reason is that I just haven’t been paying much attention to subtitles until recently.

I was playing with ripping one show last night, and I saw the CC logo on the back of the case, so I went to check the rest of my library to see which other ones had it.  Nearly my entire library of Warner Bros. DVDs displayed the logo — even for much older cartoons (Looney Tunes, Scooby Doo) — once again staying consistent with the fact that the studio puts a lot of effort into the quality of their releases.


I just started playing with extracting CC though, and just barely wrote the code to my DVD ripper to extract them, so I have no idea what the other series are like, if they have subtitles or not — VobSub or CC.  I usually don’t find out until I actually go to rip them.

Extracting the closed captioning subtitles is a lot easier and faster than getting the VobSub streams.  For Linux (and Mac and Windows) there’s a nifty OSS program called ccextractor.  Once you have your VOB video file on your harddrive, just run that on the movie, and it will create an SRT subtitle file of the closed captioning text.  It’s great, and really fast, taking probably under a minute on a 60-minute video on my box.  Comparatively, when ripping a VobSub stream, you need to read the DVD directly which causes its own bottleneck, and then demux the entire stream.  It takes probably around 3 to 5 minutes for an episode of the same length.

Another thing I like about the closed captioning titles is that because they are extracted as SRT, it’s easy to look through them since they are just text files.  If you’re really anal, you can correct typos yourself.  The VobSub subtitles are all bitmaps.  I’ve also noticed that on some DVDs, where there were issues with framerates or something else, that the VobSub timestamps will be off … and sometimes either they will show up clumped together at the beginning of the film or the sync will be way off.  I think that this has to do with the dumping process, somewhere, but I’m not sure.  I’ve never really taken the time to pin down the source.

So, with closed captioning being easier and faster to extract, as well as editable and the timestamps haven’t had any issues for me (yet), it’s quickly becoming my preferred subtitle format.

There’s only one small issue with using ccextractor, and that is you won’t know if there are any captions in the VOB until after it’s made its trial run.  The program will create an .srt file regardless when you run it, but the file will be empty if it couldn’t find any.  That’s the only drawback.  With VobSub, you can know if there are subtitles just by probing the DVD using lsdvd or something similar.

Muxing it into matroska is simple, too.  Just pass it as a file argument and you’re done.

As a sidenote, while my bend application that I wrote and use to rip DVDs would be a major pain to setup for someone else, I’ve rewritten it recently so that it uses individual classes to access every object directly: DVD, DVD track, DVD VOB, Matroska file.  They are standalone classes written in PHP if anyone wanted to use them, feel free.  You would also need my tiny class of shell functions as well, since they all make calls to it.

The DVDVOB one makes it simple to extract the subtitle stream.  In fact, all the classes make things relatively simple.  They have made writing my code so much simpler.

my blu-ray ripping trial run

Yesterday, I wanted to see if I could rip a Blu-Ray disc using my PS3.  I really want to get a BD-ROM drive, but they are so expensive still, and since I can install Linux on my PS3, I figured maybe I’d try and save myself some money and see if I could manage to get one ripped and decrypted.  It actually worked, which surprised me.  Ripping the disc was the simplest thing in the world, but the key on the movie I tried (Willy Wonka and the Chocolate Factory) was too new, and currently only AnyDVD has support for it.  I’d love to buy a copy of that, but it only runs in Windows, and it’s really expensive.  Instead, I’ll just have to wait for the keys to pop up eventually on the doom9 forums.

The first step, though, was getting the PS3 to run Linux.  I took the shamelessly easy way out (and I don’t regret it either) and installed Xubuntu.  I won’t go into details about how I got Linux on my PS3 since that’s well documented.  I will say that I remember quite vividly now why I can’t stand binary distros.  Bleh.

The BD filesystem is UDF.  Providing you have a recent kernel (2.6.20, I think) with UDF v2.5 support, you are good to go.  I mounted a remote share and just dumped the disc to an ISO file onto my desktop.

$ cat /media/cdrom0 > wonka.iso

That was the easy part.

The hard part was trying to get it decrypted.  I had to use Java tools (bleh) to get to the source.  There are three applications you need.  And if you hate digging through forums and using download services, then I’ve got direct links for yah:

For Gentoo, you’ll need to install the JDK to build the aacskeys library and binary.  I just emerged dev-java/sun-jdk and it worked for me (I know absolutely nothing about Java, but my stabbing in the dark miraculously worked).  You’ll also need a runtime environment to actually execute the stuff, and I emerged dev-java/sun-jre-bin and that worked fine, too on my amd64 box.

For aacskeys and Gentoo, you’ll need to apply this patch that I cobbled together from what I found on the doom9 forums to get it to compile.  It just fixes the Java include directorys for the Makefile.

Now, I’m still a bit fuzzy about what each program does, and whether you need all of them or not, so I won’t go into a lot of detail.  What you want to use, though, is the dumphd program.  But to use it, you’ll need to copy the aacskeys library and a file from the bdvmdbg package as well into the path or same directory as the dumphd program.

Once you have that, you can just run dumphd.sh and it’ll fire up a simple little GUI telling you if it has all the libraries it needs.  Then you just specify the source and destination, and aacskeys will see if it has a working key to access the disc.

I can’t really give much more detail than that, since I’m so new to this.  Suffice it to say, if you read the accompanying README doc that comes with each one, you’ll get along just fine.

It took me a long time last night to get just one disc ripped and transferred over my subnet to try it out, and by the time I managed to get it mounted (mount -o loop -t udf wonka.iso /mnt/udf) and access it, it was pretty late.  The keys I had didn’t work for my disc, and I didn’t want to try the whole procedure over to try another disc.

Anyway, good luck if you try it.  One thing that impressed me is how much simpler it was than I thought it’d be, but what a pain it was trying to figure out where things went wrong.  The doom9 forums are a good resource, but not exactly the best place to find clear, concise information for a beginner.  That part was frustrating.

Personally, I don’t think it’s worth the hassle right now, the way I did it.  I’ll get a BD-ROM sooner or later so I don’t have to transfer the content over the network and can instead just test it directly.  But, I started out to see if I could at least get a copy of the ISO and get the tools running all without Windows, and I can.  So, that’s progress right there.