|
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 |
#1561
|
|||
|
|||
Indeed you definitely want a minute value other than * otherwise it will queue up 60 restart jobs every night and your server will be restarted 60 times each night. Pick a specific minute of the 4 o'clock hour you want the restart to happen.
__________________
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... |
#1562
|
||||
|
||||
Quote:
I fixed the cron job setting. It's executing the script every morning at 4am but in the SageTV web showing that the Task Queue is failing every night even it restarting SageTV service without a problem. I am getting a fail message every morning but when I look at SageTV system message uptime, it shows me that service have been restarted each day without a problem. Since it working, I will leave it alone unless there a way to fix it so it would show "Complete" instead of "Failed"? Thank you Bill
__________________
HTPC System GIGABYTE GA-MA69GM-S2H AM2 AMD 690G HDMI // AMD Athlon 64 X2 6000+ Windsor 3.0GHz // G.SKILL 6GB (2 x 2GB) 240-Pin DDR2 SDRAM DDR // Hauppauge Colossus HD-PVR // Hauppauge Colossus HD-PVR // Seagate ST3750640AS 750GB SATA-300 16MB // DVD R/W - SAMSUNG Black Media Extenders HD300 HTPC Software Windows 7 Professional 64bits // SageTV 7.1.x // Java 1.7.x |
#1563
|
|||
|
|||
Other than being annoying, the failed status really doesn't hurt anything. But to fix it, just increase the sleep time as needed for your system. For example, the script I use to do the restart looks like this:
Code:
Utility.ServerRestart() sleep 300000 return 0 Also, this only works if you're using the command line or Windows service version of the task client. If you're using the Sage plugin version of the task client then it will always report a failure because the task client is restarted along with the Sage server in that case and therefore will never be able to report the completion of the task. (Well, I could offer you some alternative code to actually make the plugin client report success, but it would just blindly report success, which is about as useful/meaningful as it always reporting failed.)
__________________
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... |
#1564
|
||||
|
||||
Quote:
It what I thought, since it working and I will just ignore it. Thank you for clearing it up. Bill
__________________
HTPC System GIGABYTE GA-MA69GM-S2H AM2 AMD 690G HDMI // AMD Athlon 64 X2 6000+ Windsor 3.0GHz // G.SKILL 6GB (2 x 2GB) 240-Pin DDR2 SDRAM DDR // Hauppauge Colossus HD-PVR // Hauppauge Colossus HD-PVR // Seagate ST3750640AS 750GB SATA-300 16MB // DVD R/W - SAMSUNG Black Media Extenders HD300 HTPC Software Windows 7 Professional 64bits // SageTV 7.1.x // Java 1.7.x |
#1565
|
|||
|
|||
As of tonight, I have unsubscribed from this thread. What does this mean? It means I am no longer actively developing or supporting this plugin. All my plugins have actually been EOL'd since about 2012-2013, but tonight I unsubscribe from these threads which means I no longer get instant email notifications when people post. I'm not leaving, I'm still a user, I'm still around these forums, but I no longer support these out of date plugins and since I don't sub to these threads any longer, I may or may not notice your questions and therefore may or may not answer them -- assume that I won't, certainly not in a timely manner.
This also means I will never release another version of this plugin to the repository. I remain the owner of the plugin in the repository, but will approve a transfer if requested. No one has taken me up on that offer since my original announcement many weeks back. Unless someone does, there will be no more releases of this plugin.
__________________
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... |
#1566
|
|||
|
|||
I've decided to try out this plugin again, but I've gotten stuck setting it up once again.
I've installed SJQ, the SJQ UI, and the SJQ Task client on my SageTV server. I've setup a Comskip task. I've assigned this task to the RecordingStarted event. I start a recording, and it shows up in the Queued Tasks screen. Comskip never launches. Whenever I go to the Queued Tasks screen, the Started/Completed times are updated to the exact time I enter the screen. The log files show no information. How can I see what's going wrong? Also, how can I edit the Comskip task I setup to make sure I set it up correctly? I can't find anywhere to edit/view the task I created. Thanks. |
#1567
|
|||
|
|||
Go to manage clients and select the task from the drop down next to a client. My comskip task is a Groovy script. If yours is make sure you have "script:" in front of the executable name. Are you looking at the log files in the web GUI? If so maybe the log files on the server have more information in them (in SageTV/plugins/sjq and sjq-agent on the clients).
__________________
Home Network: https://karylstein.com/technology.html |
#1568
|
|||
|
|||
Thank you! I found the problem, a misspelled path.
My Comskip task is just pointed to the comskip.exe file, and I'm using the Groovy comskip_test.groovy script as my test script (this is one of the sample scripts available from the setup guide). In the past I've used Showanalyzer, but I'm giving Comskip a go to see how it works. In the Showanalyzer setup you could specify channels not to process, I don't think Comskip offers the same functionality so I'll have to use SJQ for this. Is Groovy the best (only) way to exclude certain channels from processing in SJQ? Sorry for asking all of these obvious questions, but this thread is 79 pages long, and a Google search isn't show me much relevant information. |
#1569
|
|||
|
|||
Have a look at Setup/Detailed Setup/Customize/ComSkip Playback Options/CommercialDetector/Do Not Run comskip on These Channels/
__________________
HTPC: Gigabyte GA-Z170XP-SLI, I7-6700, 16GB, Windows 10 Pro x64, Hauppauge HVR-1600, WinTV-dualHD, Colossus 2, Samsung 850 EVO 120GB, Seagate 3TB, WD 3TB, 3TB, 5TB, Java v1.8.0_231, SageTVx64 v9.2.1.826, Samsung UN60EH6003F, Dish ViP222K, ViewHD 1x2 HDMI Splitter. |
#1570
|
|||
|
|||
I'm trying to do a more advanced Comskip task so that I can load different .ini files depending on the channel. Instead of using the executable and test script, I want to put everything inside of a single script. I then call this script as the executable like so: script:C:\Sage\Tools\comskip.groovy
My initial testing has been working so far, however I can't seem to find a way to mark a task as skipped. Code:
if(ignoreLiveTv && AiringAPI.IsNotManualOrFavorite(mf)) { println "Recording is live TV or IR recording, skipping comskip!" return 2 } It seems that SJQ only understands "return 2" in the context of a test script, and not an executable. Any way around this? As a workaround, I could make two scripts. One as the test script (which first verifies whether or not the task should be skipped or not), and then an executable script which decides what .ini file to use, and the launches Comskip with that .ini file. Is this the best way to do this? Is it possible to have a test script return a string value, and then have that string value passed as an argument to the exe? This way I would only need one groovy script. Last edited by peternm22; 11-02-2015 at 01:12 PM. |
#1571
|
|||
|
|||
I'm going ahead with the two script method (test and executable), since I can't find a way to do everything in one script.
I have the basic logic working now. You can define different ini files by channel number (might change it to channel name later on), by simply adding this line: ruleList.push('first.ini>400|300|291') This should be self explanatory. If the channel number isn't found in any of the ruleList's, then it just uses the default ini file. See code below: Code:
ComskipPath = "C:/Program Files (x86)/Comskip/comskip.exe" iniDirectory = "C:/Program Files (x86)/Comskip/" DefaultIniFile = "comskip.ini" def ruleList = [] ruleList.push('first.ini>400|300|291') //each line defines which channels to use a particular .ini with ruleList.push('second.ini>255|652') /****************************************************************************************/ /****************************************************************************************/ /****************************************************************************************/ Object mf = MediaFileAPI.GetMediaFileForID(SJQ4_METADATA.get("SJQ4_ID").toInteger()) def channel = AiringAPI.GetAiringChannelNumber(mf) file = SJQ4_METADATA.get("SJQ4_PATH") + "\\" + SJQ4_METADATA.get("SJQ4_LAST_SEGMENT") fileType = SJQ4_METADATA.get("SJQ4_LAST_SEGMENT_TYPE") def path = new File(SJQ4_METADATA.get("SJQ4_PATH")) def fileName = SJQ4_METADATA.get("SJQ4_LAST_SEGMENT") def channelFound = false ruleList.each { contents -> if(!channelFound) { def (inifile, channels) = contents.tokenize('>') channels = "/${channels}/" if(channel =~ channels) { channelFound = true println "Use '${inifile}' for channel ${channel}" runComskip(inifile) return 0 } } } if(!channelFound) { println "Use '${DefaultIniFile}' for default processing on channel ${channel}" runComskip(DefaultIniFile) } def runComskip(String iniConfig) { arg = "--ini=${iniDirectory}${iniConfig}" def command = [ComskipPath, arg, file].execute() def p = command.waitFor() p.consumeProcessOutput(System.out, System.err) def rc = p.waitFor() if(rc == 0 || rc == 1) return 0 else return 1 } This is what popped up in the log file afterwards: Code:
javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: java.lang.Integer.consumeProcessOutput() is applicable for argument types: (java.io.PrintStream, java.io.PrintStream) values: [java.io.PrintStream@f41f34, java.io.PrintStream@12cb871] at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:138) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:124) at com.google.code.sagetvaddons.sjq.agent.ScriptRunner.exec(ScriptRunner.java:114) at com.google.code.sagetvaddons.sjq.agent.ScriptRunner.main(ScriptRunner.java:175) Caused by: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: java.lang.Integer.consumeProcessOutput() is applicable for argument types: (java.io.PrintStream, java.io.PrintStream) values: [java.io.PrintStream@f41f34, java.io.PrintStream@12cb871] at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:335) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:132) ... 3 more Caused by: groovy.lang.MissingMethodException: No signature of method: java.lang.Integer.consumeProcessOutput() is applicable for argument types: (java.io.PrintStream, java.io.PrintStream) values: [java.io.PrintStream@f41f34, java.io.PrintStream@12cb871] at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55) at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:46) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:120) at Script1.runComskip(Script1.groovy:45) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:90) at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1076) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:906) at groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java:149) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl$2.invokeMethod(GroovyScriptEngineImpl.java:316) at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent(PogoMetaClassSite.java:66) at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent(CallSiteArray.java:49) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:133) at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent(AbstractCallSite.java:141) at Script1.run(Script1.groovy:36) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:332) ... 4 more I saw in some other examples that certain things (libraries?) need to be imported. Do I need those imports with this script? If so, which ones would i need? Thanks. |
#1572
|
|||
|
|||
I use a two script method, but don't think it's necessary. I used the scripts here as templates:
https://sagetv-addons.googlecode.com...nk/SJQScripts/ Not knowing much about Java or Groovy, I think you don't want that extra def p and just use the methods from command. Here's my comskip task, (again just ripped from the samples): Code:
def cmd = "C:\\comskip\\comskip.exe" def failed = false for(int i = 0; i <= SJQ4_METADATA["SJQ4_MAX_SEGMENT_INDEX"].toInteger(); ++i) { def segment = SJQ4_METADATA["SJQ4_PATH"] + "/" + SJQ4_METADATA["SJQ4_SEGMENT_${i}"] def exe = [cmd, segment] def edlFile = "${segment}.edl" if (Utility.IsFilePath(edlFile)) continue; def p = exe.execute() p.consumeProcessOutput(System.out, System.err) p.waitFor() def rc = p.exitValue() if(rc < 0 || rc > 1) // Task failed, but run against the rest of the segments anyways... failed = true } return failed ? 1 : 0
__________________
Home Network: https://karylstein.com/technology.html |
#1573
|
|||
|
|||
Quote:
Thanks. |
#1574
|
|||
|
|||
Huh, beats me . Maybe it was posted in this thread somewhere. I know I didn't write it from scratch.
__________________
Home Network: https://karylstein.com/technology.html |
#1575
|
|||
|
|||
Hot dang, it worked!
Thanks for the code. Time to clean things up a little and I'll post the finished code when I'm done. |
#1576
|
|||
|
|||
A new problem just showed up.
One of my encoders is a network encoder (an R5000), and on certain channels it can take 30 seconds before it starts writing data to the recording file. I'm also trying to do commercial detection while the show is being recorded (as I have always done with Showanalyzer) Comskip doesn't like this and produces a few "Can not open file" in the log before giving up. Is there anyway for SJQ to wait until the recording actually has data before calling Comskip.exe? |
#1577
|
|||
|
|||
Quote:
__________________
Home Network: https://karylstein.com/technology.html |
#1578
|
|||
|
|||
Both good ideas. I have my Comskip task currently attached to the RecordingStarted event.
I'm using a slightly modified version of the comskip_test.groovy as my test. I have it set to only run Comskip on Manual and Favorite recordings. I also added an ignore channel setting, where I enter in all the channels I don't want scanned (premium channels that have no commercials). These trigger a "return 2", which tells SJQ to make these tasks as skipped. I'm just working on tweaking my main executable script. I still need to add logic to deal with recordings that have multiple segments (I see your code does that already). I'm also going to look into adding a filesize check like you suggested, and not fire comskip.exe until the file actually has data. Thanks again. |
#1579
|
|||
|
|||
I think I've got all of the bugs worked out now. See below for the groovy script.
A few notes:
I hope this script can help out people out. I know a little bit of programming so that helped, but groovy was completely new to me. Code:
ComskipPath = "C:/Program Files (x86)/Comskip/comskip.exe" iniDirectory = "C:/Program Files (x86)/Comskip/" DefaultIniFile = "comskip.ini" def ruleList = [] //each line defines which channels to use a particular .ini with //just add another line with the same format to define additional files ruleList.push('amc.ini>AMCCHD|CIIIDT') ruleList.push('second.ini>WDIVDT|ECAN') ruleList.push('third.ini>FXCHD|WUHFDT|MCHD') /****************************************************************************************/ /* No changes needed below this line **/ /****************************************************************************************/ Object mf = MediaFileAPI.GetMediaFileForID(SJQ4_METADATA.get("SJQ4_ID").toInteger()) def channel = AiringAPI.GetAiringChannelName(mf) def IniFileToUse = DefaultIniFile for (String item : ruleList) { def (inifile, channels) = item.tokenize('>') channels = /${channels}/ if(channel =~ channels) { println "Use '${inifile}' for channel ${channel}" IniFileToUse = inifile break } } if (IniFileToUse == DefaultIniFile) { println "Channel didn't match any rules. Use default '${DefaultIniFile}' for channel ${channel}" } def failed = false for(int i = 0; i <= SJQ4_METADATA["SJQ4_MAX_SEGMENT_INDEX"].toInteger(); ++i) { def arg = "--ini=${iniDirectory}${IniFileToUse}" def segment = SJQ4_METADATA["SJQ4_PATH"] + "/" + SJQ4_METADATA["SJQ4_SEGMENT_${i}"] File fileseg = new File(segment) for (i = 0; i < 3; i++) { if (fileseg.length() == 0) { println "File is empty. Sleeping 30 seconds." sleep(30000) if (i == 2) { println "File was empty, could not process." return 1 } } else { break } } def exe = [ComskipPath, arg, segment] def edlFile = "${segment}.edl" if (Utility.IsFilePath(edlFile)) continue; def p = exe.execute() p.consumeProcessOutput(System.out, System.err) p.waitFor() def rc = p.exitValue() if(rc < 0 || rc > 1) // Task failed, but run against the rest of the segments anyways... failed = true } return failed ? 1 : 0 |
#1580
|
|||
|
|||
Does anyone have SJQ v4 working under Sage V9? I have installed V9 and installed three plugins: SJQ, SJQ UI and SJQ Agent (Task Client). But I don't get a SJQ entry in my Setup menu as I do under my V7 server.
In addition the SQJ Web UI says "Not compatible" I wonder if that is really the case or if it just doesn't like V9 as the version number?
__________________
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 |
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 |