LinHES Forums http://forum.linhes.org/ |
|
move videos to recordings?? http://forum.linhes.org/viewtopic.php?f=6&t=10371 |
Page 1 of 1 |
Author: | gopher [ Mon Jun 05, 2006 9:48 pm ] |
Post subject: | move videos to recordings?? |
I am wondering if it is possible to move files in my video library to the tv recordings database??? |
Author: | ryanpatterson [ Wed Jun 07, 2006 6:54 am ] |
Post subject: | |
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. |
Author: | gopher [ Wed Jun 07, 2006 5:02 pm ] |
Post subject: | |
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... |
Author: | tjc [ Wed Jun 07, 2006 6:13 pm ] |
Post subject: | |
Beware of possible codec limitations in the builtin player used for recordings... |
Author: | misterflibble [ Wed Jun 07, 2006 8:36 pm ] |
Post subject: | |
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....." |
Author: | ryanpatterson [ Thu Jun 08, 2006 7:34 am ] |
Post subject: | |
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. |
Author: | chrisj [ Thu Jun 08, 2006 9:43 am ] |
Post subject: | |
This a way to to add your videos
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 %';"
|
Author: | gopher [ Thu Jun 08, 2006 3:34 pm ] |
Post subject: | |
![]() THANK YOU SIR YOU ARE AWESOME! |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB® Forum Software © phpBB Group http://www.phpbb.com/ |