[mythtv-users] UPDATED: pdatranscode

Peter Watkins peterw at tux.org
Tue Dec 5 00:41:47 UTC 2006

David Fishburn wrote:

>> I went ahead and copied my original email with the updated 
>> script to the following page as a start:
>> http://www.mythtv.org/wiki/index.php/Transcoding_for_the_PDA

> We should probably start listing common devices and what their screen
> dimensions are so we can document common ones for the scripts.

Not a bad idea. BTW, my script takes a "scale" argument/config option
for specifying the transcoded file's resolution for Xvid or lavc
transcoder modes.

I've now got a Palm TX, 480x320 (largely purchased so that letterboxed
content is twice as big as on my old 320x320 Palm), but  I have not
played with the different resolutions for pdatranscode.pl yet -- at ~
400 MB for a two hour program, I'm not so anxious to make the files even
bigger. TCPMP on the TX scales the 320:240 files up pretty well for
standard 4:3 aspect ratio TV shows, but it's not so nice looking for
widescreen content. I'll probably make "PDA normal (320:240)" and "PDA
wide (480:360)" jobs by adding a "--scale 480:360" to a second PDA
transcode job.

Oh, and since my initial posting, I've added more features to my Perl
pdatranscode script. See the wiki and my .pl script for details. I'm
especially happy about the simple hack that extends the max length for
the title field in the file name if the subtitle field is empty, and the
ability to make per-title subdirs & specify a maximum episode count.

Usage: ./pdatranscode.pl --file nameOfRecordingFile [options]
  OR (for compatibility with the 'pdatranscode' shell script from Jeff
       ./pdatranscode.pl %DIR% %FILE% "%TITLE%" %STARTTIME%

Configuration options:
       --description "description value"
                      description of recording (use User Job argument
               --dir "dir value" [default: "/video/recordings"]
                      where MythTV stores recordings (use User Job
argument %DIR%)
              --file "file value"
                      name of specific recording file (use User Job
argument %FILE%)
   --filename-format "filename-format value" [default:
                      format string for final PDA file names
      --max-episodes "max-episodes value"
                      how many files can exist in same directory as this
PDA file (will remove oldest)
      --max-size-all "max-size-all value"
                      how much space can be used in pda-dir & its
subdirectories, in MB (will remove oldest)
           --pda-dir "pda-dir value" [default: "/video/recordings/pda"]
                      where to store the final PDA files
             --scale "scale value" [default: "320:240"]
                      width:height pixel size for PDA files (lavc or Xvid)
          --subtitle "subtitle value"
                      subtitle of recording (use User Job argument
"%SUBTITLE%")             --title "title value"
                      title of recording (use User Job argument "%TITLE%")
        --transcoder "transcoder value" [default: "lavc"]
                      which transcoder command (lavc, Xvid, low-quality)
             --umask "umask value" [default: "0002"]
                      governs permissions of files and directories this

Any configuration variable can be used in the transcoded file by specifying
it in curly braces, for example "{title}-{starttime}.avi" will produce file
names like "The_Daily_Show_With_Jon_Stewart-20061122215900.avi". Spaces will
be changed to underscore characters, and most characters other than
alphanumeric ASCII will be discarded.

There are a number of special strings that can be used in curly braces:
  year      -- year ("2006") from the start time
  month     -- month ("11") from the start time
  day       -- day ("22") from the start time
  weekday   -- day of week ("Thursday") from the start time
  hour      -- hour ("21") from the start time
  minute    -- minute ("59") from the start time
  second    -- second ("00") from the start time
  basename  -- base recording filename, e.g. "1012_20061122215900"

Also, you can specify a maximum field length by adding a colon and maximum
character count, e.g.
produces filenames like

If the filename-format string includes "/" characters, pdatranscode will
any needed directories.  For instance, a format string like this
"{title:20}/{month}-{day}-{subtitle:20}-{hour}{minute}.avi" would put a file
named "11-19-Prime_Suspect_VII_Th-2100.avi" inside directory


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: OpenPGP digital signature
Url : http://mythtv.org/pipermail/mythtv-users/attachments/20061204/8a7fee5b/attachment.pgp 

More information about the mythtv-users mailing list