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.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 04-26-2010, 11:42 AM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Arrow Utility: MediaShrink v3.0 - An HTPC focused encoder

(Starting a new thread because the older one had to much depreciated junk info)

What it is:
There are a lot of great encoding tools out there (ffmpeg, mencoder, handbrake, etc.) but none of them are really focused on the specific needs of HTPC users. So I decided to create mediaShrink as a CLI front end that automatically mixes and matches the best encoding tools to use depending on the type of content you're trying to encode.

Is your video telecined?
Is it Interlaced?
Does it have embedded subtitles?
Does it need to be cropped?

MediaShrink will automatically scan the video and determine those answers for you so you end up with a great looking encode no matter what. And if you aren't' satisfied with the defaults, you can easily modify the settings until you're happy with the results.

Working on backing up your DVD's? MediaShrink can help you there too. It'll scan the DVD and automagically encode the main movie, include the main audio as well as any commentary tracks, and attach the closed captioning as a subtitle track. Working with TV show DVD's? No problem there either. It'll automatically pick out all of the episodes on the DVD and encode each of them individually.

How To Use It:

There are a few different ways you can use MediaShrink depending on what your needs are.
  • First (and easiest), you can just manually drag and drop recordings/DVD's onto MediaShrink.exe and it'll automatically encode the videos using the default settings and place the encoded video right next to the original.
  • Second (and recommended for SageTV), you use the CLI switch /inPlace (can just be added to mediaShrink.bat that gets created after the first time you run MediaShrink) and then when do an drag and drop encode of a SageTV recording, MediaShrink will automatically replace the original video with the encoded version and Sage (after an hour or so) will detect it and seamlessly start using it.
  • Finally (and my personal favorite), you can configure Sage Job Queue (SJQ) to automatically encode your SageTV recordings in the background. See the 2nd post for my template SJQ server/client rulesets that'll get you going in no time


Tools Used:
I can't take credit for much in this tool. 99% of of the work gets done by great tools written by other talented developers, I just wrote some perl code to get them all to play nice together.
  • Comskip - Used for detecting crop settings and generating EDL files for commercial cutting.
  • Mencoder - Used for detecting telecine, demuxing A/V, sampling DVD's to check for closed captioning, and encoding
  • Handbrake - Used for scanning DVD's for titles, detecting processor types, and encoding
  • ccextractorwin - Used for detecting/extracting closed captions embedded in recordings and DVD's
  • mkvtoonix - Used for muxing mkv videos
  • mp4box, mp4creator - Used for muxing mp4 videos
  • ffmpeg/sageTVTranscoder - Used for creating test clips and detecting video properties
  • And Lots More!

Known Issues:
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)

Last edited by evilpenguin; 08-18-2010 at 11:10 AM.
Reply With Quote
  #2  
Old 04-26-2010, 11:42 AM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Code:
mediaShrink Readme -

Simple Usage: Drag and drop videos on MediaShrink.exe or MediaShink.bat 
CLI Syntax  : mediaShrink.exe [options] <File|Folder> <File|Folder>

### Basic Options-----------------------------------------------------------

    /help                   Show these options
    /saveLog                Save log file when complete (default)
    /saveAll                Save all temp files when complete
    /batch                  Run in batch mode, intended for Dirmon2/SJQ (default)

    /altLaunch             Use alternate launching meathod.  Should only be
                              used if you're having problems and I ask you to 
                              try it.

### Output Options-----------------------------------------------------------

    /inPlace                Replace the original video when complete
    /outputName <name>      Name for output file.  Default is same as original
                            with new extention.
    /outputDirectory <path> Directory to place encoded video.  Default is same
                            path as original.
                            
    /outputSubFolder <name> Create a folder next to the original file
                            and put the finished encode in there. 
                            
    /centralWorkFolder <path> Directory to do all temp work, useful if your 
                              videos are stored on a NAS or recording drive
                              that you don't want affected by encoding work.
                              Also needed if you want to process files straight
                              off of a DVD drive.
                              
    /container <container>  A/V container to use
                              - mkv : Uses mkv container (default)
                              - mp4 : Uses mp4 container

### Video Options ---------------------------------------------------------

    /vcodec <encoder>      Set the video encoder
                            - x264   : Uses x264 encoder (default)
                            - ffmpeg : Uses ffmpeg encoder, roughly divx
    
    /vbitrate <kbs>        Set video bitrate (Default 1500)

    /vProfile <profile>    Sets the video encoding profile
                             - HQ       : Slow and pretty
                             - MQ       : A nice mix of speed and quality (default)
                             - LQ       : Fast enough for slow machines
                             - custom   : Uses custom parameters from /x264opts
                             
    /handbrakeProfile <profile>  Use one of handbrakes preset profiles.
                           Note that you still need to specify /container mp4
                           for portable device profiles.
			   
			   Example: /handbrakeProfile "Universal" /container mp4
			   
    /handbrakeFullCommand <full CLI command>
    		           Used to specify a complete handbrake CLI and overide all of 
			   Mediashrinks settings.  NOTE: You still need to specify /container
			   

   /x264opts <options>     Sets custom x264 options
                             - ex: /x264opts "ref=2:bframes=2:subme=6:mixed-refs=0"
                             
   /onePass                Performs a one-pass encode (default)
   /twoPass                Performs a two-pass encode                         
                                 
   /xRes <###>             Scale video to ????x#### (Y Res is auto-calculated)
   /yRes <###>             Scale video to ####x???? (X Res is auto-calculated)
   
   /IVTC                   Uses Handbrakes variable frame rate encoding
   /noIVTC                 Blocks usage of IVTC by autoEncode
    
   /denoise                Uses Hanbrakes denoise filter
   /noDenoise              Blocks usage of denoise by autoEncode

   /decomb                 Uses Hanbrakes decomb filter (Selective Deinterlace)
   /noDecomb               Blocks usage of decomb by autoEncode

   /deinterlace            Uses Hanbrakes deinterlace filter
   /noDeinterlace          Blocks usage of denoise by autoEncode

   /autoCrop               Automatically crop videos to remove black bars
   /noAutoCrop             Disable Automatic Cropping
    
   /noSubtitles            MediaShrink will automatically attempt to attach
                            all subtitle/CC tracks it finds since its a pretty
                            harmless operation.  Set this if you want to disable
                            
### Audio Options --------------------------------------------------------------

    /acodec <encoder>      Set the audio encoder
                              - faac   : AAC codec (Default Stereo/SDTV)
                              - lame   : MP3 codec
                              - vorbis : OGG codec
                              - ac3    : AC3 passthough (Default HDTV)
                              - dts    : DTS passthough

    /abitrate <kbs>        Set audio bitrate in kbs (Default 160)

    /atrack <Track #>        Set audio bitrate in kbs (Default 160)

    Note: atrack, abitrate, acodec can take comma separated values to force multiple tracks
    
    /allAudio              Force mediaSrhink to encode all audio tracks    
    
    /preferDTS             By defrault mediashrink will prefer AC3 5.1 tracks, but settings
    			   this it'll force it to choose a DTS track over an AC3 one.  

### DVD Options ------------------------------------------------------------

    /subLang <lang Code|all>  Lets user specify the language code of the 
                              subtitles they want to extract (default: eng)

                              http://www.loc.gov/standards/iso639-2/php/code_list.php

    /manualTitles           Prompts user to manually specify the DVD titles to encode

    /forceTitle <#,#,...>   By default mediaShrink will automatically attempt to 
                            detect which titles to encode, however, sometimes it
                            is impossible.  For those cases you can specify just
                            the DVD title numbers you want to encode sepeated by
                            commas.
                            
    /minDVDTitleLength <#>  Theshold for the minimum title time in minutes to 
                            inspect. Makes log much cleaner for commercial DVDs
                            which can have hundreds of short titles, but if you
                            have a home video DVD with a short title you may need
                            to customize this value.  (Default 5)
                            
### Commercial Cutting Options ------------------------------------------------------------
    REQUIRES VIDEOREDO TO BE INSTALLED
    
    /cutComm                Attempt to cut the commercials.  If no edl or vprj
                            file exists it will attempt to make one using comskip
    
    /onlyWhenVprj           Only cut if a vprj file already exists (default)
Also, for you SJQ users, here's my server/client configuration for launching it and its working great.

Server: Encode any mpg older than 30 days
Code:
# My Favorites to be encoded at the highest quality
if [IsObjMediaFile == true && $.IsTVFile{} == true && MediaAge > "30D" && Filename =$ ".mpg" && $.GetShowTitle{} =% "(Lost|Burn Notice|24|Dollhouse|House)"] 
{
   MEDIASHRINKHQ
}
# Hour long shows are usually more cinematic so give them more bitrate
if [IsObjMediaFile == true && $.IsTVFile{} == true && MediaAge > "30D" && Filename =$ ".mpg" && $.GetShowTitle{} !% "(Lost|Burn Notice|24|Dollhouse|House)" && $.GetFileDuration{} >= 1800000] 
{
   MEDIASHRINKMQ
}
# 30 Minute shows usually don't have a lot of action and can live with less bitrate
if [IsObjMediaFile == true && $.IsTVFile{} == true && MediaAge > "30D" && Filename =$ ".mpg" && $.GetShowTitle{} !% "(Lost|Burn Notice|24|Dollhouse|House)" && $.GetFileDuration{} < 1800000]  
{
   MEDIASHRINKLQ
}
Client: Run Monday-Friday 1 AM - 2 PM
Code:
MEDIASHRINKHQ
{
   :OFFHOUR "0-1, 15-23"
   :OFFDAY "1, 7"
   :MAX 1
   :RESOURCES 51
   "C:/Program Files/SageTV/SageTV/MediaShrink/mediaShrink.bat \"%c%\" /inPlace /batch /vprofile HQ /vbitrate 2500"
}

MEDIASHRINKMQ
{
   :OFFHOUR "0-1, 16-23"
   :OFFDAY "1, 7"
   :MAX 1
   :RESOURCES 51
   "C:/Program Files/SageTV/SageTV/MediaShrink/mediaShrink.bat \"%c%\" /inPlace /batch /vbitrate 2500 /onePass"
}

MEDIASHRINKLQ
{
   :OFFHOUR "0-1, 16-23"
   :OFFDAY "1, 7"
   :MAX 1
   :RESOURCES 51
   "C:/Program Files/SageTV/SageTV/MediaShrink/mediaShrink.bat \"%c%\" /inPlace /batch /vbitrate 2000 /onePass"
}
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)

Last edited by evilpenguin; 10-20-2010 at 02:22 PM.
Reply With Quote
  #3  
Old 04-26-2010, 11:59 AM
ohpleaseno ohpleaseno is offline
Sage Aficionado
 
Join Date: Apr 2009
Location: South Florida
Posts: 464
Great idea to start a new thread. I guess your "family" gave you some time to get back to Sage stuff. (see what I did there?)

Why would recordings called through SJQ have a very high occorunce of "no audio or video" and fail to encode yet recordings sent to MS through drag and drop have almost none?
__________________
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
Reply With Quote
  #4  
Old 04-26-2010, 07:54 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Quote:
Originally Posted by Islander View Post
I am guessing that it is possible to have the files processed without so much (or any?) cropping because after seeing this issue and not knowing much I dl something called StaxRip and ran the same file through and the resulting file did not have the same issue as the pic attached. I rather use MS because it is Sage specific/related/whatnot so the question is how do I tell it not to autocrop? I have tried modifying the mediashrink.defaults but it seems that whatever parameters are in the auto encode override that.
The /noAutoCrop switch should do it. I'd love a test clip of that, think you could cut it down to 2 minutes and FTP it to me?

Quote:
Originally Posted by BKeadle View Post
Mediashrink.bat calls mediashrink.exe (expected), but that then calls another subprocess to mediashrink.exe (with same command line - unexpected), which calls another subprocess to MediaEngine.exe with the full mediashrink default command line switches (expected) but that then calls a second instance of MediaEngine.exe (un-expected). So it looks like for a single job, it's being duplicated twice. That seems unusual.
Yeah, all that nonsense comes from the method I use to "compile" perl scripts into .exe's. So the 'exe's you have (mediaShrink/Engine.exe) are actually special self-extracting zip files that contain my code and the perl binaries they need to run. So everytime they launch they extract themselves to a temp directory and then call themselves again to run my actual code and that's why you see two instances of each of my executables.

Quote:
Originally Posted by BKeadle View Post
The "missing" Seinfeld show actually showed back up in the program listing. What's with the delay? Does the "Refresh Imported Media" do anything for that, even though "Recorded" info isn't "Imported Media"?
That's a byproduct of how Sage manages its media. It does periodic scans of its import/recording folders and after you do an encode you need to wait for the next one for it to notice that the original .mpg is gone and replace it with the new mkv/mp4.

Quote:
Originally Posted by BKeadle View Post
So, I'm not completely clear: if I run mediashrink against a recording, using the /inPlace and /cutComm, of these remaining files, which are no longer needed?
1) Seinfeld-TheBetrayal-107461-0.mkv
2) Seinfeld-TheBetrayal-107461-0.my
3) Seinfeld-TheBetrayal-107461-0.autoEncode.(1).log
4) Seinfeld-TheBetrayal-107461-0.edl
5) Seinfeld-TheBetrayal-107461-0.log
6) Seinfeld-TheBetrayal-107461-0.mpg.chapter
7) Seinfeld-TheBetrayal-107461-0.txt
8) Seinfeld-TheBetrayal-107461-0.vprj
9) Seinfeld-TheBetrayal-107461-0.xml
The only ones being generated by mediaShrink should be the .mkv and autoEncode.(1).log file. The other ones look like their junk left over by comskip. Check out the comskip.ini file and disable all the outputs except for EDL and it should stop generating them.

Quote:
Originally Posted by BKeadle View Post
If I'm also using the 3.0k Video Tools plugin (for the DVD Burning functionality), I assume I should be disabling the Compression option since it has been superceded by mediashrink - or is there something to do to have the VideoTools using mediashrink instead?

EP - I think it's been posted a couple of times, but I don't think I've seen an answer - will we see a "Burn to DVD" plugin using mediashrink thus obsoleting Video Tools?
Since mediaShrink doesn't have a STVi you should be able to use it along side your DVD burning, you'll just want to disable compression using the old video tools plug-in via SageMC Settings.

Quote:
Originally Posted by BKeadle View Post
How would I go about scheduling the conversion to:
- convert any video that is 30 days old (or more)
- convert any video that has been watched
Those things are possible with SJQ and impossible with Dirmon2. I post an example for the 30 day one in the 2nd post, but i'll have to get back to you on the watched one.

Quote:
Originally Posted by ohpleaseno View Post
Why would recordings called through SJQ have a very high occorunce of "no audio or video" and fail to encode yet recordings sent to MS through drag and drop have almost none?
Hmm, that's odd. The only problem I run into with SJQ is when I use Sage or SJQ in service mode and there are permission problems. Personally I use both of them in user mode (I just launch them at start-up manually) and I have no issues.
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)
Reply With Quote
  #5  
Old 04-26-2010, 08:52 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by evilpenguin View Post
but i'll have to get back to you on the watched one.
replace the age test with $.IsWatchedCompletely{} == true

IsWatchedCompletely
api docs
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #6  
Old 04-27-2010, 06:09 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Wow EP - you did a lot of catch-up work. Thanks so much for answering my questions. Yeah I saw your SJQ example for the delay - and I'm now convinced that I need to switch to SJQ from Dirmon2 as you all recommended. Another weekend project.

BTW: as posted in a different thread, I just have to say how much I love this forum. It's very active with lot's of helpful and knowledgeable (and patient) people like yourself and RazrSharpe and MeInMaui - with lot's of great content. SageTV couldn't be such a success without all ya'lls hard work and diligence.
Reply With Quote
  #7  
Old 04-27-2010, 06:11 AM
BKeadle BKeadle is offline
Sage Advanced User
 
Join Date: Mar 2010
Location: Illinois
Posts: 175
Also, what about the "ipconfig /all" that happens every 30 seconds under SageTV? Anyone know anything about that? Just curious.
Reply With Quote
  #8  
Old 04-27-2010, 11:22 AM
mp328 mp328 is offline
Sage Advanced User
 
Join Date: Dec 2006
Posts: 122
hep EP, great work on this as usual

i still seem to have the problem with shows over 2-3 hours as mentioned here

and it looks like its the same problem as the global.national.log shows, maybe it has nothing to do with the show length but something else. cuz i can see in both files at the end it says "no audio / video" moving to next file or something along those lines.

any ideas, it's quite annoying as i said the machine just keeps running the files over and over again for days
Attached Files
File Type: txt WWEMondayNightRAW-7960532-0.autoEncode.(1).txt (91.1 KB, 609 views)
Reply With Quote
  #9  
Old 04-27-2010, 02:23 PM
rmac321 rmac321 is offline
Sage Advanced User
 
Join Date: Dec 2008
Posts: 194
EP
Any chance we can get the progress updates back in the command prompt window? It's nice to have the feedback and know that things are progressing and have a continuous eta.

Thanks again for the great apps.
__________________
SageTV v9.1.10.479 on Ubuntu
(testing v9.1.10.479 on Debian and Win10)
Reply With Quote
  #10  
Old 04-28-2010, 07:57 AM
Islander Islander is offline
Sage Advanced User
 
Join Date: Oct 2009
Location: Cayman Islands
Posts: 163
As a further test I selected a show with a dozen recordings or so, no issues with cropping. However I have the following questions:

1. /inplace replaces the old mpg file with the new mkv file in the SageTv recordings directory. However, it does not seem that the file is being picked up by Sage. Is the SageTv check possibly linked to the library refresh? I have mine set up as manual but I am going to force a refresh to see if they get picked up that way. Otherwise, with the old file gone and the new one in place, what could be causing this? Further, is using SJQ's _RELINK a viable option? [I am guessing if the answer is yes then /inplace cannot be used so that both the mpg and mkv are available for the operation.]

2. the working folder options is working because I see the temp dir and files being created on my local (sjq client) machine. However, the processing log is being saved in the sage tv recordings directory rather than the working folder in the local machine. Is there a way to change that behavior while still retaining the capability to generate the log file?

3. what is the correct syntax of the /centralWorkFolder bit on the sjq client ruleset? /centralWorkFolder "D:\\Temp"? /centralWorkFolder D:/Temp is working but I see this entry on the sqj log right at the start:

"The filename, directory name, or volume label syntax is incorrect." It does not seem to be affecting anything though.

4. with the sjq client code provided by EP do I still need anything in the mediashrink.defaults file? I have left it alone but what takes precedence if there are conflicting entries between the sjq client code and the defaults file, say for the sake of the argument the client says /twopass but the defaults says /onepass?

Thanks.
__________________
Main Server: Intel Core i5 Processor i5-670, MSI Motherboard H57M-ED65, Corsair 4 GB PC3-12800, Intel 320 Series 160 GB SSD, Western Digital 150 GB VelociRaptor, LIAN-LI PC-C36B Case, Vista 64 Home Premium, JavaHeap = 1,200. +Network Encoder.
Storage: HP487 with 37.5TB of storage.
Extenders: x2 HD300 x6 HD200.
Tuners: Hauppauge HVR-1950 USB x3, USBIRT.
Adds-in:Many!.
Others: Sony BDVE500W, OPPO HM-31 dvanced HDMI 1.3 1080p Switch, Harmony One.

Last edited by Islander; 04-28-2010 at 07:59 AM.
Reply With Quote
  #11  
Old 04-28-2010, 11:31 AM
Islander Islander is offline
Sage Advanced User
 
Join Date: Oct 2009
Location: Cayman Islands
Posts: 163
Quick update to #1

Rescanning the library brings the mkv as imported not as replacement for the mpgs, although I still have to check that all the files are being seen. I guess that I could manually through BMT make them sage recordings by checking the box on each individual file but I wonder if this is working as intended.

One downsize of leaving them as is (i.e. imports) is that TVE will show the episode information on the list but Sage will not show it under the episode information or by pressing info while the file is playing. Making it a sage recording file seems to bring everything back but the channel information.

Any suggestions?
__________________
Main Server: Intel Core i5 Processor i5-670, MSI Motherboard H57M-ED65, Corsair 4 GB PC3-12800, Intel 320 Series 160 GB SSD, Western Digital 150 GB VelociRaptor, LIAN-LI PC-C36B Case, Vista 64 Home Premium, JavaHeap = 1,200. +Network Encoder.
Storage: HP487 with 37.5TB of storage.
Extenders: x2 HD300 x6 HD200.
Tuners: Hauppauge HVR-1950 USB x3, USBIRT.
Adds-in:Many!.
Others: Sony BDVE500W, OPPO HM-31 dvanced HDMI 1.3 1080p Switch, Harmony One.
Reply With Quote
  #12  
Old 04-28-2010, 11:36 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
I do not do an inplace... I do a relink in SJQ instead. If you choose to do an Inplace you can do a media refresh in SJQ.

:SCANMEDIA "true"


Code:
//Relink sage
if [IsObjMediaFile == "true" && (Filename =$ ".mpg" || (Filename =$ ".ts")) && FileExists == "%d%/%p%.autoencode.mkv" && Filename !$ ".mkv" && $.IsTVFile{} == "true"] {
   :RELINKOPTS "$.GetAiringID{}" "%d%/%p%.autoencode.mkv
   _RELINK
}
__________________
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; 04-28-2010 at 11:54 AM.
Reply With Quote
  #13  
Old 04-28-2010, 11:45 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
Quote:
Originally Posted by Islander View Post
Quick update to #1

Rescanning the library brings the mkv as imported not as replacement for the mpgs, although I still have to check that all the files are being seen. I guess that I could manually through BMT make them sage recordings by checking the box on each individual file but I wonder if this is working as intended.

One downsize of leaving them as is (i.e. imports) is that TVE will show the episode information on the list but Sage will not show it under the episode information or by pressing info while the file is playing. Making it a sage recording file seems to bring everything back but the channel information.

Any suggestions?
doing an inplace replacement sage should see it as the same mediafile with the same metadata providing the path/filename is the same (sans extension)
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #14  
Old 04-28-2010, 12:57 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Quote:
Originally Posted by Islander View Post
Rescanning the library brings the mkv as imported not as replacement for the mpgs, although I still have to check that all the files are being seen. I guess that I could manually through BMT make them sage recordings by checking the box on each individual file but I wonder if this is working as intended.
Sage runs periodic scans indepedant of Library scans that should see those files and reclaim them as Sage Recordings. It usually happens in an hour or so, I do my encode my recordings with /inPlace at night and they're all back in the Sage Recordings by morning.

Quote:
Originally Posted by Islander View Post
As a further test I selected a show with a dozen recordings or so, no issues with cropping. However I have the following questions:
I think that file had a a kinda corrupted timeline such that my auto-crop detection couldn't scan past the first frame so it thought the entire recording had that crazy OSD on it, hence the bad crop


Quote:
Originally Posted by Islander View Post
the working folder options is working because I see the temp dir and files being created on my local (sjq client) machine. However, the processing log is being saved in the sage tv recordings directory rather than the working folder in the local machine. Is there a way to change that behavior while still retaining the capability to generate the log file?
Right now the log is always next to the recording, that won't be affected by /centralWorkFolder or /outputFile.

Quote:
Originally Posted by Islander View Post
3. what is the correct syntax of the /centralWorkFolder bit on the sjq client ruleset? /centralWorkFolder "D:\\Temp"? /centralWorkFolder D:/Temp is working but I see this entry on the sqj log right at the start:
/centralWorkFolder "D:\\Temp" is right.

Quote:
Originally Posted by Islander View Post
"The filename, directory name, or volume label syntax is incorrect." It does not seem to be affecting anything though.
I see that randomly also, I haven't figured out why yet.

Quote:
Originally Posted by Islander View Post
4. with the sjq client code provided by EP do I still need anything in the mediashrink.defaults file? I have left it alone but what takes precedence if there are conflicting entries between the sjq client code and the defaults file, say for the sake of the argument the client says /twopass but the defaults says /onepass?
In most cases *not* doing something takes precedence over doing it (ex: /noAutoCrop vs. /autoCrop). In cases where switches contain values (ex: /vcodec ffmpeg /vcodec x264) the last one read in takes precedence (Defaults Properties are read first, CLI properties are read second, and profile scripting are read last). And for the one/two pass case /twopass takes precedence.
__________________
Clients: 1xHD200 Connected to 50" TH-50PZ750U Plasma
Server : Shuttle SFF SSH55J2 w/ Win7 Home, SageTV v7, Core i3 540, 2GB RAM, 30GB SSD for OS, 1.5TB+2x1TB WDGP for Recordings, BluRay, 2xHDHR, 1xFirewire
SageTV : PlayOn, SJQ, MediaShrink, Comskip, Jetty, Web Client, BMT


Having a problem? Don't forget to include a log! (Instructions for: PlayOn For SageTV v1.5, MediaShrink)
Reply With Quote
  #15  
Old 04-28-2010, 05:23 PM
Islander Islander is offline
Sage Advanced User
 
Join Date: Oct 2009
Location: Cayman Islands
Posts: 163
Quote:
Originally Posted by nyplayer View Post
I do not do an inplace... I do a relink in SJQ instead. If you choose to do an Inplace you can do a media refresh in SJQ.

:SCANMEDIA "true"


Code:
//Relink sage
if [IsObjMediaFile == "true" && (Filename =$ ".mpg" || (Filename =$ ".ts")) && FileExists == "%d%/%p%.autoencode.mkv" && Filename !$ ".mkv" && $.IsTVFile{} == "true"] {
   :RELINKOPTS "$.GetAiringID{}" "%d%/%p%.autoencode.mkv
   _RELINK
}
Thanks I will give it a try. Is this to be inserted in the server or the client rules? For a while I have been trying to play around and do further processing on a file, whilst the filename is still available before moving to the next process.

For example, moverec and then immediately unarchive but just the file that was processed. Or does it really matter? Or does one just insert the step without it being "ring fenced" somehow and tied to the specific file just processed?

Thanks.

p.s. These are my server and clients rule related to mediashrink:

# My Favorites to be encoded at the highest quality
if [IsObjMediaFile == true && $.IsTVFile{} == true && MediaAge > "3D" && Filename =$ ".mpg" && $.GetShowTitle{} =* "Herculoids"]
{
MEDIASHRINKHQ
}


MEDIASHRINKHQ
{
#:CPU "LOW"
#:OFFHOUR "0-1, 16-23"
#:OFFDAY "1, 7"
:MAX 1
:RESOURCES 51
"D:/Users/Rafael/Downloads/mediaShrink.exe \"%c%\" /inPlace /noAutoCrop /centralWorkFolder "D:\\Temp" /batch /vprofile HQ /vbitrate 2500 /twopass"
}
__________________
Main Server: Intel Core i5 Processor i5-670, MSI Motherboard H57M-ED65, Corsair 4 GB PC3-12800, Intel 320 Series 160 GB SSD, Western Digital 150 GB VelociRaptor, LIAN-LI PC-C36B Case, Vista 64 Home Premium, JavaHeap = 1,200. +Network Encoder.
Storage: HP487 with 37.5TB of storage.
Extenders: x2 HD300 x6 HD200.
Tuners: Hauppauge HVR-1950 USB x3, USBIRT.
Adds-in:Many!.
Others: Sony BDVE500W, OPPO HM-31 dvanced HDMI 1.3 1080p Switch, Harmony One.

Last edited by Islander; 04-28-2010 at 05:35 PM.
Reply With Quote
  #16  
Old 04-28-2010, 05:31 PM
Islander Islander is offline
Sage Advanced User
 
Join Date: Oct 2009
Location: Cayman Islands
Posts: 163
Raz and EP thanks for the further information.

The system processed 13 files starting last night (morning?) at 4 am. The files take about 39 minutes to process. I checked this morning, lunch time and afternoon and none of the mkv files have been "adopted" by Sage. The only mkv I see out of the 13 are the three that I imported by having Sage rescan the libraries.

I had a look at the logs and the name of the mks file seems to be exactly the same as the mpg one, the mkv is being copied to the recordings directory and the mpg one deleted from the same recordings directory.

I see that there are .my files which still reference the old mpg for example:

"File=D:\Recorded TV\Herculoids-TheBeakedPeopleTheRaiders-1081303-0.mpg"

The .my files for the three mkv's that I imported still point to the old mpg but there is also a new properties file associated with the mkv. Could the .my or any setting Sage or SageMc be responsible for this behavior?

I can produce processing and sqj logs for a given file if needed.

Thanks again.
__________________
Main Server: Intel Core i5 Processor i5-670, MSI Motherboard H57M-ED65, Corsair 4 GB PC3-12800, Intel 320 Series 160 GB SSD, Western Digital 150 GB VelociRaptor, LIAN-LI PC-C36B Case, Vista 64 Home Premium, JavaHeap = 1,200. +Network Encoder.
Storage: HP487 with 37.5TB of storage.
Extenders: x2 HD300 x6 HD200.
Tuners: Hauppauge HVR-1950 USB x3, USBIRT.
Adds-in:Many!.
Others: Sony BDVE500W, OPPO HM-31 dvanced HDMI 1.3 1080p Switch, Harmony One.
Reply With Quote
  #17  
Old 04-28-2010, 05:41 PM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
my files.... what are those ????? in all seriousness i think my files are a old way to store metadata and not really needed anymore... ive never created/used/needed/wanted them.... that being said i dont think they would interfere with sage reimporting them correctly... but perhaps...
__________________
Server 2003 r2 32bit, SageTV9 (finally!)
2x Dual HDHR (OTA), 1x HD-PVR (Comcast), 1x HDHR-3CC via SageDCT (Comcast)
2x HD300, 1x SageClient (Win10 Test/Development)
Check out TVExplorer
Reply With Quote
  #18  
Old 04-28-2010, 05:52 PM
Islander Islander is offline
Sage Advanced User
 
Join Date: Oct 2009
Location: Cayman Islands
Posts: 163
Ha ok that predates my serious attempt at Sage implementation. I did take a look at it few years back but it was very cursory. I could swear that there is a setting Sage or MC not sure which says "use .my files". [If only I could stop my six year old from playing Roblox on the 52 inch then I could check! Anyone has a solution for that??

Yes under SAgeMc options use, create and clean .my changed them to disabled, disabled and enabled. Will give it an hour or so to see if they get picked up.
__________________
Main Server: Intel Core i5 Processor i5-670, MSI Motherboard H57M-ED65, Corsair 4 GB PC3-12800, Intel 320 Series 160 GB SSD, Western Digital 150 GB VelociRaptor, LIAN-LI PC-C36B Case, Vista 64 Home Premium, JavaHeap = 1,200. +Network Encoder.
Storage: HP487 with 37.5TB of storage.
Extenders: x2 HD300 x6 HD200.
Tuners: Hauppauge HVR-1950 USB x3, USBIRT.
Adds-in:Many!.
Others: Sony BDVE500W, OPPO HM-31 dvanced HDMI 1.3 1080p Switch, Harmony One.

Last edited by Islander; 04-28-2010 at 07:14 PM.
Reply With Quote
  #19  
Old 04-29-2010, 12:59 PM
talbot3 talbot3 is offline
Sage Advanced User
 
Join Date: Jun 2007
Posts: 82
Thanks for all the hard work! I setup SJQ using your example and everything is working except all the encoding is being down at normal priority desite the "CPU LOW" setting in the SJQ client. Is there any other way to force the priority lower?
Reply With Quote
  #20  
Old 04-29-2010, 06:27 PM
cyberwolf cyberwolf is offline
Sage User
 
Join Date: Apr 2010
Location: Knoxville
Posts: 9
Is there a way to tell mediaShrink where to create and store log files?

First of all I love this app! works flawlessly for me. I was wondering if there is a way to have the mediaShrink log files created in a specific folder rather then right next to the about to be encoded file? I tried the /centralWorkFolder switch without success. It seems that mediaShrink still attempts to create a log file in folder I DnD. Omitting the /saveLog switch did not do the trick either for the same reason.

Some background info:
I just started using mediaShrink and have to say i'm hooked. Now i'm starting to convert my DVD collection to store in my video library for SageTV. First I copied about 2 dozen DVD's into ISO files, don't ask me why that is a long story. Then I started copying over just the Video_TS folder, using AnyDVD to simplify the process. Now I am DnD the Video_TS folders onto mediaShrink to encode. I'm looking to automate the process and hopefully skip a step or two along with ditching the ISO files.

I would like start an encoding straight from the DVD rather than pulling the Video_TS folder to the hard drive first. MediaShrink sees the DVD's just fine but errors out right before processing the Video_TS folder with:

"! Can't open create log fileExiting in 5 seconds..."

That makes sense because the DVD is read only.


My over all goal is to setup DirMon2 to check the DVD drive once at night, already have the batch files ready, and start the encoding process directly from the DVD. So all i have to do is pop in a disc before i goto bed and in the morning check the log files to see what happened. I understand that not all my DVDs will go smoothly but... easy ones first.

I also have another batch file that will mount an ISO to a virtual drive and kick off the encoding process. after encoding is done it will unmount the iso and mount another one that is in the same directory.

The batch files work when i include a copy command in them to put the Video_TS folder to the hard drive first. I would like to see if this step can be by-passed. Figure you won't know till you try it



I have:
Daemon-Tools Lite
AnyDVD (on the fly DVD decoding app)
DirMon2
mediaShrink
And a willingness to fail till i succeed (that was corny)


Any help is appreciated. I think all I need right now is the ability to tell mediaShrink where to create and store the log files.
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
Utility: Web Radio and TV Encoder michaeldjcox SageTV Customizations 858 02-27-2021 10:26 PM
(Old) MediaShrink - An HTPC focused encoder evilpenguin SageTV Customizations 603 04-26-2010 08:05 PM
Bring focused item to front and call fanart PLUCKYHD SageTV Studio 0 04-08-2009 07:38 AM
Get currently focused widget? cncb SageTV Studio 3 05-01-2008 12:22 PM
God does not want me to have HTPC, more problems - network encoder stryker SageTV Software 2 02-03-2008 08:54 AM


All times are GMT -6. The time now is 09:37 AM.


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