I have a bunch of video files with associated metadata in XML format. I want to import these files into LMCE so that the metadata is visible and can be used for sorting.
I'd like to create a script to automate the process.
Any suggestions on where to start? Should I just manipulate the database directly, or are there better ways? I notice that MythTV recordings are added to the database using the SaveMythRecording.sh script, which in turn simply calls MessageSend. Could I do it by calling MessageSend? Are the message documented somewhere?
Thanks for any and all help.
Hi,
I'm willing to help, but don't know much about it. Maybe for a start we can start parsing that message being sent. This could probably help a lot of other users with tons of video files and meta data in some sort of custom format.
You can find more info about messages on the wiki :
http://wiki.linuxmce.org/index.php/MessageSend (http://wiki.linuxmce.org/index.php/MessageSend)
There are also other examples of using MessageSend, maybe the most related is current work on photoscreen saver :
http://wiki.linuxmce.org/index.php/Use_my_own_pictures_in_the_Screen_Saver (http://wiki.linuxmce.org/index.php/Use_my_own_pictures_in_the_Screen_Saver)
Let's start discussing it, I'm sure others will jump in... For a start some Perl or bash script that does something would be nice.... I'm also tired of seeing empty rectangles on GUI... :)
Regards,
Bulek.
Looks like there's some hope for accomplishing it with SendMessage. Unfortunately, there isn't much detail about all the parameters to SendMessage. A lot of them appear to be numeric, and I haven't found a reference for what they all mean.
Quote from: gfb107 on October 30, 2007, 07:33:00 PM
Looks like there's some hope for accomplishing it with SendMessage. Unfortunately, there isn't much detail about all the parameters to SendMessage. A lot of them appear to be numeric, and I haven't found a reference for what they all mean.
I'm not at home. Could you post few messages to disect them ?
Perhaps you already know, but you can get valuable info also from web-admin page (it's under DCE somewhere)....
Guys figured out the way photoscreen does it, maybe we can easily do this as well....
Let's start doing it, I'll try to contact guys and find additional info....
Regards,
Bulek.
Hi,
The numbers that you pass are pretty straightforward.
Have a look at http://wiki.linuxmce.org/index.php/MessageSend
Basically you send to a device number, keep in mind that everything is a device which is related heirarchically in a tree structure with the DCREROUTER as the root node. Commands will usually pass down through the tree until they are consumed/handled.
The parameters are paried values with the parameter number and then the value.
In the web admin, under Configuration->Commands or something like that (Sorry I am not at home at teh moment) you can find all the commands. If you look further into them you will be able to discover the parameters, their number and their direction.
HTH
Darren
Hi,
I have taken a closer look.
Message is an event nr 69, aka "MythTV Show Recorded"
and 3 parameters follow :
DateTime
#57 The date we started recording Edit
MythTV ChannelID
#29 the channel id Edit
Name
#35 The filename Edit
Delete
It seems that proper plugin takes this info and puts it into sql database.... We should figure out what exactly is being done with those files and then write a script to mimic such behaviour....
HTH,
regards,
Bulek.
I've also done some investigating.
I found a number of MessageSend commands that look useful:
Command | Parameters | Returns | Comment |
AddMediaAttribute (391) | attributeType (122) fileID (145) value (5)
| attributeID (123) |
GetAttribute (393) | attributeID (123) | text (5) | |
GetIDFromFileName (819) | fileName (13) | fileID (145) | |
SetMediaAttributeText (392) | attributeID (123) text (5) |
GetAttributesForMedia | filename (13) | text (5) | A tab delimited list of attributes: Attribute type \t Name \t type... |
The AttributeTypes ( I figured these about by running the query "select PK_AttributeType,Description from AttributeType;") are:
ID | Description |
1 | Director |
2 | Performer |
3 | Album |
5 | Track |
6 | ASIN |
7 | CDDB |
8 | Genre |
9 | Ref # |
10 | Channel |
11 | Episode |
12 | Program |
13 | Title |
14 | Disc ID |
15 | Conductor |
16 | Composer/Writer |
17 | Studio |
18 | Rating |
19 | Release Date |
20 | Website |
21 | Chapter |
22 | Encoding |
23 | Format |
24 | Aspect Ratio(s) |
25 | Audio Encoding |
26 | Rated |
27 | DVD Release Date |
28 | Run Time |
29 | Keyword |
30 | Screen Saver For MD |
31 | Format |
32 | Region |
33 | Language |
34 | Aspect Ratio |
35 | Number of Discs |
36 | IMDB |
37 | Synopsis |
38 | Producer |
39 | Executive Producer |
40 | Purchase Info |
41 | TV Channel ID |
42 | TV Program ID |
43 | TV Series ID |
44 | Creation Date |
45 | THX Disk ID |
One that is missing that would be useful is:
Name | Parameters | Returns |
GetMediaAttributeOfType | filename (13) attributeType (122) | attributeID (123) |
That would allow us to check if an attribute of a given type was set, maybe to avoid over-writing a user-entered value.
I also didn't find a command for associating a picture with a media file.
Hi,
very useful info. It would be nice if all of this would be solvable by just sending messages. This way it would be easy, cause in another way, one should work with .id3 and sql database directly.
BTW, does anyone know how are metadata files handled :
- are .id3 files generated from sql base or vice versa ?
- what one needs to change .id3 file or sql record or both to update some info about file ?
Maybe we could try few commands how they work. There is nice web page about messagesend tricks.... Adding info there would be useful...
http://wiki.linuxmce.org/index.php/MessageSend (http://wiki.linuxmce.org/index.php/MessageSend)
I think the easiest way would be to create some new directory and put test audio file in there, trigger Media sync and follow DCERouter's log..
For sniffing what happens when picture is associated with file: those can be created from UI2 (create snapshot or something similar) and again, DCERouter's log could be sniffed...
Regards,
Bulek.
I just had a talk about Update daemon.
There are generally two sources of metadata info in LMCE : sql and .id3 files.
1. If info is missing in sql and present in .id3 files then it's transferred to sql (I guess this is meant for migration)
2. Any info that is already present in both sources, should be changed in sql only, and daemon will then put it into .id3 file
About reading tags from files :
- I've found few Perl modules that could help in dealing with that... :
http://search.cpan.org/~dongxu/Audio-TagLib-1.43/ (http://search.cpan.org/~dongxu/Audio-TagLib-1.43/)
anyone more experienced with sql and Perl ? We need small help - to browse directory tree and check/update sql info
anyone with more insight into making screenshots from video file ? I remember that Freevo used to do this with mplayer (one simple command line)....
HTH,
Bulek.