Panasonic DMR-E500H MPEG2 offload over http
9 Jul 2005

The Panasonic DMR-E500H has two basic features: a 400 GB hard disk 
and a DVD-RAM/-R recorder.  It is differentiated by having some high-end 
features: 10/100 Mbps ethernet port with UPnP connectivity, simultaneous 
MPEG-4 recording, and SD and PCMCIA card slots for copying the MPEG-4 
recording to removable media for playback on portable devices.  The UPnP 
connectivity basically allows one unit to play back the recordings from 
another unit over TCP/IP.  There are some features not advertised (or at 
least are undocumented) on the North American model, most notably the 
ability to program recordings from a cell phone.

I record shows onto the hard disk for later playback, usually using the
the 1.3x playback and commercial skip (1 minute) to basically compress
the amount of time to view a 1 hour program to a little over 30 minutes.  
I also offload the programs I want to save onto DVD-R, because even with 
a 400GB capacity, the hard disk fills up too quickly.  

My typical method for recording to DVD-R involves:

  1. choosing the program to record from the program guide
  2. deleting the commercials from the recording using the editing 
     features 
  3. burning the edited recording to DVD-R

The DMR-E500H has all the features to do all of these steps.  It is a 
complete-package machine.  It is just cumbersome to use for large numbers
of recordings, which the large hard disk lets you accumulate.  I ended
up spending about one weekend a month editing commercials out of the 
previous month's recordings just to have enough space for the coming 
week.

The model sold in the United States uses TVGuide On Screen for the program 
listings.  This software is apparently also found on other AV equipment.  
The listings are apprently broadcast over VBI, so there is no recurring 
fee to obtain the listings nor is a telephone modem dial-up or internet
connection required to obtain the listings.  The guide is used to
construct the list of programs to record, and has features such
as recording recurring programs that have the same program name
and that air at the same time.  This makes it easy to record programs
that air weekly or daily or even semi-daily.

There are two basic editing features, which are called "Shorten" and
"Divide Title".  "Shorten" is used to delete sections of a recording.
The selection of the segment to remove is done by advancing the recording 
(using fast forward, frame forward, playback, or commercial skip) 
to the starting point to be removed, marking it, and doing the same for
the ending point.  "Divide Title" is used to split a recording into two
and uses the same navigation to pick the point at which to split the 
title.  Neither operation is undoable, and both operations appear to do
it at GOP levels.  The DMR-E500H ships with the EUR7721KL0 remote control.
There is apparently a version of the remote which has a jog dial that
would make editing much easier.  However, I do not know the part number
and whether it would work with the DMR-E500H.  

Burning the recording to DVD-R (or DVD-RAM) is done by choosing a
recording to copy and then burning it.  The recorder has two basic modes
of copying a recording from the hard disk to DVD-RAM or DVD-R, "high 
speed dubbing" and "not" high speed.  The "high speed dubbing" basically
copies the recorded MPEG-2 to DVD-R at up to 8x and DVD-RAM at up to 5x.  
To use "high speed dubbing" requires that the recording to have been 
done with the option of it turned on in the setup menu.  There are some 
restrictions that this implies, but they don't matter unless you need
to have the SAP audio channel recorded as well or somehow you are 
recording something other than 4:3 aspect ratio.  If the setting for
high speed dubbing in the setup menu is not set, then copying the
recording to DVD-R/DVD-RAM is done in the "not high speed" dubbing.

The "not high speed" dubbing basically plays back the recording on the
hard disk and reencodes the recording using one of the 5 preset 
bitrates.  This is done at 1x speed, so for copying a 1 hour-long 
recording, it will take 1 hour to copy it to a removable disc.  It does 
this even if the bitrate of the recoding on the hard disk is the same 
as the desired bitrate for the DVD-R/DVD-RAM.  

(The 2005 DIGA models apprently will allow recording the +R/+RW/-RW media
as well.)

The Sci-Fi channel decided to air all of season 1 of the remake of
Battlestar Galactica in one day, basiclly airing it (and two episodes
of the original, withsome repeats of season 1) in one 22-hour continuous 
time slot.  This presents some challenges to using the DMR-E500H:

1.  Sci-Fi channel likes to show the ending credits squished to the 
    left with promos on the right, and without any significant commercial
    break between the end credits and the start of the next show, just
    the sci-fi channel original 5-second short.

    1. a.  The Battlestar Galactica production company has the gimicky 
           animation that-there's-a-name-for-but-i-don't-remember-it at 
	   the end that I like.  It's like the Simpson's opening in that
	   it's different for every episode.

2.  A few seconds (on the order of 5 to 10) are lost between 
    back-to-back programs if the recordings are separate entries.  
    To get around this, a manual timer entry can be entered that covers 
    all of the programs that want to be recorded, so that the program can
    be manually divided afterwards.

3.  Recordings are limited to a maximum of 8 hours, regardless of the
    bitrate selected.  

4.  Recordings at the maximum bitrate, "XP", basically amount to about 
    4.4 gigabytes per hour.  "SP" bitrate is half that, about 2.2 
    gigabytes per hour, and "LP" is one quarter, about 1.1 gigabytes 
    per hour.  There is an EP mode allowing 6 hour (or 8 hour if desired) 
    per DVD-R but the quality is not enjoyable on large televisions.  This 
    means in XP only 1 hour can be recorded to DVD-R, or 2 hours in SP, or 
    4 hours in LP.


I decided "SP" was acceptable recording quality for this program.  However, 
this still meant that the recording on the hard disk would be tens of 
gigabytes.  Dividing titles and editing recording using the editing 
features for 22 hours of programming is tiring and error prone.  I ended up
deciding 3 recording sessions of about 7 or 8 hours each will be sufficient 
to get the most of the programs in their entirety.  It is desirable and 
possible to be able to copy the MPEG-2 file from the hard disk to a desktop 
computer.  

The method of using UPnP to copy the MPEG-2 recording from the DMR-E500H
has been documented by Shimizu-san in article # 118 of 
Broadband Watch.  Shimizu-san goes about it in two different ways, using 
the commercial software DiXiM Media Client and using a UPnP Control Point 
program and a http downloader.

The basic steps for copying a MPEG-2 recording from the DMR-E500H to 
a computer is as follows:

1.  Add and enable the MAC address of the machines that will run the 
UPnP control point software and http downloader to the DMR-E500H's 
Network Setup.

2.  Power off the DMR-E500H.

3.  Obtain and run a UPnP control point software.

4.  Send a Browse action to the DMR-E500H to find the program
that is desired to get the URI to the MPEG-2.

5.  Use the http downloader, such as wget or Mozilla, to transfer the 
MPEG-2 file. 


Steps in detail:

Step 1:

Add MAC address of the machine you will run the UPnP
control point from to the "Network"->"Client Registration" 
on the DMR-E500H setup menu.  Once you add it, you must 
hit Enter with the entry highlighted to enable the entry.
A circle will appear next to the entry indicating that
it has been enabled.  This step is very easy to miss.  If you
find yourself perplexed for more than 5 minutes, double-check this.


Step 2:

Power off the DMR-E500H so that when accessed it will go into AV Network
mode.


Step 3:

The first piece of software needed is an UPnP control point.

The UPnP Control Point program Shimizu-san uses is "UCP - UPnP", which 
can be downloaded from http://hagiland.muon.or.jp/download/UCP/.  It 
is a java program.  jre 1.4.x is apparently required for UCP;  gij does 
not work properly.  At the time of this writing, UCP0.2d4.jar was the 
latest and was used.  To run it, type

java -jar UCP0.2d4.jar

There are some widget draw problems with the tabs when using Sun's jre, but 
the program is usable.  The author develops on MacOS X 10.3, which uses a 
different widget organization so the redraw problems do not show up there, 
but the problem is evident in the screenshots in the Boradband Watch 
article.  I used UCP on a Linux x86 machine, but it should also work in
Windows with the Sun jre 1.4.  The Intel UPnP DeviceSpy will also work 
for the same purposes, but it is Windows only (and I couldn't get their 
java version to work).  It is part of the Intel Software for UPnP 
Technology package, which can be downloaded at: 

http://www.intel.com/cd/ids/developer/asmo-na/eng/downloads/upnp/tools/index.htm

Various other UPnP control point programs exist, but these are the two
easiest in my experience to actually get working with minimal effort.


Step 4:  

Access the DMR-E500H using the UPnP Control Point software.
Use the software to find the urn:schemas-upnp-org:service:ContentDirectory:1
service.  Find the Browse action and enter these inputs

     ObjectID = ROOT/HDD/DVD_RTAV/
     BrowseFlag = BrowseDirectChildren
     Filter = *
     StartingIndex = (integer number from HDD Direct Navigtor index)
     RequestedCount = 10 (any integer 1-10)
     SortCriteria = (leave empty)

Hit the "Send Action" button and the recorder will spin up the hard disk
and respond with an XML formatted list of shows and URIs starting from
the index specified int he Browse request.  Copy the result string to a 
file or else read it in the very wide text box in the software.  Read the 
XML response to find the program's URI that is desired.  The URL will be 
identified by a <res> record and will look like 

http://192.168.1.5:49182/ROOT/HDD/DVD_RTAV/00036_PG.MPG

It's pretty straightforward to examine the XML for the URI.  For longer
results, it is easier to use Mozilla to examine the XML.  On Windows, the 
Intel DeviceSpy has an item in a context menu to send the result 
string to the web browser (by right clicking the result box's text).


Step 5:

The second pice of software needed is an http downloader.

I use wget for the http downloader because I already had it installed, but
Mozilla or Internet Explorer will probably work (but Windows Media Player 
may be launced to play the MPEG-2, even though it will probably not work).
Note:  wget versions prior to 1.10 will not download more than one file 
at a time that is greater than 2GB.  wget 1.10 has this bug fixed.  wget 1.10 
is in beta1 stage as of this writing.  To use wget:

wget -P . http://192.168.1.5:49182/ROOT/HDD/DVD_RTAV/00036_PG.MPG





The caveat for why this is slightly less useful than it appears for general 
usage for programs that aren't multiple hours long is that the DMR-E500H rate 
limits the export of the MPEG2 to 1.23 megabytes/second.  This means the 
network playback is limited to 1X speed, so it will take 8 hours to transfer 
each 8 hour-long recording.  The rate limiting is reasonable for the device
because timer recordings can go on during remote playback so it's important 
for the machine to be able to keep up with disk writes while serving the 
MPEG-2 to another machine, which presumably would only consume it at the 
playback rate anyway. 

In light of the 1.23 megabytes/second throttling, it could be faster to 
copy a recording that will fit onto DVD-RAM and then read it on a DVD-RAM 
drive in a computer.  This is possible, and I have done this.  The DVD-RAM
can be written at 5x, so about 12 minutes per hour of recording.  I ignore
the DVD-RAM reading time on the computer because it is less than the
DVD-RAM recording time on the DMR-E500H.  Whether or not it's faster
depends on the length of the recording being transferred, the speed of the
computer's DVD-RAM drive, and the speed of the DVD-RAM recording material.

Once the MPEG-2 is on a computer, it can be edited a lot eaisier, and can be 
manipulated onto DVD-R in one form or another.