Ripping Blu-Rays and DVDs to a Media Server

Hardware needed:

  • PC
  • BD-ROM / DVD-ROM
  • Large Hard Drive (mine is 2 TB)

Software needed:

Media is increasingly migrating towards streaming-only distribution. Discs, even BD/HD-DVD formats, have rather low limits on the amount of data that can be stored on each. These low limits and the increasing availability of high-speed and high-bandwidth internet connections are just two reasons that consumers have begun to rely on streaming digital content including movies, music, videos, and pictures. The convenience of streaming services like Netflix and Hulu allow consumers to avoid commercials and watch what they want and when they want. Products like DVR and TiVo are only band-aids on top of the real problem: cable companies disallowing customers to choose their own content at convenient times.

Just think about what you have to do in order to watch your DVDs and Blu-Rays. I have Blu-Rays in my possession that literally take 5 minutes just to load the main menu. This problem is magnified by useless services like BD-Live that require internet connectivity in order to load content like chat rooms and trailers that users may never even use. For users like me, I want to be able to access my content immediately and in the format of my choosing. The current implementation of HD media inconveniences consumers by disallowing various viewing options and restricting Blu-Rays to only existing on the original disc. In fact, the legality of copying  Blu-Rays for personal use even when creating simple backups is questionable because of the insane policies of the MPAA and the legislative pockets that they influence.

Unless you’re sharing and distributing your backups, I sincerely doubt any authority is going to care. The MPAA and other organizations that rely on Blu-Ray sales isn’t losing a single penny if you backup your physical media. You’ve already legally purchased the disc and are simply transferring the contents to a device of your choosing. Continue at your own discretion and follow these steps. Keep in mind that MakeMKV is not going to perform any transcoding of your content. The original video/audio codecs will be left untouched and will simply be transferred to a .mkv container.

  1. Download and install MakeMKV from the link above.
  2. Download and install Handbrake from the link above. (optional)
  3. Download and install VLC Player from the link above. (optional)
  4. Start up MakeMKV.
  5. Insert the DVD or Blu-Ray of your choice into your BD-ROM/DVD-ROM drive.
  6. Wait for MakeMKV to scan the disc and then click the big Disc –> HDD icon.
  7. Wait for MakeMKV to scan for titles, video, audio, and subtitles.
  8. Check and uncheck the desired contents to be included in the final .mkv output file. (I will write another post about specifics on video/audio codecs and subtitles.)
  9. Change the output path in the right panel and click the button to the right of the output path.
  10. Wait for MakeMKV to complete the process and transfer the final output to the shared folder of your media server.
Read more

Creating a Media Server using PS3 Media Server and a PS3

Hardware needed:

  • PC
  • PS3
  • TV
  • Switch
  • Receiver (optional)

Software needed:

Ideally your setup will look something like: PC (media server) –> Switch –> PS3 –> Receiver (optional) –> TV. The advantages of including a receiver between the PS3 and the TV include better speakers and the ability to decode some of the newer proprietary audio codecs such as DTS-HD and TrueHD (more on that in a different post.)

Follow these steps:

  1. Use the link above to obtain and install PS3 Media Server on the PC you’re using as your media server.
  2. Turn on your PS3.
  3. Start up PS3 Media Server and wait for it to scan the network for available renderers. When it’s done, you should see your PS3 in the “Detected media renderers” section. You can confirm connections or view any errors in the “Traces” tab.
  4. Under the “Navigation/Share Settings” tab, add any folders you want to share with your media renderers under the “Shared folders” section.
  5. On the PS3 menu, go to the appropriate section that you want to stream under (Pictures, Music, or Video), find the PS3 Media Server, and navigate to the content you want to stream.
  6. When you start streaming, PS3 Media Server will display information about what it is currently streaming, the buffer status, and the bitrate under the “Status” tab.

Quite honestly, this is all that needed to be done to get content streaming properly to my TV. In a separate post, I’ll talk about some of the more advanced options of PS3 Media Server, transcoding, video/audio codecs, subtitles, ripping Blu-Rays/DVDs, and lessons learned for the best streaming performance.… Read more

ASP.NET Web Services Part 2

You may have noticed that this post is about two months late. Time flies, doesn’t it? The previous post on an introduction to web services and how they work with ASP.NET provided you with a cursory glance. This post will provide you will how to implement a very basic web service both on the server side for consumption and the client side for use in an application.

Prerequisites

  • Visual Studio 2005 or 2008
  • Basic knowledge of C#
  • Basic knowledge of ASP.NET Web Services

Step 1 – Create the ASP.NET Web Service

  • Visual Studio –> File –> New –> Project… –> Visual C# –> Web –> ASP.NET Web Service Application

Once the web service application project is created, notice that a templated web service was also created (Service1.asmx). The only section of this template to be worried about at the moment is the HelloWorld method marked with the [WebMethod] attribute. Marking methods as a [WebMethod] identifies that they will be used by an external caller through XML SOAP communication and are required to be exposed by the web service WSDL described in the previous post.

  • Make sure the HelloWorld method looks exactly like below.

  • That is literally all it takes to expose a web service method to the world! Press F5 to begin debugging this application in a local web server and continue to Step 2.

Step 2 – Utilize the Exposed Web Service Methods

One thing to note is that because web services are implemented via XML, any application that can properly serialize commands into the correct format as described by the web service WSDL has the ability to utilize web services. That said, the following section will be written using a simple C# console application.

  • Visual Studio –> File –> New –> Project… –> Visual C# –> Windows –> Console Application
  • Like library references, you need to add a reference to the URL path of the hosted web service. In the case of this article, the web service is hosted locally in the previous step.
  • In the main project of the solution explorer, right click Web References –> Add New Web Reference…
  • In the URL textbox, copy and paste the URL found in your browser that popped up from Step 1 when you pressed F5 to debug.
  • Press the Go button to the right of the URL textbox to search for any exposed methods at the URL provided.
  • When found, enter a name for the Web reference in the bottom right (I named it localhost.)
  • Press add reference to allow Visual Studio to create classes that allow consumption of the web service.
  • Add the following code to the Main method. Make sure you change “localhost” to whatever you called your web reference and change Service1 to the name of your exposed web service class.

Read more

ASP.NET Web Services

NOTE: Microsoft no longer suggests using this method of web services, but it is useful knowledge if you are supporting legacy systems or are still required to implement these features for business purposes. This method of web service is still useful for internal operations that do not require high security.

Below is an overview image of common web service architectures. It’s easiest to think of web services at “web methods” contained within a “web library” that contains methods to be executed on a server. The strength of this approach is that all communication is done in a standard XML format, regardless of the platforms communicating. This allows for brand new systems to communicate with extremely legacy systems, assuming that each system can properly implement a valid SOAP request and response according to the WSDL contract.

Client: Any application that requires consumption of whatever methods the web service is exposing.
Web Server: A process that hosts the web services for consumption.
Broker: Provides the definition of the web services being exposed.
SOAP: XML formatted request and results containing data according to the WSDL (see below.)
WSDL: Definition language describing which method to execute, what parameters the method requires, what data types the parameters are, what results will be returned from the web service, and what data type to expect back from the web service.

A common SOAP request with a body but no header. Note that the method being executed is defined in the <m:GetStockPrice> tag and the parameters passed are described in the <m:StockName> tag.

A common SOAP response with a body but no header. Note that the response being returned is defined in the <m:GetStockPriceResponse> tag and the return value is described in the <m:StockNamResponsee> tag.

Stay tuned for the next post which will include how to create a web service client and server in Visual Studio 2008 using C#.… Read more

Simple Class Declaration and Initialization with PHP5

If you’re used to classes with C#, C++, and Java, then you’re used to classes in PHP as well. If you’re brand new to classes, I suggest you read up on the definition and uses of them before trying to implement them via this tiny tutorial.

To begin, let’s create a simple class that will store information about a logged in user from a session. This class should hold the user’s username, first name, and last name to identify who it is on subsequent pages and requests. Begin by naming this class as “UserPassport” and adding the three previously described properties. They should not have default values because the class does not make sense without properties assigned during construction.

Expanding on this class, we need to add a constructor and a method to use these properties in a semi-meaningful manner.

There’s nothing crazy going on in the constructor. It’s a simple matter of assigning the properties values from whatever was passed in at construction. To display the information, a displayInfo method is created that places the three values in an array and splices them together separated by a comma and a single space. This value is then echoed to the output stream.

Now, this class is pretty useless if nothing is instantiating instances of it. Below is an example of how to instantiate and display the contents of our class. I used the xhtml 1.1 from The Web Standards Project to define a blank page.

The __autoload method is used to allow auto instantiation of classes without requiring an include statement to the .php file containing the definition.… Read more

Windows Vista – Moving C:Users to Another Location

Moving your personal documents to a location other than the system partition is a good idea for several reasons. Namely, if your system crashes, you can format and reinstall Windows without affecting your personal files or requiring you to move them to another location. Of course, this does not work if the entire drive crashes and takes your personal files with it!

Follow these steps (D: is the name of my location, change it to match yours):

  1. Backup your C:Users folder to an external location
  2. Boot from Windows Vista install DVD
  3. Click “Repair” from main install screen
  4. Click Command Prompt
      • robocopy C:Users D:Users /mir /xj
      • rmdir /S /Q C:Users
      • rmdir “C:Documents and Settings”
      • mklink /J C:Users D:Users
      • mklink /J “C:Documents and Settings” D:Users
      1. Reboot

      You’ll notice that C:Users now has an arrow on its icon designating that it is a link to another location. Remember to set proper permissions and remove read-only status from the new D:Users so all applications work properly!… Read more

      Creating a Professional ToolStrip in Windows Forms Part 2

      In my previous post, I explained how to create the basic UI elements of a simple Windows Forms application with a nice looking vertical ToolStrip menu to host buttons and labels without ever leaving the Designer. In this post, I’ll explain how to wire up some events, load in some UserControl objects, and add a custom rendering method to style our MouseClick events on the ToolStrip buttons. We’ll begin by opening the project from our previous post. (seen here)

      Prerequisites

      • Microsoft Visual Studio 2008 (or 2005, but I wrote this using 2008)
      • .NET Framework 3.5 (or 2.0, but I wrote this using 3.5)
      • Basic x,y coordinate knowledge to draw and position rectangles
      • Intermediate knowledge of C# and Windows Forms
        • Inheritance and overrides
        • Event handling

      Step 1 – Create a Custom Rendering Class

      • Right click on the Project in the Solution Explorer, Add –> New Item… –> Class (.cs).
      • Name this class customRenderer.cs and click OK.

      This class is going to inherit from ToolStripProfessionalRenderer so that we can override some of the rendering methods and make them do whatever we want. In this case, however, we will only be overriding the OnRenderButtonBackground method.

      By overriding this method, we can change the behavior of how backgrounds are rendered. Some conditions will need to be applied in order to enforce that custom rendering only occurs on ToolStripButton objects and only when the objects are in a Checked state. Read through the comments in the next code block in order to understand some of the sections.

      Read more

      Creating a Professional ToolStrip in Windows Forms

      Ever wanted to create a professional looking menu in your Windows Forms applications complete with big buttons, nice mouse over effects, and images? Well, look no further. In this post, I’ll show you how to implement a graphical ToolStrip menu to navigate through a Single Document Interface (SDI). You’ll notice that the finished interface is rather similar to Spybot – Search and Destroy. Keep in mind that the following example is rather simple and leaves a lot of room for expansion.

      Prerequisites

      • Microsoft Visual Studio 2008 (or 2005, but I wrote this using 2008)
      • .NET Framework 3.5 (or 2.0, but I wrote this using 3.5)
      • Beginner’s Knowledge Windows Forms

      Step 1 – Create the Form Shell to Host the Menu

      • Create a new Windows Forms Application Project.
      • Select Form1 and adjust it’s size in the Properties Window to 964,600 (the exact size isn’t important, but you want to leave room for other controls once the menu is operational).

      Step 2 – Add the Menus

      • From the Toolbox:
        • Drag in a MenuStrip and snap it to the top of Form1 by either dragging it until the blue line snaps to the top of the form, or drop it in Form1 and set the MenuStrip object’s Dock property to Top.
        • Drag in a TableLayoutPanel to the center of the form.
          • From the submenu that pops up when you drop in the TableLayoutPanel, click “Remove Last Row.”
          • Set this new Container’s Dock property to Fill.
          • From the Toolbox, drag in a ToolStrip and drop it into the left column of the new TableLayoutPanel.
          • Click the “…” button in the Property Window for this new control’s Columns property.
          • Set Column1 width to absolute 115px and Column2 width to relative 100%.
        • Drag a ToolStrip into the left column (Column1).
          • Set its Dock property to Fill.
          • Set its LayoutStyle property to VerticalStackWithOverflow. This will cause contents to stack top to bottom.
          • Set its GripStyle property to Hidden. This is only a matter of preference.
          • Set its Padding property to 5,5,5,5. This will give space on all sides for its contents.
          • Set its ImageScalingSize property to 35, 35. This will force images on Buttons to scale to 35px by 35px.

      Step 3 – Add Content to the Menus

      • Using the “Add New Item” drop down in the ToolStrip:
        • Add a Label (menu section title).
        • Add two Buttons (menu section content).
        • Add a Label (menu section title).
        • Add three Buttons (menu section content).
      • While holding control, select each Button on the ToolStrip:
        • Set their DisplayStyle property to ImageAndText. This will cause a caption to be added to the Button in addition to an image.
        • Set their TextImageRelation property to ImageAboveText. This will cause the caption to be below the Button’s image.
        • Set their CheckOnClick property to True. This will cause the button to display as pressed or checked when clicked a single time. We will make the check state mutually exclusive for all buttons on the ToolStrip so that only one button can be checked at any given time to enforce SDI behavior.
      Read more