|
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 |
#1381
|
||||
|
||||
CommercialDetector is stand alone, it does not use SJQ in any way. There are two parts: a UI Mod and a General plugin.
Install the general plugin on the server (only once) and it will generate the .edl files. It won't hurt anything if you install the general plugin on the clients, but it doesn't get you anything. The UI mod plugin will probably not work on SageMC, but you can give it a shot. Install the UI plugin on each client.
__________________
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. |
#1382
|
|||
|
|||
My software clients are running either Sagemc or Phoenix.
Are you suggesting that the UI mod will not work on the software clients? I am confused as to why I need it on these software clients at all... once the EDL files are generated both SageMC and Phoenix know how to handle them.... am I missing something? On the server, I typically also run SageMC... if I install the server plugin only without the UI mod then how do I administer the Commercial Detector? Does it not require the UI mod to configure? Thanks in advance. |
#1383
|
|||
|
|||
One use case that I don't think CommercialDetector handles: I sometimes like to start watching something while it's still recording and have the commercials marked, (mostly used for sports). Unfortunately my kids are now getting into watching a game and texting their friends about it in real-time...sigh.
__________________
Home Network: https://karylstein.com/technology.html |
#1384
|
||||
|
||||
Quote:
On the server the UI Mod is not needed. All setup is done through the General Plugin settings.
__________________
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. |
#1385
|
||||
|
||||
CommercialDetector handles this just fine. Probably best to move this conversation to the appropriate thread.
__________________
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. |
#1386
|
|||
|
|||
moved my questions to 'Commercial Detector' plugini thread...
|
#1387
|
||||
|
||||
I'm having problems with a script I haven't used for a year or so and am now trying to resurrect. It used to work back in 2012, but a few updates have happened since and I think somewhere in there is the problem....
Basically I've got a bit of code I'm trying to run as a executable that's at a location with a space in the directory path. The location is "C:\Program Files\Handbrake" The bit of code is this: Code:
def i = 1 def file = new File(FullHBFile) while(file.exists()) file = new File(HBDir, "$Prefix-${i++}.ts") FullHBFile = file def command = """C:\\Program Files\\Handbrake\\HandBrakeCLI.exe""" + """ -i "${FullCutFile}" -o "${FullHBFile}" -e x264 -f mkv -q 20 -x ref=3:mixed-refs=2:bframes=3:b-pyramid=1:b-rdo=1:bime=1:weightb=1:subme=6:trellis=1:analyse=all:8x8dct=1:vbv-maxrate=25000 -5 -E copy:dts,AAC,ac3 --audio-fallback ac3 -6 none""" println "full command will be '$command'" if(!Settings.TEST_MODE) { // Are we running test mode, if not do this def proc = command.execute() def initialSize = 4096 def outStream = new ByteArrayOutputStream(initialSize) def errStream = new ByteArrayOutputStream(initialSize) proc.consumeProcessOutput(outStream, errStream) proc.waitFor() println 'out:\n' + outStream println 'err:\n' + errStream I know I've run into this with java/groovy passing executables to windows7 with spaces in the the path cutting the command off at the first space but have no idea how to work around the issue. Any suggestions? |
#1388
|
|||
|
|||
Make command a list of strings and then you don't have to worry about it.
For example: Code:
def cmd = ['C:/Program Files/my.exe', 'arg1', 'arg2', 'arg3'] // Redirect output, etc. def proc = cmd.execute() proc.waitFor() // Do whatever you need to do after the exe runs
__________________
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... |
#1389
|
||||
|
||||
Thanks Slugger, I'll give it a go, think I already did but syntax kills me everytime... it'd be easier to test if I could get sagegroovy working, did you see the post on the license server thread? If not, I can't get the new sagegroovy running kicking out a license error... I can provide more info if it helps get that handy environment going again.
|
#1390
|
|||
|
|||
Replied to the other message. Basically just copy the salicense.jar from SageTV\JARs\ into SageGroovy's libs folder (replacing the existing one). That should fix it up.
__________________
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... |
#1391
|
||||
|
||||
When I doing as suggested I rewrite the command from:
Code:
// def command = """C:\\Program_Files\\Handbrake\\HandBrakeCLI.exe""" + """ -i "${FullCutFile}" -o "${FullHBFile}" -e x264 -f mkv -q 20 -x ref=3:mixed-refs=2:bframes=3:b-pyramid=1:b-rdo=1:bime=1:weightb=1:subme=6:trellis=1:analyse=all:8x8dct=1:vbv-maxrate=25000 -5 -E copy:dts,AAC,ac3 --audio-fallback ac3 -6 none""" Code:
def command = ['C:\\Program Files\\Handbrake\\HandBrakeCLI.exe', '-i ${FullCutFile}', '-o ${FullHBFile}', '-f', 'mkv', '-q', '19', '-x', 'ref=3:mixed-refs=2:bframes=3:b-pyramid=1:b-rdo=1:bime=1:weightb=1:subme=6:trellis=1:analyse=all:8x8dct=1:vbv-maxrate=25000', '-5', '-E', 'copy:dts,AAC,ac3', '-audio-fallback', 'ac3', '-6', 'none', '-6', 'none'] Here's the whole script in case it helps.... and this DID work about a year ago so I'm at a loss what changed, but the handbrakecli.exe has always been finicky about the variables passed which is why it was done the way it was, though that said, this seems to be playing nicely if I could just get the values of the variables passed.... Code:
def SJQ4_METADATA = ["SJQ4_ID":"2873786", "SJQ4_TYPE":"MediaFile"] // remove the above line before using the scirpt in SJQv4. import org.apache.commons.io.FilenameUtils import org.apache.commons.io.FileUtils class Settings { static public final boolean TEST_MODE = false } def mf = MediaFileAPI.GetMediaFileForID(SJQ4_METADATA["SJQ4_ID"].toInteger()) if(mf == null) { //make sure it's a valid file id println "Invalid media file id! [${SJQ4_METADATA['SJQ4_ID']}]" return 1 } // Elements Definition def CutDir = ((MediaFileAPI.GetParentDirectory(mf).toString()) + "\\") def HBDir = "C:\\Users\\Sage\\Videos\\com_free\\handbrake\\" def Prefix = FilenameUtils.getBaseName(MediaFileAPI.GetFileForSegment(mf, 0).getAbsolutePath()) def SourceFile = MediaFileAPI.GetFileForSegment(mf, 0) // Construction zone def CutFile = new File(Prefix + ".ts") def HBFile = new File(Prefix + ".mkv") def FullCutFile = "C:\\Users\\Sage\\Videos\\com_free\\" + CutFile def FullHBFile = HBDir + HBFile // Don't compress these, just move them to final location if(MediaFileAPI.GetMediaTitle(mf) =~ /News|Breaking Bad|NFL|Burn Notice|MythBusters|Journal|Racing|racing|AMA|race/){ println "We got Racing or something else we'll keep uncompressed!" FullCutFile2 = new File(FullCutFile) try { FileUtils.moveFile(SourceFile, new File(HBDir + CutFile)) } catch(IOException e) { e.printStackTrace() } return 0 } // Shrink-i-dink with HandBrake def i = 1 def file = new File(FullHBFile) while(file.exists()) file = new File(HBDir, "$Prefix-${i++}.ts") FullHBFile = file // def command = """C:\\Program_Files\\Handbrake\\HandBrakeCLI.exe""" + """ -i "${FullCutFile}" -o "${FullHBFile}" -e x264 -f mkv -q 20 -x ref=3:mixed-refs=2:bframes=3:b-pyramid=1:b-rdo=1:bime=1:weightb=1:subme=6:trellis=1:analyse=all:8x8dct=1:vbv-maxrate=25000 -5 -E copy:dts,AAC,ac3 --audio-fallback ac3 -6 none""" def command = ['C:\\Program Files\\Handbrake\\HandBrakeCLI.exe', '-i ${FullCutFile}', '-o ${FullHBFile}', '-f', 'mkv', '-q', '19', '-x', 'ref=3:mixed-refs=2:bframes=3:b-pyramid=1:b-rdo=1:bime=1:weightb=1:subme=6:trellis=1:analyse=all:8x8dct=1:vbv-maxrate=25000', '-5', '-E', 'copy:dts,AAC,ac3', '-audio-fallback', 'ac3', '-6', 'none', '-6', 'none'] println "full command will be '$command'" if(!Settings.TEST_MODE) { // Are we running test mode, if not do this def proc = command.execute() def initialSize = 4096 def outStream = new ByteArrayOutputStream(initialSize) def errStream = new ByteArrayOutputStream(initialSize) proc.consumeProcessOutput(outStream, errStream) proc.waitFor() println 'out:\n' + outStream println 'err:\n' + errStream //relink ExternalID to new file // the three minute rule applies, so reinit this variable. mf = MediaFileAPI.GetMediaFileForID(SJQ4_METADATA["SJQ4_ID"].toInteger()) def src = (FullHBFile.toString()) println "fullpathfile is=$src" def sid = ShowAPI.GetShowExternalID(mf) println "ExternalID is ${sid}" if(!Utility.IsFilePath(src)) { println "${src} does not exist!" return 1 } if(MediaFileAPI.GetMediaFileForFilePath(new File(src)) != null) { println "${src} is already a registered SageTV media file!" return 1 } def show = ShowAPI.GetShowForExternalID(sid) if(show == null) { println "ShowEID ${sid} is invalid!" return 1 } def mfadd = MediaFileAPI.AddMediaFile(new File(src), null) if(mfadd == null) { println "Failed to add media file!" return 1 } if(!MediaFileAPI.SetMediaFileShow(mfadd, show)) { println "Failed to link show metadata to media file!" return 1 } MediaFileAPI.MoveTVFileOutOfLibrary(mfadd) println "Imported '${src}' and linked it to ShowEID '${sid}'!" // Delete the CUT file MediaFileAPI.DeleteFile(mf) // Delete any flac associated with the CUT file Utility.DirectoryListing(new File(CutDir)).each { if(FilenameUtils.wildcardMatchOnSystem(it.getName(), "${Prefix}.*")) { def fileName = new File(CutDir, Prefix + (it.getName().substring(it.getName().indexOf('.')))) try { fileName.delete() } catch(IOException e) { e.printStackTrace() } } } return 0 } else { // if we are in test mode do this println "Would run '$command' if test mode were disabled!" |
#1392
|
|||
|
|||
Quote:
That's two separate arguments, so def cmd = ['C:\\Program Files\\Handbrake\HandBrakeCLI.exe', '-i', FullCutFile, '-o', FullHBFile, '-f', 'mkv', '-q', '19', ...]
__________________
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... |
#1393
|
||||
|
||||
Of course it is!
. Having read a bunch about argument use and when to use the $ and {} I'm still bamboozled by it all, thx as always for helping. |
#1394
|
|||
|
|||
Error message running groovy script.
I have been using the groovy script, late_night_talk_alerts.groovy, (thanks Slugger) successfully for some time. I recently had to re-install window 7 and sage (see my thread in the hardware category) and now I receive the error message I've attached as a screen shot. I haven't changed any settings other than updating Java to 1.7.45. Any suggestions?
|
#1395
|
|||
|
|||
You were running an older version of groovy. In the script there's a line like:
private class EmailSettings Just remove the word private and you should be good to go.
__________________
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... |
#1396
|
|||
|
|||
That worked, thanks.
|
#1397
|
||||
|
||||
Okay, so I'll be honest, this is actually the first time I've used SJQ v4. It has come out of a desire to auto-reset my R5000HD network encoder if there are more than 2 halts in a given recording. I've created a task called R5000HALT, and assigned it to the system message event. I've reated a pretest script to check for the message type and the count, and only execute my task if it is a halt, on that tuner, with a count >2.
CheckMsfForHalt.groovy: Code:
println "System Message event generated with:"; println SJQ4_METADATA.toMapString(); if(SJQ4_METADATA.get("SJQ4_MSG_TYPE")=="Halt Detected in Recording") { println "This event is a halt event"; if(SJQ4_METADATA.get("SJQ4_TEXT").contains("VIP-211-1")) { println "This event is from the VIP-211-1 - proceeding..."; if (Integer.parseInt(SJQ4_METADATA.get("SJQ4_COUNT")) > 2) { println "Event Count > 2 - performing reset..."; return 0; } else { println "Event Count < 3 - skipping..."; return 2; } } else { println "This event is NOT from the VIP-211-1 - clearing event"; return 2; } } else { println "Not a halt event - skipping."; return 2; } I have temporarily set it to only reset on a count of 2, so once the 3rd comes in it won't do anymore - I'm hoping that's enough, but that runs the risk of NOT resetting later in a program if it goes wonky again (as I THINK the count will remain above 2. plus, if everything resets fine, i'd prefer to actually purge the events from the log, and perhaps generate my own event stating that it was reset automatically. Can't do any of that unless I can figure out how to actually delete the message from either the task of the pretest.
__________________
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 |
#1398
|
||||
|
||||
You know, i just realize I can likely create a much more extensive script for my actual task, and have it retrieve all messages from the server via the API, and systematically delete all of them associated with this particular tuner/show. Just means I have to learn a LOT more about groovy than just println, if-else, and return...
__________________
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 |
#1399
|
|||
|
|||
If it helps, groovy is a superset of Java. Valid Java code is valid groovy code (with very few exceptions -- so few they're not worth mentioning).
As you said, I'd just grab the sys msgs via Sage API calls (using sagex, it's on the classpath, just import sagex.api.*) and delete the one(s) you need to.
__________________
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... |
#1400
|
||||
|
||||
Quote:
As to the API calls, do i need to bring in sagex? I was under the impression that the sage API was mapped to the script engine via the Global class. So i should be able to call the Global.SystemMessageAPI.GetSystemMessages and iterate through that, correct?
__________________
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 |
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 |