|
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 |
#221
|
|||
|
|||
Exactly... see above response for further details.
__________________
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... |
#222
|
|||
|
|||
Quote:
__________________
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... |
#223
|
|||
|
|||
Quote:
Code:
// Note: This is a complete example script, but with all error checking suppressed import org.apache.commons.io.FileUtils File src = new File("foo.mpg") File target = new File("bar.mpg") FileUtils.copyFile(src, target) Just as an example, to run an exe in a groovy script you do something like this: Code:
String[] cmd = ["comskip.exe", "foo.mpg"] Process p = cmd.execute() p.waitFor() int rc = p.exitCode() return rc
__________________
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... |
#224
|
|||
|
|||
Quote:
__________________
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... |
#225
|
|||
|
|||
comskip_test script issue
Slugger, I believe I see an issue with your example comskip_test.groovy script.
Here is the scenario... - comskip task is setup to execute on RecordingStarted - your test script (comskip_test.groovy) is in place - user selects (plays) a show from the program guide, then after a few seconds stops watching the program. In the above scenario the comskip task will be executed however the test script will return 1 because mf=null. My guess is that it returns null because the media file is no longer present. This will put the comskip task back in the queue. Because the user is now longer watching the show (so no media) mf will always be null so this task will just sit in the queue in an endless loop. Is there a particular reason you choose a return code of 1 vs 2 in your first check where you are validating variables/metadata? Seems like changing the return value to 2 would be a simple fix. HC |
#226
|
|||
|
|||
It's a tough call... I return the task to the queue because I assume if none of those vars exist then there was an error inserting the task into the queue. I further assume that if you put the task in the queue then you wanted to run it and if it doesn't then you'll want to retry running it until it finally is able to run (instead of just hiding it as a failed task).
With all of that said, I've modded the script to (better, but not perfectly) handle the case where the media file goes missing. You can download the updated version and replace the original. I've just committed the update to svn so it should be there now for download (use the same link as referenced in the tutorial).
__________________
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... |
#227
|
|||
|
|||
Quote:
1) Run Comskip (if show was recorded from a channel with commercials) 2) Transcode and place output file to separate archive folder based on show name and change filename to episode name. 3) Move edl to archive folder and rename to be consistent with mpg file (now avi file) name. To increase the degree of difficulty I may run the show through VRD to remove the commercials from the file prior to transcoding. That would negate the need to move an edl file.
__________________
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 |
#228
|
|||
|
|||
Quote:
__________________
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... |
#229
|
|||
|
|||
Migrating to SJQv4
Until a week or so ago I had been using SageTV v6 and SJQv3 quite happily. However, I decided the time had come to upgrade to version 7 (which I like quite well personally), so now I am on SageTV v7 and SJQv4.
I am currently attempting to port my SJQv3 tasks to v4. I was able to get my ccextractor task running fairly easily, as that could naturally be attached to the "recording started" event. However I am having some difficulty determining how to port some of my other tasks, which in broad terms use handbrake (via a Windows batch file) to compress shows if I havn't watched them within a few days of airing. The old tasks did such things as check the media age, match against the show title, check if the airing was HD or not, and pass media file format info to the batch script so it could do different things based on that info. It seems this type of task cannot be attached to one of the available events in v4, so I would need to use the cron function to run it periodically. As far as scheduling, that is fine with me. However, it seems that using cron there is no media info available, as the cron event is not associated with any particular Sage object. Do I need to write basically a Java program to somehow enumerate all the Sage media objects and iterate through them in order to implement these tasks? Or is there some facility or technique I am overlooking? Thanks.
__________________
Andrew |
#230
|
|||
|
|||
Quote:
Code:
for(Object mediaFile : MediaFileAPI.GetMediaFiles()) { /* If the media file matches the given title regex, is an HD recording and it's older than 3 days then enter the if block and do your thing */ if(MediaFileAPI.GetMediaTitle(mediaFile) =~ /My Title|Another Title|Yet Another Title/ && AiringAPI.IsAiringHDTV(mediaFile) && System.currentTimeMillis() - MediaFileAPI.GetFileEndTime(mediaFile) > (3L * 86400000L)) { // Do whatever it is you want to do for the matching recordings in here // You should tag recordings you process with a metadata value that you also check for so as not to process the same recording more than once, if applicable } }
__________________
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... |
#231
|
|||
|
|||
This is exactly what I'm looking for as well. Wayner, if you take this route please post an example of your script. I'll do the same if I get to it first.
|
#232
|
|||
|
|||
Quote:
As an extension to your example above, can you tell me what the syntax would be to execute a batch script, passing it the full media path and the "media file format description" (formerly contained in $.GetMediaFileFormatDescription{}) as arguments? Thanks.
__________________
Andrew |
#233
|
|||
|
|||
Quote:
Code:
for(Object mediaFile : MediaFileAPI.GetMediaFiles()) { /* If the media file matches the given title regex, is an HD recording and it's older than 3 days then enter the if block and do your thing */ if(MediaFileAPI.GetMediaTitle(mediaFile) =~ /My Title|Another Title|Yet Another Title/ && AiringAPI.IsAiringHDTV(mediaFile) && System.currentTimeMillis() - MediaFileAPI.GetFileEndTime(mediaFile) > (3L * 86400000L)) { def cmdLine = ["C:/handbrake.exe", MediaFileAPI.GetFileForSegment(mediaFile, 0).getAbsolutePath(), MediaFileAPI.GetMediaFileFormatDescription(mediaFile)] Process p = cmdLine.execute() p.waitFor() } }
__________________
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... |
#234
|
|||
|
|||
Way to test scripts?
Earlier in this thread somewhere I think I remember reading about you maybe releasing something that could be used to test scripts before deploying them, some kind of development environment where we could get some immediate feedback and do some debugging on scripts we are writing. Is there any news on that? The only alternative I am aware of is to take a crack at writing it, attach it to a task, hope for the best, and check the logs after the task runs. Cumbersome and slow, especially for newcomers to this scripting language.
Thanks!
__________________
Andrew |
#235
|
|||
|
|||
Quote:
__________________
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... |
#236
|
|||
|
|||
I've spent the better part of 2 days converting from SJQ3-4 and while it wasn't exactly a smooth conversion, I do like the new model better. Good job, even though there is a learning curve!
One of the things I noticed when modifying the comskip_test.groovy script is that Code:
SJQ4_METADATA.get("SJQ4_CHAN_NAME") I've attached my comskip_test.groovy that has been modified to allow skipping comskip based on channel name incase anyone is interested. Just edit the SkipList string to add matches for channels you don't want to perform comskip on. |
#237
|
|||
|
|||
You'll have to pull the channel name via the AiringAPI. Only MediaFile metadata is attached in the context of RecordingStopped/Started events. Anything else will have to be pulled via the API, as you've done.
__________________
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... |
#238
|
|||
|
|||
Ahh that makes sense. Now to let things run for a day or so and see if anything blows up
|
#239
|
|||
|
|||
Finally making the migration from SJQ3 to SJQ4 and running into an issue - but not sure what the cause of the problem is.
I am attempting to setup comskip I don't get anything in my sjqagent.log, in my wrapper.log I have quite a few entries complaining about Error: Attempted to append to closed appender. If I look at the log from the test script from the SageUI I see that there is a ScriptException whose cause seems to be NumberFormatException: null - presumably meaning we attempted to parse a String, but null was sent in before. I copied the provided comskip test groovy file and I see the first action is to do a parseInt on SJQ4_ID - so I am guessing that is where I am failing. I can only assume that I am calling the script incorrectly? Her eis what I have in my sjqagent.properties: Code:
task.comskip.exe=C:/comskip/comskip.exe task.comskip.args="$SJQ4_PATH\\$SJQ4_LAST_SEGMENT" task.comskip.test=C:/sjqc/scripts/comskip_test.groovy # task.mytask.testargs= # task.mytask.schedule=* 13-17 * * * # task.mytask.resources=50 task.comskip.maxprocs=1 # task.mytask.rcmin=0 # task.mytask.rcmax=0
__________________
Host: ESXi 6.5 w/ Intel Core i7 2.8GHZ 8GB Ram Guest: Ubuntu 16.04 with Sage v9 in Docker Tuners: 2 HDHR (OTA); Extenders: HD300 connected to a Samsung 56" DLP HDTV; HD300 connected to a Sharp 42" LCD Storage: OmniOS w/6 1TB Samsung Spinpoint in a RaidZ2 configuration in a 20 bay SATA hotswap case. |
#240
|
|||
|
|||
How are you queuing tasks? Recordings must be queued either via an event (RecordingStarted/RecordingStopped) or you must queue a recording manually from its recording details screen. That's how SJQ is able to set all those variables is uses in the script (SJQ4_ID, etc). If you just manually queue a comskip task from the SJQ menu then it won't know which recording it's for and therefore all of that metadata will not be properly set.
__________________
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... |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Plugin: MizookLCD (Alternate SageTV LCDSmartie Plugin) | cslatt | SageTV Customizations | 48 | 06-11-2012 10:44 AM |
SJQv4: Technology Preview | Slugger | SageTV v7 Customizations | 39 | 12-17-2010 01:17 PM |
SageTV Plugin Developers: Any way to see stats for your plugin? | mkanet | SageTV Software | 4 | 12-12-2010 10:33 PM |
MediaPlayer Plugin/STV Import: Winamp Media Player Plugin | deria | SageTV Customizations | 447 | 12-11-2010 07:38 PM |
SJQv4: Design Discussion | Slugger | SageTV v7 Customizations | 26 | 10-18-2010 08:22 AM |