Windows Phone Thoughts: Encoding and Streaming to your Pocket PC

Be sure to register in our forums! Share your opinions, help others, and enter our contests.


Digital Home Thoughts

Loading feed...

Laptop Thoughts

Loading feed...

Android Thoughts

Loading feed...



Monday, August 25, 2003

Encoding and Streaming to your Pocket PC

Posted by Philip Colmer in "SOFTWARE" @ 09:00 AM

Have you ever found yourself sitting in your garden, wishing you could have an almost limitless supply of music or video on your Pocket PC? Well, you can ... and if you want to find out how, just read on ...

If you've got a Windows PC, this article will show you how to get audio & video content from your PC onto your Pocket PC. There are two ways of doing it:
  • By encoding the source material into a format suitable for the Pocket PC and then copying the files onto the device
    or
  • By using a network (preferably a wireless one!) and streaming the encoded data over to the Pocket PC
What You'll Need
This article is going to focus on using the following:
  • A Windows PC
  • A Pocket PC with Pocket PC 2002 or 2003
  • Windows Media Encoder
  • Windows Media Player on the Pocket PC
  • A wireless network (optional)
There are other ways of achieving the same end results with other pieces of hardware and software. If you don't want to use some of the above, hopefully this article will help you to use the items of your choice.

Getting Started
Before your Pocket PC can play audio & video, the material needs to be in the right format. If you are using Windows Media Player, this means Windows Media Audio and Video files.

If you've already used Windows Media Player to rip a CD onto your home PC, the files on your PC are Windows Media Audio files, so you can just copy the files onto your Pocket PC and start playing them.

Video is a bit harder :-). Luckily Microsoft has a free tool to make life easier for us - Windows Media Encoder. There are two versions of the encoding tool available for download - Encoder 7.1 and Encoder 9. Please note that the latter is, according to Microsoft's site, only for use with Windows 2000 and XP.

Which one should you use? By preference, you should use Encoder 9 as it is the more up-to-date encoding application but, as noted above, it does require Windows 2000 or XP. Otherwise, use Encoder 7.1 - it does the job just as well even though it isn't using the latest algorithms from Microsoft and the user interface is a bit awkward compared to Encoder 9.

Most of the PC screenshots in this article will be from Encoder 9. If there are significant differences in appearance from Encoder 7.1, I'll point them out.

So what does the encoder software do? It takes your source material and converts it into a format that the Pocket PC can handle. In the case of video, this involves making the picture smaller (e.g. 208x160) and fewer frames per second (e.g. 8 instead of 29.97 for NTSC and 25 for PAL).

Enough detail - let's get our hands dirty!

The Encoding Process
By this point, you should have downloaded & installed one of the encoding applications. Fire it up - you'll find it on the Start menu under Windows Media.

Encoder 7.1 starts by giving you the choice of using the New Session Wizard, create a custom encoding session, open an existing encoding session or a recent encoding session.


Figure 1: The opening choices with Encoder 7.1

Choosing the New Session Wizard and clicking on OK presents you with the available wizards - broadcast a live event, capture audio or video and convert an audio or video file.


Figure 2: Encoder 7.1's encoding wizards

Encoder 9 takes you straight into the choice of Wizards, making it easier for you to set up the encoding session.


Figure 3: Encoder 9's New Session window

For now, choose the "Convert a file" wizard. Both encoders then display a window asking you for the source file and the output file. Do take account of the tip that is displayed in the window - always use the highest quality source file. Re-encoding a file that has already been processed in a way that has resulted in some loss of the source data will not be as good as encoding the original source file.

Once you've picked your source & output file names, click on the Next button. The encoder then asks you how you want to distribute your file. If you are using Encoder 9, choose "Pocket PC" and click on Next. You will then be asked how you want to encode your audio and video. Leave the video option set to "Pocket PC standard video" but change the audio to "Voice quality audio". Click on Next.

If you are using Encoder 7.1, choose "File will stream from a Web server or play directly on a computer" and click on Next. You will then be asked which profile you want to use. If you've got an old Pocket PC or you want to play safe for now, choose "Video for color PDA devices (150 Kbps)" and click on Next. If you've got a newer Pocket PC, you might want to try the other PDA profile (225 Kbps) as this offers 20 frames per second instead of eight, but playback may be choppy if your Pocket PC isn't fast enough.

If you've followed the above steps carefully then, regardless of which encoder you are using, you should be looking at a window that allows you to specify information about the content. This allows you to enter the title, author, copyright, rating and description information. Enter as much or as little information as you like and click on Next.

The wizard will then display a review of the options you have picked. Click on Finish! The encoder window will then be displayed, showing audio bars on the left, with input and output video windows next to them and details of the encoding process underneath.


Figure 4: Encoder 9 encoding away

Encoder 9 does the video encoding in two passes. During the first pass, there isn't any output displayed.

In either case, once the encoding has finished, copy the "wmv" file onto your Pocket PC, start up Windows Media Player, click on Select, click on your file and then on the play icon. Sit back and enjoy the fruits of your labour!

The above steps can also be used to take audio files and convert them for the Pocket PC. By following the above steps and picking an audio file instead of a video file, the encoder will automatically produce a WMA file. The only thing you may want to play around with is the bit rate used to encode the audio. The lower the bit rate, the lower the quality, but it all comes down to taste :-) If you are using Encoder 7.1, the profiles will automatically be restricted to audio-only and you can pick one for a bit rate that suits you.

If you are using Encoder 9, it gets a little bit more complicated because the choice of profiles is based on your answer to the content distribution question. What I would suggest is that you use these steps:
  • When you get to the Content Distribution page, choose Pocket PC as before
  • Leave the audio setting as "CD quality audio (CBR)"
  • Enter any display information
  • On the "Settings Review" page, deselect the "Begin converting when I click Finish" option and click on Finish
  • In the Encoder window, click on the Properties button. The Session Properties window will appear within the Encoder window


    Figure 5: Changing the properties of an encoding session in Encoder 9

  • Click on the Edit button next to "Destination: Pocket PC". The Custom Encoding Settings window will appear
  • Click on the "70 Kbps" tab


    Figure 6: Picking a different audio bit rate

  • Choose any bit rate you like from the drop-down window BUT ensure that you pick one that says 44KHz and not 48KHz
What About The Almost Limitless Supply?
OK, so you may be thinking to yourself "well, yes, but I've still got to copy files onto my Pocket PC and I haven't got a limitless amount of storage, so what can be done about that?" ... or maybe not :-)

What we've looked at so far is how to encode, or convert material that is on your PC into a format that the Pocket PC can handle. We are now going to take what we've learned and take it to the next step - sending it across a wireless network ... or streaming it, to use the posh term. :-)

The significant point, though, about streaming from Windows Media Encoder on your PC to the Pocket PC is that you can then use the "capture from device" to your advantage. For example, if you set up Windows Media Player on your PC to play a list of tracks that lasts a couple of hours, you can stream from the sound card device to your Pocket PC without having to spend ages downloading the files to the Pocket PC first.

If you've got a TV tuner card in your PC, you can even stream television to your Pocket PC ... bliss!

So What Is Streaming?
Streaming, at its most literal, is the continuous supply of data. If you've ever watched a movie trailer on the Internet, it is likely that it has been streamed to your PC or Pocket PC. Streaming avoids the need to download the whole file before you can start playing it. That becomes particularly important if you want to watch or listen to a live broadcast ... it becomes a bit difficult trying to download that :-)

What Are We Waiting For, Then?
Nothing much! Start by running the encoder application. If you are using Encoder 7.1, leave the first option selected and click on OK then pick "Broadcast a live event from attached devices or computer screen" and click Next. If you are using Encoder 9, select the "Broadcast a live event" wizard and click on OK.

Both encoders will then display a window that allows you to specify the devices you want to use as your source material. If you want to just stream a single file, it can be done, but you need to set up a custom session in order to achieve that. I'll cover that near the end of the article.


Figure 7: Specifying the devices to be used for the source material

You have to stream at least audio - the video part is optional. So the first step is to turn off the video option if you only want to stream audio. Let's do that for now - we can come back and do video later.

Make sure that your sound card is selected as the device and click on the Configure button. The window that appears will allow you to select the recording input on your sound device. If you want to stream what Windows Media Player is playing, your sound device must offer something like "What U Hear" or "mixer" - in other words, the output of the sound card. Select that from the "Pin Line" drop down menu, select the checkbox next to Enable and click on OK.


Figure 8: Specifying the input on your audio card

(If your sound card doesn't give you the option of using its output as a recording input, there is a workaround given in the section "And I Can Do This With Video Too?" below).

Click on Next in the Wizard window to move on to the next step - the broadcast method. If you are using Encoder 9, make sure you select "Pull from the encoder" and click on Next. Both encoder applications will then display the Broadcast Connection window.


Figure 9: Encoder 9 broadcast method choice


Figure 10: The Broadcast Connection window

Unless you want to change the HTTP port being used, leave it alone and click on Next. For Encoder 7.1 users, you are now looking at the Profile Selection, so pick the audio profile you want to use.

For Encoder 9 users, you are looking at the Encoding Options window. By default, Encoder 9 tries to provide multiple bit rates over the stream, with 135 Kbps as the initially selected rate. Leave the settings like that for now - you can experiment later :-)

Clicking Next takes you to the Archive File window, where you can archive a copy of the broadcast to a file. You probably don't want to do this ...

Clicking Next again takes you to the Display Information window. As before, put as much or as little information in here and click Next. If you are using Encoder 9, deselect the "Begin converting" checkbox. With both encoders, click Finish on the Settings Review window. If you are using Encoder 9, you need to go back into the session properties, click on the Compression tab, click on the Edit button, click on the 135Kbps tab and change the audio format from "128kbps, 48kHz" to "128kbps, 44kHz". Click on OK to close the Custom Encoding window and then click on Apply to keep the change you've made.

With both encoding applications, you can now start the encoding process. Since we are just broadcasting audio, there won't be any video windows shown in the encoder window, but the encoder should be showing activity in the audio bars and the time in the Progress area should be increasing.


Figure 11: Encoding and streaming in action

Ready to start receiving the broadcast on your Pocket PC? OK - here are the steps:
  • Start Windows Media Player
  • Click on Tools
  • Click on "Open URL"
  • Enter the URL in the format HTTP://ip addr:8080 where ip addr is the IP address of your PC. Using the IP address avoids any potential problems with the Pocket PC trying to translate your PC's name into its IP address.
  • Click on OK
WMP will say "Buffering" in the status area and then, after a while, change to "Playing". If you've got the speakers on on your PC, you will notice that there is a lag between what your PC is playing and what your Pocket PC is playing. This is normal and is down to the time taken to encode, send the data across the wireless network and then decode it before it can be played.

And I Can Do This With Video Too?
Yes! If you've got a capture card or TV Tuner card in your PC, you can choose this as an input device right at the beginning of the steps discussed above. Your PC will then encode and stream the video across the wireless network. As above, there will be a lag, but the streamed video and audio will be in sync with each other, so you won't notice it if you aren't able to see the original source at the same time :-)

Alternatively, if you've got a video file that you want to stream, you can do this as well, but the steps taken vary depending on which encoder you are using.

If you are using Encoder 7.1, choose "Create a custom encoding session" when you start the application. The New Session window will appear.


Figure 12: Creating a custom session in Encoder 7.1

With the Sources tab selected, click on New. The "New Source Group" window will appear. By default, the video source will be set to "Screen capture". Click on the drop-down menu and choose "Browse for file". You can then specify your source video file. For the audio source, you can select a device or a file containing the audio (which may be the same file as that being used for the video). When you are happy with your choices, click on OK. You can add as many sources as you like, thus making the broadcast as long as the combined length of the files.

This is also an alternative way of broadcasting audio if your sound card does not have the ability to treat the output sound as a recording source.

Once you are happy with your source material, click on "Display Information". As before, enter the information you want then click on the "Profile" tab. Here, pick the same profile you used when you were encoding files. Finally, click on the "Output" tab and ensure that "Broadcast encoded output" is selected and "Archive to file" is deselected. Click on OK and the encoder window will be displayed. Click on the Start button and the encoder will start encoding & streaming the output.

If you are using Encoder 9, the process is very similar. You start by defining your sources, be they files, devices or a mixture. You can also specify what the encoder does at the end of the list - stop, loop, roll over to next source or roll over to first source. Once you've specified your source material, you click on the "Output" tab to select "Pull from encoder". You can then click on the "Compression" tab and ensure that the destination is Pocket PC and that the audio is "Voice quality audio". Click on "Apply" then "Start Encoding" ... and away you go :-)

Gotchas
You may be wondering why, if you are using Encoder 9, I kept on telling you to change the audio settings. The reason is because, by default, the encoder likes to use a 48kHz audio format - which Pocket PC 2002 doesn't like. I don't have Windows Mobile 2003 device, so I can't confirm whether or not that behaves the same way. Anyway, the problem is documented in Knowledge Base article 813693 if you want the MS line on this and how to permanently fix it.

Conclusions
Hopefully I've been able to help two audiences with this article - those who want to encode audio & video material for their Pocket PC and those who want to stream that material over a wireless network. By using the encoder application, the process is actually reasonably painless - once you've got the hang of the various settings :-)

So go on - set your PC up, recharge the battery on your Pocket PC and go and sit in the sun and enjoy the stream!

Tags:

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...

Reviews & Articles

Loading feed...

News

Loading feed...