[mythtv-users] ANNOUNCE: pdatranscode.pl
Peter Watkins
peterw at tux.org
Fri Nov 24 14:34:05 UTC 2006
OK, I decided to go ahead and build this for fun.
The main advantages, as I see them, are
- that it makes it easier to change the output filename
- it allows you to set a maximum length for each part of the output
filename
- that it takes more command line arguments, so the same script could
be used for more than one user job, e.g. you could encode news shows
with a "one-per-weekday" scheme like "Nightly_News-Monday.avi" and
encode episodic shows with a different naming scheme
The full script is here:
http://www.tux.org/~peterw/linux/pdatranscode.pl.txt
Below is the usage output.
Jeff, thanks very much for your work. Playing recordings on my PDA is
something I've wanted to do for quite a while, and your script &
instructions were just what I needed.
-Peter
Usage: ./pdatranscode.pl --file nameOfRecordingFile [options]
OR (for compatibility with the 'pdatranscode' shell script from Jeff
Volckaert)
./pdatranscode.pl %DIR% %FILE% "%TITLE%" %STARTTIME%
Configuration options:
--description "description value"
--dir "dir value" [default: "/video/recordings"]
--file "file value"
--filename-format "filename-format value" [default:
"{title:20}-{month}-{day}-{subtitle:20}-{hour}{minute}.avi"]
--pda-dir "pda-dir value" [default: "/video/recordings/pda"]
--scale "scale value" [default: "320:240"]
--subtitle "subtitle value"
--title "title value"
--transcoder "transcoder value" [default: "lavc"]
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.
"{title:20}-{month}-{day}-{subtitle:20}-{hour}{minute}.avi"
produces filenames like
"Masterpiece_Theatre-11-19-Prime_Suspect_VII_Th-2100.avi".
Peter Watkins wrote:
> Jeff volckaert wrote:
>> to add starttime since then the name would be really long (i.e.
>> MythBusters-ShatteringSubwooferandRoughRoadDriving-20061120000000.avi).
>
> With my hacked version, I removed the year and second fields from the
> timestamp, so my names now look like MythBusters-11200000.avi
> In my generic script idea, there would be {} keywords for YEAR, MONTH,
> HOUR, etc. based on starttime, and the script would allow for usage like
> "{TITLE-20}-{SUBTITLE-20}-{MONTH}-{DAY}-{HOUR}{MIN}.avi"
> so users could decide how long any given field could be.
>
> But the chances of my doing that are slim... :-)
-------------- 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/20061124/133feaf7/attachment.pgp
More information about the mythtv-users
mailing list