[mythtv-users] discarding original file after transcoding

Stephen Shelton stephen at stephenashelton.com
Fri Mar 13 16:31:59 UTC 2009


On Mon, 2 Mar 2009 14:20:57 -0800
Josh Mastronarde <jmastron at gmail.com> wrote:

> On Mon, Mar 2, 2009 at 12:54 PM, Stephen Shelton
> <stephen at stephenashelton.com> wrote:
> > I've got some shell script wrappers that do some transcoding. While they work
> > well, they still do not overwrite the original file or touch the myth database.
> > I'd like to incorporate that into my scripts, but have a couple questions:
> >
> > 1) What all is required here? Of the fields on the 'recorded' table, I'll
> > obviously need to modify filesize, and basename if I rename the file. I'm
> > guessing the video length is (endtime - starttime), so I either need to have
> > those times not reflect the air times, or have the length not reflect the final
> > video length. Not a big deal. Do I want to clear the cutlist or commercial flags
> > (will they cause me pains otherwise?)
> 
> I've spent some time playing with this too:
> 
> - 'basename' and 'filesize' look like the only fields that are
> specific to the actual recording file in the 'recorded' table

Updating these two works pretty well, in addition to the storage group (see
below.)

> 
> - If you're transcoding to mp4 (which has a built-in seek table that
> Myth uses, which mpeg2 doesn't have), you'll want to delete all
> entries in 'recordedseek' for that show (get 'chanid' and 'starttime'
> from the 'recorded table' to use for selecting).  There doesn't appear
> to be a need to rebuild the seektable for mp4, and it broke things
> worse when I tried.
> 
> - As far as I can tell, leaving the edit points and commercial flags
> in place seems to work, as long as you transcode to the same framerate
> as the original (the entries in 'recordedmarkup' are frame numbers).
> Depending on your keyframe rate, the actual seek may go to a slightly
> different point, but should be close.

I'll play with this. I'm cutting out commercials, so this isn't so much an
issue, but it seems to do odd things from time to time (and this may have
something to do with it (and obviously mythcommflag messing up does as well :)
))

> 
> >
> > 2) The basename doesn't really let me put my transcoded files into a separate
> > directory. To accomplish this, do I want to change storage groups?
> 
> I haven't tried this yet, but it looks like you can define an
> additional storage group (e.g. "transcoded"), put your files there,
> and change the 'storagegroup' field in the database.  As long as you
> don't define scheduled recording jobs to have that storagegroup,
> nothing else should get dropped in there.

This is exactly what I've done, and has worked very well.

> 
> >
> > 3) Will I run into trouble by running ad-hoc sql statements to accomplish the
> > above?
> 
> Probably, but that's half the fun!  Seriously, it'd be a good idea to
> tread very carefully after any upgrade that changes the database.  I
> have a daily mysqldump run to save snapshots that I can restore if I
> screw things up too badly.
> 
> Josh
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


-- 
Stephen Shelton
stephen at stephenashelton.com


More information about the mythtv-users mailing list