SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Studio
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Studio Discussion related to the SageTV Studio application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the Studio software application should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-19-2011, 02:51 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Allow creation of MediaFiles Objects w/o an actual media file

Now that I've finally made some progress in getting UPnP MediaServer navigation (read: PlayOn) in Java its going to open up some new possibilities for tighter Sage integration. One area that i'd really like to de-hackify is the queue importer.

One nice way for me to do it this time would be for me to make the virtual mediaFiles internal to sage rather than having to rely on creating placeholder physical files and voodoo magic. To do that i'd like to request a new method for creating MediaFile objects which don't have a physical media file attached to it, rather just a generic string. Also, should probably have a smaller identifier string like MediaType that could be used for easy identification/filtering.
Code:
AddVirtualMediaFile(String Anything, String MediaType)
AddVirtualMediaFile("UPnP\PlayOn\Netflix\Toy Story 3 (2010)", "UPnP")
AddVirtualMediaFile("http://www.youtube.com/watch?v=wX9Sc88qreg", "HTTP")
For my purposes i'd just create a bunch of MediaFiles with the UPnP path to the real video and enough associated metadata to fit in with TV shows/Movies. I can also see some other interesting use cases for this...
  • Making Podcasts behave more like favorites and show up in your Recording list as new recordings when they become available.
  • Favoriting Youtube Videos for easy playback without having to download them
  • Generating placeholder videos to represent unrecorded/future shows.
  • Offline DVD's
And with something this generic i'm sure there would be plenty more creative uses people would come up with.

Edit: I guess this doesn't really fit in well with the MediaFile object, but it also doesn't seem to fit anywhere else well either.
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)

Last edited by evilpenguin; 04-20-2011 at 02:45 PM.
Reply With Quote
  #2  
Old 04-19-2011, 05:33 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Seconded while we are at it would give me a place to store offline movie details from mymovies
Reply With Quote
  #3  
Old 04-19-2011, 06:03 PM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
But then wouldn't you also need a way to associate one of these pseudo MediaFiles to a real MediaFile?

Edit: Just typing out loud: Is there a way to fake the sage core into thinking there is a physical file on the disk when there really isn't?
- There is already a CreateTempMediaFile(String filePath) method. If that is invoked does it actually create a physical file?
- What happens in you pass in a File Object to AddMediaFile() that has no physical file associated with it? (AddMediaFile(new java.io.File(somePath), somePrefix)) Does this create a physical file on disk or not?
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.

Last edited by tmiranda; 04-19-2011 at 06:16 PM.
Reply With Quote
  #4  
Old 04-19-2011, 06:18 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Well, any plugin that would create these types of MediaFiles would also be responsible for including/displaying/handling them correctly. They probably should only be available by request so that if the plug-in is uninstalled and the MediaFile objects aren't cleaned up they don't pollute peoples MediaFileLists with objects they don't know how to handle.

Quote:
- Is there a way to fake the sage core into thinking there is a physical file on the disk when there really isn't?
Doesn't look like it. When you call those functions Sage checks if the file exists and runs format parsing on it, both of which would require a real video.
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)

Last edited by evilpenguin; 04-19-2011 at 06:27 PM.
Reply With Quote
  #5  
Old 04-19-2011, 07:11 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Those are the main reasons whey we create the VFS in Phoenix. We needed to treat anything as a media file, whether it was a real file or not.

CreateTempMediaFile can be used if you need to create a short lived object, but I don't think you can use it for what you are looking at.

Eventually, I'll start looking at creating a Pheonx VFS Implementation for PlayOn as well (Actually I've started looking at it, but it'll be a a little while before I get back to it )

Just so you know as well... Phoenix VFS already exposes the online videos or any rss feed as a vfs folder. It also has support for creating virtual folder that simply link to online content. In fact, I created it, so that I could bookmark youtube videos.
Reply With Quote
  #6  
Old 04-19-2011, 08:40 PM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
Those are the main reasons whey we create the VFS in Phoenix. We needed to treat anything as a media file, whether it was a real file or not.

CreateTempMediaFile can be used if you need to create a short lived object, but I don't think you can use it for what you are looking at.

Eventually, I'll start looking at creating a Pheonx VFS Implementation for PlayOn as well (Actually I've started looking at it, but it'll be a a little while before I get back to it )

Just so you know as well... Phoenix VFS already exposes the online videos or any rss feed as a vfs folder. It also has support for creating virtual folder that simply link to online content. In fact, I created it, so that I could bookmark youtube videos.
Right but those still dont link to metadata fields and such in the core correct. What we are needing or at least me is a way to store and such against these non existent files.
Reply With Quote
  #7  
Old 04-20-2011, 04:10 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by PLUCKYHD View Post
Right but those still dont link to metadata fields and such in the core correct. What we are needing or at least me is a way to store and such against these non existent files.
I agree... but yet I still store metadata against non sagetv mediafiles, since the vfs supports that. In phoenix a mediafile is totally abstracted, so that we don't need the mediafile to be a sagetv mediafile in order to store/display its metadata.

It was determined early on for us, that we needed to abstract the mediafile system in sagetv if we were ever going to support mediafiles that are not actually exist in sagetv.

The vfs doesn't duplicate storage, ie, it will use sage's mediafile apis for setting/getting data on regular files, but it will transparently store data against non-mediafiles, such as online videos.

It's not a question of whether you use Phoenix's vfs... I'm just letting you know, that won't be able to cram all mediafiles into to sagetv, as is, if you go down the road of wanting to transparently show mediafiles from multiple sources, then you're going to want to design some sort of abstraction layer.. ie, vfs.

but if you do want to shoehorn non-sagetv mediafiles into sagetv, you can hack around it. You can probably just create a dummy import file (ie, like the playon importer does now I think), and then store the original URL in a custom metadata field. From the UI, you'll still need to know how to handle that special type of file, but it would allow you to treat it like a regular, long term, mediafile.
Reply With Quote
  #8  
Old 04-20-2011, 05:37 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Quote:
Originally Posted by stuckless View Post
Just so you know as well... Phoenix VFS already exposes the online videos or any rss feed as a vfs folder. It also has support for creating virtual folder that simply link to online content. In fact, I created it, so that I could bookmark youtube videos.
Forgive me in advance for hijacking this thread. Can you expand on this a little more? I want to know if I'm wasting my time working on PodcastRecorder, or if I could do it in a better way using Phoenix. You can email me if it's not something you want to go into here.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #9  
Old 04-20-2011, 06:49 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by tmiranda View Post
Forgive me in advance for hijacking this thread. Can you expand on this a little more? I want to know if I'm wasting my time working on PodcastRecorder, or if I could do it in a better way using Phoenix. You can email me if it's not something you want to go into here.
Tom, I've moved this discussion to the bmt area (there isn't a public Phoenix area yet).
Reply With Quote
  #10  
Old 04-20-2011, 06:58 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
but if you do want to shoehorn non-sagetv mediafiles into sagetv, you can hack around it. You can probably just create a dummy import file (ie, like the playon importer does now I think), and then store the original URL in a custom metadata field. From the UI, you'll still need to know how to handle that special type of file, but it would allow you to treat it like a regular, long term, mediafile.
Yeah that is the hack I want to avoid. Not a fan of "dummy" video files . For now I just stick with the MyMovies database, but figured I would throw my "me too" on to EP want/suggestion.
Reply With Quote
  #11  
Old 04-20-2011, 07:10 AM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
I'll throw my "me too" in there as well. Since having that ability would simplify what I'm doing now for exposing online content as mediafiles... and if sage does implement it, at least it'll be transparent to Phoenix

While we are on the wish list...

Having Play(URL) would be extremely helpful, where the Play(URL) handles all the work that is currently being done in the STV for background downloading of the media file, buffering, buffer monitoring, etc. That way, playing an online video stream would be a simple task of Play(Url) instead of what has to happen today

I suspect that SageTV won't implement the MediaFile=CreateVirtualMediaFile() type of api, since then they'd have to ensure that their current Watch(MediaFile) api handles the ability to be able to "watch" the MediaFile (which to me, is really the important part). The other challenge I see for SageTV in creating virtual media files is that how do they clean them up. Today they do a pretty good job of syncing the "real" files to MediaFiles in the Wiz.bin... but how would they clean up virtual files?
Reply With Quote
  #12  
Old 04-20-2011, 02:28 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Quote:
Originally Posted by stuckless View Post
I suspect that SageTV won't implement the MediaFile=CreateVirtualMediaFile() type of api, since then they'd have to ensure that their current Watch(MediaFile) api handles the ability to be able to "watch" the MediaFile (which to me, is really the important part). The other challenge I see for SageTV in creating virtual media files is that how do they clean them up. Today they do a pretty good job of syncing the "real" files to MediaFiles in the Wiz.bin... but how would they clean up virtual files?
Like I said before, it'd be the responsibility of the plugin writer to ensure that these VirtualMediaFiles (perfect name, btw) are handled/cleaned up properly. If your VirtualMediaFile can't be handled by Watch() then its the plugin writters responsibility to ensure it never gets there. And if it does, Sage can just throw up an error like it does with any other MediaFile it can't play.

No need to back away from it because badly written plugins might mess things up, hell I can a pretty good job of that today with the current API's they already give me
Quote:
Originally Posted by stuckless View Post
Having Play(URL) would be extremely helpful, where the Play(URL) handles all the work that is currently being done in the STV for background downloading of the media file, buffering, buffer monitoring, etc. That way, playing an online video stream would be a simple task of Play(Url) instead of what has to happen today
I bugged Jeff about Play(URL) for v7 beta and he looked at it but decided to punt it. I bet if we bug him *really hard* he might look at it again
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)

Last edited by evilpenguin; 04-20-2011 at 02:46 PM.
Reply With Quote
  #13  
Old 04-20-2011, 02:46 PM
stuckless's Avatar
stuckless stuckless is offline
SageTVaholic
 
Join Date: Oct 2007
Location: London, Ontario, Canada
Posts: 9,713
Quote:
Originally Posted by evilpenguin View Post
I bugged Jeff about Play(URL) for v7 beta and he looked at it but decided to punt it. I bet if we bug him *really hard* he might look at it again
I bugged him around the same time as well, but no go. It would be a handy API though... (Are you listening Jeff? )
Reply With Quote
  #14  
Old 04-21-2011, 11:57 AM
PLUCKYHD PLUCKYHD is offline
SageTVaholic
 
Join Date: Dec 2007
Posts: 6,257
Quote:
Originally Posted by stuckless View Post
I bugged him around the same time as well, but no go. It would be a handy API though... (Are you listening Jeff? )
Yes please!!!

I mean +1
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
V6.1.7 Client - File name cut on Copy Media from File function tawpgk SageTV Beta Test Software 8 04-24-2007 12:52 AM
V6.1.7 Client - File Path not shown on Copy Media from File function directory list tawpgk SageTV Beta Test Software 3 04-17-2007 11:05 PM
XML file creation in Video Libraries question dvd_maniac SageTV Customizations 1 11-12-2005 08:37 AM
long pause on file creation. Ryokurin SageTV Software 3 06-10-2004 02:17 PM


All times are GMT -6. The time now is 12:57 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.