Author Topic: Extracting DTS audio from DVD to multi track wave file.  (Read 743 times)

Offline Village Idiot

  • Hero Member
  • *****
  • Posts: 2345
  • Have A Nice Day.
Extracting DTS audio from DVD to multi track wave file.
« on: October 29, 2011, 01:50:50 PM »
Hi.

I'm just a poor boy, nobody loves me...  ;)

Sorry if this is not asked in the correct place. I'm usually self-sufficient on these matters...

Recently due to the nostalgia of the PCLinuxOS ISOs that have come and gone, I found myself cranking up an old edition that played very nice with very expensive multi-track PCI soundboards I own. And on a computer with PCI slots!  :o

Long story short, I can again playback a 6 or 8 channel .wav file to a surround-sound speaker configuration, something that Pulse eludes me from doing with any hardware I seem to have, new or old. Doesn't bother me tho.

Many years ago, I was given a music video DVD of a popular 70's rock band and the audio available on the disk is either Dolby stereo or DTS 5.1 remixed. At the time the only way to enjoy the remixed surround sound option was to play the disk on a stand-alone DVD player with DTS and 6 channel outs. I'd like to extract the DTS surround and dump it to a 6-track wave file.

Any suggestions how to accomplish this with tools available in the current repos?

TIA
 :)

edit: command line tools preferred.  :P
$ fortune
No Microsoft products were used in any way for the creation of this message.
If you are using a Microsoft product to view it, BEWARE! - I'm not
responsible for any harm you might encounter as a result.

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10691
  • MLUs Forever!
Re: Extracting DTS audio from DVD to multi track wave file.
« Reply #1 on: October 29, 2011, 05:18:39 PM »
I'm posting mostly to get reminders of this thread  :D

What have you tried so far?   
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Village Idiot

  • Hero Member
  • *****
  • Posts: 2345
  • Have A Nice Day.
Re: Extracting DTS audio from DVD to multi track wave file.
« Reply #2 on: October 29, 2011, 05:30:57 PM »
I'm posting mostly to get reminders of this thread  :D

What have you tried so far?  


Thanks.

Recently tried:
ls
mencoder --help
 ;)

Five years ago:
Everything but the kitchen sink. And gave up.


I've found this relic offsite, this looks like a suitable solution if it works:
http://www.linuxquestions.org/linux/answers/Applications_GUI_Multimedia/DTS_to_AC3_0

Quote
By Steel_J at 2005-12-30 16:22

Some of you may have encountered a few AVI movies with DTS audio tracks.

Sometimes we don't want to keep it as DTS.

Unfortunately, to extract and convert DTS audio some creativity must be involved as this format is not accepted widely by A/V tools in LINUX.

Here is a script I created to rip a bunch of AVI files DTS tracks and convert them to Stereo AC3 tracks automagically.

Copy/paste this to a text file and save it as "avidts2ac3":

#!/bin/bash

#avidts2ac3 (extracts DTS tracks from video file and converts it to ac3)

#requirements: mplayer / ffmpeg

#variables
current_directory=$( pwd )
OUTPUT_AVI="output_avi.av" #'av' extension used to prevent filename conflict
OUTPUT_WAV="output_wav.wav"
OUTPUT_AC3="output_ac3.ac3"

#remove spaces
for i in *.avi; do mv "$i" `echo $i | tr ' ' '_'`; done > /dev/null 2>&1 &

#remove uppercase
for i in *.[Aa][Vv][Ii]; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done > /dev/null 2>&1 &

#rip with Mencoder / encode with ffmpeg
for i in *.avi ; do nice -n 10 mencoder $i -oac pcm -ovc copy -o $OUTPUT_AVI && nice -n 10 ffmpeg -i $OUTPUT_AVI -acodec copy $OUTPUT_WAV && nice -n 10 ffmpeg -i $OUTPUT_WAV -ac 2 -ab 192 -ar 48000 $OUTPUT_AC3 && mv $OUTPUT_AC3 "`basename "$i"`.ac3" && rm $OUTPUT_WAV ;done


#Cleanup
rm $OUTPUT_AVI

exit;

You might want to copy this as root to your path so you can use it in any directory. (/usr/bin or /urs/local/bin)

Don't forget to give it permission: chmod +rx avidts2ac3

Then put all the AVI movies you want to convert in one folder and use the script in console from that folder.

For those who want or need to understand the mechanics of it all here it is broken down for you in a step by step guide:

DTS to AC3

1)Convert the audio in the movie in WAV PCM:

nice -n 10 mencoder input_video.avi -oac pcm -ovc copy -o output_movie.avi

2)Extract the WAV file from the new AVI:

nice -n 10 ffmpeg -i output_movie.avi -acodec copy movie_audio.wav

3)Convert the WAV to AC3 Stereo

nice -n 10 ffmpeg -i movie_audio.wav -ac 2 -ab 192 -ar 48000 audio.ac3

After that you can multiplex your mpeg2 movie with your new AC3 track

* Note that once the WAV is extracted you can convert it to whatever you prefer also.
$ fortune
No Microsoft products were used in any way for the creation of this message.
If you are using a Microsoft product to view it, BEWARE! - I'm not
responsible for any harm you might encounter as a result.

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10691
  • MLUs Forever!
Re: Extracting DTS audio from DVD to multi track wave file.
« Reply #3 on: October 29, 2011, 05:35:05 PM »
.......  but that makes a two channel stereo file? ......  which is not what you wanted, I understood ...
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10691
  • MLUs Forever!
Re: Extracting DTS audio from DVD to multi track wave file.
« Reply #4 on: October 29, 2011, 05:44:16 PM »
wonder about this ........

http://linux.die.net/man/1/dtsdec

Quote
DTS Coherent Acoustics decoder
This is a free decoder for the DTS Coherent Acoustics format. It
consists of a library and a command line decoder. DTS is a high
quality multi-channel (5.1) digital audio format used in DVDs and
DTS audio CDs.



It is in the repo .....

EDIT .......  there is also a gstreamer plugin for DTS decoding .....

« Last Edit: October 29, 2011, 05:47:21 PM by Just18 »
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT

Offline Village Idiot

  • Hero Member
  • *****
  • Posts: 2345
  • Have A Nice Day.
Re: Extracting DTS audio from DVD to multi track wave file.
« Reply #5 on: October 29, 2011, 05:49:37 PM »
That might be the ticket.  :)

The man page is a little vague isn't it?

$ fortune
No Microsoft products were used in any way for the creation of this message.
If you are using a Microsoft product to view it, BEWARE! - I'm not
responsible for any harm you might encounter as a result.

Offline Just17

  • PCLinuxOS Tester
  • Super Villain
  • *******
  • Posts: 10691
  • MLUs Forever!
Re: Extracting DTS audio from DVD to multi track wave file.
« Reply #6 on: October 29, 2011, 05:53:35 PM »
That might be the ticket.  :)

The man page is a little vague isn't it?



It is designed, as far as I can tell, for playing the streams .......  there is ref on the bottom of the man page to a tool to extract the sound streams.
MLUs rule the roost!

Linux XPS 3.4.38-pclos1.bfs  64 bit
Intel Core2 Quad CPU Q9450 @ 2.66GHz
4 GB RAM
MCP51 High Def Audio
GeForce GTX 550 Ti
PHILIPS  ‎DVD+-RW DVD8701
‎Logitech ‎BT Mini-Receiver
Afatech DTT