Search This Blog

Showing posts with label HandBrake. Show all posts
Showing posts with label HandBrake. Show all posts

Sunday, December 23, 2012

Proposed Handbrake improvement.

I've been busy ripping DVDs from my collection and I've run into an improvement for handbrake.

While converting TV episodes on DVD, I wanted to autoname the new file using output pattern S01-E0{title+offset}  like {title+5} for disc 2 in a DVD set where the title-1 is episode 6.

Handbrake - HandBrake is an open-source, GPL-licensed, multiplatform, multithreaded video transcoder, available for MacOS X, Linux and Windows

So I downloaded the codebase and found where in Windows code tree auto naming occurs.  HandBrakeCS its in Main.cs and Handbreake WPF autoNameHelper.cs

I have this code compiled and working locally great!

Now a commentary:

Dear SourceForge:

You have to be kidding! Separate logins for main site and forums site.  What is going on?
SourceForge also give lip service only to OpenID.  I initially created my user account with OpenID and  only to find I have limited permissions and I would need to create 'real' account to do anything useful.

SourceForge your site is terrible and I would recommend handbrake moving to another open source hosting site.

destinationFilename = UserSettingService.GetUserSetting<string>(UserSettingConstants.AutoNameFormat);

                    //Add ability to auto name file using {title-offset} or {title+offset}
                    // example {title-1} or {title+3]
                    // This is extremely useful when ripping DVD of tv show episodes.
                    #region AutoName based on {title-offset} or {title+offset}

                    int startPos = 0;
                    int stopPos = 0;
                    string offsetTag;
                    var iDvdTitle = Convert.ToInt32(dvdTitle);

                    if (destinationFilename.Contains("{title-"))
                    {
                        offsetTag = "{title-";
                        startPos = destinationFilename.IndexOf(offsetTag, StringComparison.InvariantCulture);
                        stopPos = destinationFilename.IndexOf("}", startPos, StringComparison.InvariantCulture);
                        string tag = destinationFilename.Substring(startPos, stopPos - startPos + 1);
                        string offset = destinationFilename.Substring(startPos + offsetTag.Length, stopPos - startPos - offsetTag.Length);
                        int iOffset = 0;
                        try
                        {
                            iOffset = Convert.ToInt32(offset);
                        }
                        catch { }
                        destinationFilename = destinationFilename.Replace(tag, (iDvdTitle - iOffset).ToString(CultureInfo.InvariantCulture));

                    }

                    if (destinationFilename.Contains("{title+"))
                    {
                        offsetTag = "{title+";

                        startPos = destinationFilename.IndexOf(offsetTag, StringComparison.InvariantCulture);
                        stopPos = destinationFilename.IndexOf("}", startPos, StringComparison.InvariantCulture);
                        string tag = destinationFilename.Substring(startPos, stopPos - startPos + 1);
                        string offset = destinationFilename.Substring(startPos + offsetTag.Length, stopPos - startPos - offsetTag.Length);
                        int iOffset = 0;
                        try
                        {
                            iOffset = Convert.ToInt32(offset);
                        }
                        catch { }
                        destinationFilename = destinationFilename.Replace(tag, (iDvdTitle + iOffset).ToString(CultureInfo.InvariantCulture));

Saturday, December 1, 2012

Plex Media Server

Over Thanksgiving, my brother-in-law introduced me to Plex Media Server.
It's like  your own personal Netflix using MP4 ripped from your collection.

Plex Media Server is a media distribution system that can use a variety of formats (I'm using MP4/m4v) and distribute the media to different devices at once.
In my household, I am streaming to 3 xboxes, 6 computers, and 4 android tablets.

There other nice aspect of Plex Media server, it is going to allow me to purchase movies and TV shows now in MP4 format then deploy them

Plex is just the server so you will need additional software to convert DVD to MP4s. http://www.plexapp.com/

I am using AnyDVD HD from SlySoft. http://www.slysoft.com/en/anydvd.html

And I am using Handbrake for Windows. http://handbrake.fr/downloads.php

HandBrake can seems a bit complex but reading through the explanaion of the parameters and the help got me started.  I would recommend that you do a couple sample conversions and testing the resulting MP4.

The nice thing is in handbrake you can save your settings as presets.

I created a preset for action movies and went with very conservative parameters to capture motive and I tested the with Wide screen edition of Empire Strikes Back which I then viewed in a 60in TV via XBOX 360.  Handbrake ripped the movie in 2 hrs on 4 3.0 GHz Quad core XEON Dell Precison 490 with 4 GB RAM running 32 bit Windows 7.  The video came out fantastic.



Of course with any software solution, better hardware results in better performance.

Compare:  Ripping a Red Dwarf Episode using good quality video settings (identical on both).

Intel 2-CPU 2-Core Xeon 3.0 Ghz, 4GB RAM , 32bit Windows 7:  ~28 min
Intel i7-2600 CPU 3.40 Ghz, 8 GB RAM, 64bit Windows 7: ~8:30 min !!