Your Ad Here
2010
05.21

Recently I bought the first series of The Thick Of It on the iTunes store – I was impressed with the ease of use and the quick download. However, watching most sorts of video on a PC monitor is quite tiring, and it can be a lot easier to watch such programmes on a regular TV. So, as I have a Wii with the homebrew channel and MPlayer CE installed on it, I decided to put it to good use for this purpose. However, I couldn’t just put the episodes onto a SD card or USB stick and play them with MPlayer as iTunes encrypts video purchases and ties them to your account – in addition it is unlikely that the Wii’s hardware could handle the H.264 encoding of the video. So instead here is a solution to this problem – it’s quite fiddly and not very elegant but it has produced reasonable results for me.

To stream videos from your PC to your TV you will need:

  • A fairly powerful PC running Windows XP or Vista (Sorry mac and linux users – I’m currently trying to work out a way to do this with open source tools)(Not tested on Windows 7)
  • A networked Wii with MPlayer (find out how to install The Homebrew Channel, MPlayer and other software on your Wii for free at http://wiibrew.org)
  • An SD card or USB stick, anything to get a file to the Wii for MPlayer to open – you can the same card that MPlayer is installed on.
  • Windows Media Encoder – get it here: (64bit or 32bit)

Step 1

Open iTunes and right click on the video that you want to play and select “Get Info”. Make a note of the “Video Dimensions” property, you will be needing this later.

Now open up and pause a copy of your video, it may help to move the player into one corner of your desktop for later. It may help to get better quality if you right click the video and select “actual size”, this will remove any quality degradation from resizing the video. However, for HD videos you might need to resize the window to make it smaller, as the Wii cannot handle HD video. It’s good to aim for resolutions around 640×480 for videos with an aspect ratio of 4:3 and 640×360 for widescreen videos.

Step 2

Install Windows Media Encoder, whichever version is suitable for your platform (if you’re not sure, choose 32-bit). Open it up, you should see a dialog box like this:

Choose “Custom Session” and click OK

Step 3

You should be now presented with a new screen.

As is shown in the picture, select “Screen Capture” as a video source and click the “Configure” button next to it. You should get this window:

Select “Region of Screen”, then click the button underneath and drag it over your video, trying to be as accurate as possible. Now, tweak the “Top left corner” and Width/Height settings until you have covered the appropriate area of the screen. If you selected “Actual size” at the end of step 1, the Width and Height should be the same as the “Video Dimensions” you found from iTunes earlier. If you didn’t because your video is HD, don’t worry, just try and fit the video well. Note that the width and height must both be divisible by 2 or you will get an error.

When you are done, click “OK”. Now select the audio source as “Stereo Mix” – if you can’t see it on the list, there are various tutorials on how to enable it for Vista – http://www.singsnap.com/snap/forum/topic/aa373f is one example. (Windows 7 does not have this feature; I have not yet found a solution.)

Your screen should by now look something like this:

Step 4

Select the “Output” tab. Verify that your screen looks like this:

Make sure your screen looks like the above screen – I have used port 8080 because it is unused on my PC. If you are unsure, click “Find Free Port”. You should also make sure that Windows Media Encoder and the port you have chosen are allowed through any firewalls you have installed on your PC (don’t bother disabling your router’s firewall if you have one, there is no need for the whole world to be able to view your stream if it is just for your Wii).

Step 5

Select the “Compression” tab. It probably will look something like this:

This is where we select a media profile to encode the captured video into. All these profiles are designed for web streaming; however we are streaming using specific circumstances – we have a fast network connection to a device with moderate processing power. If you’re interested in video encoding principles you can have a play around with this page and try and optimise for quality or speed – for now, let’s create a custom session that should provide a good all-round profile.

Try and match the screen above, then click “Edit”.

Click the tab at the top of the dialog box and enter the same settings as above. They may not be perfect but provide a good middle ground, and as mentioned earlier you can tweak them to your liking if you know what you’re doing. When you’re done, close the dialog by clicking “OK”. Your screen should now resemble this:

Step 6

Now we’ve created a profile, it might be a good time to save it – this way you can open it again weeks or months later – for episodes of the same show with the same resolution, you’ll only need one profile. This is why it’s useful to line up your iTunes video window with a corner of the screen – it makes it very easy to line up again when you load up a saved profile.

You are now ready to start encoding. Click the “Start Encoding” button on the second toolbar at the top of the window. Your encoder window should minimise itself – if you re-open it you should have something like this in front of you:

If the encoder stops or finishes when you restore it, don’t worry – you can disable this in the settings menu.

As you can see from the status bar at the bottom, the encoder is now broadcasting. The stats at the bottom give a good indication of whether or not your video will be of good quality – if “Average fps” is much lower than “Expected fps”, your PC cannot handle the encoding – you can try closing programs you don’t need, resizing your video window to make it smaller (don’t forget to redo the first half of step 3 if you do this!) or going back to step 5 and lowering the video and audio bitrates – however this will also affect quality.

Make sure there are no windows on top of your video or they will be shown in the output.

Step 7

So now you’ve done the hard part, you just need to get your Wii to connect. This is possible by making a playlist file. Open up a text editor such as notepad and paste the following into it:

[playlist]
File1=http://your-address:your-port
Title1=Desktop Stream
Length1=-1
NumberOfEntries=1
Version=2

This is the basis of a PLS playlist file which MPlayer can open. It’s not finished yet though. Find the internal (network) IP address of the PC you’re using – if you don’t know how, read this – it usually comes in the format “192.168.xxx.xxx”. Put this where “your-address” is in the example. Then, after the colon, put the port you chose earlier in step 4. In my case, the computer had the IP address 192.168.1.3 and the port I was using was 8080 – so the config file looked like this:

You now need to save the file onto your SD card or USB stick. Put it somewhere easy to remember. You need to give the file a .pls extension, so when you’re saving it, call it “desktop.pls”, and make sure to select “All Files (*.*)” as the file type. Then click Save.

Step 8

Now take your SD card or USB stick with the playlist file on it and put it in your Wii. Start up MPlayer CE through The Homebrew Channel or another method, and then use the controller to browse to and open the playlist file you saved. After a few seconds you should see your paused video. You can now go to your PC and begin the video – due to the use of buffering in streaming, there will be a delay of several seconds before your video starts to play – this can be reduced or eliminated using the Windows Media Encoder settings. Now get a drink and some popcorn, sit back and enjoy!

Notes

This technique of streaming is not limited to iTunes videos – it can also be used to stream games, web videos, or other content direct from your screen. However, for many other uses there are better alternatives, such as just copying a recorded video file onto a SD card or USB stick and playing it direct from the Wii. You can also use Windows Media Encoder to save screen captures to .wmv files using a similar method, but I will not explain that here as to use it on iTunes videos to make a copy may breach copyright laws in some countries. I do not believe streaming has such issues as no “copy” of the file is being made, and if you have personally bought the content and are only streaming it to yourself, there is no “theft” taking place. For this reason you should not give out stream details freely on the internet and should also not generally allow the stream past your router’s firewall. This technique is also resource-heavy as it requires the PC to both play and encode the video in real time. The process could be improved by making it cross-platform using open-source streaming software such as VLC, although I had no luck capturing video and audio at the same time. If you do get this to succeed, please comment with the information or a link to it if you have posted it yourself.

Hopefully this tutorial helped you out, if you had any problems, or have a suggestion or criticism, please post a comment below and I’ll see what I can do :)

If you wish to publish this tutorial on your site, please provide a link to the original article here, or post a comment explaining where and why you’re going to publish it.

No Comment.

Add Your Comment