XBMC Community Forum
mythicalLibrarian - a tool to build Movie and TV Show library from MythTV recordings - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for XBMC (/forumdisplay.php?fid=116)
+--- Thread: mythicalLibrarian - a tool to build Movie and TV Show library from MythTV recordings (/showthread.php?tid=65644)



- outleradam - 2010-12-28 21:46

according to your log
Code:
[font=Courier New][color=#dd0000] [/color][color=#0000bb]mythicalLibrarian [/color][color=#007700]--:[/color][/font][font=Courier New][color=#0000bb]invalid pattern

usage[/color][color=#007700]: [/color][color=#0000bb]mythicalLibrarian [/color][color=#dd0000]'path/to/file' [/color][color=#007700][[/color][color=#dd0000]'title'[/color][color=#007700]] [[/color][color=#dd0000]'subtitle'[/color][/font][font=Courier New][color=#007700]]
[/color][color=#0000bb]usage[/color][color=#007700]: [/color][color=#0000bb]mythicalLibrarian [/color][color=#007700]--[/color][color=#0000bb]mode [/color][color=#007700][[/color][color=#0000bb]parameter[/color][color=#007700]] [[/color][color=#0000bb]parameter[/color][/font][font=Courier New][color=#007700]]
[/color][color=#0000bb]items in brackets are [/color][color=#007700][[/color][color=#0000bb]context sensitve[/color][/font][font=Courier New][color=#007700]]
[/color][color=#0000bb]ensure you have set the user settings set properly [/color][color=#007700]and [/color][/font][font=Courier New][color=#0000bb]run
[/color][color=#007700]--[/color][/font][font=Courier New][color=#0000bb]mythicalDiagnostics before using mythicalLibrarian
in [/color][color=#007700]--[/color][color=#0000bb]scan mode [/color][color=#007700]or as [/color][color=#0000bb]a UserJob[/color][/font][font=Courier New][color=#007700].
For [/color][color=#0000bb]more information type[/color][color=#007700]: [/color][color=#0000bb]mythicalLibrarian [/color][color=#007700]--[/color][color=#0000bb]help [/color][color=#007700]or --[/color][/font][color=#0000bb][font=Courier New]special
done[/font][/color][color=#007700][font=Courier New]. [/font]
[/color]
mythicalLibrarian is not obtaining information about the show. mythicalLibrarian has to work properly for a jobSucessful job to be run.

User jobs were implemented so that you can utilize the information generated by mythicalLibrarian in a custom manner. The ffmpeg example is just an example.

The following line converts mpg to mp4
Code:
ffmpeg -i $MoveDir/$ShowFileName.$OriginalExt -target ntsc-vcd $MoveDir/$ShowFileName.mp4

You can verify operation from the command line by running
Code:
ffmpeg -i /path_to_my/file.mpg -target ntsc-vcd /path_to_my/file.mp4

if the ffmpeg fails then you do not have ffmpeg installed on the system
Code:
apt-get install ffmpeg #possibly others as well

but, first and foremost, before anything else will work, mythicalLibrarian must work. you can run
Code:
mythicalLibrarian /path_to_my/recording.mpg

mythicalLibrarian was designed to do naming conventions. It imports all mythtv shows into XBMC. That's it's job. It seems that you are trying to use it for one of it's external system calls.




- rmikulec - 2010-12-28 22:18

I really appreciate your help. I am trying to create a manual for installing Mythbuntu and mythicalLibrarian as a backend, with XBMC and mythBox as a frontend. I am soooooo close!

I had a couple questions based on your previous reply.

Quote:mythicalLibrarian is not obtaining information about the show. mythicalLibrarian has to work properly for a jobSucessful job to be run.

1. Could this be because I was not recording TV series but rather manually recording the morning news? The recordings I have tested on have been moved to the Showings folder.

2. Can I have mythicalLibrarian transcode even if it can't find data on the show?

Again, you have been super helpful.


- outleradam - 2010-12-28 22:30

Tell you what, I made a video about 2 months ago of installation of mythicalLibrarian. it starts with a fresh installation of XBMCLive with MythTV installed with shows already recorded. It runs through from start to scanning shows into XBMC. I never posted the video on youtube because I felt that the installation process could be made smoother and I put it on the back burner while I studied for my Security+ certification. I'll post the video up tonight when I get home.


- rmikulec - 2010-12-28 22:43

Awesome! I ran the two tests

Quote:mythicalLibrarian /path_to_my/recording.mpg

returned

PHP Code:
rmikulec@MythBE01:/home/mythtv/.mythicalLibrarian/mythicalSetupmythicalLibrarian 2074_20101228151000.mpg
 mythicalLibrarian 
--:invalid pattern

usage
mythicalLibrarian 'path/to/file' ['title'] ['subtitle']
usagemythicalLibrarian --mode [parameter] [parameter]
 
items in brackets are [context sensitve]
 
ensure you have set the user settings set properly and run
 
--mythicalDiagnostics before using mythicalLibrarian
 in 
--scan mode or as a UserJob.
 For 
more information typemythicalLibrarian --help or --special
 done
.
rmikulec@MythBE01:/home/mythtv/.mythicalLibrarian/mythicalSetup

This

Quote:ffmpeg -i /path_to_my/file.mpg -target ntsc-vcd /path_to_my/file.mp4

Runs perfectly


- rmikulec - 2010-12-28 23:35

OK, I made some progress. I got it to somewhat work, but it appears I am having an error trying to changer permissions on the moved file.

PHP Code:
rmikulec@MythBE01:/home/mythtv/.mythicalLibrarian/mythicalSetupmythicalLibrarian /home/mythtv/recorded/2074_20101228151000.mpg
Revision 907 Mon Dec 27 22
:03:15 EST 2010
Accessing MythTV DataBase
:
COMMERCIAL DATA START:7218 STOP:11530
COMMERCIAL DATA START
:46002 STOP:50781
COMMERCIAL DATA START
:57983 STOP:65055
RECSTART
:2010-12-28 15:10:00 DATE2010-04-02
PROGRAMID
:EP007537860109 ShowCategory:Drama
PLOT
Melinda and Avery (Margaret Choinvestigate when a comic book artist starts drawing encounters with ghosts before they happen.
PERFORMING MAINTENANCE ROUTINE...
REMOVING ORPHAN FOLDER:/home/mythtv/.mythicalLibrarian/mythicalSetup/Episodes/Mister Rogers Neighborhood
SEARCHING
www.TheTvDb.com SHOW NAMEGhost Whisperer EPISODEOn Thin Ice
TESTING 
FOR ZAP2ITID MATCH:SH753786 Ghost Whisperer
MATCH FOUND BASED ON Zap2itID
:
FOUND:Ghost Whisperer ID#:78817 WITH CONFIDENCE:1
DATABASE IS MAINTAINEDTIME IS:1293572762 NEXT UPDATE IS:1293642662
Absolute Exx NR
:104 BASED ON AIRDATE:2010-04-02
TOTAL MATCHES
:14 TOTAL VERIFIED FUZZY ERRORS:4
EPISODE
:On Thin Ice EPISODE NUMBER:104 S05E17 WITH CONFIDENCE1
CONFIDENCE
:4 LOGIC PATH:  Attempted Match On Zap2itIDSucessfulAttemped match on OriginalAirDateSucessful;  Verified with Standard logicVerified with Fuzzy logic;
JOBmythicalLibrarian '/home/mythtv/recorded/2074_20101228151000.mpg' 'Ghost Whisperer' 'On Thin Ice'
TARGET SET:/home/mythtv/recorded/Episodes/Ghost Whisperer/Season 5/Ghost Whisperer S05E17 (On Thin Ice).mpg
MOVED
: /home/mythtv/recorded/2074_20101228151000.mpg
TO
: /home/mythtv/recorded/Episodes/Ghost Whisperer/Season 5/Ghost Whisperer S05E17 (On Thin Ice).mpg 
chmod
changing permissions of `/home/mythtv/recorded/Episodes/Ghost Whisperer/Season 5/Ghost Whisperer S05E17 (On Thin Ice).mpg': Operation not permitted
REMOVING - 2074_20101228151000.mpg - THUMBNAILS - DATABASE ENTRIES
SENDING REQUESTED COMMANDS TO:192.168.10.30:8888
RSS ENTRY SUCCESSFULLY CREATED: /var/www/mythical-rss/rss.xml
chmod: changing permissions of 
`/home/mythtv/recorded/Episodes/Ghost Whisperer/Season 5/Ghost Whisperer S05E17 (On Thin Ice).mpg': Operation not permitted
SUCCESSFUL COMPLETEION TYPE: MoveModeSuccessful
rmikulec@MythBE01:/home/mythtv/.mythicalLibrarian/mythicalSetup$ 

Have you seen this before?


- outleradam - 2010-12-29 00:30

It looks like local policy is preventing you from modifying the file.

In order to preserve MythTV's ownership of the file, mythicalLibrarian's logging and overall security of the system, the best way is to have user mythtv control all aspects of mythicalLibrarian's operation. For this reason, mythicalSetup asks you for a password for user mythtv. This makes user mythtv a full-fledged valid user on your system.

When running as user rmikulec, file operations and logging are performed by that username rather then mythtv. The linux filesystem's granular control can be a burden sometimes. It's simpler to simply not deal with that and allow mythtv to control it's files by running mythicalLibrarian as mythtv. User jobs are automatically run with mythtv permissions. Under most distributions, MythTV is run with mythtv permssions, however some distributions use other usernames, so I could not make it manditory for the user mythtv to be used. Because of Linux's granular permissions, and local policy preventing certain actions on different distributions, multiple users creating multiple files with different permissions is impossible to manage. The way around this is to bypass all of linux security, run as root or allow sudo with no password... However this is bad procedure and allows for a gigantic security hole.

It's always best if the user who creates the file, manages the file. In this case it's mythtv.

You can run
Code:
mythicalLibrarian --undo
sudo su mythtv
mythicalLibrarian --scan mpg /path_to_my/recordings

Let me know if there are any other problems.


- rmikulec - 2010-12-29 03:19

Ok, I think I have it figured out. Everything works fine until it attempts to transcode. I think the issue is that there are parentheses "(" in the naming convention and it bombs the transcoding. I havent figured a way around it yet.


- outleradam - 2010-12-29 04:28

Put double quotes around the ffmpeg job filenames. "

() is a perfectly valid filenames, the spaces are not. It needs to have "quotes" wrapped around it.

Please email a copy of your userjob, or update the wiki when you are finished. That way this will be easier for others.


- GregoryK - 2010-12-29 21:41

Adam:

Is there any way to get mythicalLibrarian to generate commercial-skip files that XBMC Dharma will properly execute? I have followed the related threads regarding the frame-rate issue in Dharma, and it doesn't look like a solution (either via MythTV or XBMC patches) is very probable in the near term.

I've been trying to think of workarounds, so that my wife & kids can use XBMC for playback without running into bad skipping.

Would transcoding the files as a user job in Myth, removing the commercials, before running mythicalLibrarian, be a work-around that makes sense?

If yes, would transcoding also help with my existing recordings, which have already been renamed and moved via mythicalLibrarian? (I suppose I might have to delete the commskip txt files from the /Episodes/[name] directories.)

Any thoughts are appreciated.

/Greg


- outleradam - 2010-12-30 00:04

GregoryK: The problem is XBMC's handling of MPEG2-TS variable framerate. The show comes in at 24fps, and some commercials are appended into the broadcast at 60fps. Using MythTranscode on each file will patch the problem in both MythTV and XBMC by setting it at a fixed framerate. MythTV handles variable framerate with a table which is generated by it's comskip handler. If the file is variable framerate, the frame numbers in the comskip.txt are correct, but XBMC blindly assumes fixed framerate based on the first few frames of the recording.

The patch is to have MythTV transcode every file. This creates a fixed framerate for every show. This should be done before mythicalLibrarian runs. So, set MythTV to run only 1 job at a time. Set MythTV to do MythTranscode job, select MythCommFlag checkbox, and have mythicalLibrarian run last.

Let me know if there are any problems