[mythtv-users] pdatranscode.pl Problem

Peter Watkins peterw at tux.org
Sun May 13 15:22:41 UTC 2007


On Sat, May 12, 2007 at 09:52:14PM -0400, Benton Roberts wrote:

> I recently wrote an update / alternative to the pdatranscode script,
> that incorporates and extends many of its ideas and features. To address
> your specific concern, it also features a "-verbose n" parameter, which
> will show you every command it's going to execute (when n > 0), so you
> can try each one yourself to see why it's failing.

Nice idea. Friendlier than my dump-all-variables-after-failure approach,
especially for something like your script that can spawn multiple 
sequential tasks.

Hey, I looked at your script briefly the other day. I think you
should take another look at my script's makeWorkingDir() code. 
There are two reasons for my approach: 
 1) Some of the tools the script invokes tend produce output files with
    constant names in the current directory, so unless the working directory
    is different for each invocation of the script, you can't run it
    multiple times concurrently. Making safe on-demand working directories is
    easier and more rewarding than adding code to only allow one invocation
    at a time. It's true that the MythTV "jobs" engine doesn't run tasks
    in parallel, but I like having the option of concurrent transcodes.
 2) Using a world-writable directory can lead to security problems (race
    conditions, mostly). 
I don't know for sure if your script has any concurrency problems or 
exploitable race conditions -- I just make it a habit to create a known-safe
working directory when I'm creating output files.

Oh, I also like how you extract MySQL connection information from the MythTV
config file -- much smarter than my hard-coded default values.

And you should update the PDA transcode wiki page with information about
your scripts and a link to your site:
http://www.mythtv.org/wiki/index.php/Transcoding_for_the_PDA

Thanks,

-Peter
http://www.tux.org/~peterw/



More information about the mythtv-users mailing list