IPB

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
Extracting Soundtrack From Movie?
Dr. Horrible
post May 26 2013, 01:20
Post #1





Group: Members
Posts: 8
Joined: 26-May 13
Member No.: 108329



I'm trying to figure out a way to extract audio from the two front speakers from a movie as an MKV file that I have. The audio is in 5.1 surround. I am completely new to this and would like a detailed how to process. Thank you
Go to the top of the page
+Quote Post
saratoga
post May 26 2013, 01:22
Post #2





Group: Members
Posts: 4718
Joined: 2-September 02
Member No.: 3264



This looks like what you want:

http://www.videohelp.com/tools/MKVExtractGUI
Go to the top of the page
+Quote Post
gib
post May 26 2013, 05:48
Post #3





Group: Members
Posts: 227
Joined: 20-January 03
From: A Tropical Isle
Member No.: 4640



Since you specifically want to extract the two front channels, I'd suggest you use eac3to. It's a command-line program and very powerful. With it you could very easily extract and downmix the 5.1 audio to stereo and output it to, say, flac. Or if you truly want just the front channels and not a downmix, you could take the 5.1 track, output each channel as a separate flac, then use any audio editor to create a stereo track from the two front channels.
Go to the top of the page
+Quote Post
Dr. Horrible
post May 26 2013, 19:07
Post #4





Group: Members
Posts: 8
Joined: 26-May 13
Member No.: 108329



So I have the ac3 file of the audio on the DVD (all 5 channels). When I go into EAC3to, I open it in the source file section, and nothing is grayed out except "PCM and TrueHD Options", "DTS Rate", "Channel Order Mode", and everything under "Set Custom Channel Order". Also, I just realized that the soundtrack also plays through the surround L & R channels. Sorry if I'm a little gray with the details, this is the first time I've attempted something like this.
Go to the top of the page
+Quote Post
CoRoNe
post May 26 2013, 20:59
Post #5





Group: Members
Posts: 164
Joined: 31-May 05
From: Netherlands
Member No.: 22417



If you'd ask me, I would use Avisynth, FFmpegSource and avs2pipemod. This way you don't even have to extract the soundtrack from the MKV-container.

Open Notepad and enter:
CODE
FFMpegSource2("<path>\movie.mkv", atrack=-1)
GetChannel(1,2)
Save as "movie_soundtrack.avs".
=====================================
In case your movie has multilingual soundtracks and let's say it's the 2nd audiotracks you want. And in case conversations are only on the center-channel, you could go for this:
CODE
FFMpegSource2("<path>\movie.mkv", atrack=2)
flr = GetChannel(1, 2)
fcc = GetChannel(3, 3)
MixAudio(flr, fcc, 0.5858, 0.4142)
=====================================

Make sure you've downloaded your desired audio-encoder. Open a command-prompt (cmd.exe) and enter:
CODE
"<path>\avs2pipemod.exe" -wav "<path>\movie_soundtrack.avs" > "<path>\movie_soundtrack.wav"
or
"<path>\avs2pipemod.exe" -wav "<path>\movie_soundtrack.avs" | "<path>\oggenc2.exe" -q0 - -o "<path>\movie_soundtrack.ogg"
or
"<path>\avs2pipemod.exe" -wav "<path>\movie_soundtrack.avs" | "<path>\opusenc.exe" --bitrate 64 - "<path>\movie_soundtrack.opus"
etc.


--------------------
DC-Bass Source Mod: http://reino.degeelebosch.nl
Go to the top of the page
+Quote Post
o-l-a-v
post May 26 2013, 21:05
Post #6





Group: Members
Posts: 117
Joined: 18-July 12
From: Norway
Member No.: 101545



Use "TAudioConverter".
Drag the film into the program. Choose "Extract Audio".
Go to the top of the page
+Quote Post
Dr. Horrible
post May 27 2013, 01:54
Post #7





Group: Members
Posts: 8
Joined: 26-May 13
Member No.: 108329



CoRoNe:

I was able to create the movie_soundtrack.WAV file with the first piece of code you gave me to feed into the cmd prompt. BUT the wav file is empty. It's 0 bytes and doesn't play.

This post has been edited by db1989: May 27 2013, 12:21
Reason for edit: replacing unnecessary full quote with username
Go to the top of the page
+Quote Post
Dr. Horrible
post May 27 2013, 21:38
Post #8





Group: Members
Posts: 8
Joined: 26-May 13
Member No.: 108329



QUOTE (gib @ May 25 2013, 23:48) *
Since you specifically want to extract the two front channels, I'd suggest you use eac3to. It's a command-line program and very powerful. With it you could very easily extract and downmix the 5.1 audio to stereo and output it to, say, flac. Or if you truly want just the front channels and not a downmix, you could take the 5.1 track, output each channel as a separate flac, then use any audio editor to create a stereo track from the two front channels.

What options would I use to extract the 2 front channel flacs?
Go to the top of the page
+Quote Post
CoRoNe
post May 27 2013, 22:36
Post #9





Group: Members
Posts: 164
Joined: 31-May 05
From: Netherlands
Member No.: 22417



All I can say is: Make sure you've entered all the correct <path>'s and check whether your avs-file plays correctly in MPC-HC (or any other DirectShow player). It then has to work.


--------------------
DC-Bass Source Mod: http://reino.degeelebosch.nl
Go to the top of the page
+Quote Post
Dr. Horrible
post May 28 2013, 01:04
Post #10





Group: Members
Posts: 8
Joined: 26-May 13
Member No.: 108329



QUOTE (CoRoNe @ May 27 2013, 16:36) *
All I can say is: Make sure you've entered all the correct <path>'s and check whether your avs-file plays correctly in MPC-HC (or any other DirectShow player). It then has to work.

That must have been the problem then. But it's now saying that it failed to load avisynth.dll ...
Go to the top of the page
+Quote Post
Dr. Horrible
post May 28 2013, 01:14
Post #11





Group: Members
Posts: 8
Joined: 26-May 13
Member No.: 108329



QUOTE (CoRoNe @ May 27 2013, 16:36) *
All I can say is: Make sure you've entered all the correct <path>'s and check whether your avs-file plays correctly in MPC-HC (or any other DirectShow player). It then has to work.

I fixed the dll error. But I'm having one that says there is no function named FFMpegSource2.
Go to the top of the page
+Quote Post
Kohlrabi
post May 28 2013, 08:34
Post #12





Group: Super Moderator
Posts: 953
Joined: 12-March 05
From: Kiel, Germany
Member No.: 20561



Is there a specific reason why you ignore the simple and straightforward solution presented by saratoga and instead go for the (obviously) complicated multi-tool and multi-step solution by CoRoNe? FWIW, you could also check out the newer version of MKVextractGUI.

This post has been edited by Kohlrabi: May 28 2013, 08:37


--------------------
Audiophiles live in constant fear of jitter.
Go to the top of the page
+Quote Post
Dr. Horrible
post May 28 2013, 21:00
Post #13





Group: Members
Posts: 8
Joined: 26-May 13
Member No.: 108329



QUOTE (Kohlrabi @ May 28 2013, 02:34) *
Is there a specific reason why you ignore the simple and straightforward solution presented by saratoga and instead go for the (obviously) complicated multi-tool and multi-step solution by CoRoNe? FWIW, you could also check out the newer version of MKVextractGUI.

I keep getting an error when I open MVExtract that says
"Put me in mkvtoolnix dr, please! In case if you don't have it - just press 'OK' to get it from www.bunkus.org/videotools/mkvtoolnix/win32/"
I'm not sure how to fix this error, as the download files presented at this website are MKVMergeGUIs and I cannot put MKVExtract into MKVMerge...
Go to the top of the page
+Quote Post
CoRoNe
post May 28 2013, 23:12
Post #14





Group: Members
Posts: 164
Joined: 31-May 05
From: Netherlands
Member No.: 22417



QUOTE (Kohlrabi @ May 28 2013, 09:34) *
simple and straightforward solution presented by saratoga...[/url].
Solution to what? Not his question at least.

Dr. Horrible, just in case; for FFmpegSource you have to download either ffms-2.17.7z or ffms2-2.18-rc1.7z . Then you have to extract the content to your Avisynth-plugins directory. Then try again.


--------------------
DC-Bass Source Mod: http://reino.degeelebosch.nl
Go to the top of the page
+Quote Post
gib
post May 29 2013, 07:59
Post #15





Group: Members
Posts: 227
Joined: 20-January 03
From: A Tropical Isle
Member No.: 4640



QUOTE (Dr. Horrible @ May 27 2013, 10:38) *
What options would I use to extract the 2 front channel flacs?

Haven't been on the last couple days. Sorry. Anyway, it sounds like you're using a GUI for eac3to. I don't, so I couldn't tell you what to do in one. But here's what you'd do at the command line in two easy steps:

Step 1: Let's analyze the file (you said it was an .mkv):

eac3to [filename].mkv

After the brief analysis, eac3to will output a list of the contents of the file. It will look something like this:
CODE
MKV, 1 video track, 1 audio track, 1 subtitle track, 0:25:29, 24p /1.001
1: h264/AVC, English, 1488x1080 24p /1.001
2: AC3, 5.1 channels, 640kbps, 48kHz
3: Subtitle (SRT), English

We can see the video is track 1, the audio is track 2, and the subtitles are track 3. I will use track 2 in my examples, but substitute whatever number is the audio track for your file.

Step 2: Now that we know what track to work with, let's decode the ac3 track and output it as individual .wav files per channel:

eac3to [filename].mkv 2: blah.wavs

With this command we're telling eac3to to work with track 2, decode and output the audio to multiple .wav files named blah (eac3to will add the channel to the name automatically). It will look something like this:
CODE
MKV, 1 video track, 1 audio track, 1 subtitle track, 0:25:29, 24p /1.001
1: h264/AVC, English, 1488x1080 24p /1.001
2: AC3, 5.1 channels, 640kbps, 48kHz
3: Subtitle (SRT), English
a02 Writing WAVs...
a02 Creating file "blah.C.wav"...
a02 Creating file "blah.L.wav"...
a02 Creating file "blah.R.wav"...
a02 Creating file "blah.SR.wav"...
a02 Creating file "blah.LFE.wav"...
a02 Creating file "blah.SL.wav"...
Video track 1 contains 36656 frames.
eac3to processing took 35 seconds.
Done.

And that's it, you're done. Now you can discard the channels you don't need (LFE, SR, SL) and do whatever you want with the L and R channels. Just in case this doesn't suit you and what you really want is a downmix of the 5.1 audio, use this command:

eac3to [filename].mkv 2: blah.flac -down2 -mixlfe

This will downmix the multichannel audio, including the LFE, to stereo and output a neat and tidy flac.

Hope this helps.
Go to the top of the page
+Quote Post
gib
post May 29 2013, 08:27
Post #16





Group: Members
Posts: 227
Joined: 20-January 03
From: A Tropical Isle
Member No.: 4640



QUOTE (Kohlrabi @ May 27 2013, 21:34) *
Is there a specific reason why you ignore the simple and straightforward solution presented by saratoga...

For what it's worth, I don't think MKVExtractGUI will really do what the OP wants. It looks like it's just a GUI interface for MKVToolnix and doesn't offer any decoding/transcoding functionality from what I can tell (didn't look too close, so I could be wrong).

As an aside, MKVToolnix has it's own GUI anyway (mmg.exe).
Go to the top of the page
+Quote Post
Dr. Horrible
post May 29 2013, 20:24
Post #17





Group: Members
Posts: 8
Joined: 26-May 13
Member No.: 108329



QUOTE (gib @ May 29 2013, 01:59) *
QUOTE (Dr. Horrible @ May 27 2013, 10:38) *
What options would I use to extract the 2 front channel flacs?

Haven't been on the last couple days. Sorry. Anyway, it sounds like you're using a GUI for eac3to. I don't, so I couldn't tell you what to do in one. But here's what you'd do at the command line in two easy steps:

Step 1: Let's analyze the file (you said it was an .mkv):

eac3to [filename].mkv

After the brief analysis, eac3to will output a list of the contents of the file. It will look something like this:
CODE
MKV, 1 video track, 1 audio track, 1 subtitle track, 0:25:29, 24p /1.001
1: h264/AVC, English, 1488x1080 24p /1.001
2: AC3, 5.1 channels, 640kbps, 48kHz
3: Subtitle (SRT), English

We can see the video is track 1, the audio is track 2, and the subtitles are track 3. I will use track 2 in my examples, but substitute whatever number is the audio track for your file.

Step 2: Now that we know what track to work with, let's decode the ac3 track and output it as individual .wav files per channel:

eac3to [filename].mkv 2: blah.wavs

With this command we're telling eac3to to work with track 2, decode and output the audio to multiple .wav files named blah (eac3to will add the channel to the name automatically). It will look something like this:
CODE
MKV, 1 video track, 1 audio track, 1 subtitle track, 0:25:29, 24p /1.001
1: h264/AVC, English, 1488x1080 24p /1.001
2: AC3, 5.1 channels, 640kbps, 48kHz
3: Subtitle (SRT), English
a02 Writing WAVs...
a02 Creating file "blah.C.wav"...
a02 Creating file "blah.L.wav"...
a02 Creating file "blah.R.wav"...
a02 Creating file "blah.SR.wav"...
a02 Creating file "blah.LFE.wav"...
a02 Creating file "blah.SL.wav"...
Video track 1 contains 36656 frames.
eac3to processing took 35 seconds.
Done.

And that's it, you're done. Now you can discard the channels you don't need (LFE, SR, SL) and do whatever you want with the L and R channels. Just in case this doesn't suit you and what you really want is a downmix of the 5.1 audio, use this command:

eac3to [filename].mkv 2: blah.flac -down2 -mixlfe

This will downmix the multichannel audio, including the LFE, to stereo and output a neat and tidy flac.

Hope this helps.

thank you so much! It worked perfectly. I can't thank you enough!
Go to the top of the page
+Quote Post
gib
post May 29 2013, 22:53
Post #18





Group: Members
Posts: 227
Joined: 20-January 03
From: A Tropical Isle
Member No.: 4640



No problem. Glad I could help.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th April 2014 - 19:42