<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Add Stereo Audio Tracks to MKV Files</title>
	<atom:link href="http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/</link>
	<description>For savvy admins everywhere...</description>
	<lastBuildDate>Wed, 14 Jul 2010 15:57:06 -0700</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: mkvsmoothie - free your mkv</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-937</link>
		<dc:creator>mkvsmoothie - free your mkv</dc:creator>
		<pubDate>Sat, 19 Jun 2010 20:54:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-937</guid>
		<description>&lt;strong&gt;Mkv smoothie 0.6.6...&lt;/strong&gt;

I found your entry interesting thus I&#039;ve added a Trackback to it on my weblog :)...</description>
		<content:encoded><![CDATA[<p><strong>Mkv smoothie 0.6.6&#8230;</strong></p>
<p>I found your entry interesting thus I&#8217;ve added a Trackback to it on my weblog :)&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-932</link>
		<dc:creator>Bruce</dc:creator>
		<pubDate>Wed, 19 May 2010 15:56:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-932</guid>
		<description>Great stuff as usual.</description>
		<content:encoded><![CDATA[<p>Great stuff as usual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: construction games</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-930</link>
		<dc:creator>construction games</dc:creator>
		<pubDate>Tue, 04 May 2010 02:26:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-930</guid>
		<description>Great stuff as usual.</description>
		<content:encoded><![CDATA[<p>Great stuff as usual.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saran</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-869</link>
		<dc:creator>Saran</dc:creator>
		<pubDate>Thu, 31 Dec 2009 10:07:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-869</guid>
		<description>The script looks fine, gmendoza :)

Why I started fiddling with script is to actually automate the process as much as possible and as many movies as possible, so this way that requires much user interaction is no good (for me). I&#039;m sure I&#039;ll try/use it for single file conversions :)</description>
		<content:encoded><![CDATA[<p>The script looks fine, gmendoza :)</p>
<p>Why I started fiddling with script is to actually automate the process as much as possible and as many movies as possible, so this way that requires much user interaction is no good (for me). I&#8217;m sure I&#8217;ll try/use it for single file conversions :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gmendoza</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-867</link>
		<dc:creator>gmendoza</dc:creator>
		<pubDate>Thu, 31 Dec 2009 07:21:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-867</guid>
		<description>Saran, yes indeed.  Have a look at the script I&#039;ve been using.  Keep in mind that it can be improved a great deal by adding some input validation, subtitle prompts, and post processing cleanup of temp wav and mp3 files.  And of course, the dialogue makes sense to me, but for new users, it can probably be a little complicated.  :-)

I call it mkmkv.sh, but feel free to call it whatever you like.  It relies only on a single argument (the video file name), and just make sure to invoke the script from the same directory as the video file.

&lt;blockquote&gt;&lt;code&gt;&lt;strong&gt;cd /path/to/mkv-dir/
mkmkv.sh filename.mkv&lt;/strong&gt;&lt;/code&gt;&lt;/blockquote&gt;

&lt;pre lang=&quot;bash&quot;&gt;#!/bin/bash
MP3=&quot;${1}.mp3&quot;
WAV=&quot;${1}.wav&quot;

echo &quot;&quot;
echo &quot;Identifying Video File: \&quot;$1\&quot;&quot;
echo &quot;&quot;

ffmpeg -i &quot;$1&quot; 2&gt;&amp;1 &#124; grep &quot;Audio&quot;

echo &quot;&quot;
echo &quot;Which audio track do you wish to convert to Stereo MP3?&quot;
read -p &quot;Enter desired FFmpeg audio stream ID in X:Y format: &quot; STREAM
echo &quot;&quot;
echo &quot;Identifying MKV Track ID&#039;s...&quot;
echo &quot;&quot;

mkvmerge -i &quot;$1&quot;

echo &quot;&quot;
read -p &quot;Enter Video ID to be Included: &quot; VID
read -p &quot;Enter Video ID $VID Description: &quot; VDESC
echo &quot;&quot;
read -p &quot;Enter Audio ID to be Included: &quot; AID
read -p &quot;Enter Audio ID $AID Description: &quot; ADESC
echo &quot;&quot;
read -p &quot;Enter name for your NEW MKV file (e.g. movie.mkv): &quot; OUTPUT
echo &quot;&quot;
echo &quot;&quot;
echo &quot;Verify proposed mkvmerge command...&quot;
echo &quot;&quot;
echo &quot;\&quot;mkvmerge\&quot; -o \&quot;$OUTPUT\&quot; --language $VID:eng --track-name \&quot;$VID:$VDESC\&quot; --default-track $VID:yes --language $AID:eng --track-name \&quot;$AID:$ADESC\&quot; --default-track $AID:yes -a $AID -d $VID -S \&quot;$1\&quot; --language 0:eng --track-name \&quot;0:English Stereo MP3\&quot; --default-track 0:no -a 0 -D -S \&quot;$MP3\&quot; --track-order 0:$VID,0:$AID,1:0&quot;

echo &quot;&quot;
read -p &quot;Ctrl+C to cancel, or ENTER to continue.&quot;

echo &quot;&quot;
echo &quot;Running command: ffmpeg -i \&quot;$1\&quot; -map $STREAM -acodec pcm_s16le -ac 2 \&quot;$WAV\&quot;&quot;
ffmpeg -i &quot;$1&quot; -map $STREAM -acodec pcm_s16le -ac 2 &quot;$WAV&quot;

echo &quot;&quot;
echo &quot;Running command: lame -V0 -q0 --vbr-new \&quot;$WAV\&quot; \&quot;$MP3\&quot;&quot;
lame -V0 -q0 --vbr-new &quot;$WAV&quot; &quot;$MP3&quot;

echo &quot;&quot;
echo &quot;Running mkvmerge...&quot;
echo &quot;&quot;
&quot;mkvmerge&quot; -o &quot;$OUTPUT&quot; \
--language $VID:eng \
--track-name &quot;$VID:$VDESC&quot; \
--default-track $VID:yes \
--language $AID:eng \
--track-name &quot;$AID:$ADESC&quot; \
--default-track $AID:yes \
-a $AID -d $VID -S &quot;$1&quot; \
--language 0:eng \
--track-name &quot;0:English Stereo MP3&quot; \
--default-track 0:no \
-a 0 -D -S &quot;$MP3&quot; \
--track-order 0:$VID,0:$AID,1:0
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Saran, yes indeed.  Have a look at the script I&#8217;ve been using.  Keep in mind that it can be improved a great deal by adding some input validation, subtitle prompts, and post processing cleanup of temp wav and mp3 files.  And of course, the dialogue makes sense to me, but for new users, it can probably be a little complicated.  :-)</p>
<p>I call it mkmkv.sh, but feel free to call it whatever you like.  It relies only on a single argument (the video file name), and just make sure to invoke the script from the same directory as the video file.</p>
<blockquote><p><code><strong>cd /path/to/mkv-dir/<br />
mkmkv.sh filename.mkv</strong></code></p></blockquote>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #007800;">MP3</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>.mp3&quot;</span>
<span style="color: #007800;">WAV</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">${1}</span>.wav&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Identifying Video File: <span style="color: #000099; font-weight: bold;">\&quot;</span>$1<span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">grep</span> <span style="color: #ff0000;">&quot;Audio&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Which audio track do you wish to convert to Stereo MP3?&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Enter desired FFmpeg audio stream ID in X:Y format: &quot;</span> STREAM
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Identifying MKV Track ID's...&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
&nbsp;
mkvmerge <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;$1&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Enter Video ID to be Included: &quot;</span> VID
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Enter Video ID <span style="color: #007800;">$VID</span> Description: &quot;</span> VDESC
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Enter Audio ID to be Included: &quot;</span> AID
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Enter Audio ID <span style="color: #007800;">$AID</span> Description: &quot;</span> ADESC
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Enter name for your NEW MKV file (e.g. movie.mkv): &quot;</span> OUTPUT
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Verify proposed mkvmerge command...&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>mkvmerge<span style="color: #000099; font-weight: bold;">\&quot;</span> -o <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$OUTPUT</span><span style="color: #000099; font-weight: bold;">\&quot;</span> --language <span style="color: #007800;">$VID</span>:eng --track-name <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$VID</span>:<span style="color: #007800;">$VDESC</span><span style="color: #000099; font-weight: bold;">\&quot;</span> --default-track <span style="color: #007800;">$VID</span>:yes --language <span style="color: #007800;">$AID</span>:eng --track-name <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$AID</span>:<span style="color: #007800;">$ADESC</span><span style="color: #000099; font-weight: bold;">\&quot;</span> --default-track <span style="color: #007800;">$AID</span>:yes -a <span style="color: #007800;">$AID</span> -d <span style="color: #007800;">$VID</span> -S <span style="color: #000099; font-weight: bold;">\&quot;</span>$1<span style="color: #000099; font-weight: bold;">\&quot;</span> --language 0:eng --track-name <span style="color: #000099; font-weight: bold;">\&quot;</span>0:English Stereo MP3<span style="color: #000099; font-weight: bold;">\&quot;</span> --default-track 0:no -a 0 -D -S <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$MP3</span><span style="color: #000099; font-weight: bold;">\&quot;</span> --track-order 0:<span style="color: #007800;">$VID</span>,0:<span style="color: #007800;">$AID</span>,1:0&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> <span style="color: #660033;">-p</span> <span style="color: #ff0000;">&quot;Ctrl+C to cancel, or ENTER to continue.&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Running command: ffmpeg -i <span style="color: #000099; font-weight: bold;">\&quot;</span>$1<span style="color: #000099; font-weight: bold;">\&quot;</span> -map <span style="color: #007800;">$STREAM</span> -acodec pcm_s16le -ac 2 <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$WAV</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">ffmpeg</span> <span style="color: #660033;">-i</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #660033;">-map</span> <span style="color: #007800;">$STREAM</span> <span style="color: #660033;">-acodec</span> pcm_s16le <span style="color: #660033;">-ac</span> <span style="color: #000000;">2</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$WAV</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Running command: lame -V0 -q0 --vbr-new <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$WAV</span><span style="color: #000099; font-weight: bold;">\&quot;</span> <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #007800;">$MP3</span><span style="color: #000099; font-weight: bold;">\&quot;</span>&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">lame</span> <span style="color: #660033;">-V0</span> <span style="color: #660033;">-q0</span> <span style="color: #660033;">--vbr-new</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$WAV</span>&quot;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MP3</span>&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Running mkvmerge...&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #ff0000;">&quot;mkvmerge&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$OUTPUT</span>&quot;</span> \
<span style="color: #660033;">--language</span> <span style="color: #007800;">$VID</span>:eng \
<span style="color: #660033;">--track-name</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$VID</span>:<span style="color: #007800;">$VDESC</span>&quot;</span> \
<span style="color: #660033;">--default-track</span> <span style="color: #007800;">$VID</span>:<span style="color: #c20cb9; font-weight: bold;">yes</span> \
<span style="color: #660033;">--language</span> <span style="color: #007800;">$AID</span>:eng \
<span style="color: #660033;">--track-name</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$AID</span>:<span style="color: #007800;">$ADESC</span>&quot;</span> \
<span style="color: #660033;">--default-track</span> <span style="color: #007800;">$AID</span>:<span style="color: #c20cb9; font-weight: bold;">yes</span> \
<span style="color: #660033;">-a</span> <span style="color: #007800;">$AID</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$VID</span> <span style="color: #660033;">-S</span> <span style="color: #ff0000;">&quot;$1&quot;</span> \
<span style="color: #660033;">--language</span> <span style="color: #000000;">0</span>:eng \
<span style="color: #660033;">--track-name</span> <span style="color: #ff0000;">&quot;0:English Stereo MP3&quot;</span> \
<span style="color: #660033;">--default-track</span> <span style="color: #000000;">0</span>:no \
<span style="color: #660033;">-a</span> <span style="color: #000000;">0</span> <span style="color: #660033;">-D</span> <span style="color: #660033;">-S</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$MP3</span>&quot;</span> \
<span style="color: #660033;">--track-order</span> <span style="color: #000000;">0</span>:<span style="color: #007800;">$VID</span>,<span style="color: #000000;">0</span>:<span style="color: #007800;">$AID</span>,<span style="color: #000000;">1</span>:<span style="color: #000000;">0</span></pre></div></div>

]]></content:encoded>
	</item>
	<item>
		<title>By: Saran</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-863</link>
		<dc:creator>Saran</dc:creator>
		<pubDate>Wed, 30 Dec 2009 15:35:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-863</guid>
		<description>Thanks, gmendoza :)

I was, too, aware that such simple script can&#039;t cover all aspects, but for me it does cover 90% of mkvs :)

As you surely know, this line does ripping of audio:

 ffmpeg -i $1 -acodec pcm_s16le -ac 2 audio.wav

and (as you also surely know) with this command you can inspect the streams:

  ffmpeg -i 

Example result:

    Stream #0.0(eng): Video: h264, yuv420p, 1280x720, PAR 1:1 DAR 16:9, 24 tbr, 1k tbn, 47.95 tbc
    Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16
    Stream #0.2(eng): Audio: dca, 48000 Hz, 5.1, s16

So, you just need to add this to choose a different (in this case, the 3rd, dts) stream:

 -map 0.2

Solution: add another input parameter for script specifying the audio stream mapping (tho you have to check the file beforehand with ffmpeg -i ).


It just depends on the number of files you are working on so it can turn out that u spent more time on script than you would on converting each file manually (via e.g. gui) :)
But at least we polish our scripting skillz ;)</description>
		<content:encoded><![CDATA[<p>Thanks, gmendoza :)</p>
<p>I was, too, aware that such simple script can&#8217;t cover all aspects, but for me it does cover 90% of mkvs :)</p>
<p>As you surely know, this line does ripping of audio:</p>
<p> ffmpeg -i $1 -acodec pcm_s16le -ac 2 audio.wav</p>
<p>and (as you also surely know) with this command you can inspect the streams:</p>
<p>  ffmpeg -i </p>
<p>Example result:</p>
<p>    Stream #0.0(eng): Video: h264, yuv420p, 1280&#215;720, PAR 1:1 DAR 16:9, 24 tbr, 1k tbn, 47.95 tbc<br />
    Stream #0.1(eng): Audio: ac3, 48000 Hz, 5.1, s16<br />
    Stream #0.2(eng): Audio: dca, 48000 Hz, 5.1, s16</p>
<p>So, you just need to add this to choose a different (in this case, the 3rd, dts) stream:</p>
<p> -map 0.2</p>
<p>Solution: add another input parameter for script specifying the audio stream mapping (tho you have to check the file beforehand with ffmpeg -i ).</p>
<p>It just depends on the number of files you are working on so it can turn out that u spent more time on script than you would on converting each file manually (via e.g. gui) :)<br />
But at least we polish our scripting skillz ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gmendoza</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-861</link>
		<dc:creator>gmendoza</dc:creator>
		<pubDate>Wed, 30 Dec 2009 10:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-861</guid>
		<description>Very nice Saran.  I too ended up creating an automation script, but did not publish it for the simple reason that it would get complicated trying to make it versatile enough for just about any source MKV file I come across.

For example, many of my MKV&#039;s have multiple audio tracks, and the default isn&#039;t always English.  So simply running ffmpeg without specifying which to use, might cause ffmpeg to pull the wrong source audio track.  Also, many foreign movies end up needing subtitle tracks, and excluding them all by default can suck.  :-)  Again, choosing the right one when there are multiple subtitle tracks is also important.

It will take some work, but you&#039;ve inspired me to get a public version going.  Thanks again!</description>
		<content:encoded><![CDATA[<p>Very nice Saran.  I too ended up creating an automation script, but did not publish it for the simple reason that it would get complicated trying to make it versatile enough for just about any source MKV file I come across.</p>
<p>For example, many of my MKV&#8217;s have multiple audio tracks, and the default isn&#8217;t always English.  So simply running ffmpeg without specifying which to use, might cause ffmpeg to pull the wrong source audio track.  Also, many foreign movies end up needing subtitle tracks, and excluding them all by default can suck.  :-)  Again, choosing the right one when there are multiple subtitle tracks is also important.</p>
<p>It will take some work, but you&#8217;ve inspired me to get a public version going.  Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Saran</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-854</link>
		<dc:creator>Saran</dc:creator>
		<pubDate>Sun, 27 Dec 2009 15:32:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-854</guid>
		<description>Here&#039;s a simple script to automate the AC3-&gt;WAV-&gt;MP3-&gt;MVK process:

#!/bin/bash
echo
echo $1
echo
mkvmerge -i $1

echo
echo &quot;####### STARTING AUDIO EXTRACTION #######&quot;
echo
ffmpeg -i $1 -acodec pcm_s16le -ac 2 audio.wav

echo
echo &quot;####### COMPRESSING AUDIO #######&quot;
echo
lame -V0 -q0 --vbr-new audio.wav audio.mp3

echo
echo &quot;####### APPENDING AUDIO TO CONTAINER #######&quot;
echo
mkvmerge -o new.$1 \
$1 \
--language 0:eng \
--track-name &quot;0:2-Channel Stereo (MP3)&quot; \
--default-track 0:yes \
-a 0 -D -S audio.mp3 \

echo
echo new.$1
echo
mkvmerge -i new.$1







Just call it from (unix) command line with mkv filename as argument.</description>
		<content:encoded><![CDATA[<p>Here&#8217;s a simple script to automate the AC3-&gt;WAV-&gt;MP3-&gt;MVK process:</p>
<p>#!/bin/bash<br />
echo<br />
echo $1<br />
echo<br />
mkvmerge -i $1</p>
<p>echo<br />
echo &#8220;####### STARTING AUDIO EXTRACTION #######&#8221;<br />
echo<br />
ffmpeg -i $1 -acodec pcm_s16le -ac 2 audio.wav</p>
<p>echo<br />
echo &#8220;####### COMPRESSING AUDIO #######&#8221;<br />
echo<br />
lame -V0 -q0 &#8211;vbr-new audio.wav audio.mp3</p>
<p>echo<br />
echo &#8220;####### APPENDING AUDIO TO CONTAINER #######&#8221;<br />
echo<br />
mkvmerge -o new.$1 \<br />
$1 \<br />
&#8211;language 0:eng \<br />
&#8211;track-name &#8220;0:2-Channel Stereo (MP3)&#8221; \<br />
&#8211;default-track 0:yes \<br />
-a 0 -D -S audio.mp3 \</p>
<p>echo<br />
echo new.$1<br />
echo<br />
mkvmerge -i new.$1</p>
<p>Just call it from (unix) command line with mkv filename as argument.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yachika Verma</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-709</link>
		<dc:creator>Yachika Verma</dc:creator>
		<pubDate>Wed, 25 Nov 2009 07:37:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-709</guid>
		<description>Thanks for great info. I will visit your blog for more interesting posts like this.</description>
		<content:encoded><![CDATA[<p>Thanks for great info. I will visit your blog for more interesting posts like this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: gmendoza</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-430</link>
		<dc:creator>gmendoza</dc:creator>
		<pubDate>Sun, 27 Sep 2009 15:55:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-430</guid>
		<description>Hey thanks for the tip on HandBrake!  This is exactly what I&#039;ve been looking for to help convert and manipulate various video formats!

Regarding AC3, the whole point in the mentioned scenario was that certain media players won&#039;t decode the AC3 DD audio for you.  So unless you have a receiver in between the player and the TV, you can&#039;t hear anything.  Unless I&#039;m missing something about 2-Channel AC3, wouldn&#039;t that still hold true?  Sounds like a test is in order.  I&#039;ll add it to the post if so.

Thanks again!</description>
		<content:encoded><![CDATA[<p>Hey thanks for the tip on HandBrake!  This is exactly what I&#8217;ve been looking for to help convert and manipulate various video formats!</p>
<p>Regarding AC3, the whole point in the mentioned scenario was that certain media players won&#8217;t decode the AC3 DD audio for you.  So unless you have a receiver in between the player and the TV, you can&#8217;t hear anything.  Unless I&#8217;m missing something about 2-Channel AC3, wouldn&#8217;t that still hold true?  Sounds like a test is in order.  I&#8217;ll add it to the post if so.</p>
<p>Thanks again!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aaf</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/comment-page-1/#comment-429</link>
		<dc:creator>aaf</dc:creator>
		<pubDate>Sun, 27 Sep 2009 15:32:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403#comment-429</guid>
		<description>Ac3 to Mp3...Blah! Just make it into a 2 CH 128kb/s Ac3.:)
The Holy Trinity of Linux Video...ffmpeg,mkvtoolnix and HandBrake[!].</description>
		<content:encoded><![CDATA[<p>Ac3 to Mp3&#8230;Blah! Just make it into a 2 CH 128kb/s Ac3.:)<br />
The Holy Trinity of Linux Video&#8230;ffmpeg,mkvtoolnix and HandBrake[!].</p>
]]></content:encoded>
	</item>
</channel>
</rss>
