[7. June 2013] Youporn available now | [19. April 2013] A-400 Advanced Network Setup | [11 Jan. 2013] Customize your A-400 Home Screen

Firmware: A-400 [13 May 2013] | C-300 [30 Nov. 2012] | A-300 [30 Nov. 2012] | C-200 RC1 [13 June 2013] | A-200/A-210 RC1 [13 June 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: 1 Guest(s)
Thread Closed 
mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
08-11-2008, 08:32 PM
Post: #76
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
Still mot working with crimson script:

john@john-linux:/media/nas/etch/SABnzbd-0.2.5/complete/Death_sentence$ ./mkv2.sh death.mkv
Extracting track 2 with the CodecID 'A_DTS' to the file '/tmp/death.dts'. Container format: Digital Theater System (DTS)
progress: 100%

Aften: A/52 audio encoder
Version SVN-r761
© 2006-2007 Justin Ruggles, Prakash Punnoor, et al.

libdca-0.0.5 - by Gildas Bazin <gbazin@videolan.org>
based on the a52dec code from Michel Lespinasse <walken@zoy.org> and Aaron Holtzman
Stream with high frequencies VQ coding
input format: Microsoft WAVE Floating-point 32-bit little-endian 48000 Hz 5.1-channel
output format: 48000 Hz 3/2 + LFE

SIMD usage: MMX SSE SSE2
Threads: 1

progress: 0% | q: 321.4 | bw: 34.0 | bitrate: 448.0 kbps 651 frames in 1.00 seprogress: 0% | q: 324.3 | bw: 34.0 | bitrate: 448.0 kbps 977 frames in 1.49 seprogress: 0% | q: 327.3 | bw: 34.0 | bitrate: 448.0 kbps 1298 frames in 1.99 sprogress: 0% | q: 328.9 | bw: 34.0 | bitrate: 448.0 kbps 1627 frames in 2.48 sprogress: 0% | q: 330.1 | bw: 34.0 | bitrate: 448.0 kbps 2284 frames in 3.47 sprogress: 0% | q: 331.8 | bw: 34.0 | bitrate: 448.0 kbps 2609 frames in 3.97 sprogress: 0% | q: 331.6 | bw: 34.0 | bitrate: 448.0 kbps 2935 frames in 4.46 sec (658.07 fps), 326 last 0.50 sec (652.00 fps)
3162 frames decoded in 4.82 seconds (656.02 fps)
progress: 100% | q: 332.3 | bw: 34.0 | bitrate: 448.0 kbps

mkvmerge v2.2.0 ('Turn It On Again') built on Mar 4 2008 10:19:49
'death.mkv': Using the Matroska demultiplexer.
'/tmp/death.ac3': Using the AC3 demultiplexer.
'death.mkv' track 1: Using the MPEG-4 part 10 (AVC) video output module.
'death.mkv' track 2: Using the DTS output module.
'death.mkv' track 3: Using the AC3 output module.
'/tmp/death.ac3' track 0: Using the AC3 output module.
The file '/tmp/death.ac3.mkv' has been opened for writing.
progress: 100%
The cue entries (the index) are being written...
Muxing took 5 seconds.
mv: cannot stat `/tmp/death.tmp.mkv': No such file or directory
Total processing time: 21 seconds.
john@john-linux:/media/nas/etch/SABnzbd-0.2.5/complete/Death_sentence$

Will try the manual method

Thanks

Trux
Find all posts by this user
08-11-2008, 11:17 PM
Post: #77
Question RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
Ok here are my steps: embedded (start with *)[/font]:


this looks far more complicated then it actually is .. i provide sample data output at every command i drop thats why it looks so bloody long Wink

1.) you will still need the same tools the script needs and enough disc space (surprise)

-> mkvmerge
check with
Code:
which mkvmerge
should give you an output like
Code:
/usr/bin/mkvmerge

* $ which mkvmerge
/usr/bin/mkvmerge

-> mkvextract
check with
Code:
which mkvextract
should give you an output like
Code:
/usr/bin/mkvextract

* $ which mkvextract
/usr/bin/mkvextract

-> dcadec
Code:
which dcadec
should give you an output like
Code:
/usr/local/bin/dcadec

* $ which dcadec
/usr/local/bin/dcadec

-> aften
Code:
which aften
should give you an output like
Code:
/usr/bin/aften

* $ which aften
/usr/local/bin/aften

so you got everything installed and enough disc space (please check youself)->

2.) lets find out if there is a dts track and the id of the dts track and extract it
Code:
mkvmerge -i /path/to/original/file.mkv
should give you an output like
Code:
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_DTS)
-> track 2 is a dts track -> extract this track

* $ mkvmerge -i death.mkv
File 'death.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_DTS)
Track ID 3: audio (A_AC3)

(yes I know there is a ac3 track there - but this is just the sample file it does the same for the dull file that doesn't have the ac3 track)

Code:
mkvextract tracks /path/to/original/file.mkv 2:/tmp/filename.dts
(note : 2 is the number of the dts track)
this will should give you an output like
Code:
Extracting track 2 with the CodecID 'A_DTS' to the file '/tmp/filename.dts'. Container format: Digital Theater System (DTS)
this will take a few minutes, when finished you should have a file /tmp/filename.dts Wink

* mkvextract tracks death.mkv 2:/tmp/death.dts
Extracting track 2 with the CodecID 'A_DTS' to the file '/tmp/death.dts'. Container format: Digital Theater System (DTS)
progress: 100%


3.) convert the dts track to ac3
Code:
dcadec -o wavall /tmp/filename.dts | aften - /tmp/filename.ac3
(huge output and progress bla bla)
this will take a few more minutes, when finished you should have a file /tmp/filename.ac3 Wink (can somebody pls donate me a core 2 mobo and processor for my server ? k thx by)

* $ dcadec -o wavall /tmp/death.dts | aften - /tmp/death.ac3

Aften: A/52 audio encoder
Version SVN-r761
© 2006-2007 Justin Ruggles, Prakash Punnoor, et al.

libdca-0.0.5 - by Gildas Bazin <gbazin@videolan.org>
based on the a52dec code from Michel Lespinasse <walken@zoy.org> and Aaron Holtzman
Stream with high frequencies VQ coding
input format: Microsoft WAVE Floating-point 32-bit little-endian 48000 Hz 5.1-channel
output format: 48000 Hz 3/2 + LFE

SIMD usage: MMX SSE SSE2
Threads: 1

progress: 0% | q: 321.8 | bw: 34.0 | bitrate: 448.0 kbps 674 frames in 1.00 seprogress: 0% | q: 326.6 | bw: 34.0 | bitrate: 448.0 kbps 1010 frames in 1.50 sprogress: 0% | q: 328.6 | bw: 34.0 | bitrate: 448.0 kbps 1690 frames in 2.50 sprogress: 0% | q: 330.1 | bw: 34.0 | bitrate: 448.0 kbps 2030 frames in 3.00 sprogress: 0% | q: 331.8 | bw: 34.0 | bitrate: 448.0 kbps 2709 frames in 3.99 sprogress: 0% | q: 331.6 | bw: 34.0 | bitrate: 448.0 kbps 3044 frames in 4.50 sec (676.44 fps), 335 last 0.51 sec (656.86 fps)
3162 frames decoded in 4.68 seconds (675.64 fps)
progress: 100% | q: 332.3 | bw: 34.0 | bitrate: 448.0 kbps


4.) delete the dts track (we don´t need it anymore .. of couse you could also delete it later but don´t forget to delete it!!)
Code:
rm -f /tmp/filename.dts

* yup

5.) merge the ac3 file to the original mkv file -> create a new mkv file
Code:
mkvmerge -o /tmp/filename_new.mkv /path/to/original/file.mkv /tmp/filename.ac3
sample output
Code:
The file '/tmp/filename_new.mkv' has been opened for writing.
this will also take some time Wink (core 2 for free anyone?)

* mkvmerge -o /tmp/death_new.mkv death.mkv /tmp/death.ac3
mkvmerge v2.2.0 ('Turn It On Again') built on Mar 4 2008 10:19:49
'death.mkv': Using the Matroska demultiplexer.
'/tmp/death.ac3': Using the AC3 demultiplexer.
'death.mkv' track 1: Using the MPEG-4 part 10 (AVC) video output module.
'death.mkv' track 2: Using the DTS output module.
'death.mkv' track 3: Using the AC3 output module.
'/tmp/death.ac3' track 0: Using the AC3 output module.
The file '/tmp/death_new.mkv' has been opened for writing.
progress: 100%
The cue entries (the index) are being written...
Muxing took 6 seconds.

now we will have a new file (/tmp/filename_new.mkv) with both tracks inside, AC3 and DTS .. lets check that :
Code:
mkvmerge -i /tmp/filename_new.mkv

should give you an output like
Code:
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_DTS)
Track ID 3: audio (A_AC3)

* mkvmerge -i /tmp/death_new.mkv
File '/tmp/death_new.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: audio (A_AC3)


6.) delete the ac3 track
Code:
rm -f /tmp/filename.ac3

WUHU you have them both inside of course you should move the /tmp/filename_new.mkv to a proper directory (cp /tmp/filename_new.mkv where/ever/you/want/it/ )
if you want to delete the dts track skip the copy part and continue with 7

7.) as you see at the end of section 5 we still have the dts track with the id 2 within the mkv and a ac3 track with the id 3 (important)
now lets copy the file to a new destination but without the dts track
Code:
mkvmerge -o /tmp/filename_even_newer.mkv -a 3 /tmp/filelname_new.mkv
again you will get a writing progress (note: since this is the last step you could also write the file to the proper destination directory directly .. the -o defines the output file so you could replace the /tmp/filename_even_newer.mkv with /path/to/wherever/you/want/it/filename_even_newer.mkv and skip the mv part below)

mkvmerge -o /tmp/death_even_newer.mkv -a 3 /tmp/death_new.mkv
mkvmerge v2.2.0 ('Turn It On Again') built on Mar 4 2008 10:19:49
'/tmp/death_new.mkv': Using the Matroska demultiplexer.
'/tmp/death_new.mkv' track 1: Using the MPEG-4 part 10 (AVC) video output module.
'/tmp/death_new.mkv' track 3: Using the AC3 output module.
The file '/tmp/death_even_newer.mkv' has been opened for writing.
progress: 100%
The cue entries (the index) are being written...
Muxing took 2 seconds.


8.) copy the filename_even_newer.mkv
Code:
mv /tmp/filename_even_newer.mkv /path/to/wherever/you/want/it/filename_even_newer.mkv

test it with mkvmerge -i /path/to/wherever/you/want/it/filename_even_newer.mkv


now you will have two files .. you could delete the original file
[/quote]

* mkvmerge -i /tmp/death_even_newer.mkv
File '/tmp/death_even_newer.mkv': container: Matroska
Track ID 1: video (V_MPEG4/ISO/AVC)
Track ID 2: audio (A_AC3)

Yes the manual steps worked perfectly - so why doesn't the script work for me?

Really want to get this to work automatically!

:-(

Thanks for help/
Find all posts by this user
[+] 1 user says Thank You to truxntrax for this post
08-13-2008, 08:31 AM
Post: #78
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
did you try http://crimson.endofinternet.org/mkvdts2ac3 this version ? i had an error at the cp command before ..
Find all posts by this user
08-13-2008, 09:56 PM (This post was last modified: 08-13-2008 10:53 PM by truxntrax.)
Post: #79
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
Yes latest version! What's going wrong what does stat mean?
Find all posts by this user
08-15-2008, 10:00 PM
Post: #80
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
Please help - definitley using the latest version of the script!

Version: 0.3.1-crimson

Where am I going wrong? Could it be because the files are on my nas device which I have mounted as a drive?

Many thanks

Trux
Find all posts by this user
11-02-2008, 11:58 PM (This post was last modified: 11-03-2008 12:05 AM by janky.)
Post: #81
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
Just want to add a few things I did with this script to help others out. I reinstalled my ubuntu and had to reinstall everything.

1) for some reason I couldn't get libdca to compile correctly. So, instead I installed the gnome deb located here: http://debian.cs.binghamton.edu/debian/p...1_i386.deb The script worked fine after I installed it.

2) Make your script a nautilus menu item:
-- copy mkvdts2ac3 into /usr/local/bin (this will also make the script available in bash ad a command)
-- Create a text file called "Convert DTS to AC3" and copy it into ~/.gnome2/nautilus-scripts with:
Code:
#!/bin/sh
for moviefile in "$@"; do
    gnome-terminal -x mkvdts2ac3 "$moviefile"
done
-- Then find the mkv you want to convert right click it and in the menu go to "Scripts", your script should be there.

3) The Crimson script is no longer available, I used v0.22 from the googlecode page and everything works fine.
Find all posts by this user
[+] 1 user says Thank You to janky for this post
11-03-2008, 08:50 PM (This post was last modified: 04-13-2009 10:32 PM by JakeWharton.)
Post: #82
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
<strike>I actually got a surround sound system that's capable of decoding DTS so I'm sorry to say that I'll no longer be developing this script. I'll be more than happy to add anyone to the Google Code project so that they can continue development at that location. I'm still subscribed to this thread and will check the further replies here and offer any assistance I can. Despite the fact that I developed the script into 400+ lines I personally still use the original, 10-ish line version...</strike>
Visit this user's website Find all posts by this user
12-05-2008, 06:57 PM
Post: #83
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
(11-03-2008 08:50 PM)JakeWharton Wrote:  I actually got a surround sound system that's capable of decoding DTS so I'm sorry to say that I'll no longer be developing this script. I'll be more than happy to add anyone to the Google Code project so that they can continue development at that location. I'm still subscribed to this thread and will check the further replies here and offer any assistance I can. Despite the fact that I developed the script into 400+ lines I personally still use the original, 10-ish line version...

I'd be interested in seeing either (10 lines or 400 lines)version as I run the commands by hand currently. (I made the mistake of selling my receiver because the wireless back speakers messed with my wifi.... only to find that even though my NEW HTiB said "DTS" on it, it's only the DVD player portion that can USE DTS)

-Jim Wharton
Find all posts by this user
12-08-2008, 08:33 PM (This post was last modified: 04-13-2009 10:16 PM by JakeWharton.)
Post: #84
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
(12-05-2008 06:57 PM)nobleach Wrote:  I'd be interested in seeing either (10 lines or 400 lines)version as I run the commands by hand currently. (I made the mistake of selling my receiver because the wireless back speakers messed with my wifi.... only to find that even though my NEW HTiB said "DTS" on it, it's only the DVD player portion that can USE DTS)

-Jim Wharton

The 400-line version is available via SVN: <strike>http://mine.jakewharton.com/repositories/entry/mkvdts2ac3/trunk/mkvdts2ac3.sh</strike> http://github.com/JakeWharton/mkvdts2ac3...dts2ac3.sh

I've also uploaded the 10-line version which I still use as version 0.2: <strike>http://mine.jakewharton.com/projects/list_files/mkvdts2ac3</strike> http://github.com/JakeWharton/mkvdts2ac3...dts2ac3.sh

I also just received an email with a user who made his own improvements which I will be integrating into SVN soon. I'm not sure if i'll be making another true release (version 0.3) since I don't have the means or will to adequately test the script anymore so any future changes will need to be obtained through SVN.
Visit this user's website Find all posts by this user
12-08-2008, 08:38 PM
Post: #85
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
Thanks!
Find all posts by this user
12-25-2008, 09:20 PM
Post: #86
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
where should the mkvdts2ac3 be put?
im using os x
Find all posts by this user
12-26-2008, 06:02 AM
Post: #87
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
(12-25-2008 09:20 PM)dsi Wrote:  where should the mkvdts2ac3 be put?
im using os x

Well you can put it anywhere really! I actually don't have OS X and have only used it once and it was to get this script working for a friend. I put it in /usr/bin I think so that it was accessible without prefixing the full path to the script. Don't forget to "chmod +x filename" the script so you can execute it!
Visit this user's website Find all posts by this user
12-26-2008, 01:54 PM
Post: #88
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
(12-26-2008 06:02 AM)JakeWharton Wrote:  Well you can put it anywhere really! I actually don't have OS X and have only used it once and it was to get this script working for a friend. I put it in /usr/bin I think so that it was accessible without prefixing the full path to the script. Don't forget to "chmod +x filename" the script so you can execute it!

ok thx i forgot to chmod it thats why it was not working
Find all posts by this user
01-24-2009, 07:27 PM
Post: #89
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
I'm using the trunk version downloaded from here:
http://mine.jakewharton.com/repositories...dts2ac3.sh

Getting the following error on the final remux

Code:
mkvmerge v2.4.2 ('Oh My God') built on Jan 17 2009 23:07:45
Error: The source file '"test.mkv"' could not be opened successfully, or retrieving its size by seeking to the end did not work.
ERROR: Merging the AC3 track back into the MKV failed.

If you look closely, the name of the file is "test.mkv" including the quotes (Instead of just test.mkv)

I think that this is happening due to a wrong escaping, for example:
Code:
#!/bin/bash

CMD="mkvmerge -i \"test.mkv\""
echo $CMD
$CMD

echo will show:
Code:
mkvmerge -i "test.mkv"

but this will be executed:
Code:
mkvmerge -i \"test.mkv\"

I removed the escaping for now, but I guess the solution is to escape spaces using sed.

This is weird because I see that it does work for most of you guys.... maybe the truck version @ http://mine.jakewharton.com/ is different then the last version on google code?

BTW, Does anyway still maintaining this script?
Find all posts by this user
[+] 1 user says Thank You to PiXeL for this post
01-24-2009, 07:52 PM
Post: #90
RE: mkvdts2ac3 (Adding AC3 track from DTS) [Linux/OSX]
(01-24-2009 07:27 PM)PiXeL Wrote:  I'm using the trunk version downloaded from here:
http://mine.jakewharton.com/repositories...dts2ac3.sh

Getting the following error on the final remux

Code:
mkvmerge v2.4.2 ('Oh My God') built on Jan 17 2009 23:07:45
Error: The source file '"test.mkv"' could not be opened successfully, or retrieving its size by seeking to the end did not work.
ERROR: Merging the AC3 track back into the MKV failed.

If you look closely, the name of the file is "test.mkv" including the quotes (Instead of just test.mkv)

I think that this is happening due to a wrong escaping, for example:
Code:
#!/bin/bash

CMD="mkvmerge -i \"test.mkv\""
echo $CMD
$CMD

echo will show:
Code:
mkvmerge -i "test.mkv"

but this will be executed:
Code:
mkvmerge -i \"test.mkv\"

I removed the escaping for now, but I guess the solution is to escape spaces using sed.

This is weird because I see that it does work for most of you guys.... maybe the truck version @ http://mine.jakewharton.com/ is different then the last version on google code?

BTW, Does anyway still maintaining this script?

Yeah I'm still around to make any changes anyone requests or fix any problems anyone finds. I don't use the trunk version myself so I usually rely on other people to submit fixes. Feel free to fix this and any other changes you find and email me the details or even a diff and i'll gladly integrate it.
Visit this user's website Find all posts by this user
Thread Closed 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Automated tool to convert DTS to AC3 (windows) *New Version and Batch Conversion* spelosi 140 268,257 01-30-2013 03:27 AM
Last Post: skoobyd
Tongue Tool for WMV/WMA Pro to MKV/AC3 conversion ooris 103 92,064 10-10-2011 10:06 PM
Last Post: Modify_inc
  adding channels and menu barnea 0 785 07-31-2011 03:33 PM
Last Post: barnea
  mounting hdx shares from Linux - read only schnaaf 0 1,239 01-24-2010 01:21 PM
Last Post: schnaaf
Question Any DTS to AC3 Apps Run On NMT? NOD 9 5,331 12-11-2009 05:28 PM
Last Post: choekstr
  DTS->Stereo AAC Script (Linux) MukiEX 0 4,704 11-15-2009 05:00 PM
Last Post: MukiEX
  TV Episode Renamer for Linux users qwerty454 18 18,590 10-25-2009 06:08 PM
Last Post: ciao
  nmt community software installer on osx gabric098 24 10,915 10-04-2009 06:02 PM
Last Post: Ger Teunis
  php exec() function and linux shell command Shaika-Dzari 23 12,683 08-10-2009 08:16 PM
Last Post: highonhd
  adding zlib to the toolchain jjabba 5 2,827 05-25-2009 12:14 AM
Last Post: jjabba

Forum Jump: