Hauppauge HD PVR Streaming to Flash Player

This blog shows how to stream directly from the Hauppauage HD PVR H.264 Encoder to a Flash Player Client with no need to reencode the audio or video.  To accomplish this I have used a series of Windows DirectShow Filters to receive the stream from the HD PVR, send the stream out to the network using RTP/AVP.  And then Wowza Media Server does the rest to restream it to flash player.

What you will need:

- Hauppauge HD PVR
- Elecard NWRenderer DirectShow Filter (Elecard Codec .NET SDK G4 or Streaming Plug-in)
- Windows Graph Edit (Windows Driver Devlopment Kit)
- Wowza Media Server

First, install the Hauppauage HD PVR and drivers and get a good video signal coming in to it.   Next, get a copy of the Windows Driver Development Kit and you only need to install the AV Stream Tools in order to get the graphedt.exe and related libraries.  ( “C:\WINDDK\3790.1830\tools\avstream\x86\graphedt.exe” )  Most of the instructions will be building a DirectShow Filter Graph using this tool.

Using Windows Graph Edit you can create a filter graph to expose the raw data from the HD PVR.  The raw data is an MPEG Transport Stream containing H.264 video and AAC audio.  In Graph Edit you need to add and connect in sequence the Hauppauge HD PVR Crossbar, Hauppauge HD PVR Capture Device, and Hauppauge PVR Encoder filters.  These are found under Graph > Insert Filters > WDM Streaming Crossbar Devices,  WDM Streaming Capture Devices, and WDM Streaming Encoder Devices respectivally.  Connect the crossbar device to the capture device and connect the capture device to the encoder.  You can right click on each of these to modify properties.  Especially usefully is the encoder properties page to set the H.264 and AAC settings.

You now have direct access to the MPEG Transport Stream (containing H.264 audio and AAC video).  You could use a Dump Filter to dump this directly to a file if you wanted to.  What we want to do is feed this into the Elecard NWRenderer and stream it out to the network.  You will need to install either the Elecard Codec .NET SDK G4 or the Elecard Streaming Pack.  Once you have installed these they should show up under Graph > Insert Filters > DirectShow Filters.  If for some reason you do not see these Elecard filters, you may need to register them in windows.  The filters are *.ax files in the install folder of the Elecard software.  ( “C:\Program Files\Elecard\Elecard Codec SDK G4\Bin” or “C:\Program Files\Common Files\Elecard” )  Pass each of the *.ax filenames as a parameter to regsvr32.exe.

Insert the Elecard NWRenderer filter.  Connect the output of the Hauppauge Encoder to the Input of the Elecard NWRenderer.  Click Play to run the filter graph.  Right click to view the properties of the NWRenderer.  Under Information Click the Save SDP message.  Save this file out.  You can open this file in VLC Media Player to test that it is really being sent out over the network.  We are finished using the Graph Edit program.  Leave the graph playing and streaming on the network.

Install Wowza Media Server with an MPEG-TS add-on license.  Make sure you request an MPEG-TS add-on license.  Without the MPEG-TS add-on this does not work in Wowza Media Server.  Copy the rtplive folder from “%WMSCONFIG_HOME%\examples\NativeRTPVideoStreaming\conf” to “%WMSCONFIG_HOME%\conf”.  Create an empty folder named  rtplive in “%WMSCONFIG_HOME%\applications”.  Copy the .sdp into “%WMSCONFIG_HOME%\content”. Start the Wowza service.

Now you can run “%WMSCONFIG_HOME%\examples\NativeRTPVideoStreaming\client\nativertp.html”.  Put the filename of the .sdp file as the stream name. You are now watching the video and audio being encoded from the HD PVR.  Wowza simply converts the container from mpeg transport stream to the flash compatible mp4 box.

More to come including screen shots …