Putting Panasonic SDR-H200 video on the web with ffmpeg

I recently got a Panasonic SDR-H200 camcorder.  It's got excellent quality video, fits perfectly in the palm of my hand and packs a ton of features.

 

I'm a total video newbie so when I tried transferring the video from the embedded hard drive to my computer so that I could post the video to the web I was very much dismayed to find that the files were stored in an unfamiliar format (.MOD).

 

Transferring digital video involves determining 3 things; the file format, the video encoding and the audio encoding.  The file format, sometimes called the container format, specifies how the data is organizing inside the file (e.g., the video encoding, audio encoding, chunk size, etc..)

 

While I'm not sure what the .MOD format is, video recorded from the SDR-H200 is encoded in mpeg2.  Audio is encoded in AC3.

 

Ultimately I wanted to put the video on a website so that family members can watch it.  So I wanted to choose the file format, video encoding and audio encoding that were most widely available.  The following microsoft links helped greatly in this regard:


First download download ffmpeg.  There is no installer so just extract it to a directory.

In case you don't have mpeg2 codecs installed, download and install the klite codec pack.

ffmpeg is a command-line utility.  To use it, open a command prompt and change to the ffmpeg\bin directory.

To convert from .MOD to .wmv:

ffmpeg -i mov001.MOD -f asf -vcodec wmv1 -acodec wmav1 mov001.wmv

This will convert using default settings for bitrate; ffmpeg tries to convert in a way that preserves as much video and audio quality as possible.  However, you may find the quality less than stellar.  In this case, you'll want to increase the bitrate.  One way to do this is

ffmpeg -i mov001.MOD -f asf -vcodec wmv1 -acodec wmav1 -sameq mov001.wmv

This file will be pretty big since it forces ffmpeg to use the same quality as the input.

To determine which file formats, video codecs and audio codecs are installed on your machine:

ffmpeg -formats > formats.txt

This will dump all the formats into a file called formats.txt.  In the doc directory the General documentation has descriptions of each of the formats and codecs.  The names in the General documentation are not the same as the values passed to ffmpeg on the command line.  To get those values you'll need to look at the formats.txt file.

ffmpeg has a bunch of other features, all of which are accessed from command line switches.  See the ffmpeg docs in the doc directory.

Windows XP as a VPN server

Oddly enough, Windows XP (professional and home) can provide VPN access to a home LAN.  I ran across this feature while in a hospital which provided free WiFi access but only allowed outbound web and VPN traffic.  So to do anything other than browse the web (e.g., listen to the soon to be defunct Yahoo Music Jukebox) I needed to VPN to my home LAN then use its network connectivity to run other apps.

 

XP's VPN Server can be configured via the "add new connection" wizard in Network Connections.  Choose "Advanced" then "Accept Incoming Connections".  Don't worry about selecting a physical port for connections (e.g., printer, USB, etc...).  Once the new connection is created change the properties to specify the range of IP addresses (I choose a range near the top of my subnet so that I'd know when someone was using a VPN connection).

 

If you're behind a NAT enabled router you will probably have to put the XP VPN server in the DMZ.  Apparently the more common tunneling protocol (PPTP) uses GRE which sits at the same layer as TCP and UDP in the network stack.  So there's no port to forward for GRE connections.  I'm fine with this as long as Windows Firewall is also running....

 

 

HTML Help for Windows Forms

I briefly tried using HTML Help Workshop to provide context sensitive help for a Windows Forms application but had no luck. Recently I've gotten a chance to take another look at it. So here are a few tips:


  1. Create a separate HTML page for each topic.

    • Another way to put this is to create a separate HTML page for everything that might require context sensitive help. E.g., every user interface widget (or at least those you want to provide with context sensitive help).
    • Use whatever HTML editor you prefer - I like the Visual Studio 2005 designer so I use that.

  2. Create an HTML Help project (.hhp) in the directory containing the HTML files.
  3. Manually add all of the HTML files to the project.
  4. Don't bother with automatically generating a table of contents since all sections within a file will link to the top of the file.
  5. Manually create a Table of Contents from the "Contents" tab.

    • There are 2 types of entries; headings and pages.
    • Heading entries are represented by a book and can contain child entries.
    • If you want the heading entry to display a topic (=HTML page) when clicked you have to edit it.
    • Edit an entry by selecting it then clicking the pencil button to open the "Table of Contents Entry" editor.
    • Under "Files/URLs and their information types" add the topic (e.g., MyFirstTopic.html) to the list.
    • Do the same thing for pages since you usually want a topic to display when a page is clicked from the TOC.

  6. Use relative Files/URLs so that moving the project and its html files to a different directory won't prevent compilation.
  7. Compile the project then click the glasses icon to view the .chm file.

Once the HTML help project is done compiling a new .CHM file can be automated in a post-build event that uses the HHC.exe in the program files directory for HTML Help Workshop.