Monday, August 12, 2013

Completing the DVD-rip workflow

In February I posted about ripping DVDs and that I would post a script to compress the DVD dumped matroska files from makemkv into something smaller.  I found out that HandBrake was a cool "trancoding" program. It has relatively easy to understand options and a good level of automatic features. After figuring out what codec and quality settings to make I made SimpleBreak. Now published at github.

SimpleBreak takes one argument: The .mkv file to compress.  The it uses "mediainfo" to figure out what audio tracks and subtitles are available and shows terminal based dialogs to let the user choose languages. It assumes that I always want subtitles - 'cause I do, but it there are none in the source file that's OK.  It produces a new .mkv file with mp3 sound and h.264 video. This is played nicely by our family TV over DLNA and by everything else besides (phone, laptop, pad, whatever).

It produces a file with named the same as the original but with  - appended.  That way I could keep Nemo-English-English around in case anyone adult would like to enjoy the original voices, and Nemo-Norwegian-Norwegian for the kids.

I'm quite happy with it.

Sunday, February 17, 2013

Tastatur på telefonen!

For en stund siden kjøpte jeg et slikt (til høyre) Blue Tooth tastatur men fikk aldri brukt det som jeg hadde tenkt så det lå i kjelleren og støvet ned. Til frua, frustrert over alle tastaturene hun har forsølt på Android telefonen sin (inklusive SwiftKey og Swype) spurte om det ikke var noe sånn mini-tastatur som jeg en gang i tiden hadde brukt med Palm Pilot'en min (m505 mener jeg) til telefonen hennes.

Jeg greide å finne keysonic tastaturet i kjelleren og inne i "Innstillinger" på BT-skjermen gikk det som en drøm å pare opp tastaturet med telefonen og (utrolig nok) så bare virket det umiddelbart. Og når vi brukte muse-platen på tastaturet fikk telefonen en liten musepeker også slik at vi kunne muse rundt og klikke på skjermen.

Så gøy. Og frua er litt mer fornøyd med telefonen sin.  Men hun vil helst ha tilbake den gamle feature telfonen sin som hun kunne skrive meldinger på uten å se på skjermen - eller tastaturet.

Getting rid of the DVDs

Some years ago I ripped my CDs and have since stored all my music on disk (quite a few disks and now also my phone). The CDs have been relegated to the basement.

For some time I've been meaning to do the same with the DVDs, so 3 years ago I made sure my new server had a BD capable optical drive. And a lot of disk.  It has since received a lot more disk (just because I could, and with the DVD project in mind), but the disks are not exactly full. Life as a dad and husband with a newly built house does not lend itself to other projects.

But after the kids ruined yet another DVD the other day - by having left it on the floor - I resolved to use some late evening hours to work on the problem.

Going back in time two years now: The first stage was clear to me: makemkv. It decrypts the DVDs and stores all the contents (all video angles, all audio tracks, all subtitles) in a MKV file. Thus I should have good and complete source material and won't have to rip it from disk again later. makemkv is easy to operate, unlike dvd::rip. It's even easier HandBrake too - it does less than both - KISS in practice! In addition to decrypting whatever disk I feed it it works around that silly DVD zone problem so I can rip all my US disks as well as my European disks, no sweat, without changing the zone of the drive or messing with drive firmware.

I had hoped that the next step was simple: DLNA playback via the familys "smart" Samsung BD player. Samsung supports all kinds of formats including CD-XA in Matroska containers.  But the first tests were disappointing - the video stuttered. Not sure if it was the computing power of the player or the lack of  bandwidth in the WiFi network or the USB-WiFi dongle sitting in the behind of the player. But my laptop can play back the same mkv files over the same WiFi without stuttering.  Also, and much worse, it would not let me change audio tracks or the subtitles when doing DLNA playback.  But other HD content in MKV containers it plays very well over WiFi.  Just not the full bandwidth DVD stream which I have a few of on disk.

So, problem on the back burner quite a while.

As time passed I discovered that "MX Player" on my Android phone could play pretty much anything.

Also as time passed I had been considering Apple TV running Linux. Some other mini box running XBMC.  And Popcorn Hour - the A-400 model seems compelling. I've been tempted by TV-dongels running Android - one just might hang from one of the HDMI inputs of the amplifier in the back of the shelf. And there are a number of other media boxes based on Android as well.  The thing is I'm reluctant to add boxes to the family unfortunate low space media center. A old phone or a Android dongle should be just the ticket. Getting out the old Samsung Galaxy S II phone proved that the full-bandwidth DVD stream made that too stutter (and I plan to use the S III as a phone a while longer). I then grew dubious to how useful some other Android device with a lesser CPU might handle my media streams. And also cynical about how many OS upgrades they would receive after purchasing them.

Seems I will have to transcode the streams to some lower bit rate already proven to be handled by the phone... or indeed the Samsung BD player! OK scratch Android, bring back the BD player.

Next up, how to transcode from full-content MKV to lower bit-rate-with-selected-content video file as easy as apple pie (you'll have to wait while I write the code ;-)  It seems to be given that I will use the HandBrake CLI tool though.  It's a GOOD deal less scary than any other transcoding tool I have seen or attempted to use over the years. And it can use all the CPU cores in computer.

Honorable mentions:

If I had stayed with the old phone or other Android platform alternative I would have had to do the same transcoding to get lower bit rates.  And then I would probably have used BSPlayer which supports playback from Samba shares among other things.

Also, MediaHouse is a very good DLNA-browser that supports IMDB lookups (including Movie posters) and that can give a handle on remote content to MX Player and have it played even though MX Player does not support DLNA. Unfortunately that precludes fast forward, rewind or even resume of the video which sucks if you watch anything longer than 5 minutes.