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
  #1  
Old 03-03-2009, 07:49 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
(Old) MediaShrink - An HTPC focused encoder

This thread is closed, for the latest release/instructions see this new thread...

Older/Outdated info is below...

Release History:
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.

Usage Instructions: See 2nd post


Submitting Issues:

If you have any issue i'll need you to post the mediaEngine.log file that gets created next to the .exe. Otherwise I'll have no idea what the problem is.

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:

Last edited by evilpenguin; 04-26-2010 at 08:05 PM.
  #2  
Old 03-03-2009, 07:50 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
For the latest release/instructions see this post...

Older/Outdated info is below...

Basic Usage:

For general usage all you need to do is drag and drop videos, VIDEO_TS folders, and/or folders containing videos onto mediaShrink.exe and, by default it'll encode them using the AutoEncode profile.

AutoEncode Profile:

The AutoEncode profile will go inspect the video and automatically pick the encoding options for you.

SDTV:
Code:
Video: 1500 kbs h.264
Audio: 128 kbs AAC
Container: MKV
Extra Settings: Decomb, AutoCrop
Encoder: Handbrake
720p HDTV:
Code:
Video: 1500 kbs h.264
Audio: copy original 5.1 AC3 or 2 Channel 128 kbs AAC
Container: MKV
Extra Settings: Decomb, AutoCrop
Encoder: Handbrake
Note: I never IVTC 720p video (60 fps -> 23.976 fps). About half the time it'll end up with jerky video and/or the audio/video will be out of sync. IMHO the video looks great when left at 60 fps and x264 is so smart/efficient it'll recognize all of the duplicate frames and not waste a lot of bitrate on them

1080i HDTV:
Code:
Video: 1500 kbs h.264
Audio: copy original 5.1 AC3 or 2 Channel 128 kbs AAC
Container: MKV
Extra Settings: Scale to 720x???, Decomb, VFR if telecined, AutoCrop
Encoder: Handbrake
In addition if there are embedded closed captions it'll extract it and attach it to the MKV as a subtitle track. (I know Sage doesn't support them now, but hopefully they will eventually )

Advanced Usage:

MediaShrink reads all of its default options out of mediaShrink.defaults.txt which is right next to MediaShrink.exe and it is just a list of command line switches that will always be used.

These are the default options:
Code:
/defaultProfile autoEncode /scanDVDs
In addition you can also add any of the below, available, switches to further customize the encode

Available Switches:
  • /(avi|mp4|mkv) - Force video to use specified container (default: mkv)
  • /(divx|xvid|x264) - Force video to use specified encoder (default: x264)
  • /(mp3|aac|aac|aac51|copyAudio) - Force audio to use specified encoder (default: aac)
  • /cliBitrate "###" - Use specified video bitrate (default: 1500)
  • /deinterlace - Use a deinterlacing filter
  • /denoise- Use a denoising filter
  • /reverseTelecine- Use a reverse telecine filter (Will convert video to 24 fps)
  • /verticalScale "###" - Scale video vertically to specified height
  • /horizontalScale "###" - Scale video horizontally to specified width
  • /autoCrop - Automatically detect and crop out black bars
  • /onePass - Do a one pass encode
  • /inPlace - Replace the original video with the encoded one
  • /forceMencoder - Force to use mencoder for encodes
  • /cutComm - Cut commercials using VideoRedo or Mencoder (NOTE: SEE BELOW!!!!!)
  • /onlyWhenVprj - Can be used with /cutComm to only cut commercials if a vprj file already exists.

Commercial Cutting:
Yes, this tool will cut commercials, but there are a few catches.
  1. If your commercial detection isn't perfect then the encodes will either cut too much or to little. Crap in... crap out. You've been warned
  2. By a wide margin, my recommended cutting method is to use VideoRedo. It costs $$$ but is well worth it in my opinion. Alternatively the tool can also attempt to cut the videos with mencoder but in my experience that fails 50% of the time.

I've tried many other tools and they are either un-scriptable and/or unreliable. If you've think you've got another tool that'll do the job, see if you can get it working 100% from the command line and if so let me know.

My advice: Buy VideoRedo and make your .vprj files by hand before you try and encode.

Why does this seem very similar to mediaScraper?:

Because it's 100% the same code, just different profiles

Last edited by evilpenguin; 03-16-2010 at 07:24 PM.
  #3  
Old 03-03-2009, 07:57 PM
S_M_E S_M_E is offline
Sage Fanatic
 
Join Date: Dec 2007
Posts: 908
I like the idea but I'll wait for the instructions before I start asking questions...
  #4  
Old 03-03-2009, 08:08 PM
Peter_h Peter_h is offline
Sage Fanatic
 
Join Date: May 2008
Location: Kailua, HI
Posts: 798
Quote:
Originally Posted by S_M_E View Post
I like the idea but I'll wait for the instructions before I start asking questions...
This looks awesome and I've been waiting for this since video tools 3.5 got scrapped.

However, i don't trust my self to play with this and not brake something. I'll wait on some instructions and give this a whirl.

Thanks EP.
  #5  
Old 03-03-2009, 08:12 PM
S_M_E S_M_E is offline
Sage Fanatic
 
Join Date: Dec 2007
Posts: 908
Quote:
Originally Posted by Peter_h View Post
This looks awesome and I've been waiting for this since video tools 3.5 got scrapped.

However, i don't trust my self to play with this and not brake something. I'll wait on some instructions and give this a whirl.

Thanks EP.
VT3.5 *not* cropping if I dragged and dropped is why I stopped using it and moved to handbrake+gui...
  #6  
Old 03-03-2009, 08:14 PM
QueOnda's Avatar
QueOnda QueOnda is offline
Sage Icon
 
Join Date: Jan 2008
Posts: 1,093
EP, NICE. I'm waiting IMpatiently!!
__________________
Server: HP AMD64 dual core running Win7 64bit (MCE disabled) with 4G memory Tuners: 2 PVR-500(disabled), 3 HDHR and 1 HDPVR Clients: 2 HD200 and 1 HD100 TV: 70" and 52" and 42" Media Storage: ReadyNas 8TB Recording media: 300GB + 200GB+ 250 GB Network: Gigabit backbone'

Thanks to all the developers who work on SageMC, code, utilities and plug-ins to make SageTV better!!!
  #7  
Old 03-03-2009, 09:28 PM
flashbacck flashbacck is offline
Sage Aficionado
 
Join Date: May 2004
Posts: 326
If I read the other thread correctly, mediaShrink is not ment to be integrated into Sage like SVT was. If I just want to compress recordings, is there any benefit to switching over to this?
__________________
C2D e6320
P4M800Pro, 1gb DDR, 1100GB HDs
Hauppauge HVR-1600, HDHomerun, Geforce 6200
  #8  
Old 03-04-2009, 01:31 AM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
To be completely honest, this tool did a lot more heavy lifting before Handbrake became so damn awesome that I just started using it for everything

But there's still a lot of benefits of using this as a wrapper for handbrake: Commercial Cutting, Closed Caption support, automatically encoding all episodes on a TV DVD, more accurate auto crop, and drag and drop operation. Basically, for me atleast, it just fills in the blanks that Handbrake hasn't filled in (yet ).

And if you're still using Sage's built in encoding, you should give this (or just handbrake a shot). The difference in the quality of the encodes is *staggering*.

Last edited by evilpenguin; 03-04-2009 at 01:34 AM.
  #9  
Old 03-04-2009, 01:44 AM
S_M_E S_M_E is offline
Sage Fanatic
 
Join Date: Dec 2007
Posts: 908
Why isn't /autocrop a default, is there a reason not to crop?

What other options are recommended that aren't default?
  #10  
Old 03-04-2009, 02:25 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
EP,

I notice handbrake runs at normal priority is there a way to force it to run belownormal?
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
  #11  
Old 03-04-2009, 02:46 AM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Quote:
Originally Posted by S_M_E View Post
Why isn't /autocrop a default, is there a reason not to crop?

What other options are recommended that aren't default?
All of my recommended options (autoCrop, decomb, mkv, x264, aac, etc.) get set by the AutoEncode profile automatically. The only reason you'd have to add it to the mediaShrink.defaults.txt file is if you were manually using the handbrake or mencoder profiles by themselves.

Edit: Oh, I see why you were confused. I went ahead and added AutoCrop to the list extra settings for all of the Auto Encode descriptions.

Last edited by evilpenguin; 03-04-2009 at 02:52 AM.
  #12  
Old 03-04-2009, 02:48 AM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Quote:
Originally Posted by nyplayer View Post
EP,

I notice handbrake runs at normal priority is there a way to force it to run belownormal?
Ahh, I knew I forgot something. I've actually got that working in another branch, I just need to port it over.

Last edited by evilpenguin; 03-04-2009 at 02:50 AM.
  #13  
Old 03-04-2009, 07:31 AM
razrsharpe razrsharpe is offline
Sage Icon
 
Join Date: Sep 2008
Location: Boston, MA
Posts: 2,111
This looks awesome can't wait to try it out

One question: Does it handle multiple audio tracks for TV shows (.mpgs)? I just want to direct stream copy all the audio tracks. The reason I care is there is a bug in my recording of the local FOX feed (don't know if its on my end or on FOX's). Sometimes (occasionally and rarely but often enough to be REALLY annoying) my HDHR records 2 audio tracks. One of them is empty; the other contains the normal english soundtrack. Inevitably the empty one is the default. So in this case all I want to do is just copy both soundtracks.

Second question: I know .ts files (from the hd-pvr) crashed 3.5. Is that still the case?

Anyway it looks great and I can't wait to start using it.
__________________
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
  #14  
Old 03-04-2009, 08:46 AM
matt91's Avatar
matt91 matt91 is offline
Sage Icon
 
Join Date: Feb 2005
Location: Washington, DC
Posts: 1,185
EP -

IIRC, your prior video tools project provided for a Sage Recording -> DVD profile. That is, you could create a DVD from recorded TV shows.

I don't think I ever tried it, so this is just from memory.

Does this tool, now or perhaps in the future, allow for this use? (I'm not sure that I'd ever use it, but just curious).

Thanks for all the effort on these projects lately.

Matt
__________________
Server: Ubuntu 16.04 running Sage for Linux v9
  #15  
Old 03-04-2009, 10:15 AM
Arioch5 Arioch5 is offline
Sage Advanced User
 
Join Date: Jan 2006
Posts: 118
Quote:
1080i HDTV:
Extra Settings: Scale to 720x???
Can you explain that a little? This looks like if I record OTA HD-TV with a HD-Homerun the auto profile will scale the video down to 720. I'm sure there's a good reason for it can you tell me why we would want this? Seems like you would lose quality.
__________________
Server:
AMD 64 X2 5000+, ATI 3450 256MB,2GB of PC6400, ~300GB SATA (recordings), HD-Homerun, PVR-350, On-board Coax SPDIF, Unraid Media Server (all other media).

Other:
Mitsubishi 65" DLP
5.1 Speakers on a Kenwood Receiver - Digital SPDIF
Harmony 1000
  #16  
Old 03-04-2009, 11:18 AM
nyplayer nyplayer is offline
SageTVaholic
 
Join Date: Sep 2005
Posts: 4,997
EP,

I noticed you always use Decomb. Is there a way to not use Decomb if you choose not to?.
__________________
Channels DVR UBUNTU Server 2 Primes 3 Connects TVE SageTV Docker with input from Channels DVR XMLTV and M3U VIA Opendct.
  #17  
Old 03-04-2009, 12:23 PM
S_M_E S_M_E is offline
Sage Fanatic
 
Join Date: Dec 2007
Posts: 908
Can we drag and drop multiple files at once?

If so, does it join them or work like a batch of separate files?
  #18  
Old 03-04-2009, 01:00 PM
matt91's Avatar
matt91 matt91 is offline
Sage Icon
 
Join Date: Feb 2005
Location: Washington, DC
Posts: 1,185
The media scraper will process multiple-dragged files independently, I'm sure this does the same.
__________________
Server: Ubuntu 16.04 running Sage for Linux v9
  #19  
Old 03-04-2009, 01:09 PM
S_M_E S_M_E is offline
Sage Fanatic
 
Join Date: Dec 2007
Posts: 908
Every time I try to D&D a VIDEO_TS folder it runs for a second and quits with no conversion. Perhaps it's a Vista64 thing or, more likely, it's a UAC problem...or a bug.
  #20  
Old 03-04-2009, 01:38 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Quote:
Originally Posted by nyplayer View Post
EP,

I noticed you always use Decomb. Is there a way to not use Decomb if you choose not to?.
You'd have to manually remove it from AutoEncode.profile by modifying this line.

Code:
    Encode CLI #8     =?>ORIGINAL:videoCodec=~mpeg2video&&!ORIGINAL:videoResolution=~(1280x|x720)&&!reverseTelecine<:>/deinterlace<?
    Encoder #8        =/setOptions
Quote:
Originally Posted by S_M_E View Post
Every time I try to D&D a VIDEO_TS folder it runs for a second and quits with no conversion. Perhaps it's a Vista64 thing or, more likely, it's a UAC problem...or a bug.
Are they UNC paths?

Last edited by evilpenguin; 03-04-2009 at 01:41 PM.
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
Utility: MediaShrink v3.0 - An HTPC focused encoder evilpenguin SageTV Customizations 228 10-05-2016 07:05 PM
Bring focused item to front and call fanart PLUCKYHD SageTV Studio 0 04-08-2009 07:38 AM
Encoder number graphic shows wrong encoder being used jpaddock3000 SageMC Custom Interface 11 02-05-2009 02:29 PM
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 06:26 PM.


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