Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 2 Guest(s)
Thread Closed 
mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
03-12-2008, 01:46 AM (This post was last modified: 12-10-2009 01:26 AM by JakeWharton.)
Post: #1
mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
mkvdts2ac3
A script for adding an AC3 track to an MKV with DTS

This script will add an AC3 audio track to your MKV's which contains a DTS track. By retaining the DTS track rather than stripping it, we allow for future DTS decoding but give the NMT an audio stream it currently knows how to decode. If you choose to not save the DTS track, the `-n` switch will not include it in the final MKV.

Features:
  • Saves DTS track after conversion or optionally removes it.
  • Optional setting of new AC3 track as default.
  • Explicitly specify DTS track ID (For multiple DTS tracks)
  • Simple run-it and forget-it design
  • Actively developed, open source, and free!



You can get the current version of this script as well as read documentation and submit issue tickets at:
github.com/JakeWharton/mkvdts2ac3/



To use the script just pass in a file and wait about 10 minutes.
Code:
./mkvdts2ac3.sh Some.Movie.mkv

Once the script is done executing you can check that the new AC3 track has been added in addition to the original DTS track by issuing the following command
Code:
mkvmerge -i Some.Movie.mkv
or by using a program such as MediaInfo.

Command line options:
Code:
mkvdts2ac3-1.5.0 - by Jake Wharton <jakewharton@gmail.com> and
                      Chris Hoekstra <chris.hoekstra@gmail.com>

Usage: mkvdts2ac3.sh [options] <filename>
Options:
     -c TITLE,        Custom AC3 track title.
     --custom TITLE
     -d, --default    Mark AC3 track as default.
     -e, --external   Leave AC3 track out of file. Does not modify the
                      original matroska file. This overrides '-n' and
                      '-d' arguments.
     -f, --force      Force processing when AC3 track is detected
     -k, --keep-dts   Keep external DTS track (implies '-n').
     -m, --nocolor    Do not use colors (monotone)
     -n, --no-dts     Do not retain the DTS track.
     -o MODE          Pass a custom audio output mode to libdca.
     -p PRIORITY      Modify niceness of executed commands.
     -t TRACKID,
     --track TRACKID  Specify alternate DTS track.
     -w FOLDER,
     --wd FOLDER      Specify alternate temporary working directory.

     --test           Print commands only, execute nothing.
     --debug          Print commands and pause before executing each.

     -h, --help       Print command usage.
     -v               Turn on verbose output
     -V, --version    Print script version information.

Post any questions or comments below and i'll try to get back to you as quickly as possible.
Visit this user's website Find all posts by this user
[+] 1 user says Thank You to JakeWharton for this post
03-12-2008, 08:27 PM
Post: #2
 
Nice work! Big Grin
Find all posts by this user
03-15-2008, 04:09 PM
Post: #3
 
This is for use in Linux environments right? If so, are you planing on making a windows version? I'd also like to see an option to strip the DTS if you like.
Find all posts by this user
03-22-2008, 06:42 AM
Post: #4
 
+1 the above comment.

though i like the idea of retaining the dts audio track in the file for when pch hopefully fixes it.

how much extra space does it take up though to keep both audio tracks and how do you select the ac3 track in the pch?

there is a windows prog that will recode the dts to ac3 but its for ps3 playback so it also remuxes the x264 mkv to avchd.

if its a l4.1 h.264 video file mkv though and generally compatible in most other ways, the remux to avc is super quick though so that prog could still be an option to make a file that plays properly on the pch.

though at that point i'd prob just use my ps3 to play it as it seems to have nice playback interface, controls and shows more info of the file etc.
Find all posts by this user
03-22-2008, 05:00 PM
Post: #5
 
I'm going to add support for command line parameters such as for stripping the DTS as well as support for multiple files this week. I'll post when it's done
Visit this user's website Find all posts by this user
03-26-2008, 07:13 PM
Post: #6
 
Might I also suggest you use pipes? That would eliminate the need for the multi-gigabytes of interim files necessary for the conversion process. Does seem to make the output a bit harder to understand though...

Very handy script either way. It's amazing how many tools are available in linux and how few of them are documented. I guess everybody wants shiny Windows GUIs.
Find all posts by this user
04-24-2008, 01:41 PM (This post was last modified: 04-13-2009 10:19 PM by JakeWharton.)
Post: #7
Version 0.21-080424 released
New minor version 0.21-080424 released.

GregRozon Wrote:Might I also suggest you use pipes? That would eliminate the need for the multi-gigabytes of interim files necessary for the conversion process.

Changelog:
* Eliminated interim wav file

Enjoy... (if anyone even uses this)
Visit this user's website Find all posts by this user
06-10-2008, 02:12 PM
Post: #8
 
I will try this very soon, just what I need.

Does it work ok for you? Any bugs?
I read in another thread about mkvs with subs did not work on PCH after changing audio track from dts to ac3, they had to run the converter software twice I think, it was not clearly stated. But it was not regarding this script, I think it was the "freeware" windows program but that still uses the same tools, or some of them.
Is this a problem with mkvmerge or perhaps in an earlier version?
Are aften and libdca stable software?
Visit this user's website Find all posts by this user
06-10-2008, 04:31 PM
Post: #9
 
I've been trying to get these scripts to work on some files I have, but I keep running into errors. I have a feeling the subs or the extra AC3 (commentary) track are messing them up. The only script I could get working is your beta script. Here is the output from mkvmerge:

Code:
File 'film.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_DTS)
Track ID 3: audio (A_AC3)
Track ID 4: subtitles (S_TEXT/UTF8)
Track ID 5: subtitles (S_TEXT/UTF8)

Has anyone had luck with multi-track mkv's or mkv's with subs?

Thanks!
Find all posts by this user
06-10-2008, 05:13 PM
Post: #10
 
pinkpocky Wrote:This is for use in Linux environments right? If so, are you planing on making a windows version? I'd also like to see an option to strip the DTS if you like.

De1Phi4n Wrote:+1 the above comment.

though i like the idea of retaining the dts audio track in the file for when pch hopefully fixes it.

how much extra space does it take up though to keep both audio tracks and how do you select the ac3 track in the pch?

there is a windows prog that will recode the dts to ac3 but its for ps3 playback so it also remuxes the x264 mkv to avchd.

if its a l4.1 h.264 video file mkv though and generally compatible in most other ways, the remux to avc is super quick though so that prog could still be an option to make a file that plays properly on the pch.

though at that point i'd prob just use my ps3 to play it as it seems to have nice playback interface, controls and shows more info of the file etc.

you guys need to check out heartware's audioconverter.
Find all posts by this user
06-10-2008, 06:43 PM
Post: #11
 
janky Wrote:
Code:
File 'film.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_DTS)
Track ID 3: audio (A_AC3)
Track ID 4: subtitles (S_TEXT/UTF8)
Track ID 5: subtitles (S_TEXT/UTF8)

Has anyone had luck with multi-track mkv's or mkv's with subs?

I use this very frequently on both types actually and i'm surprised that it's failing. What exactly happens?
Visit this user's website Find all posts by this user
06-10-2008, 06:54 PM
Post: #12
 
JakeWharton Wrote:I use this very frequently on both types actually and i'm surprised that it's failing. What exactly happens?

I'll have to run it again when I get home... The original script fails saying that it expects a second parameter, your most recent stable version does something similar, whereas the beta version works and does all the conversion but does not remux the AC3 into the mkv.

I can give more later when I run the various different scripts. Perhaps, I should also try it on another file.
Find all posts by this user
06-10-2008, 07:05 PM
Post: #13
 
janky Wrote:...the beta version works and does all the conversion but does not remux the AC3 into the mkv.

The beta version has been broken for a while unfortunately. I haven't really had any time to fix it (nor the need) so i'm going to take it down for now.

janky Wrote:The original script fails saying that it expects a second parameter, your most recent stable version does something similar...

This might be a problem with your libdca or aften versions though I doubt it. When you get a chance, post the output from the script when it fails and i'll do my best to figure this out and fix it.
Visit this user's website Find all posts by this user
06-10-2008, 07:24 PM
Post: #14
 
JakeWharton Wrote:This might be a problem with your libdca or aften versions though I doubt it. When you get a chance, post the output from the script when it fails and i'll do my best to figure this out and fix it.
Then please also post your versions of libdca and aften.
Visit this user's website Find all posts by this user
06-10-2008, 08:12 PM
Post: #15
 
It may be libdca for sure. The source files on vlc's page didnt install correctly in ubuntu for me so I found a .deb packaged version of libdca 0.0.5 which worked fine in your beta script.
Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  adding channels and menu barnea 0 953 07-31-2011 03:33 PM
Last Post: barnea
  mounting hdx shares from Linux - read only schnaaf 0 1,438 01-24-2010 01:21 PM
Last Post: schnaaf
  DTS->Stereo AAC Script (Linux) MukiEX 0 5,459 11-15-2009 05:00 PM
Last Post: MukiEX
  TV Episode Renamer for Linux users qwerty454 18 21,072 10-25-2009 06:08 PM
Last Post: ciao
  php exec() function and linux shell command Shaika-Dzari 23 15,582 08-10-2009 08:16 PM
Last Post: highonhd
  adding zlib to the toolchain jjabba 5 3,377 05-25-2009 12:14 AM
Last Post: jjabba
  Exiled Destiny Anime fix-it script (Linux) MukiEX 0 1,142 04-06-2009 09:54 PM
Last Post: MukiEX
  Adding web service through ftp/telnet tiwas 5 4,813 03-19-2009 08:38 AM
Last Post: Ger Teunis
  Need Help with Linux Commands, ... NFS to the QNAP box. Legion455 9 4,010 07-19-2008 08:44 PM
Last Post: Legion455

Forum Jump: