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 12-15-2009, 07:28 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
Utility: SAGEAudioConvert, DTS to AC-3

SAGEAudioConvert v0.1.16

Purpose: Create an AC-3 audio track for every mkv movie that has a DTS track without a corresponding AC-3 in the same language.

If you don't have a DTS receiver this tool is for you. It is able to take a .mkv, look and see if the only audio is dts for a language, encode a new ac3 track from the dts one and add the new ac3 to the original mkv preserving both the original dts and adding the new ac3.


Previous Version

Lastest version available here


Installation: simply unrar the archive while keeping it directory structure.

For some documentation, look at readme.txt file included.


Syntax: SAGEAudioConvert [options] source

Options:
-inplace . . . . . . . . . . replace the original video when complete.
-outputdir=<value> . . .directory to place final video if not using inplace option.
-workdir=<value> . . . . temporary working directory. Default is OS temp directory.
-language=<value> . . .convert this language (ISO639-1) only. Default to every languages.
-stereo . . . . . . . . . . .downmix multi channel audio to stereo (Dolby Pro Logic II).
-kbps=<value> . . . . . .kbps for AC3 encoding. Possible values are "192", "448" or "640".
-priority=<value> . . . . process priority. Possible values are "low" or "normal".
-recursive . . . . . . . . .process every mkv file recursively from source directory.
-listISO639 . . . . . . . . display a list of valid language code to use with -language option.
-markdone . . . . . . . . .create a .dtsDone file beside the movie file. Useful will SJQ.
-force . . . . . . . . . . . .replace existing AC3 track with new one. Replace only if language and #channels match, otherwise append.
-defAc3Lang=<value>. .set this new language Ac3 Track as default.
-test . . . . . . . . . . . . do not convert anything, just simulate. Use to preview what will be done.
-debug . . . . . . . . . . .create a verbose debug log beside the executable.

Defaults:
-inplace -kbps=640 -priority=normal -language=all

Defaults:
-inplace -kbps=640 -priority=normal -language=all


Examples:

Find and proceed every mkv files in z:\movies directory recursively. The originals movies will be overwritten.

SAGEAudioConvert -recursive z:\movies

Find and proceed every mkv files in z:\movies directory, using 448 kbps for ac-3 encoding. New mkv files written to z:\moviesConverted.

SAGEAudioConvert -outputdir=z:\moviesConverted -kbps=448 z:\movies

Requirements:
Microsoft Windows XP or higher.
Microsoft .Net Framework 2.0 or higher.
Tools included: madshi eac3to, mkvtoolnix and mediainfo dll.

Change Log
v0.1.16
Fix exception under SageJob Queue

v0.1.15
* removed beta notice
* add -defAc3Lang switch. set this new language Ac3 Track as default.

Example: -defAc3Lang=en
will set the new english generated track as the default one. Any good mkv player should prefer the track that has his 'default' flag set.

v0.1.14 beta
* removed expiration date (march 1st 2010)

v0.1.13 beta
* fix undetected ac-3 [und] track. If a DTS [und] track was found, a new ac-3 track will always be generated even if it was already present. Other languages were fines.

v0.1.12 beta
* fix Language [und] Error: No language specified in '--language 0:'

v0.1.11 beta
* add -test switch.. . . . . Test mode only, do not create new tracks, just simulate. Use to preview what will be done.
* add -force switch. . . . . Replace existing AC3 track with new one. Replace only if language and #channels match, otherwise append.
* add -markdone switch. . Create a .dtsDone file beside the movie file. Useful will SJQ.

v0.1.10 beta
* initial release

Last edited by mikep; 01-31-2011 at 10:11 AM. Reason: new version
Reply With Quote
  #2  
Old 12-15-2009, 07:28 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
reserved for future need.
Reply With Quote
  #3  
Old 12-15-2009, 08:29 PM
aflat aflat is offline
Sage Aficionado
 
Join Date: Feb 2009
Posts: 302
Is your tool any different then this tool?

http://www.networkedmediatank.com/sh....php?tid=20887
Reply With Quote
  #4  
Old 12-15-2009, 09:11 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
HI,

Pretty much the same, but much simpler. It is doing DTS to AC-3 only.
You can use it with SJQ to automate everything, so when a new movie appear on your nas, It will take care of it. Also, I don't like tools that virus scanner detect as trojan, be false positive or not... so I wrote what I needed.

Mike
Reply With Quote
  #5  
Old 12-15-2009, 09:13 PM
ohpleaseno ohpleaseno is offline
Sage Aficionado
 
Join Date: Apr 2009
Location: South Florida
Posts: 464
I haven't tried this yet, but it looks EXACTLY like something I've been wanting for a long time.

What is your SJQ ruleset and client script for this?

Thanks so much for writing this.
__________________
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
  #6  
Old 12-16-2009, 12:02 AM
Fuzzy's Avatar
Fuzzy Fuzzy is offline
SageTVaholic
 
Join Date: Sep 2005
Location: Jurupa Valley, CA
Posts: 9,957
Any chance you could upload it to the sage server instead of the crappy megaupload site? for a community that hates commercials, ad-crammed sites like that are quite irritating.. ;-)
__________________
Buy Fuzzy a beer! (Fuzzy likes beer)

unRAID Server: i7-6700, 32GB RAM, Dual 128GB SSD cache and 13TB pool, with SageTVv9, openDCT, Logitech Media Server and Plex Media Server each in Dockers.
Sources: HRHR Prime with Charter CableCard. HDHR-US for OTA.
Primary Client: HD-300 through XBoxOne in Living Room, Samsung HLT-6189S
Other Clients: Mi Box in Master Bedroom, HD-200 in kids room
Reply With Quote
  #7  
Old 12-16-2009, 07:15 AM
tmiranda's Avatar
tmiranda tmiranda is offline
SageTVaholic
 
Join Date: Jul 2005
Location: Central Florida, USA
Posts: 5,851
Thank you. I needed something like this and will try it out shortly. I really like simple tools that do one specific thing really well.
__________________

Sage Server: 8th gen Intel based system w/32GB RAM running Ubuntu Linux, HDHomeRun Prime with cable card for recording. Runs headless. Accessed via RD when necessary. Four HD-300 Extenders.
Reply With Quote
  #8  
Old 12-16-2009, 07:27 AM
ChaOConnor's Avatar
ChaOConnor ChaOConnor is offline
Sage Aficionado
 
Join Date: Nov 2008
Location: Bel Air, MD
Posts: 355
Mike, thank you!!! This is awesome!!! I've been doing this by hand for a while now, and I love the fact you could use this w/ SJQ. Have you tried a ruleset for SJQ yet?

Thanks again!

- Cha
__________________
Server: AMD Phenom II X6 1090T 3.2GHz, ASRock 890FX Deluxe4 890FX, PNY Optima 8GB DDR3 1333
Media Storage: Rosewill RSV-S4-X 4 Bay Enclosure w/ 4 x 3TB via unRAID
Capture: HDHomerun Prime, HDHomerun x 2
Software: Sage Server 7.1.9 on Windows 7 (Virtualized in ESXi)
Clients: i3-2105, ASRock Z68 Pro3-M, 4GB DDR3 1600, 64GB SATA III (OS), 2TB WD Green (Recording), PNY GT 430 // 2 x HD-300
Reply With Quote
  #9  
Old 12-16-2009, 11:08 AM
perfessor101 perfessor101 is offline
Sage Advanced User
 
Join Date: Nov 2003
Location: Vancouver, British Columbia, Canada
Posts: 246
Re: New Audio Tool

Quote:
Originally Posted by mikep View Post
Hi, I almost finished writing such a tool SAGEAudioConvert...

Syntax: SAGEAudioConvert [options] source
Sorry ... but I was curious ... will this tool support audio normalization?

Thanks for your time,
Bobby

* moved from another topic *
__________________
SageTV Server: Windows 7 64Bit, Phenom II X6 1090T, Asus M4A89GTD-PRO/USB3 (AM3), ATI Radeon HD 4290, 2 x KHX1600C9D3/4GX, 4 x HD-PVR2 Gaming, , 4 x 320GB recording drives, 2 x USB-UIRT, SageTV Server Beta
SageTV Client & 2 x HD-300 Extender.
40.8TB unRaid 6.6.5 media server
Reply With Quote
  #10  
Old 12-16-2009, 01:36 PM
heffe2001's Avatar
heffe2001 heffe2001 is offline
Sage Icon
 
Join Date: Mar 2004
Location: Conover, NC
Posts: 1,269
Quote:
Originally Posted by Fuzzy View Post
Any chance you could upload it to the sage server instead of the crappy megaupload site? for a community that hates commercials, ad-crammed sites like that are quite irritating.. ;-)
I didn't notice any ads on the site when I pulled it down (although I AM using adblock plugin for Firefox, and the SkipScreen plugin to automatically enter the code to start the download timer and start the actual download). It's definitely better than Rapidshare tho, they can be a large PITA...
__________________
Server: AMD Phenom 2 920 2.8ghz Quad, 16gb Ram, 4tb Storage, 1xHVR-2250, 1 Ceton Cable Card adapter, Windows 7 SP1
Reply With Quote
  #11  
Old 12-16-2009, 04:41 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
Quote:
Originally Posted by ChaOConnor View Post
Mike, thank you!!! This is awesome!!! I've been doing this by hand for a while now, and I love the fact you could use this w/ SJQ. Have you tried a ruleset for SJQ yet?

Thanks again!

- Cha
I will change/update my SJQ ruleset to include my program tonight or tomorrow and I will post my ruleset + client after I am done with testing

Mike
__________________
Server: Sage 7 on WinXP with 1TB of storage
NAS: Unraid with 6TB of storage
Clients: 4 HD-200 and 3 Sage Clients PC
Capture: 2 HD-PVRs + SA4250HDs
Reply With Quote
  #12  
Old 12-16-2009, 04:48 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
Quote:
Originally Posted by Fuzzy View Post
Any chance you could upload it to the sage server instead of the crappy megaupload site? for a community that hates commercials, ad-crammed sites like that are quite irritating.. ;-)
Will try again with next update. At first I tried but it failed 2 times on sage server, so I used another place. Maybe it was cause by google chrome browser, next time will try with MS IE.

BTW, guy, sorry for any typos, I am a french guy and english is not my first language
__________________
Server: Sage 7 on WinXP with 1TB of storage
NAS: Unraid with 6TB of storage
Clients: 4 HD-200 and 3 Sage Clients PC
Capture: 2 HD-PVRs + SA4250HDs
Reply With Quote
  #13  
Old 12-16-2009, 04:54 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Nope sage only allows up to 2 mb downloads. You could try open sourcing your software and using google code or sourceforge?
__________________
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
  #14  
Old 12-16-2009, 07:17 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
Quote:
Sorry ... but I was curious ... will this tool support audio normalization?

Thanks for your time,
Bobby
Dialog normalization is removed when encoding DTS to AC-3. I can add an option to disable the dialog normalization removal if required.

Mike
__________________
Server: Sage 7 on WinXP with 1TB of storage
NAS: Unraid with 6TB of storage
Clients: 4 HD-200 and 3 Sage Clients PC
Capture: 2 HD-PVRs + SA4250HDs
Reply With Quote
  #15  
Old 12-16-2009, 09:09 PM
hugenbdd hugenbdd is offline
Sage Advanced User
 
Join Date: Feb 2009
Location: Cincinnati, KY
Posts: 81
Hi
Great tool!!
I have one request/question.

Is it possible to overwrite an AC3 track that may already be on a file? I.E. an overwrite flag?

Why do this? Sometimes there is a DTS audio track, and an AC3 track that is "commentary". I would like to replace the commentary with the converted DTS.

Thanks
Dave
Reply With Quote
  #16  
Old 12-16-2009, 09:14 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
Quote:
Originally Posted by hugenbdd View Post
Hi
Great tool!!
I have one request/question.

Is it possible to overwrite an AC3 track that may already be on a file? I.E. an overwrite flag?

Why do this? Sometimes there is a DTS audio track, and an AC3 track that is "commentary". I would like to replace the commentary with the converted DTS.

Thanks
Dave
Great suggestion! I will add this option with my next release.
Mike
__________________
Server: Sage 7 on WinXP with 1TB of storage
NAS: Unraid with 6TB of storage
Clients: 4 HD-200 and 3 Sage Clients PC
Capture: 2 HD-PVRs + SA4250HDs
Reply With Quote
  #17  
Old 12-16-2009, 09:36 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
Here is my SJQ ruleset, *BUT* you will need a new version... I've add a new option -markdone to simplify the process with SJQ.... Next version will be available in max 2 days

Ruleset
Code:
#Check for DTS only track within mvk library files 
if [IsObjMediaFile == true && $.IsVideoFile{} == true && Filename =$ ".mkv" && FileExists != "%d%/%p%.dtsDone" ] {
   :PRIORITY 2 // Optional, default priority is zero
   DTSAUDIOCONVERT
}
Client config (note the new option -markdone)
Code:
DTSAUDIOCONVERT
{
  :MAX 1 //max 1 instance of this task
  :RESOURCES 50
  :CPU LOW
  "C:/SAGEAudioConvert/SAGEAudioConvert.exe -markdone -priority=low \"%c%\""
}
Mike
__________________
Server: Sage 7 on WinXP with 1TB of storage
NAS: Unraid with 6TB of storage
Clients: 4 HD-200 and 3 Sage Clients PC
Capture: 2 HD-PVRs + SA4250HDs
Reply With Quote
  #18  
Old 12-17-2009, 08:30 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
New version 0.1.11 beta

Hi,

I just upload a new version, there is no bug corrected , just 3 new features;

Change Log
v0.1.11 beta
* add -test switch.. . . . . Test mode only, do not create new tracks, just simulate. Use to preview what will be done.
* add -force switch. . . . . Replace existing AC3 track with new one. Replace only if language and #channels match, otherwise append.
* add -markdone switch. . Create a .dtsDone file beside the movie file. Useful will SJQ.

Have fun.
__________________
Server: Sage 7 on WinXP with 1TB of storage
NAS: Unraid with 6TB of storage
Clients: 4 HD-200 and 3 Sage Clients PC
Capture: 2 HD-PVRs + SA4250HDs
Reply With Quote
  #19  
Old 12-18-2009, 08:42 AM
hugenbdd hugenbdd is offline
Sage Advanced User
 
Join Date: Feb 2009
Location: Cincinnati, KY
Posts: 81
Hello
Thank you for adding the force flag, it helps alot. I have just one more suggestion, and that's cause I'm lazy and don't like to hit the audio button on the remote. Is there a way you can make a flag so the new AC3 track becomes the default track? Right now, the files start playing on the HD200 with DTS and I have to change it to the AC3 track. (Again cause I'm lazy, but would help improve the WAF). Or I wonder if I'm just missing a configuration setting in Sage that will set this.

I think this can be done with mkvtoolnix that you are using to recombine the new mkv with. I found the flags on their website but I'm not sure which one would be used.


--track-order <FID1:TID1[,FID2:TID2,...]>


This option changes the order in which the tracks for an input file are created. The argument is a comma separated list of pairs IDs. Each pair contains first the file ID which is simply the number of the file on the command line starting at 0. The second is a track ID from that file. If some track IDs are omitted then those tracks are created after the ones given with this option have been created.

--default-track <TID[:bool]>


Sets the ’default’ flag for the given track (see section TRACK IDS) if the optional argument bool is not present. If the user does not explicitly select a track himself then the player should prefer the track that has his ’default’ flag set. Only one track of each kind (audio, video, subtitles, buttons) can have his ’default’ flag set. If the user wants no track to have the default track flag set then he has to set bool to 0 for all tracks.
This option can be used multiple times for an input file applying to several tracks by selecting different track IDs each time.


Again Thanks for this great tool, it really eliminates the only missing item I have with the HD200!!!!!!!

Thanks
Dave
Reply With Quote
  #20  
Old 12-18-2009, 05:06 PM
mikep mikep is offline
Sage User
 
Join Date: Nov 2009
Location: Canada, QC
Posts: 65
Hi
To help the WAF, I will do something, this is crutial

I know that I can arrange tracks order and defaults with mkvtoolnix so I will add an option in my next release for that, but this release will be after christmas, no much time left for me right now...

I someone want some more features let me know... I promise nothing but you can always ask.

I glad to help to improve the WAF...
__________________
Server: Sage 7 on WinXP with 1TB of storage
NAS: Unraid with 6TB of storage
Clients: 4 HD-200 and 3 Sage Clients PC
Capture: 2 HD-PVRs + SA4250HDs
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: SageMCEDisplay Jere_Jones SageTV Customizations 37 04-13-2009 03:53 PM
Srt2Smi utility alon24 SageTV Customizations 4 12-08-2008 02:31 PM
Burn in utility mattdcknsn The SageTV Community 2 07-20-2007 01:38 PM
Which compression utility is the best? davephan General Discussion 7 01-03-2007 06:57 AM


All times are GMT -6. The time now is 02:03 PM.


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