SageTV Community  

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

Notices

SageTV Github Development Discussion related to SageTV Open Source Development. Use this forum for development topics about the Open Source versions of SageTV, hosted on Github.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-07-2017, 08:22 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
Video Conversion Time Limits

I'm starting to play around with the Video Conversions built into Sage - is there a way to have them only run at certain hours?
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #2  
Old 02-07-2017, 08:29 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
My advice is to use SJQ to kick off your own transcoding jobs and use whatever software you like, such as Handbrake.
__________________
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
Reply With Quote
  #3  
Old 02-07-2017, 08:32 AM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
I thought SJQ was abandoned? I used it years ago for distributed comskip processing. Is there a V9 compatible version?
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #4  
Old 02-07-2017, 08:36 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Slugger has stopped supporting it as he no longer uses Sage but it still works in V9. I have just installed it and started to get a few of my jobs converted to work on my new unRAID server.

I have a job that runs when recordings are done. If the genre indicates that it is a childrens show then the show is transcoded to H.264/MP4 via Handbrake and moved to a Videos\Kids' Shows\Show Title folder. With Handbrake and the right CPU you could also use Intel QuickSync to speed up the process.
__________________
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
Reply With Quote
  #5  
Old 02-07-2017, 08:42 AM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Quote:
Originally Posted by bialio View Post
I thought SJQ was abandoned? I used it years ago for distributed comskip processing. Is there a V9 compatible version?
It still works under v9 except that the web plug-in will not install because the manifest has it only compatible up to SageTV v7.1.9.256 . I still use it, but it takes some manual editing of configuration files. Who knows if something in the future will break it, though . I know I had an issue at one point that someone fixed by putting a "stub" of some sort in the core.
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #6  
Old 02-07-2017, 08:49 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
What do you mean by web plugin? Do you mean the additional SJQ menu item that shows up on the regular web UI?

I have that working via a manual process where you move a sjq.groovy file to a specific folder for the webserver. But you don't really even need that as you can do the rest of the stuff via the Sage UI in the additional menu item it creates under Settings. That is just useful to keep an eye on your queue.
__________________
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
Reply With Quote
  #7  
Old 02-07-2017, 09:07 AM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Quote:
Originally Posted by wayner View Post
What do you mean by web plugin? Do you mean the additional SJQ menu item that shows up on the regular web UI?

I have that working via a manual process where you move a sjq.groovy file to a specific folder for the webserver. But you don't really even need that as you can do the rest of the stuff via the Sage UI in the additional menu item it creates under Settings. That is just useful to keep an eye on your queue.
How do you define tasks? I thought that was moved to the web UI.
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #8  
Old 02-07-2017, 09:20 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
You can create tasks in the SageTV UI. I did it two days ago.
__________________
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
Reply With Quote
  #9  
Old 02-07-2017, 09:40 AM
KarylFStein KarylFStein is offline
Sage Fanatic
 
Join Date: Apr 2006
Location: Westland, Michigan, USA
Posts: 999
Quote:
Originally Posted by wayner View Post
You can create tasks in the SageTV UI. I did it two days ago.
Oh, you have to drill down into the clients. Is an edit task buried in there somewhere too?
__________________
Home Network: https://karylstein.com/technology.html
Reply With Quote
  #10  
Old 02-07-2017, 09:53 AM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
Quote:
Originally Posted by KarylFStein View Post
Oh, you have to drill down into the clients. Is an edit task buried in there somewhere too?
I think it is when you click on the specific clients. It may also show the number of current tasks - click on that and then you can see and edit them or create new tasks. I can't do it right now as I set up a new router last night but I don't have OpenVPN working yet so I can't access it right now.
__________________
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
Reply With Quote
  #11  
Old 02-07-2017, 10:47 AM
EnterNoEscape's Avatar
EnterNoEscape EnterNoEscape is offline
SageTVaholic
 
Join Date: Jun 2010
Location: Harrisburg, PA
Posts: 2,657
Quote:
Originally Posted by wayner View Post
You can create tasks in the SageTV UI. I did it two days ago.
You can also directly edit the ini files, but it's more of a pain to follow because they are not written in a human logical order.
__________________
SageTV v9 Server: ASRock Z97 Extreme4, Intel i7-4790K @ 4.4Ghz, 32GB RAM, 6x 3TB 7200rpm HD, 2x 5TB 7200rpm HD, 2x 6TB 7200rpm HD, 4x 256GB SSD, 4x 500GB SSD, unRAID Pro 6.7.2 (Dual Parity + SSD Cache).
Capture: 1x Ceton InfiniTV 4 (ClearQAM), 2x Ceton InfiniTV 6, 1x BM1000-HDMI, 1x BM3500-HDMI.

Clients: 1x HD300 (Living Room), 1x HD200 (Master Bedroom).
Software: OpenDCT :: WMC Live TV Tuner :: Schedules Direct EPG
Reply With Quote
  #12  
Old 02-07-2017, 05:21 PM
bialio's Avatar
bialio bialio is offline
SageTVaholic
 
Join Date: May 2007
Location: Frisco, TX
Posts: 3,445
wayner - can you give me an example of the scripts / etc you use for your 'shrink the kids show' SJQ task?
__________________
PHOENIX 3 is here!
Server : Linux V9, Clients : Win10 and Nvidia Shield Android Miniclient
Reply With Quote
  #13  
Old 02-07-2017, 05:51 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
I actually posted it five years ago here but since then it has been somewhat improved although I rarely look at it. Shockingly for me the code is reasonably well documented. I grew up programming on a Commodore VIC-20 with 3.5KB of memory so you didn't waste bytes on comments.

This file calls a file called rename.groovy that hasn't changed since the old post in 2012.

You may want to change the Handbrake parameters to whatever you like - you can just set things up in the Handbrake GUI and then the log will show you the command that it uses. You can copy this to use as the basis for your own set of parameters. That is in the line HBParams=...

Beware that this code deletes the original recording file. You might want to comment out that line (the third last line) until you are happy with how things work.

Code:
/* Outstanding tasks

Check out cropping options
*/
import org.apache.commons.io.FileUtils
import static groovy.io.FileType.*
import java.text.SimpleDateFormat

ComskipPath="C:\\comskip\\comskip.exe"  //Put your comskip path here
CSParams=" --verbose=0 "  //Change to 1 or higher if you want output from comskip
HBCLIPath='"C:\\Program Files\\Handbrake\\HandBrakeCLI.exe"'

def LogFile= new File("c:\\temp\\ProcKidsShows.log")


FileID= Integer.parseInt(SJQ4_METADATA.get("SJQ4_ID"))
mf = MediaFileAPI.GetMediaFileForID(FileID)
NumSegs=MediaFileAPI.GetNumberOfSegments(mf)
Width= MediaFileAPI.GetMediaFileMetadata(mf ,"Format.Video.Width").toInteger()  //This is needed as a Handbrake parameter
RetName ="New file name to be returned"
DestFolder="\\\\carnoustie\\videos\\Isabella's Shows\\"
ShowTempName= ShowAPI.GetShowTitle(mf)
ShowName=ShowTempName.replaceAll(":|\\*|\\?","_")
//======================Handbrake Parameters=======================================
//These paramters are for CPUs that don't have Quick Sync
//HBParams=" -f mp4 -4  --deinterlace=fast -w "+Width+" --loose-anamorphic  -e x264 -q 23 -r 29.97 --pfr  -a 1 -E faac -B 160 -6 dpl2 -R Auto -D 0 --gain=0 --audio-copy-mask none --audio-fallback ffac3 "  

//These parameters are for Intel QuickSync encoding on capable CPUs
HBParams=' -f mp4  --deinterlace="qsv" -w '+Width+' --loose-anamorphic -e qsv_h264 -q 24 -r 29.97 --cfr -a 1 -E av_aac -6 dpl2 -R Auto -B 112 -D 0 --gain 0 --audio-fallback ac3  --qsv-preset=balanced --h264-level="4.0"  --h264-profile=main -verbosity 0'
//End of Handbrake Params section===================================================

run (new File("c:\\GroovyFiles\\Temp\\rename1.groovy")) //this routine finds the new filename which is return as RetName

SourceFile= MediaFileAPI.GetFileForSegment(mf, 0)
SourceFileName=SourceFile.toString()
SourceFileExt=SourceFileName.substring(SourceFileName.lastIndexOf('.')+1, SourceFileName.size())
LogFile.append("======================================================================================\r\n")
LogFile.append("${new Date()} Log File for MediaFile $SourceFileName\r\n")
LogFile.append("Extension for Source File is $SourceFileExt\r\n")
LogFile.append("File width is $Width\r\n")

//Check to see if Destination folder for show exists, if not, create it
DestShowFolder=new File(DestFolder+ShowName)
DFExists= DestShowFolder.exists()
LogFile.append("Destination folder does exists? $DFExists\r\n")
if (!DFExists) {
LogFile.append("Destination folder does not exist so I will create it\r\n")
DestShowFolder.mkdir()
}
DestFileName=DestFolder+ShowName+"\\"+RetName
FilePrefix = DestFileName.substring(0, DestFileName.lastIndexOf('.'))
FileType= DestFileName.substring(DestFileName.lastIndexOf('.')+1, DestFileName.size())
    LogFile.append("File is $FileType file\r\n")
if (SourceFileExt =="mp4") {
    LogFile.append("File is mp4 so I don't have anything to do!!!\r\n")
    return 0
    }
if (NumSegs > 1) {
    LogFile.append("File has more than one segment so I am aborting the process!!!\r\n")
    return 2
    }
	
DestFile = new File(DestFileName)
//LogFile.append("Moving $SourceFileName to $DestFileName\r\n")
//FileUtils.moveFile( SourceFile, DestFile)

    //  This next section calls Comskip
	// It is commented out so I don't need this on kids shows, to reactivate it uncomment the next 11 or so lines
InputCSFile=DestFileName 
def initialSize = 8192
/*CSProc=ComskipPath+CSParams+'"'+InputCSFile+'"'
println (CSProc)
def outStream = new ByteArrayOutputStream(initialSize)
def errStream = new ByteArrayOutputStream(initialSize)
def command=CSProc
LogFile.append("${new Date()} Running Comskip with command $CSProc\r\n")
def proc=command.execute()
proc.consumeProcessOutput(outStream, errStream)
proc.waitFor()
LogFile.append("${new Date()} Comskip is done\r\n")  */
    
    //This next section calls Handbrake


InputVidFile=SourceFileName //DestFileName is what it used to be but I no longer move the file first.
OutputVidFile=FilePrefix+".mp4"
HBProc=HBCLIPath+" -i "+'"'+InputVidFile+'"'+" -o "+'"'+OutputVidFile+'"'+HBParams

outStream = new ByteArrayOutputStream(initialSize)
errStream = new ByteArrayOutputStream(initialSize)
LogFile.append("${new Date()} Running Handbrake with command $HBProc\r\n")
def HBcommand=HBProc
def HBproc=HBcommand.execute()
HBproc.consumeProcessOutput(outStream, errStream)
HBproc.waitFor()
LogFile.append("${new Date()} Handbrake is finished\r\n")
//LogFile.append("${new Date()} Handbrake output is $outStream\r\n")  Uncomment this line and the next to troubleshoot Handbrake problems
//LogFile.append("${new Date()} Handbrake error output is $errStream\r\n")
FinalFile=new File(OutputVidFile)

//The Section below changes the timestamp of the new file to be the same as the original file
SourceTime=SourceFile.lastModified()
String TSTime = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss a").format(SourceTime)
LogFile.append("${new Date()} Resetting timestamp of $OutputVidFile to timestamp of $SourceFileName which is $TSTime\r\n")
LogFile.append("${new Date()} The original file timestamp is $SourceTime\r\n")
FinalFile.setLastModified(SourceTime)

//The two lines below are to reinit the variables as they seem to expire after three minutes
FileID= Integer.parseInt(SJQ4_METADATA.get("SJQ4_ID"))
mf = MediaFileAPI.GetMediaFileForID(FileID)

DestDeleted=MediaFileAPI.DeleteFile(mf)
LogFile.append("${new Date()} File $SourceFileName is deleted? $DestDeleted\r\n")
LogFile.append("${new Date()} Process is now complete\r\n")
__________________
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
Reply With Quote
  #14  
Old 02-07-2017, 06:28 PM
BobPhoenix BobPhoenix is offline
SageTVaholic
 
Join Date: Oct 2004
Posts: 3,152
Quote:
Originally Posted by wayner View Post
... I grew up programming on a Commodore VIC-20 with 3.5KB of memory so you didn't waste bytes on comments...
Off topic so remove/will remove post if requested.

Mine was Commodore 64 but my favorite was the Commodore 128. Still have mine in basement and was working last I tried.
__________________
"Keep your goals away from the trolls"
Reply With Quote
  #15  
Old 02-07-2017, 06:57 PM
wayner wayner is offline
SageTVaholic
 
Join Date: Jan 2008
Location: Toronto, ON
Posts: 7,491
The progress in some things is pretty remarkable. My unRAID server has 24GB of memory or more than 7,000,000 X the memory of that VIC-20.
__________________
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
Reply With Quote
Reply


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
Video conversion BBCritical General Discussion 3 08-03-2011 01:41 PM
HD Video Conversion Problems in V7 Ted@TNT SageTV Software 1 01-27-2011 09:21 AM
PSP Video Conversion Deadbolt SageTV Software 7 12-26-2006 06:40 PM
Video Conversion options? spacecadet SageTV Beta Test Software 4 11-28-2006 08:54 PM


All times are GMT -6. The time now is 05:47 PM.


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