|
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. |
|
Thread Tools | Search this Thread | Display Modes |
#121
|
|||
|
|||
hey Slugger,
any idea why SJQ would not let mediashrink finish out it's job? it will encode my video, but then just hangup on the file moving out of the work folder that media shrink creates and not move on from there.
__________________
Server: WHS with 11TB of storage Clients:1) HD-200 to a Samsung 32" Slimfit CRT HDTV 2) HD-200 to a Pioneer 26" X1 LCD Tuners: 1) HD-Homerun 2) Avermedia USB ATSC Twitter: ohpleaseno |
#122
|
|||
|
|||
Quote:
What you need to do is save the logs from mediashrink and post for penguin. PS I have had problems with Mediashrink creating MP4 with closed captions where it fails on the mp4 merge. I stopped using mediashrink instead use handbrake by itself... through batch file.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct. |
#123
|
|||
|
|||
I'm still confused as to why I have no problem with Mediashrink using drag and drop, but it hangs up when I use SJQ. I figured it would be a mediashrink problem, but I thought it was worth a shot anyway to ask over here.
thanks!
__________________
Server: WHS with 11TB of storage Clients:1) HD-200 to a Samsung 32" Slimfit CRT HDTV 2) HD-200 to a Pioneer 26" X1 LCD Tuners: 1) HD-Homerun 2) Avermedia USB ATSC Twitter: ohpleaseno |
#124
|
|||
|
|||
SJQ simply creates a process and waits for it to complete. I don't use mediashrink myself, so I have no experience with it, but SJQ just creates the process and waits for it to finish. As nyplayer said, you will want to pursue the issue with penguin.
__________________
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... |
#125
|
|||
|
|||
can I have SJQ call for the console window of a program it is running to expose itself instead of running in the background?
__________________
Server: WHS with 11TB of storage Clients:1) HD-200 to a Samsung 32" Slimfit CRT HDTV 2) HD-200 to a Pioneer 26" X1 LCD Tuners: 1) HD-Homerun 2) Avermedia USB ATSC Twitter: ohpleaseno |
#126
|
|||
|
|||
Negative. All you can do in Java is create the process and grab its output, which is what I already do and I log that output back to the SJQ server for viewing.
__________________
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... |
#127
|
|||
|
|||
if someone is looking for help here's my transcoding setup
I started out using mediashrink but wanted more control. I then created a script to call handbrake (note: I haven't retried with 0.94), but handbrake couldn't read all of my recordings. So I fell back to mencoder which I've used at previous jobs for automated video transcoding. Mencoder doesn't do closed captioning or multiple audio streams. So I may end up first trying handbrake and using mencoder only if handbrake fails.
I'm finishing my transition from Beyond to Sage. Without SJQ I'd never have finally committed to changing. I want all HD and more customizability. So Sage is the way to go. I plan to post my full SJQ configuration (including scripts) as a tutorial. Until then: My script requires Python 2.6 (+ the win32 package on Windows). It currently only runs on Windows but Mac/Linux support is stubbed out in case someone needs it. I recommend using the ActivePython installer for Windows. Server: # Mencoder # (if the file is not actively recording, and this file came from a tuner, # it is a scheduled recording or a live or an intelligent recording older than 3 hours, # and the filename ends with mpeg, mpg or ts, # and it is over 500MB, and a comskip file exists, # a transcoding file does not exist [the file extension for temporary output files # during the conversion process], # and an avi, divx, mkv or mp4 does not exist) if [IsObjMediaFile == true && $.IsFileCurrentlyRecording{} == false && $.IsTVFile{} == true && ($.IsNotManualOrFavorite{} == false || ($.IsFileCurrentlyRecording{} == false && MediaAge >= "3H")) && (Filename =$ ".mpeg" || Filename =$ ".mpg" || Filename =$ ".ts") && MediaSize > "500M" && FileExists == "%d%\\%p%.edl" && FileExists != "%d%\\%p%.transcoding" && (FileExists != "%d%\\%p%.avi" && FileExists != "%d%\\%p%.divx" && FileExists != "%d%\\%p%.mkv" && FileExists != "%d%\\%p%.mp4")] { :PRIORITY 5 MENCODER } # Delete mpg files where a avi, divx, mkv or mp4 file exists (the mpg has been compressed) # (if this file is not being watched, and it came from a tuner, # an mpg exists, # and a avi, divx, mkv or mp4 file exists) if [IsObjMediaFile == true && IsViewingMedia == false && $.IsTVFile{} == true && $.IsFileCurrentlyRecording{} == false && FileExists == "%d%\\%p%.mpg" && (FileExists == "%d%\\%p%.avi" || FileExists == "%d%\\%p%.divx" || FileExists == "%d%\\%p%.mkv" || FileExists == "%d%\\%p%.mp4")] { :PRIORITY 15 :SCANMEDIA "true" DELETEMPG } Client: MENCODER { //Max of 1 worker at the same time :MAX 1 //This requires 66% of the system's resources :RESOURCES 66 //This task can only run for the 3 times the video's length (the script should kill it at 275%) :MAXRUNRATIO 3.0 //Explicitly check for return code 0 :RETURNCODE 0 "python \"C:\\Programs\\sjq3\\MPlayer\\launch_mencoder.py\" --input-file \"%c%\" --max-duration-percentage 275 --perform-service-wrapper-process-check --perform-local-sage-process-check" } DELETEMPG { //Max of 5 workers at the same time :MAX 5 //This requires 5% of the system's resources :RESOURCES 5 //Run for 1 minute max :MAXRUN 1 "python \"C:\\Programs\\sjq3\\Scripts\\delete.py\" \"%d%\\%p%.mpg\"" } (change you paths to where ever you extract the attached scripts. Also, the above assumes Python is on your PATH) You can get mencoder from here: http://downloads.sourceforge.net/pro...se_mirror=iweb Attached is a zip containing: launch_mencoder.py -- the main script program_options.py -- where you set your transcoding options And a zip containing: delete.py -- An "if exists, delete file" script What can launch_mencoder.py do? It launches mencoder and monitors it. It writes all its output to a file named XXX.mencoder_python_log (which remains if the transcoding fails). It can be set to check if the Sage process is running and shut down mencoder if it shuts down or its process ID changes. Same with the service wrapper (wrapper.exe). It can also check for a remotely running Sage instance (I use sagex to do this but any URL that changes each time Sage launches). It can be configured with a max run time and to operate on files only above a certain length. It also checks the resulting converted file to ensure its length is within a certain percentage (3% by default) of the original (I had some trouble with handbrake getting partially done). The idea is catch all possible errors and avoid a whole bunch of transcoding processes launching (in the case that Sage or SJQ clients get restarted). Hopefully this can be of use to someone besides me Last edited by jakfech; 11-29-2009 at 01:27 PM. Reason: Forgot delete command |
#128
|
|||
|
|||
thanks
Quote:
|
#129
|
|||
|
|||
Fix for 'Database is locked' errors
My first attempt to fix the 'Database is locked' errors is now available in snapshot 664. I've introduced the ability for threads to request exclusive access to the database and while a thread has such access, all others are blocked. This should undoubtedly prevent the database is locked errors.
My initial implementation deadlocked the app, which was not totally unexpected, but I studied the code quite thoroughly and I believe I've removed all the deadlock scenarios from the code, but that's where I need everyone else to help out with testing. Please install snapshot 664 and do your worst to it, so to speak. If the SJQ server appears to become non-responsive then look at the sjq.log file and pay particular attention to SJQ's issuance of the exclusive DataStore connection: Code:
2009-11-28 16:18:43,477 INFO [DataStore]: Thread 'SJQ-LogCleaner' is seeking an exclusive DataStore connection! 2009-11-28 16:18:43,477 INFO [DataStore]: Thread 'SJQ-LogCleaner' is waiting for an exclusive DataStore connection! [AVAIL=4; MAX=5; WAIT=0ms] 2009-11-28 16:18:43,477 INFO [DataStore]: Thread 'SJQ-LogCleaner' is waiting for an exclusive DataStore connection! [AVAIL=4; MAX=5; WAIT=0ms] 2009-11-28 16:18:44,398 INFO [DataStore]: Thread 'SJQ-LogCleaner' has received an exclusive DataStore connection! [WAIT=921ms] 2009-11-28 16:18:44,414 INFO [LogCleaner]: LogCleaner instance finished [16ms] 2009-11-28 16:18:44,414 INFO [DataStore]: 'SJQ-LogCleaner' has returned its exclusive DataStore connection!
__________________
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... |
#130
|
||||
|
||||
So strange thing i'm seeing, keep in mind i'm just speculating here, is that jobs over ~3 hours might be getting interference from whatever stdin SJQ is giving them.
1) People have had problems with SJQ where Handbrake was getting killed via phantom stdin input and its not unusual for a job to go over 3 hours. I don't see this error on my machine, but I modified my dev version to not pass on stdin command a while ago. 2) I'm getting what look like hangs on Comskip when I run live on football games which run ~4 hours at about the 2.5 hour mark. I know Comskip can also be paused via a single key presses over stdin so it looks like that might be happening. Tomorrow i'm gonna write a tool that just loops/logs STDIN and runs as a SJQ job for a few hours and see if I can catch anything strange happening. Just a heads up to see if you have any ideas in advance. Edit: nm, thought I was onto something, but looks like Comskip doesn't have a pause command. Time for some alternate debugging... Last edited by evilpenguin; 11-29-2009 at 04:51 AM. |
#131
|
|||
|
|||
Slugger.
snapshot 664 seems to fix the DB locks. I did get some waits on exclusive... but it cleaned up when it got exclusive control and I had no DB locks.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct. |
#132
|
|||
|
|||
Quote:
My local build I'm running now includes an additional fix that moves the db vacuum process (the process that frees unused disk space from the db file) into a separate thread and the vacuum process also requests an exclusive connection (the vacuum process is another one that can be rather slow and cause db lock exceptions). I'm seeing the log cleaner and the vacuum process simultaneously request the exclusive connection and it's all working as expected. So I'm fairly confident that I've eliminated the cause of the db locked errors through the use of the exclusive connection, but keeping the rest of the app concurrent and zippy by using a non-exclusive db connection where possible. Of course, this is all pending more feedback from others. My local build contains the vacuum thread fix/enhancement, which also reduces the vacuum frequency to once a month instead of once a week. It also includes the noise reduction on the log file by turning down a lot of the INFO messages to DEBUG level. I've kept a few places at INFO level until I get more feedback on this 664 build, but as it is now, the amount of data dumped to the log is way down (like probably cut by at least 80%). All of these fixes are checked in, I just haven't uploaded the build to the project site yet as I'm waiting for more feedback on 664 first. I really want some feedback on the db fixes in 664 before throwing another build up there for people to move 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... |
#133
|
|||
|
|||
Quote:
Quote:
The fix is contained in r668. I haven't uploaded a new build to the project site yet as I'm still waiting for feedback on the specific db fixes in 664 so just grab the next snapshot that's posted as long as it's numbered 668 or higher then this fix will be in there.
__________________
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... |
#134
|
|||
|
|||
Thanks
Great. I might grab the source and try it out. Thanks, Slugger.
|
#135
|
|||
|
|||
If you do attempt to build from source, you can follow the SageAlert build document - both projects build basically the same. If I were to write a similar doc for SJQ, I would literally just copy, rename it and replace 'SageAlert' with 'SJQ' throughout the doc.
One slight change in the 'Run the Build' section: To build the zip for deployment in SJQ, the target name is 'zip' not 'dist' so where it says to run 'ant dist' simply replace it with 'ant zip'. Other than that, the doc should work verbatim to build SJQ from source. If you do try and that's not the case please let me know of any updates and I'll probably make a copy of the doc for SJQ.
__________________
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... |
#136
|
|||
|
|||
Snapshot 671 ready
I wanted to wait for more feedback on 664, but I've made too many changes over the last few days to hold back a new snapshot any longer. Snapshot 671 is now available:
I'm still waiting for more feedback on 664 (specifically the db locked errors). I'm kind of assuming no news is good news?
__________________
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... |
#137
|
|||
|
|||
I was wondering if anybody had ideas on how to use SJQ for the various stages of recording conversion I wish to accomplish.
I have comskip running and am looking to: Manually verify the cuts comskip has found with Videoredo and save the commercial cut video to a subdirectory. Automatically: copy file back over original (here is where I think SJQ cannot help me) handbrake to ipod format on a client machine leaving cut MPG then mediashrink to it's final format in place and replace MPG My thought was to create text files to indicated the stage the conversion process it is in: XYZ.MPG XYZ.IPOD indicating it has been commercial cut and waiting for the IPOD conversion. XYZ.MEDIASHRINK indicating it has been converted to ipod, awaiting mediashrink conversion. |
#138
|
|||
|
|||
Should be able to do it all, but you will have to use "dummy" (text) files as markers for the step you're on and use the FileExists test in SJQ to check which step you should be performing. Should also be able to do the copy over, but that's always an iffy step because the copy over could fail if, for example, the file were being used by something else (i.e. someone else was watching the recording). You'd have to be very careful to ensure the copy over was successful and only create the text file after you're sure the copy over was completed properly.
__________________
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... |
#139
|
|||
|
|||
I know you just put this out there but I have a request for a change. If this came with options before and after a specified time it would be more useful. For example, Handbrake sometimes takes 2-3 times the media length to convert some files. It would be great if it could limit it by:{No recordings happening from now until 3 x target media length}. This way if it begins transcoding a 30 minute program, 30-60 minutes later it would not interfere with another recording just starting.
|
#140
|
|||
|
|||
Quote:
Quote:
pseudocode in the client: Code:
copy xyz.mpg to sagetvDirectory create ipod text file |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Sage Job Queue (SJQ) new release notifications | Slugger | Customization Announcements | 3 | 12-17-2009 09:59 AM |
Plugin: Sage Job Queue (SJQ) | Slugger | SageTV Customizations | 991 | 12-11-2009 03:52 PM |
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 |