[mythtv-users] adding files from elsewhere to myth

R. G. Newbury newbury at mandamus.org
Tue Oct 9 14:08:50 UTC 2012


On 10/08/2012 05:17 PM, Evuraan wrote:
> I've mythtv 0.25.2, OTA wit hdhr dual.
>
> I generate (flv,mpg) files from publicly available, commercial laden,
> tv streams. I'd like to add these files to mythtv recording list, and
> need them processed by mythcommflag above all.
>
> I've couple of local channels that I never watch stuff on – so either
> I can pin these hourly dumps to those, or float a new channel. If i
> have the know-how, that is, and hence this email. :)
>
> I've seen recommendations to name the file as 1091_20121008070000.mpg,
> and have myth.rebuilddatabase.pl run against those files etc -  i am
> afraid these instructions are old, and does not apply to 0.25 that I
> am on.
>
> So in summary, how do I add files from elsewhere to mythtv?

Although myth.rebuilddatabase.pl has been deprecated it does work at 
least partially.

I suspect that part of the reason it has been deprecated is because it 
does not insert the file size into the database. As a result, myth 
reports it cannot find the file although the script has run properly and 
entered everything else.

This little script pokes the filesize into the database. This was on a 
page in the wiki which I can no longer find.

*******
Myth.rebuilddatabase.pl does work to re-add the video files into the
database. However, it does not 'know' what the files represent. It uses
the channel+date+time file name. *IF* you know what the file represents,
you can enter the info. (Or you can do that later using phpMyAdmin while
looking at the files to determine what each is.
There is one problem with the myth.rebuilddatabase script. It leaves the
file *size* as zero bytes, so myth chokes.
So in addition you need to run this little scriptlet, one file at a time
using the filename on the command line, as in:

myth.rebuild.filesize.sh 1061_20090416215800.mpg

********** myth.rebuild.filesize.sh *******
# Taken from an anonymous post on the mythtv wiki.
# Thanks due to whoever you are, not Geoff Newbury!

SIZE=`ls -l $1 | awk '{print $5}'`
echo " File $1 is $SIZE bytes"

mysql -u mythtv -pmythtv mythconverg << EOF
update recorded set filesize = '$SIZE' where basename = '$1';
EOF
**********************

So, run myth.rebuilddatabase.pl and then run myth.rebuild.filesize.sh 
repeatedly to fix the filesize.

I use cut&paste in one window, using the output of a mysql 'select 
chanid,title,subtitle,basename from recorded where filesize="";' in 
another window on the rare occassions I need to do this.

Geoff







More information about the mythtv-users mailing list