Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - raldo

Pages: 1 2 3 4 [5] 6
81
Scripts and Templates / Re: Some questions regarding export plugins...
« on: April 07, 2009, 02:05:32 pm »
It is very difficult for me to say which method is the best as I have never worked with MC and it's API.
Well, I was more thinking in general terms. Would you view this as a good "general method" of integrating with a front end type of system?

If I would need existing data from PVD I would just query the PVD database directly using SQL and then put data into MC using it's API. This seems like most powerful and universal way to me.

Another approach that is much easier is to create an export template for PVD and write an import plugin for MC that understands files generated using the template. 

If i would need to get data from MC into PVD I would just write an import plugin that uses MC API.
Some other users in your forum have already solved this. I.e. we can Import metadata from PVD.

But it requires several manual steps and that's what I'm trying to "fix" with the solution outlined above. I.e. what I'm trying to achieve, is a tighter integration between MC and PVD which doesn't require several steps and switching back and forth between applications after the user has acquired and imported new movies in MC.

I have no problem adding some kind of communication protocol in PVD if it would make sense, but I do not see a need for this at this point.
Fair enough, It's your call..

82
Scripts and Templates / Re: Some questions regarding export plugins...
« on: April 07, 2009, 01:40:29 pm »
Nostra,

Are you interested in integrating PVD with MC as I outline above, considering that there will be needed sw changes on the PVD side?

On the other hand, do you think the method I outlined above is "good"? Is there maybe another way in which this can be made seamless?

83
Scripts and Templates / Re: Some questions regarding export plugins...
« on: April 02, 2009, 09:44:03 pm »
I take it your thinking is media may be first imported to MC, and therefore the plugin needs to be able to induce PVD to create a record and download the metadata. Slick, but I think there are too many things that could go wrong. Even if it does work, the plugin is more likely to need updating when PVD (the program) is updated. But most importantly, this doesn't make sense from a work flow point-of-view. If PVD is being used to collect and manage metadata for videos, then it should be allowed to do that—with user supervision—before the data is imported to MC. Otherwise, the data may be incomplete or erroneous. To make matters worse, it will remain that way in PVD until the user recognizes this is so.
Yes, I suppose things could go wrong, especially the first time you export from PVD to MC. But you could still browse the received data in MC. I'm not saying that we don't *need* the PVD GUI, I'm just saying that, hopefully, MC's theater view browsing will improve over time...

But after that, when you do one movie at a time, detecting errors should be easier..

Quote
It seems to me this has to be much simpler, and doesn't violate the work flow premise. It would be reasonable to assume that, whatever the state of the data at the time the plugin is run, it's appropriate to import it. Also, rather than requiring the user to select items in MC to be updated, the plugin could automatically update items based on PVD's Date updated (new in 0.9.9.5). There would need to be an equivalent field in MC that the plugin updates. Knowing the MC user can choose to use Auto-import or not, it makes sense to ignore records that exist in PVD but have not yet been added to MC. Such records would be updated after they have been added to PVD.
This seems to be a "phase 2" issue. Remember, I haven't even started writing code yet :) I am not even sure yet if it will be possible to do my outline from above...

Quote
BTW, we discussed in the MC forum how perhaps credits can be handled using two fields in MC. For example, for actors, import [Name] to Actors and [Seq#]. [Name] as [Role] to a second field (Actor credits?). Are you planning on building that into your plugin? I don't see a special-purpose credits field being added to MC, so this is probably the way to go.
I haven't really "solved" yet how field mapping should be done. I think that Nostra's excellent system of field mapping/parsing could be used as is (see, for example, plain text export). The advantage of this is that it has already been done :) and the parsing engine is designed around the database. The parsed output, one per file, would then be transmitted to MC via UDP. MC would then simply stick the field mappings into the proper MC fields.

The plugin on the PVD side would then be installed together with a default template (with a "pages template" for Credits which would surely accomodate your sequencing request).

84
Scripts and Templates / Re: Some questions regarding export plugins...
« on: April 02, 2009, 04:02:48 pm »
Good idea.

I'm thinking of making an JRMC-PVD interface where PVD serves metadata to JRMC.

My suggestion below is for a "seamless interface" where no action needs to be taken on the PVD side.

The way it would work (if possible) is as follows:
(i) In MC, select one or more files and select "Import metadata from PVD"
(ii) The MC plugin signals PVD sequentially for each filename with with a request for metadata.
(iii) A receive thread on the PVD side processes each request and initiates a metadata scan.
(iv) When the scan for a file has finalized, PVD signals back to MC, either a disambiguation list of alternatives (as descibed above) or the "one and only result"
(v) If MC receives a list of alternatives, the MC plugin brings up a dialog from which the user can select the correct item. Then, MC requests data from PVD.
(vi) When the MC plugin has received data, it populates fields in the MC db according to user configuration in the MC Plugin.

Communication would take place via UDP.

Alternatively, MC could retrieve the data from the database (using the API some other user provided in "some other thread").

85
Scripts and Templates / Re: Some questions regarding export plugins...
« on: April 02, 2009, 02:34:48 pm »
Quote from: nostra link=topic=1254.msg4594#cfløæ'msg4594 date=1238670039
What do you mean with "scan"?
Scan: When you first have set up your "watch folders" and then select "scan folders" to retrieve metadata. (PVD isn't installed on this PC so I'm not completely sure what the exact wording is)

By "Scan results" I mean the disambiguation dialog that pops up when you import meta data. For example to select between the original "Open your eyes (abre los ojos)" and the Hollywood remake.

86
Scripts and Templates / Export plugins for J River Media Center
« on: April 02, 2009, 10:03:13 am »
I'm "working on" an export plugin for JRiver mediacenter.

Now, I think I have worked out a way of doing the file selection and metadata import "seamlessly" on the MC side.

Some questions, possibly on the SDK or commandline on the PVD side:
o Is there a way to start a *silent* scan on a single file from within the export plugin framework? I.e. is there a part of the SDK or the command line interface that facilitates this?
o Is it possible to somehow get the scan results programmatically so that the scan results can be resolved programmatically?

Thanks.

87
to add a configuration window to set up fields easily. Once the plugin is set up the only thing you will need to do to update information in MC will be hitting the Export button in PVD ;)
Ok, I'll take a look at you plugin examples when I get back from vacation in a weeks time.

In the meantime, could you please point me in the direction to a workable/compilable plugin example, preferably in C++? I know there are som examples in the forum, but it'd be good to start off with the newest version of a workable example...

88
You're right. I'm too used to thinking about from a relational database point-of-view, which MC is not. So an actor is not related to a movie via a role in MC—it can only search selected fields for the text of the actors name. This also means my idea of using one list field for all credits is not a good one. MC would not be able to simple things like list movies of a particular director—you would have to search for "[name] - Director" in Credits, rather than "[name]" in Director.

Yup, that's exactly the point. Datamodelling is *hard* and I think that's one of the reasons why JR probably sticks to their current model. Also, do you think they'd be able to make MC that fast with a relational database?

Quote
It would help if I had a train of thought that goes in one direction.  ;D

Yes. Doable and concise suggestions may be implemented. Other, vague ideas are hard to implement because there is no "design".

89
Yes. That's just my way of describing a generic format for all credits. More specifically, it would be "[name] - [role]" for actors, and "[name] - [function, position or job title]" for production credits. It could then be used for any type of credit. For example, you could chose not to have a separate Director field, saving "[name] - Director" in a Production Credits field, along with "[name] - Key grip", etc.

What if you use semicolon delimited lists for: Roles = name1 - role1; name2 - role2; ...

For example:
Credits = Peter Sellers - Actor (German RocketScientist, The President, English Colonel); Raldo - Key grip; ...

You could use their language to pick actors, key grips, etc., directors.

The flexibility of the metadata view would be even as important. There should be a default config, and flexibility for advanced users..

Quote
I think I've already expressed my views in the thread I mentioned. But if you have something to say, I'll probably find it impossible not to add my 2 cents. ;)

I'm thinking: Take the essence of the beforementioned thread and start over again in a new thread. That'll "refresh your package" and make it easier for others to get into your train of thought..

Quote
What I was leading to with this half-thought is that what most users need help with is the configuration, which is largely a field mapping exercise. Maybe a plugin would be most helpful to the extent it made that as painless as possible. Starting with the premise users are able to configure PVD to get exactly the information they want, imagine this: Your plugin reads their database and sets out all the fields used. For each field, it lists the fields available in MC for mapping, or the option of creating a custom MC field—of the appropriate field type. It would revisit this mapping configuration whenever it detects a field has been added, renamed, changed in type or deleted in PVD. It might even create a default Library View—to arbitrarily display all the fields being populated from the PVD database. I think something like this would be a big help to the "average" user in configuring and maintaining the integration of the two applications.

Yes, one's balancing a thin line between ease of use and flexibility. A plugin with a default, unchangeable map and then additional configurable maps would be the way to go.

90
Excuse me if I'm clueless about such things, but wouldn't your MC plugin just access the Firebird database directly? Why would you need a plugin on the PVD side? To enable the update of PVD from MC, I suppose.
Yup, that may be a way to access the data. The reason why I think something must be done on the PVD side is, as you suggest, that MC needs to be able to tell PVD that action must be taken, I.e. update the database.

I was just suggesting a generic approach ("New Plugin Type") but a simpler solution may work as well.

91
types of data (e.g., ordered lists of [name] - [role]/[function] for credits) and they ask for a list of fields needed for movies, I have to
Do you mean the annoying reordering of lists into alphabetical order? I agree that there should be another ordered list type.

I don't understand the syntax "[name] - [role]/[function]". Is this a new field type?

Then, maybe they'll find a way to accommodate both approaches.

Yes, I agree with you on this.

Do you want to start a new thread on this in the MC forums? The timing is correct now...

92
You want to get only one (first?) file for arecord or what?
If so then define the template link like this:
Code: [Select]
{%value=27 template="pages\files.ptm" maxvalues="1"}
maxvalues="1" results in the number two filename (alphabetically) being exported. I think the solution above is good enough for now...

Nostra, are you the owner of PVD? If yes, would you be interested in cooperating towards making a JRMC plugin where PVD serves JRMC's needs for meta data? JRMC has a pretty comprehensive API, look here: http://wiki.jrmediacenter.com/index.php/Media_Center_Automation.

On your side, I'd guess you'd have to develop another plugin type, a database Server of some sort. I work as a programmer, and I'd be interested in trying something like this.

93
[..]
Yes. I see you just replace all commas with semi colons. I used a separate export to do that only for list fields—so it wouldn't replace commas in fields like Description.
[...]
Yeah, I guess I can live with some extra semicolons.. Since the MPL file can be reimported, I guess I can do it all over again if those semicolons start bothering me!

[..]
I attempted to explain here some new field types that would be required to properly handle movie information, but there's no sign yet they "get it."
[...]
Notice how JRMC did the GUI design in cooperation with the users on the forum. I'm pretty sure they'll come around with a proper list of meta data for movies. As far as I understand, they're also working on theater view meta display view for movies.

It'd be interesting to know how the various online databases overlap and differ wrt. meta data. Has anyone done a survey?! The intersection between these services + some of the "Good differences" I guess should be the standard for what they end up with...

Quote
So, does this achieve a level of integration you're satisfied with, or do you think there might be a better solution?
[...]
It looks like this is as far as we can get without code changes on either side. It's pretty good, I'd say...

The best solution, of course, would be a plugin on the JRMC side with direct communication to PVD.

94
I've found a solution which works better than before. See Edit above...

95
To split files use this code in main template file:
Code: [Select]
Files:
{%value=path template="pages\files.ptm"}

And this in files.ptm
Code: [Select]
{%value}


P.S. You will need to use field number instead of "path" if you use 0.9.8.20

Nostra:

This is a step forward but consider this: In the resulting MPL file, I would like one <item> section per File. When I do what you suggest above, I get one item section where the filenames appear twice.

I tried moving the Item section into files.ptm, but then %value=xx didn't parse into the resulting mpl file.

Can a child template somehow inherit  the values from the parent template?


96
[...]Would you like to share your routine? [...]

Export template:
Code: [Select]
%OPTIONS%
replace="&<->&amp;"
replace="<<->&lt;"
replace="><->&gt;"
replace=",<->;"
filter="MPL Files|*.mpl"
encoding="UTF8"
%OPTIONS%
%HEAD%
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<MPL Version="2.0" Title="PVD->MC Export file">
%HEAD%
<Item>
{%value=27 template="pages\files.ptm"}
<Field Name="Year">{%value=5}</Field>
<Field Name="Genre">{%value=44}</Field>
<Field Name="MPAA Rating">{%value=6}</Field>
<Field Name="Actors">{%value=52}</Field>
<Field Name="Director">{%value=53}</Field>
<Field Name="Producer">{%value=56}</Field>
<Field Name="Screenwriter">{%value=54}</Field>
<Field Name="Original Title">{%value=3}</Field>
<Field Name="Country">{%value=45}</Field>
<Field Name="Tag Line">{%value=14}</Field>
<Field Name="Studios">{%value=50}</Field>
<Field Name="Description">{%value=15}</Field>
<Field Name="Season">{%value=42}</Field>
<Field Name="Episode">{%value=41}</Field>
<Field Name="Keywords">{%value=51}</Field>
<Field Name="IMDBRating">{%value=9}</Field>
<Field Name="Composer">{%value=55}</Field>
</Item>
%FOOT%
</MPL>
%FOOT%

And then the template for filenames, should be placed under [...]\PersonalVideo..\Plugins\template\pages

Code: [Select]
<Field Name="Filename">{%value}</Field>
This yields duplicate filenames for each record in the mpl file, but MC manages to import the records anyways. The good news here is that movies with more than one file get metadata for one of the files!

In the configuration dialog for the plain text template, tick "Open file upon completion". The new export template is also configured as "Use As Default".

In PVD, all folders that contain movies are selected in the File Scanner Group of the Tools\preferences\folders

I then associate .mpl files with a batch (.cmd) file that has the following text (create a file called "ImportMc.cmd"):
    mc13.exe /Import %1

File types can be associated by right clicking the file, selecting properties and then pressing "Change" in the General tab. Then press browse and point to the batch file.

When this is correctly set up I can import new files into mc by:
o PVD: Tools\Scan folders. One may have to press ok some times.
o PVD: Tools\Export

97
[...]
That's slick. Would you like to share your routine? I'm also curious about how you handle the list fields.
[...]

I'll post the scripts when I get back home later on today.

I assume you're talking about semi colon (after replace in output script) delimited fields? I have posted some suggestions over at the mc forums regarding this.  http://yabb.jriver.com/interact/index.php?topic=51208.0. It'll be interesting to see if for example "Director" (MC) will be changed to accomodate this.

[...]
Except for the problem you mention, it sounds like you've come pretty close to an ideal. Even if it has to be done manually, it only takes a few minutes. Beyond that, I can only offer some conflicting thoughts...

Since PVD uses a Firebird database, there's a possibility of the data being pulled directly from the database. This would probably be child's play for MC developers, but they're not going to do it for a handful of users using PVD.

Most people willing to make the effort to collect the information are going to use custom fields, use standard fields for other uses, and have differing preferences as to how data elements are handled in PVD and MC. Accommodating all the possible variations makes closer integration more difficult. In fact, with this in mind, the flexibility of exporting to XML starts to look pretty good.

A user with sufficient programming knowledge could write an application that reads the database and writes a MPL file. The advantage of that is it could be scheduled to run at regular intervals, and MC could be configured to import it regularly. The fact that both the export and import would run automatically would make it seem the two applications were integrated.

While it doesn't seem like a big deal, there is user data created in MC (e.g., date played, rating) that has no way of being recorded (automatically) in PVD. As a practical matter, I suppose the best way to deal with such things is to import the PVD counterparts into separate fields—for comparison to the MC values. In MC you would have the choice of displaying one, the other, or a calculated result, and would be able to report at any time what needs to be updated in PVD to bring it in sync.

Regardless of the integration issues, I'm convinced MC will never have an information gathering ability of it's own that will come close to what PVD can do. So, hopefully, we can work through the integration issues. Meanwhile, I'm enjoy using PVD with my "Theater View" skin to "collect, organize and play" my movies. ;)

But what about the following solution which requires "smaller" changes on the PVD side? And practically NO changes on the JRMC side:
o Use send to external in MC (with filename as parameter) to pass parameters to PVD (Similar to how JRMC can receive parameters)
o Implement a silent mode on the PVD side, where search, update and export are done "behind the curtains".
o PVD's export function "runs" the exported MPL file
o  -- OR even better: PVD sends a core command to MC with mpl filename attached. Doesn't require OS to trigger import
o JRMC dialog pops up when import has finished.


98
Rick.ca:

There has been a lot of discussion on the JRMC forums regarding feasible methods on obtaining meta data for video.

What, would you say, is the possibility of somehow more closely integrating PVD with MC?

99
[...]
It would require a text editor that uses regex, and the regex for finding and deleting the text between the first "|" and "</" of the filename tag.

Yes, that's possible. Still, It's cumbersome.

It's a pity because I have a setup that's relatively simple to use now:

Open PVD, search folders and export. The export launches a batch file which again launches MC with import playlist command line options. Done.


100
PVD: 0.9.8.20
script: 0.5.0.6

Why?

Using just one filepath would naturally solve the problem to a certain extent, as you explain. It would be a lot of manual work, though.

Pages: 1 2 3 4 [5] 6
anything