|
SageTV v7 Customizations This forums is for discussing and sharing user-created modifications for the SageTV version 7 application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss plugins for SageTV version 7 and newer. |
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
Overload SageAPI classes
I've been trying to learn Java and I'm at the point where I need a project to play with to get things to solidify in my mind.
One idea I had would be to write some Java code to replace the built-in transcode features of SageTV with some that would run custom scripts (like ccextractor + handbrake). One idea would be to override some of the methods in the TranscodeAPI object. I love how the transcode stuff is integrated with SageTV and in the webserver, but I'd really like to be able to transcode stuff without losing the closed captions... Is this feasible thing to try? |
#2
|
|||
|
|||
Short answer: no.
Long answer: The SageAPI is only accessible via reflection, there is no direct access to the actual API calls. Even if there were, I'd lay 50:1 that the underlying obfuscated classes are all defined final, which means you couldn't subclass them anyway. But even if they weren't final and you could subclass them, you'd have to convince the Sage core to instantiate your subclass(es) instead of the core's parent classes at runtime, which also isn't possible. Either way, you're out of luck. You could write your own routines, but I assume you also want other things, like the web ui, etc. to also use your routines instead of the default ones without having to touch anything? That won't happen. Trying to change the base functionality of any Sage API calls is simply not worth anyone's time or effort because it's not going to happen. I highly recommend finding a new project to feed your SageTV curiosity.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#3
|
|||
|
|||
What about writing SJQ routines that can do pretty much all of the stuff that you suggest? This coding is done in Groovy which is closely related to Java. I have written some SJQ scripts that use Handbrake to transcode my files and perform other tasks, but I don't care about CC so I don't know what happens to them.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#4
|
|||
|
|||
Quote:
But what I believe the OP wants to do is to override the default Sage API calls, like the transcoder calls such that they use his tools/methods to transcode videos and also by doing so other UIs, like the Sage STV and the web UI "magically" tie into these new routines without having to modify the STV or the web UI. This part is what's not possible. You can definitely write alternate routines to do anything Sage does, but if you want other pieces of the puzzle (i.e. the web UI) to also use these alternate routines then you need to rewrite those pieces (web ui/stv/etc.) to make them use your alternate routines. You can't get the Sage core to use alternate API calls, won't happen. You could get the STV to use alternate API calls, but you're basically rewriting the STV and creating a custom version of it. In the end, it's not really worth it, imho. Or it's at least not worth it as an "I want to learn Java/the Sage API" kind of project.
__________________
Twitter: @ddb_db Server: Intel i5-4570 Quad Core, 16GB RAM, 1 x 128GB OS SSD (Win7 Pro x64 SP1), 1 x 2TB media drive Capture: 2 x Colossus STB Controller: 1 x USB-UIRT Software:Java 1.7.0_71; SageTV 7.1.9 Clients: 1 x HD300, 2 x HD200, 1 x SageClient, 1 x PlaceShifter Plugins: Too many to list now... |
#5
|
|||
|
|||
Thanks for the replies -- I didn't really think it could possibly be that easy, but I figured it couldn't hurt to ask.
One way to accomplish a similar effect might be to create a plugin that monitors the convert queue for items to be converted using a special type of profile, and then call the external conversion of those files. So, for example, I could create profile called "High Quality with Captions" and whenever the plugin sees it, it would run external stuff. Maybe this is basically what SJQ would do -- I haven't used that stuff. |
#6
|
||||
|
||||
There is possibly another route you could take. You could analyse the modified ffmpeg source that is available, which is the SageTVTranscoder.exe application, and write a wrapper for it to launch a different encoding process on conversion jobs, and redirect to a renamed original SageTVTranscoder for placeshifter/thumbnail generation.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#7
|
||||
|
||||
Quote:
__________________
Automatic Power Off | Squeezeslave | DVB-S Importer | DVB Decrypter & Card Client | Tuner Preroll Every man is a damn fool for at least five minutes every day; wisdom consists in not exceeding the limit. ~ Elbert Hubbard |
#8
|
||||
|
||||
What, no reason the wrapper can't be written in Java - it most likely just has to interpret the command line, and pass through standard input/output.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#9
|
||||
|
||||
Quote:
The Studio work for this would be minimal so it's a good first project.
__________________
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. |
#10
|
||||
|
||||
I think the key aspect of keeping the original API call's is the Auto-convert feature built into the favorites - this, of course, can all be duplicated, and already has been with SJQ.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#11
|
|||
|
|||
To go back to the beginning - I don't really know why you would want to override the calls to the Sage transcoder. IMHO there was one huge drawback of that transcoder, at least when called from the Sage API, and that was that you didn't know when a job was done. The API would through a process into the Transcoder queue and you wouldn't know when it was done - that's a real issue if you want to do something else when the transcoding is finished, like move the file or copy the file to a mobile device.
I would far rather write my own process in something like SJQ in Groovy/Java and be able to have full control over the process. And you can view SJQ jobs through the web UI as well.
__________________
New Server - Sage9 on unRAID 2xHD-PVR, HDHR for OTA Old Server - Sage7 on Win7Pro-i660CPU with 4.6TB, HD-PVR, HDHR OTA, HVR-1850 OTA Clients - 2xHD-300, 8xHD-200 Extenders, Client+2xPlaceshifter and a WHS which acts as a backup Sage server |
#12
|
|||
|
|||
Quote:
Edit: Maybe I'm not the first person to want to work on this: http://forums.sagetv.com/forums/showthread.php?t=59756 Last edited by Dargason; 01-07-2013 at 06:16 PM. |
#13
|
||||
|
||||
I think that other person was looking to just roll the required modifications into a more current revision of ffmpeg, for better performance - not change the functionality as a whole. Really, the only reason you'd need to even look at the ffmpeg source code would be to figure out what sort of communications are built into it with he sagetv server. there is something, as the server gets transocding status from it - but whether that is via the standard output, error output, or some other connection, I'm not sure.
__________________
Buy Fuzzy a beer! (Fuzzy likes beer) unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers. Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA. Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S Other Clients: Mi Box in Master Bedroom, HD-200 in kids room |
#14
|
|||
|
|||
Running "SageTVTranscoder.exe -version" gives me the ffmpeg version that was used along with the build configuration. I'll have to dig through the source code a bit to see if I can figure out how it's communicating with the SageTV service.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
SageAPI question - find active CaptureDevice? | wayner | SageTV v7 Customizations | 4 | 01-04-2012 01:26 PM |
Think I have reached information overload | medwynd | SageMC Custom Interface | 6 | 04-18-2010 06:33 PM |
access SageAPI from standalone application | matrix35 | SageTV Studio | 16 | 02-21-2007 03:09 PM |
Help! Forum overload! What plug ins can do this? | Homebuilder | SageTV Customizations | 1 | 12-06-2005 02:34 AM |
Intelligent Recording Overload | Grey_Goose | SageTV Software | 6 | 08-28-2004 11:17 PM |