[mythtv-users] an easier way to create "friendly" names for converted files
Larry Roberts
mythtv at american-hero.com
Thu Jan 3 06:22:41 UTC 2013
My end goal is to get a couple of daily recordings converted to a roku
compatible format with friendly names for my wife to watch on the roku
in our bedroom.
I have managed to setup a proper ffmpeg job to do the transcoding as a
user job but the files all get named by $chanid_$starttime.m4v
What I have managed to brute force is a portion of the transcode script
that does a dump of the mythconverg database , looks for the particular
file name and then does a rename. Given the various spaces,tabs, file
extenstions its been a pain.
My final working method (or at least It worked the last time) is:
mysql -uroot -ppasswordremoved mythconverg -B --exec "select
basename,title,subtitle from recorded;" | grep ${CHANID}_${STARTTIME} |
sed 's/.mpg//'| sed 's/\t/ /g' | while read b NAME ;do mv
{$TMPDIR}/${CHANID}_${STARTTIME}.m4v /roku/"$NAME".m4v;done
CHANID and STARTTIME are variables passed to the script ($1 and $2) from
the user job setup.
NAME ends up being the title,subtitle of the recording regardless of
length as I like.
I looked at adding in some additional variables to the user job, but I
couldn't figure out how to get $1 and $2 to be the first and second
option passed to the script, and $3 to be "all the rest"
My problem is that the program has spaces in the name as well as in the
description such that $3 ends up only being "days" instead of "days of
our lives"
Perhaps I'm going about this all wrong. I'm by no means a programmer
and I'm not that great of a trial and error hacker.
Would love some thoughts on this. I'm giving up for the night but plan
on working this again tomorrow when I get home.
Thanks in advance..
Larry
More information about the mythtv-users
mailing list