NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 24 25 26 27 28 … 93 Next »
Another meta data question

 
  • 0 Vote(s) - 0 Average
Another meta data question
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#1
2009-03-27, 02:36 AM
I've been searching this here and there and just can't quite get the answer, as the word metadata (at least on the net) seems ambiguous...

I'm finishing my Recordin Rename tool, and one of the last things I want to do is copy over the ADS meta data fro the recording... I could copy the meta data straight to the next file

Code:
copy filename1.mpg:metadata.xml, filename2.mpg:metadata.xml

Or to a standalone file

Code:
Copy filename1.mpg:metadata.xml, XMLFile.xml

I can't seem to get it though...

For starters, It is NTFS, and the original file still has it's meta data, as viewed in the Video Library (after recording, the info is visible in Video Library)
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#2
2009-03-27, 04:34 AM
C# class for accessing alternate data streams: http://www.codeproject.com/KB/cs/ntfsstreams.aspx
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#3
2009-03-27, 04:51 AM
Here is one I cloned. It is part of WizGenUtils.

To see if metadata exists you can:

Code:
if (WizGenHelper.ADSFile.ADSStreamExists(filename, "metadata.xml"))
// do something

To read metadata from a file:

Code:
string metadata = WizGenHelper.ADSFile.Read(filename, "metadata.xml");
[SIZE=2]To write metdata into a file, where string metadata contains the metdata:

[/SIZE]
Code:
WizGenHelper.ADSFile.Write(metadata, this.FileName, "metadata.xml");
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#4
2009-03-27, 11:09 PM
JavaWiz Wrote:Here is one I cloned. It is part of WizGenUtils.

To see if metadata exists you can:

Code:
if (WizGenHelper.ADSFile.ADSStreamExists(filename, "metadata.xml"))
// do something

To read metadata from a file:

Code:
string metadata = WizGenHelper.ADSFile.Read(filename, "metadata.xml");
[SIZE=2]To write metdata into a file, where string metadata contains the metdata:

[/SIZE]
Code:
WizGenHelper.ADSFile.Write(metadata, this.FileName, "metadata.xml");

That's really well written code. It converted to VB .net with only only glitch (made it easy on me to sort though it.

(Variable of 'read' used with a Procedure 'read') I suspect that C# is allowed that kind of stuff
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#5
2009-03-27, 11:49 PM
Great, glad you found it useful!
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#6
2009-03-28, 04:45 AM
So there has been some discussion on the two xml formats.

It seems that when I copy out the ads metadata into a [filename]xml, then Video Library stops showing anything. I delete the file and then it's back.

Do I need to delete the metadata, or do I need to convert the metadata xml to the other format?
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#7
2009-03-28, 05:00 AM
You're right, there are two formats and they do not seem to be compatible. The tags are different between the two formats, and GBPVR is sensitive to which format it is reading from.

The ADS format:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<recording>
  <filename>G:\PVR\TV\Dollhouse\Dollhouse - 106- Man on the Street.mpg</filename>
  <channel>13 KCPQ</channel>
  <status>READY</status>
  <startTime>2009-03-27 19:32:07</startTime>
  <endTime>2009-03-27 20:32:07</endTime>
  <title>Dollhouse</title>
  <subtitle>Man on the Street</subtitle>
  <genre>Drama,Science-Fiction</genre>
  <description>Echo becomes the perfect wife for a lonely internet mogul and Sierra?s attacker is revealed. Mellie?s life is in danger and Agent Ballard?s investigation takes a surprising turn when he comes face-to-face and goes fist-to-fist with Echo for the first very time.</description>
  <uid/>
  <provider>THETVDB</provider>
</recording>

and the external file based XML format:
Code:
<Title>
  <FullTitle>Dollhouse - Man on the Street</FullTitle>
  <LocalTitle>Dollhouse - Man on the Street</LocalTitle>
  <Channel>13 KCPQ</Channel>
  <ProductionYear>2009-03-20</ProductionYear>
  <RunningTime>60</RunningTime>
  <Description>Echo becomes the perfect wife for a lonely internet mogul and Sierra’s attacker is revealed. Mellie’s life is in danger and Agent Ballard’s investigation takes a surprising turn when he comes face-to-face and goes fist-to-fist with Echo for the first very time.</Description>
  <DataProvider>THETVDB</DataProvider>
  <DataProviderId/>
  <Rating/>
  <Covers>  <Front>.\Dollhouse - 106- Man on the Street.jpg</Front>
</Covers>
  <Genres>Drama,Science-Fiction</Genres>
</Title>

The ADS format will not work in the external format, and the external format will not work as an ADS.

WizMetadataGrabber translates between the two formats and stores the appropriate format based on the target output.

If you are going to transcode a file, I would suggest extracting metadata from the ADS, saving it off, transcode the file, then add the saved metadata back as an ADS.
zehd
Offline

Posting Freak

Posts: 5,119
Threads: 249
Joined: Feb 2006
#8
2009-03-28, 05:05 AM
JavaWiz Wrote:You're right, there are two formats and they do not seem to be compatible. The tags are different between the two formats, and GBPVR is sensitive to which format it is reading from.

The ADS format:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<recording>
  <filename>G:\PVR\TV\Dollhouse\Dollhouse - 106- Man on the Street.mpg</filename>
  <channel>13 KCPQ</channel>
  <status>READY</status>
  <startTime>2009-03-27 19:32:07</startTime>
  <endTime>2009-03-27 20:32:07</endTime>
  <title>Dollhouse</title>
  <subtitle>Man on the Street</subtitle>
  <genre>Drama,Science-Fiction</genre>
  <description>Echo becomes the perfect wife for a lonely internet mogul and Sierra?s attacker is revealed. Mellie?s life is in danger and Agent Ballard?s investigation takes a surprising turn when he comes face-to-face and goes fist-to-fist with Echo for the first very time.</description>
  <uid/>
  <provider>THETVDB</provider>
</recording>

and the external file based XML format:
Code:
<Title>
  <FullTitle>Dollhouse - Man on the Street</FullTitle>
  <LocalTitle>Dollhouse - Man on the Street</LocalTitle>
  <Channel>13 KCPQ</Channel>
  <ProductionYear>2009-03-20</ProductionYear>
  <RunningTime>60</RunningTime>
  <Description>Echo becomes the perfect wife for a lonely internet mogul and Sierra’s attacker is revealed. Mellie’s life is in danger and Agent Ballard’s investigation takes a surprising turn when he comes face-to-face and goes fist-to-fist with Echo for the first very time.</Description>
  <DataProvider>THETVDB</DataProvider>
  <DataProviderId/>
  <Rating/>
  <Covers>  <Front>.\Dollhouse - 106- Man on the Street.jpg</Front>
</Covers>
  <Genres>Drama,Science-Fiction</Genres>
</Title>

The ADS format will not work in the external format, and the external format will not work as an ADS.

WizMetadataGrabber translates between the two formats and stores the appropriate format based on the target output.

If you are going to transcode a file, I would suggest extracting metadata from the ADS, saving it off, transcode the file, then add the saved metadata back as an ADS.

With my UltraXMLTV Renamer, I decided on a whim, that while I rename a file, that I make sure the meta gets copied over too. Then I decided that I could output the meta data into file xml, so that the recording is more portable.

Rather than reinvent the wheel, you wouldn't happen to have a class for the external xml metadata, would you?
Frank Z
[COLOR="Gray"]
I used to ask 'why?' Now I just reinstall...
[SIZE="1"]______________________________________________
Author: ZTools: ZProcess, MVPServerChecker; UltraXMLTV Enhancer, Renamer, Manager; [/SIZE]
[/COLOR]
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#9
2009-03-28, 05:30 AM
zehd Wrote:With my UltraXMLTV Renamer, I decided on a whim, that while I rename a file, that I make sure the meta gets copied over too. Then I decided that I could output the meta data into file xml, so that the recording is more portable.

Rather than reinvent the wheel, you wouldn't happen to have a class for the external xml metadata, would you?
I don't have anything that quite does what you want, but attached is a class called MovieEntry.cs. It might provide a base to start from to build what you are looking for.

The private fields at the top of the class define all the fields that are associated with metdata. There are getters/setters for these fields.
Additionally, there are two properties RecordingMetdata and Metadata that returns formatted XML strings in either ADS or external format.


The idea would be to:
  • Create an empty MovieEntry object
  • Read the ADS from the video file
  • Populate the setter methods for the MovieEntry object
  • Call the Metadata property to get the external format suitable for writing to moviename.xml.
You could probably create an empty constructor, and use the setters to populate the object or create a constructor that takes the filename, and have it read the ADS an populate itself.

The Metadata property creates the appropriate string suitable for writing the XML data into external file.

The RecordingMetadata property creates the ADS formated XML string acceptable for writing to the ADS.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Web API only_new Question Gazavant 6 2,583 2021-04-04, 06:54 PM
Last Post: sub
  Another Artwork question scJohn 15 8,036 2019-09-10, 05:33 PM
Last Post: nonob
  How to extract M3U8 and get matching XMLTV guide data from NPVR almightyj 0 3,350 2018-10-23, 07:24 AM
Last Post: almightyj
  Getting more than 24 hours of Guide Data scJohn 4 3,555 2018-05-16, 04:20 AM
Last Post: sub
  WEB API GuidService/Listing question(s) scJohn 6 4,217 2017-08-09, 02:18 PM
Last Post: scJohn
  skin question pBS 2 3,304 2016-06-18, 07:03 PM
Last Post: pBS
  Attention Sub: Open TV / Custom Data Grabber plugin Benoire 2 2,857 2014-11-14, 02:05 AM
Last Post: Benoire
  Another SQL question bgowland 15 7,144 2014-05-21, 08:09 AM
Last Post: bgowland
  Merge xmltv data with xslt Graham 4 3,410 2014-01-02, 12:45 PM
Last Post: Graham
  Timing.Info question mvallevand 2 2,046 2013-04-19, 03:54 AM
Last Post: mvallevand

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode