SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Closed Thread
 
Thread Tools Search this Thread Display Modes
  #741  
Old 06-15-2009, 09:31 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by rsagetv99 View Post
Also, can you or slugger help me with the error that I am still getting? "Cannot get MediaFile object from database!"
A task is queued for a media file and before the task is assigned to a client the media file has gone missing (typically happens when processing live tv recordings and those recordings are deleted by Sage before the task is assigned to a client).
__________________
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...
  #742  
Old 06-15-2009, 09:38 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Quote:
Originally Posted by rsagetv99 View Post
That worked! Thanks

Can you tell me why?

Also, can you or slugger help me with the error that I am still getting? "Cannot get MediaFile object from database!"
It has to do with the "/I" switch.... mediashrink needs a new DOS environment to run.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
  #743  
Old 06-16-2009, 08:59 AM
rsagetv99's Avatar
rsagetv99 rsagetv99 is offline
Sage Fanatic
 
Join Date: Nov 2004
Posts: 766
Quote:
Originally Posted by nyplayer View Post
It has to do with the "/I" switch.... mediashrink needs a new DOS environment to run.
I guess I spoke to soon. It was working, but now for some reason the job gets stuck on "Started" in SJQ. I tried running the job manually from a command-line using the same batch and it works fine.

Any ideas?
  #744  
Old 06-16-2009, 09:19 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Tasks that get stuck in started state do so for one of two reasons:

1) The client tried to send the signal back to the server that it has successfully started the task, but that attempt failed (check client log files to see if that happened); if this is the case then the program you triggered should still be running and when it completes the client should then attempt to signal the server that it finished.

2) The client crashed before it could signal the server. Did the client crash? If so, I'd like to know about it (and if you can reproduce it that's waaaaay better).
__________________
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...
  #745  
Old 06-16-2009, 09:52 AM
rsagetv99's Avatar
rsagetv99 rsagetv99 is offline
Sage Fanatic
 
Join Date: Nov 2004
Posts: 766
Well that was weird. I checked the client log and there noticed a bunch of "connection refused" errors followed by http 413 errors.

I stopped the service and in the sjqc.properties file I changed "host=localhost" to "host=127.0.0.1", brought the service back up and it started working.

It wasn't just a matter of restarting the service either, because I had tried that several times and had even tried rebooting.

Thanks for the help.
  #746  
Old 06-16-2009, 10:00 AM
rsagetv99's Avatar
rsagetv99 rsagetv99 is offline
Sage Fanatic
 
Join Date: Nov 2004
Posts: 766
Should this test work, because I don't think that it does.

&& ChannelNumber !% "5[00-40]"

In the rule definition I am trying to target every channel except 500-540.
  #747  
Old 06-16-2009, 10:19 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by rsagetv99 View Post
Should this test work, because I don't think that it does.

&& ChannelNumber !% "5[00-40]"

In the rule definition I am trying to target every channel except 500-540.
Nope. That regex, I do believe, will check for channels 50-54. Try this instead (untested):

ChannelNumber !% "5(?:[0-3][0-9]|40)"

That regex should test for the values "5 followed by a 0-3 followed by a 0-9" (ie. 500-539) or "5 followed by 40" (ie. 540).
__________________
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...
  #748  
Old 06-16-2009, 10:50 AM
rsagetv99's Avatar
rsagetv99 rsagetv99 is offline
Sage Fanatic
 
Join Date: Nov 2004
Posts: 766
Quote:
Originally Posted by Slugger View Post
ChannelNumber !% "5(?:[0-3][0-9]|40)"
That regex should test for the values "5 followed by a 0-3 followed by a 0-9" (ie. 500-539) or "5 followed by 40" (ie. 540).
Wow, that's complicated. I don't think I saw ?: in the documentation, what does it do?

Also, how does SJQ know which directories to monitor? Does it take just your recordings/imports directory settings from Sage and monitor those? The reason I ask, is because I want to create a job that is triggered by the contents of a non-Sage directory.
  #749  
Old 06-16-2009, 11:49 AM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Quote:
Originally Posted by rsagetv99 View Post
Wow, that's complicated. I don't think I saw ?: in the documentation, what does it do?

Also, how does SJQ know which directories to monitor? Does it take just your recordings/imports directory settings from Sage and monitor those? The reason I ask, is because I want to create a job that is triggered by the contents of a non-Sage directory.
The ?: isn't really necessary - just a habit of mine. It prevents the group from being captured (very important when optimizing regex processing for some tasks that I used to do for work). You could remove the ?: and just use:

"5([0-3][0-9]|40)"

and that should work just fine.

SJQ gets its media list from Sage, which in turn comes from the defined recording/import directories. You can still trigger things based on the existence (or lack there of) of a file anywhere in the server's file system by using the FileExists test. However, SJQ does not read the contents of any files - it only can test if they exist or not.
__________________
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...
  #750  
Old 06-16-2009, 01:58 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Slugger,

I use the built in transcoder to move files to my NAS is there a way to specify a new name in the :TRANSCODEOPTS

See my rule below

Code:
if [IsSomethingRecording == "false" && IsTV == "true" && IsActivelyRecording == "false" && IsArchived == "false" && IsManualRecord == "true" && Filename =$ ".mp4" && FileExists != "s:\\temp\\%p%.working" && FileExists == "////GForceNAS//sagetvnas//connected.txt" && FileExists != "c:\\oktoreboot.txt" && (Filename =^ "J:" || (Filename =^ "j:" || (Filename =^ "M:" || (Filename =^ "m:" || (Filename =^ "N:" || (Filename =^ "n:" || (Filename =^ "O:" || (Filename =^ "o:"))))))))]{
   :TRANSCODEOPTS "Copy-MP4 Move Play" "false" "////GForceNAS//sagetvnas//sagetv"
    :PRIORITY 252
   _TRANSCODE
}

My Profile
Code:
transcoder/formats/Copy-MP4\ Move\ Play=f\=mp4;[bf\=vid;f\=copy;][bf\=aud;f\=copy;]
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.

Last edited by nyplayer; 06-16-2009 at 02:00 PM.
  #751  
Old 06-16-2009, 02:20 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Should just be able to append a file name to the end of the path. If a file name is specified, Sage is suppose to honour it, otherwise it will generate a file name of its own in the specified directory. I believe I tested this feature and it worked when I tested it (awhile ago, haven't actually used it since).
__________________
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...
  #752  
Old 06-16-2009, 03:54 PM
rsagetv99's Avatar
rsagetv99 rsagetv99 is offline
Sage Fanatic
 
Join Date: Nov 2004
Posts: 766
Quote:
Originally Posted by nyplayer View Post
It has to do with the "/I" switch.... mediashrink needs a new DOS environment to run.
Hey nplayer or slugger, if you are running a job via a batch file, is there a way to make the job send the console ouput to SJQ? I am trying to run the command with the >CON added, but it doesn't seem like it is working. Here's my command from the batch.
Code:
start /I /BELOWNORMAL /MIN /WAIT mediaShrink.exe %COMMAND% /defaultProfile autoEncode /onePass /savelog >CON 2>&1
Actually, I don't think that it is possible, since the start command starts the process in a new cmd session. Is there another way to do it?

Last edited by rsagetv99; 06-16-2009 at 03:57 PM.
  #753  
Old 06-16-2009, 04:38 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Mediashrink does it's own logging. Therefore you cannot get it to SJQ.

PS why would you want all that logging? in your SJQ DB
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
  #754  
Old 06-16-2009, 05:01 PM
rsagetv99's Avatar
rsagetv99 rsagetv99 is offline
Sage Fanatic
 
Join Date: Nov 2004
Posts: 766
Quote:
Originally Posted by nyplayer View Post
Mediashrink does it's own logging. Therefore you cannot get it to SJQ.

PS why would you want all that logging? in your SJQ DB
I was referring to the console logging that occurs when you run mediashrink manually, not all of the logging in the logfiles that are created by mediashrink.

When I ran the mediashrink executable directly from SJQ, instead of via a batch file, I would get the logging. This was helpful in troubleshooting problems, allowing me to see the errors without remoting into the Sage server.

As for the SJQ db, I could have it to purge the logs every day to keep the DB cleaned up.

BTW, you are able to run mediashrink directly right? Or were you forced to use a batch file as well?
  #755  
Old 06-16-2009, 05:49 PM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Quote:
Originally Posted by rsagetv99 View Post
I was referring to the console logging that occurs when you run mediashrink manually, not all of the logging in the logfiles that are created by mediashrink.

When I ran the mediashrink executable directly from SJQ, instead of via a batch file, I would get the logging. This was helpful in troubleshooting problems, allowing me to see the errors without remoting into the Sage server.

As for the SJQ db, I could have it to purge the logs every day to keep the DB cleaned up.

BTW, you are able to run mediashrink directly right? Or were you forced to use a batch file as well?
Yes I run it like this

SHRINK {
:CPU BELOWNORMAL
:MAX 1
"C:\\SHRINK\\mediaShrink.exe \"%c%\" /inPlace /divx /cutComm /cliBitrate 1000 /onePass /horizontalScale 512 /mp4"
}
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
  #756  
Old 06-17-2009, 10:01 AM
rsagetv99's Avatar
rsagetv99 rsagetv99 is offline
Sage Fanatic
 
Join Date: Nov 2004
Posts: 766
Quote:
Originally Posted by Slugger View Post
Should just be able to append a file name to the end of the path. If a file name is specified, Sage is suppose to honour it, otherwise it will generate a file name of its own in the specified directory. I believe I tested this feature and it worked when I tested it (awhile ago, haven't actually used it since).
So would this work?

Code:
:TRANSCODEOPTS "Copy-MP4 Move Play" "false" "%d%/%t%.%e%"
Also Nplayer, I was disecting your rule, and I had a couple questions. I get most of it, like checking for a file on your NAS to make sure you are connected, but I am not sure what the last part does.

I guess maybe you have another job that reboots your system if the "oktoreboot.txt" exists, which is probably generated when you have nothing else scheduled right? Can you share this rule? I would like to do something similar.

Also, what are all of the file doesn't start with "X:" checks you are doing at the end?
  #757  
Old 06-17-2009, 10:35 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
Rebooting Sage Box. I have all my rules check to make sure "c:\\oktoreboot.txt" does not exist. This prevents new tasks from being scheduled after 4:00 am on sunday


rule
Code:
//Ok To Reboot
if [IsSomethingRecording == "false" && IsActivelyRecording == "false" && TranscodeQueueSize < "1" && TimeUntilNextRecording > "30M" && FileExists == "c:\\oktoreboot.txt" && Title == "Not Recording"]{
    :PRIORITY 110
      OKTOREBOOT
}
1. I created a small mpg.... Deposited it in one of my sage imports folders... used the webserver to change the title to "Not Recording"

2. I schedule a task to run every sunday at 4:00 am to create "c:\\oktoreboot.txt" on my server using task scheduler.

createoktoreboot.bat
Code:
echo "ok to reboot" >c:\oktoreboot.txt
3. My client rule

Code:
OKTOREBOOT {
:CPU NORMAL
:MAX 1
  "c:\\sagebatch\\rebootsagebox.bat \"%c%\""
}
4. my rebootsagebox.bat..... I also reboot my client... and cleanup temp files. Exit 1 makes it fail so that SJQ will run it again next weekend ( I have failed tasks to always be retried).

Code:
del c:\oktoreboot.txt
del "C:\Documents and Settings\All Users\Application Data\TEMP" /q
start shutdown -m \\sageclient -r -f -t 60
start shutdown -r -f -t 2
exit 1

PS also if I want to reboot Sage at the next convenient time i simply create "c:\oktoreboot.txt"
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.

Last edited by nyplayer; 06-17-2009 at 10:52 AM.
  #758  
Old 06-17-2009, 10:49 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
X: etc...
That is just checking to make sure that my MP4 start with those particular drives. I use a capital and small letter just in case. This insures that if i were to loose my SJQ db I can recreate the rules and not worry about The mp4's I have in my NAS getting transcoded.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
  #759  
Old 06-17-2009, 02:04 PM
rsagetv99's Avatar
rsagetv99 rsagetv99 is offline
Sage Fanatic
 
Join Date: Nov 2004
Posts: 766
Quote:
Originally Posted by nyplayer View Post
X: etc...
That is just checking to make sure that my MP4 start with those particular drives. I use a capital and small letter just in case. This insures that if i were to loose my SJQ db I can recreate the rules and not worry about The mp4's I have in my NAS getting transcoded.
So Slugger, I guess that means the the "Filename" test, includes the path+filename and not just the name of the file?
  #760  
Old 06-17-2009, 02:33 PM
Slugger Slugger is offline
SageTVaholic
 
Join Date: Mar 2007
Location: Kingston, ON
Posts: 4,008
Without looking it up, I'd guess the answer is yes. You can confirm, if necessary, by checking out the SageTV API call (under the MediaFileAPI). If that call returns the full path of the file, then that's what SJQ uses to process the test.
__________________
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...
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin: Sage Job Queue (SJQ) v3 Slugger SageTV Customizations 1355 07-25-2013 07:44 AM
Sage Job Queue (SJQ) new release notifications Slugger Customization Announcements 3 12-17-2009 09:59 AM
Sage Job Queue Completed tasks problem raffmanlt SageTV Customizations 2 08-18-2009 07:34 PM
Comskip Monitor VS Sage Job Queue SJQ personalt SageTV Customizations 6 03-02-2009 10:27 AM
Plugin: SJQ v1.1.0RC1 Available - Testers Needed Slugger SageTV Customizations 35 04-21-2008 08:12 AM


All times are GMT -6. The time now is 10:00 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.