|
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 |
#281
|
|||
|
|||
Task definition - non-environment data
Could anyone provide an example of how media information can be passed to the task executable if that information is not available via pre-defined environment variable? Specifically, I have created a groovy script that will be run via the cron function that will assign tasks to media objects based on various criteria. The task executables are Windows batch files. The first argument to the batch file is the path and file name of the media file, and that information is available via "$SJQ4_PATH/$SJQ4_LAST_SEGMENT". However the second argument needs to be the information contained in the MediaFileAPI.GetMediaFileFormatDescription string, which is not available as an environment variable. In SJQv3 I could use "$.GetMediaFileFormatDescription{}", but I do not think that will work in the new version.
Thanks.
__________________
Andrew |
#282
|
|||
|
|||
Quote:
String desc = MediaFileAPI.GetMediaFileFormatDescription(mf) Then use the desc variable as an argument to the batch file you're calling (presumably from groovy). You'd pull the path and file names in similar fashion using the MediaFileAPI and pass those as arguments to the batch file as well.
__________________
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... |
#283
|
|||
|
|||
Quote:
Neither upper or lowercase extension worked. |
#284
|
|||
|
|||
Quote:
Hope this makes more sense this time. Thanks.
__________________
Andrew |
#285
|
|||
|
|||
@awhenry Yeah, I see what you're saying. I need to support dynamic editing of task arguments, it's the only way you'll be able to do it. You'll probably want to ticket this issue to remind me. With that said, this is a big enough change that it's going to be some time (I'm still not quite out of vacation mode - as far as my Sage dev work goes). Until this feature is added, the only way to do it is as I've described by wrapping your batch file call within a groovy script and pulling the required args via groovy and calling your batch file.
__________________
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... |
#286
|
||||
|
||||
Slugger, a couple of rambling questions on cron based tasks. Getting some weird behavior and need clarification on the way some things work these beasties.
I'm trying do a mediashrink task on watched shows that have been sitting around a while. I'm testing this through "Queue Task" and not actually using cron yet. When I run the task without the actual p.waitFor(), process execution, the test script log tells me everything is going well and ends up in the Completed Task list. However, when I actually fire off mediashrink, it proceeds as expected, handbrake runs and finishes, the mkv is produced, but the test script log file is empty except for "The process was killed by SJQ." But here's the really odd thing, the task is executed again! With mediashrink recompressing the mpg (obviously I haven't deleted the MPG yet in the script). This will repeat ad nasueum until I manually kill off mediashrink (and after many attempts) remove the task from the queue. Why is it behaving so differently simply because i'm executing an outside command?? And why does it repeat itself? The only change is adding the cmdline, execute() and waitFor(). Eventually there will be tags on the metadata and all that, but it still shouldn't refire itself like it appears to be doing. I imagine it has something to do with the way the script is returning. I'm not sure it's even coming back to my script to be honest. BTW, sometimes it can be a real pain to kill off a task and I have to disable the client to do it. ); Is it wise to do cron tasks without an executable stated for the task? Is that even allowed? Or would it be better to set an environment variable (though I think you said that can't be done within cron jobs) and pass it up to the executable that way? And one more, in a cron task, what value needs to be returned and where to have a task marked "Completed" and not "Failed" or "Returned"? Haven't figured that out yet either.
__________________
Server: AMD 9600 Phenom on XP, Gigabyte GA-MA78GPM, 2GB RAM, 320+250+500 GB SATA drives, HDHomeRun Prime, HD-PVR x.5.1, Paterson serial Client/Encoder:AMD 3800+ X2, 512 MB RAM, ATI X1650 XT, nMediaPC case, Hauppauge HD-PVR, Cyberlink/ArcSoft decoders, USB-UIRT Client/Encoder: AMD 3800+ X2, 512 MB RAM, 6150 graphics, nMediaPC case, ArcSoft decoders Client: HD300, Asus Pundit P1-AH1, AMD 3800+ X2 CPU, 1 GB RAM, 6150 graphics, ArcSoft decoders Backup: Synology SageTV version: FINAL |
#287
|
||||
|
||||
Quote:
__________________
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. |
#288
|
||||
|
||||
made some progress. setup an empty batch script in as an executable, that solved the "Completed" task status.
but still having issues with running mediashrink from within the groovy script as a process. It is not completing from within the script when given something to process. if I don't give it any parameters, it errors out and I get all the output, captured in consumeProcessesOutput(). But If pass in something to shrink, the compressing occurs, an MKV file is produced but my script is never returned to, almost like SJQ isn't waiting long enough (BTW, I have Max Time set to 1 day). Also it looks like Java no longer has control of mediashrink as it's out of the Java process tree when it starts to run Handbrake. And because the script hasn't "finished" , SJQ just calls my task all over again. And again and again. I'm missing something somewhere. I'm beginning to think this isn't going to work unless I pass the media file up to MediaShrink as an executable as part of the task. Anyone else trying to run mediashrink as a process in their script?
__________________
Server: AMD 9600 Phenom on XP, Gigabyte GA-MA78GPM, 2GB RAM, 320+250+500 GB SATA drives, HDHomeRun Prime, HD-PVR x.5.1, Paterson serial Client/Encoder:AMD 3800+ X2, 512 MB RAM, ATI X1650 XT, nMediaPC case, Hauppauge HD-PVR, Cyberlink/ArcSoft decoders, USB-UIRT Client/Encoder: AMD 3800+ X2, 512 MB RAM, 6150 graphics, nMediaPC case, ArcSoft decoders Client: HD300, Asus Pundit P1-AH1, AMD 3800+ X2 CPU, 1 GB RAM, 6150 graphics, ArcSoft decoders Backup: Synology SageTV version: FINAL Last edited by phelme; 01-13-2011 at 06:43 PM. |
#289
|
|||
|
|||
Quote:
|
#290
|
|||
|
|||
Glad I could help sort something out! And no worries, it's a minor annoyance, not a huge problem. Appreciate all the hard work you and slugger are doing on this!
|
#291
|
|||
|
|||
Quote:
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... |
#292
|
|||
|
|||
I was just about to report this as well, but I had a hard time recreating it... It happens for me on the queue more than the completed tasks.
|
#293
|
|||
|
|||
Quote:
|
#294
|
|||
|
|||
Quote:
Thanks for the help nevertheless.
__________________
Andrew |
#295
|
|||
|
|||
Quote:
For anyone interested, I had to include these import lines to get my scripts running in Eclipse (and left them in to no ill effect when running on the task clients): Code:
import com.google.code.sagetvaddons.metadata.Factory; import sagex.api.*; I am guessing that you would need to run eclipse on the same machine the Sage server is running on in order for this to work (this is what I did, but I did not try any other setup). Additionally, you will want the 32-bit version of Eclipse regardless of your platform (I did try the 64-bit one, and it had problems with the H2 database). Hope this helps, and good luck!
__________________
Andrew |
#296
|
|||
|
|||
Quote:
Quote:
As far as having to run these setups on the same box as Sage, that's not true. Since SJQv4 utilizes the remote APIs, you can run it from anywhere. You may get some unexpected results if you have more than one Sage server on the LAN with the remote APIs installed, but if you just have one server on the LAN then you shouldn't have any problems running it from any host within the LAN.
__________________
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... |
#297
|
|||
|
|||
I'm very shamed and sorry to ask in public but theres lots and lots of pages of information and I dont have much additional time to read them without first knowing what exactly SJQv4 do in simple way?
|
#298
|
|||
|
|||
In one sentence, SJQ allows you to automate tasks associated with your SageTV environment. SJQ (v4, especially) is a scripting platform and task queue management system that allows users to script and automate task execution across multiple hosts. Plenty of docs and discussion available to read on here for more 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... |
#299
|
|||
|
|||
Quote:
|
#300
|
|||
|
|||
I think the most popular use would be to selectively schedule comskip processing of certain recordings while skipping others. People use it in all kinds of ways. I use it for comskip and I also use it to selectively archive certain recordings and move them from my Sage server to my NAS. Others use it to transcode their recordings. Others use it to schedule "safe" restarts of their Sage tv systems. Basically, if there's a task you want to do periodically with your system, the SJQ platform helps with it.
__________________
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 |