View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 8 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Mon Jun 05, 2006 9:48 pm 
Offline
Joined: Mon Jun 05, 2006 9:44 pm
Posts: 3
I am wondering if it is possible to move files in my video library to the tv recordings database???


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 07, 2006 6:54 am 
Offline
Joined: Fri Aug 26, 2005 9:54 pm
Posts: 617
Is it possible? Yes.

But it would be very difficult. Could you explain why you want to "move" the recordings? I see no advantage except that the play recordings user interface is "better" then the play videos user interface.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 07, 2006 5:02 pm 
Offline
Joined: Mon Jun 05, 2006 9:44 pm
Posts: 3
exactly!!!

I like the interface better...
I i also think it would be more convenient to have 1 place to put all videos
and my ir remote works better for the mythtv internal video player, not sp good for mplayer...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 07, 2006 6:13 pm 
Offline
Joined: Thu Mar 25, 2004 11:00 am
Posts: 9551
Location: Arlington, MA
Beware of possible codec limitations in the builtin player used for recordings...


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 07, 2006 8:36 pm 
Offline
Joined: Mon Aug 01, 2005 10:18 am
Posts: 84
If it's just about replacing mplayer with the internal video player, you can do that for mythvideo by changing the play command for files to "Internal" from "mplayer....."


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 08, 2006 7:34 am 
Offline
Joined: Fri Aug 26, 2005 9:54 pm
Posts: 617
misterflibble wrote:
If it's just about replacing mplayer with the internal video player, you can do that for mythvideo by changing the play command for files to "Internal" from "mplayer....."

Or simply edit the file: /home/mythtv/.lircrc (going on memory for that might not be exactly the right filename) and configure the remote better for mplayer.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 08, 2006 9:43 am 
Offline
Joined: Tue Jan 17, 2006 7:34 am
Posts: 126
Location: Australia
This a way to to add your videos

    Add Channel for each year
    Make a link to you video dir in your recordings video
    Make sure every video you want to export has a category


Every year that has a video need to have a channel ,this allows the display of the year data ,no channel then video will not be shown
Code:
mysql -umythtv mythconverg -B --exec "INSERT INTO channel SET chanid = 2004, channum ='Year' , callsign = 2004 , visible =0;"


make a link in your recordings dir to your videos , in this example I have used the link name of 'video' , you need to rember this
Code:
ln -s /myth/video /myth/tv/video


Edit every video so it has a category ,when browsing your recordings I group videos like you would normaly do with a tv series . This stops the recordings list becoming very full !
Code:
mysql -umythtv mythconverg -B --exec "SELECT * FROM `videocategory`;"


Be warned this script dose not do any error control.. it just quits. This meand that you need to remove any videos that are in the recorded tableor you will endup with a key error .
Code:
#!/usr/bin/perl
#
# Mythtv

# Adds video's to recording table
# No error control !

# by chris <mailme@chrisjoyce.id.au>
#
# To use: ./addvideos.pl
#


use strict;
use warnings;

use DBI;
use Time::Local;
use Getopt::Long;

my $path = "video";
my $embed;
my $dsn = 'dbi:mysql:mythconverg';
my $user = 'mythtv';
my $pass;
my $mySQL = "";
my $hostname ="mythtv";
my $i;
my $test_mode =0;
my $inumber = 0 ;

# get database password
unless (defined $pass) {
  $pass = `grep DBPassword /usr/share/mythtv/mysql.txt | cut -f2 -d'='`;
  chomp($pass);
}

my $dbh = DBI->connect($dsn, $user, $pass) || die "$DBI::errstr";
my $host_query = "SELECT SUM(CHAR_LENGTH(data)+1) as LenData FROM settings ";
my $host_query = "$host_query where value like 'VideoStartupDir' and hostname like '$hostname';";
my $sth;
my $LenData;
$sth = $dbh->prepare( $host_query );
$sth->execute || die "Could not execute ($host_query)";
if (my @row = $sth->fetchrow_array) {
        $LenData = $row[0];
}

$mySQL = "SELECT  videometadata.year as chanid ,QUOTE(CONCAT('Video ',videocategory.category)) as title, ";
$mySQL = "$mySQL  QUOTE(videometadata.title) as subtitle , ";
$mySQL = "$mySQL QUOTE(videometadata.plot) as description, videometadata.length as length, ";
$mySQL = "$mySQL QUOTE(CONCAT('$path',SUBSTRING(videometadata.filename FROM $LenData))) as filename , ";
$mySQL = "$mySQL videometadata.userrating as stars ";
$mySQL = "$mySQL FROM videometadata, videocategory,channel WHERE ";
 $mySQL = "$mySQL videometadata.category = videocategory.intid ";
$mySQL = "$mySQL AND videometadata.year = channel.chanid ORDER by title , subtitle;";

$sth = $dbh->prepare( $mySQL );
$sth->execute || die "Unable to execute query: $dbh->errstr\n";

my $isth;
while(my $row = $sth->fetchrow_arrayref()) {
   my ($chanid, $title, $subtitle, $description, $length, $filename, $stars) =@$row;

## add records to db
$i = "INSERT INTO recorded SET chanid ='$chanid' , starttime= DATE_ADD('$chanid-01-01 01:00:00', INTERVAL '$inumber' HOUR),  ";
$i = "$i endtime= DATE_ADD('$chanid-01-01 01:00:00', INTERVAL '$inumber:$length' HOUR_MINUTE), title=$title, ";
$i = "$i subtitle=$subtitle,description= $description, category='video',hostname='$hostname', ";
$i = "$i autoexpire= 0, basename = $filename,stars='$stars'; ";
         print " $i \n\n";

        if ($test_mode=="0") {
                $isth = $dbh->prepare($i);
                $isth->execute ||  die "Could not execute ($i)\n";
        } else {
                print("Test mode: insert would have been done\n");
                print("  Query: '$i'\n");
        }
  $inumber++ ;
  next unless -f $filename;

}



Last think .. yep will will fall over often , the video types supported is ver limited , so concider transcoding .

This script will only work with videos that have been setup with the video manager.


Just remebered , you will need to remove any videos if you are running the script for a second time , as you will see it prefix's each category with "Video " , you could try the following ( un tested )

Code:
mysql -umythtv mythconverg -B --exec "DELETE FROM category WHERE title like 'Video %';"


Last edited by chrisj on Thu Jun 08, 2006 7:30 pm, edited 2 times in total.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 08, 2006 3:34 pm 
Offline
Joined: Mon Jun 05, 2006 9:44 pm
Posts: 3
:shock: WOW i will try to implement your script tonight if i can find the time... Will report back.

THANK YOU SIR YOU ARE AWESOME!


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 36 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu