<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>SavvyAdmin.com &#187; Video</title>
	<atom:link href="http://savvyadmin.com/tag/video/feed/" rel="self" type="application/rss+xml" />
	<link>http://savvyadmin.com</link>
	<description>For savvy admins everywhere...</description>
	<lastBuildDate>Thu, 05 Aug 2010 03:30:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Adding Chapters to Videos Using MKV Containers</title>
		<link>http://savvyadmin.com/adding-chapters-to-videos-using-mkv-containers/</link>
		<comments>http://savvyadmin.com/adding-chapters-to-videos-using-mkv-containers/#comments</comments>
		<pubDate>Thu, 05 Aug 2010 03:16:50 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Matroska]]></category>
		<category><![CDATA[MKV]]></category>
		<category><![CDATA[mkvmerge]]></category>
		<category><![CDATA[mkvtoolnix]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[x264]]></category>
		<category><![CDATA[Xvid]]></category>

		<guid isPermaLink="false">http://savvyadmin.com/?p=737</guid>
		<description><![CDATA[If you would like to add chapters to your video files, such as XviD, x264, OGG, etc., simply use the Matroska multimedia container format. For those of you that have never created Matroska files, visit the Matroska website to find the right software for your platform. If you&#8217;re using Ubuntu Linux, install the mkvtoolnix package [...]


Related posts:<ol><li><a href='http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/' rel='bookmark' title='Permanent Link: Add Stereo Audio Tracks to MKV Files'>Add Stereo Audio Tracks to MKV Files</a></li>
<li><a href='http://savvyadmin.com/convert-3gp-videos-to-xvid-avi/' rel='bookmark' title='Permanent Link: Convert 3gp Videos to XviD AVI'>Convert 3gp Videos to XviD AVI</a></li>
<li><a href='http://savvyadmin.com/quickly-identify-video-file-attributes/' rel='bookmark' title='Permanent Link: Quickly Identify Video File Attributes'>Quickly Identify Video File Attributes</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you would like to add chapters to your video files, such as XviD, x264, OGG, etc., simply use the <a href="http://www.matroska.org" target="_blank">Matroska</a> multimedia container format.</p>
<p>For those of you that have never created Matroska files, visit the <a href="http://www.matroska.org" target="_blank">Matroska website</a> to find the right software for your platform.  If you&#8217;re using Ubuntu Linux, install the <code>mkvtoolnix</code> package from the repositories.  It contains all the tools you need to start working with MKV files.</p>
<blockquote><p><strong><code>sudo apt-get-install mkvtoolnix</code></strong></p></blockquote>
<p>The easiest method of creating your chapter definitions is with any text editor, using the following format.  Feel free to change the name and time values accordingly.  Save the file anywhere you can remember, e.g. <code>chapter.txt</code>.</p>
<blockquote><p><code>CHAPTER01=00:00:00.000<br />
CHAPTER01NAME=Chapter 01<br />
CHAPTER02=00:05:00.000<br />
CHAPTER02NAME=Chapter 02<br />
CHAPTER03=00:10:00.000<br />
CHAPTER03NAME=Chapter 03<br />
CHAPTER04=00:15:00.000<br />
CHAPTER04NAME=Chapter 04<br />
CHAPTER05=00:20:00.000<br />
CHAPTER05NAME=Chapter 05</code></p></blockquote>
<p>If you want to create a chapter file from an existing DVD, <code>dvdxchap</code> is a great tool for the job if you&#8217;re using Linux.  It&#8217;s part of the <code>ogmtools</code> package.  For more info, check out the <a href="http://www.bunkus.org/videotools/ogmtools/" target="_blank">OGMtools project web site</a>.</p>
<p>Installation and three examples of how to use the tool are below.</p>
<blockquote><p><code><strong>sudo apt-get install ogmtools</code></p>
<p><code>dvdxchap /dev/dvd > chapter.txt<br />
dvdxchap ./VIDEO_TS/ > chapter.txt<br />
dvdxchap video.iso > chapter.txt</strong></code></p></blockquote>
<p><code>mkvmerge</code> is the only tool you need to create an MKV file.  In the following examples, your source video file is called <code>video.avi</code>, and your destination file is <code>video.mkv</code>.</p>
<p>A simplified version of the <code>mkvmerge</code> syntax is as follows.</p>
<blockquote><p><code><strong>mkvmerge video.avi --chapters chapter.txt -o video.mkv</strong></code></p></blockquote>
<p>I typically like to set my default language to English, and also turn off header compression for all tracks since some players don&#8217;t play nicely with compression enabled.  The syntax and example output is displayed below.</p>
<blockquote><p><code><strong>mkvmerge video.avi --default-language eng \<br />
--compression -1:none --chapters chapter.txt -o video.mkv</strong><br />
mkvmerge v4.2.0 ('No Talking') built on Jul 28 2010 16:47:39<br />
'video.avi': Using the AVI demultiplexer. Opening file. This may take some time depending on the file's size.<br />
'video.avi' track 0: Using the MPEG-4 part 2 video output module.<br />
'video.avi' track 1: Using the MPEG audio output module.<br />
The file 'video.mkv' has been opened for writing.<br />
'video.avi' track 0: Extracted the aspect ratio information from the MPEG4 layer 2 video data and set the display dimensions to 712/416.<br />
Progress: 100%<br />
The cue entries (the index) are being written...<br />
Muxing took 30 seconds.</code></p></blockquote>
<p>That&#8217;s really all there is to it.  Now any media player that supports MKV chapters will allow you to navigate them.  My favorites are VLC, Mplayer, and my Western Digital media player, the WD TV Live Plus.</p>
<p>Verify the contents of your MKV using <code>mkvmerge</code> or <code>mkvinfo</code>.</p>
<blockquote><p><code><strong>mkvmerge -i video.mkv</strong><br />
File 'video.mkv': container: Matroska<br />
Track ID 1: video (V_MS/VFW/FOURCC, XVID)<br />
Track ID 2: audio (A_MPEG/L3)<br />
Chapters: 13 entries</code></p>
<p><code>mkvinfo video.mkv<br />
+ EBML head<br />
|+ EBML version: 1<br />
|+ EBML read version: 1<br />
|+ EBML maximum ID length: 4<br />
|+ EBML maximum size length: 8<br />
|+ Doc type: matroska<br />
|+ Doc type version: 2<br />
|+ Doc type read version: 2<br />
+ Segment, size 1325519138<br />
|+ Seek head (subentries will be skipped)<br />
|+ EbmlVoid (size: 4029)<br />
|+ Segment information<br />
| + Timecode scale: 1000000<br />
| + Muxing application: libebml v1.0.0 + libmatroska v1.0.0<br />
| + Writing application: mkvmerge v4.2.0 ('No Talking') built on Jul 28 2010 16:47:39<br />
| + Duration: 5004.680s (01:23:24.680)<br />
| + Date: Thu Aug  5 00:26:03 2010 UTC<br />
| + Segment UID: 0x81 0x4b 0xc4 0xf1 0xf4 0x5b 0x6d 0xda 0xc5 0x40 0xc1 0x03 0x3f 0x36 0x0f 0xd9<br />
|+ Segment tracks<br />
| + A track<br />
|  + Track number: 1<br />
|  + Track UID: 1318207700<br />
|  + Track type: video<br />
|  + Lacing flag: 0<br />
|  + MinCache: 1<br />
|  + Codec ID: V_MS/VFW/FOURCC<br />
|  + CodecPrivate, length 40 (FourCC: XVID, 0x44495658)<br />
|  + Default duration: 40.000ms (25.000 fps for a video track)<br />
|  + Video track<br />
|   + Pixel width: 480<br />
|   + Pixel height: 416<br />
|   + Display width: 712<br />
|   + Display height: 416<br />
| + A track<br />
|  + Track number: 2<br />
|  + Track UID: 3206714560<br />
|  + Track type: audio<br />
|  + Codec ID: A_MPEG/L3<br />
|  + Default duration: 24.000ms (41.667 fps for a video track)<br />
|  + Audio track<br />
|   + Sampling frequency: 48000<br />
|   + Channels: 2<br />
|+ EbmlVoid (size: 1099)<br />
|+ Chapters<br />
| + EditionEntry<br />
|  + EditionFlagHidden: 0<br />
|  + EditionFlagDefault: 0<br />
|  + EditionUID: 585228242<br />
|  + ChapterAtom<br />
|   + ChapterUID: 4059317607<br />
|   + ChapterTimeStart: 00:00:00.000000000<br />
|   + ChapterFlagHidden: 0<br />
|   + ChapterFlagEnabled: 1<br />
|   + ChapterDisplay<br />
|    + ChapterString: Chapter 01<br />
|    + ChapterLanguage: eng<br />
|  + ChapterAtom<br />
|   + ChapterUID: 3065648262<br />
|   + ChapterTimeStart: 00:05:00.000000000<br />
|   + ChapterFlagHidden: 0<br />
|   + ChapterFlagEnabled: 1<br />
|   + ChapterDisplay<br />
|    + ChapterString: Chapter 02<br />
|    + ChapterLanguage: eng<br />
|  + ChapterAtom<br />
|   + ChapterUID: 2388361707<br />
|   + ChapterTimeStart: 00:10:00.000000000<br />
|   + ChapterFlagHidden: 0<br />
|   + ChapterFlagEnabled: 1<br />
|   + ChapterDisplay<br />
|    + ChapterString: Chapter 03<br />
|    + ChapterLanguage: eng<br />
|  + ChapterAtom<br />
|   + ChapterUID: 1448933008<br />
|   + ChapterTimeStart: 00:15:00.000000000<br />
|   + ChapterFlagHidden: 0<br />
|   + ChapterFlagEnabled: 1<br />
|   + ChapterDisplay<br />
|    + ChapterString: Chapter 04<br />
|    + ChapterLanguage: eng<br />
|  + ChapterAtom<br />
|   + ChapterUID: 1319721142<br />
|   + ChapterTimeStart: 00:20:00.000000000<br />
|   + ChapterFlagHidden: 0<br />
|   + ChapterFlagEnabled: 1<br />
|   + ChapterDisplay<br />
|    + ChapterString: Chapter 05<br />
|    + ChapterLanguage: eng<br />
|+ EbmlVoid (size: 101)<br />
|+ Cluster</code></p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F&amp;t=Adding%20Chapters%20to%20Videos%20Using%20MKV%20Containers" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Adding%20Chapters%20to%20Videos%20Using%20MKV%20Containers%20-%20http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F&amp;title=Adding%20Chapters%20to%20Videos%20Using%20MKV%20Containers&amp;notes=If%20you%20would%20like%20to%20add%20chapters%20to%20your%20video%20files%2C%20such%20as%20XviD%2C%20x264%2C%20OGG%2C%20etc.%2C%20simply%20use%20the%20Matroska%20multimedia%20container%20format.%0D%0A%0D%0AFor%20those%20of%20you%20that%20have%20never%20created%20Matroska%20files%2C%20visit%20the%20Matroska%20website%20to%20find%20the%20right%20softwa" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F&amp;title=Adding%20Chapters%20to%20Videos%20Using%20MKV%20Containers&amp;bodytext=If%20you%20would%20like%20to%20add%20chapters%20to%20your%20video%20files%2C%20such%20as%20XviD%2C%20x264%2C%20OGG%2C%20etc.%2C%20simply%20use%20the%20Matroska%20multimedia%20container%20format.%0D%0A%0D%0AFor%20those%20of%20you%20that%20have%20never%20created%20Matroska%20files%2C%20visit%20the%20Matroska%20website%20to%20find%20the%20right%20softwa" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Adding%20Chapters%20to%20Videos%20Using%20MKV%20Containers&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F&amp;title=Adding%20Chapters%20to%20Videos%20Using%20MKV%20Containers&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=If%20you%20would%20like%20to%20add%20chapters%20to%20your%20video%20files%2C%20such%20as%20XviD%2C%20x264%2C%20OGG%2C%20etc.%2C%20simply%20use%20the%20Matroska%20multimedia%20container%20format.%0D%0A%0D%0AFor%20those%20of%20you%20that%20have%20never%20created%20Matroska%20files%2C%20visit%20the%20Matroska%20website%20to%20find%20the%20right%20softwa" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F&amp;title=Adding%20Chapters%20to%20Videos%20Using%20MKV%20Containers&amp;annotation=If%20you%20would%20like%20to%20add%20chapters%20to%20your%20video%20files%2C%20such%20as%20XviD%2C%20x264%2C%20OGG%2C%20etc.%2C%20simply%20use%20the%20Matroska%20multimedia%20container%20format.%0D%0A%0D%0AFor%20those%20of%20you%20that%20have%20never%20created%20Matroska%20files%2C%20visit%20the%20Matroska%20website%20to%20find%20the%20right%20softwa" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fadding-chapters-to-videos-using-mkv-containers%2F&amp;title=Adding%20Chapters%20to%20Videos%20Using%20MKV%20Containers" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/' rel='bookmark' title='Permanent Link: Add Stereo Audio Tracks to MKV Files'>Add Stereo Audio Tracks to MKV Files</a></li>
<li><a href='http://savvyadmin.com/convert-3gp-videos-to-xvid-avi/' rel='bookmark' title='Permanent Link: Convert 3gp Videos to XviD AVI'>Convert 3gp Videos to XviD AVI</a></li>
<li><a href='http://savvyadmin.com/quickly-identify-video-file-attributes/' rel='bookmark' title='Permanent Link: Quickly Identify Video File Attributes'>Quickly Identify Video File Attributes</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/adding-chapters-to-videos-using-mkv-containers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Convert 3gp Videos to XviD AVI</title>
		<link>http://savvyadmin.com/convert-3gp-videos-to-xvid-avi/</link>
		<comments>http://savvyadmin.com/convert-3gp-videos-to-xvid-avi/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 18:30:33 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[3gp]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[FFMpeg]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://savvyadmin.com/?p=581</guid>
		<description><![CDATA[3gp is the container format used when recording video with many mobile phones, which can be a pain when trying to view them using a number of multimedia players. Fortunately, converting videos from 3gp to XviD AVI is easy with FFmpeg. Usually, there&#8217;s not much to the quality of these types of source video files, [...]


Related posts:<ol><li><a href='http://savvyadmin.com/extract-ac3-dolby-digital-with-ffmpeg/' rel='bookmark' title='Permanent Link: Extract AC3 Dolby Digital with FFMpeg'>Extract AC3 Dolby Digital with FFMpeg</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/' rel='bookmark' title='Permanent Link: Add Stereo Audio Tracks to MKV Files'>Add Stereo Audio Tracks to MKV Files</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/3GP" target="_blank">3gp</a> is the container format used when recording video with many mobile phones, which can be a pain when trying to view them using a number of multimedia players.  Fortunately, converting videos from <a href="http://en.wikipedia.org/wiki/3GP" target="_blank">3gp</a> to XviD AVI is easy with <a href="http://ffmpeg.org/" target="_blank">FFmpeg</a>.</p>
<p>Usually, there&#8217;s not much to the quality of these types of source video files, so many of the more complex video and audio options aren&#8217;t needed.  A simple FFmpeg command that retains as much quality as possible would look like the following.</p>
<blockquote><p><code><strong>ffmpeg -i video.3gp -acodec libmp3lame -vcodec libxvid -qscale 2 -f avi video.avi</strong></code></p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F&amp;t=Convert%203gp%20Videos%20to%20XviD%20AVI" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Convert%203gp%20Videos%20to%20XviD%20AVI%20-%20http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F&amp;title=Convert%203gp%20Videos%20to%20XviD%20AVI&amp;notes=3gp%20is%20the%20container%20format%20used%20when%20recording%20video%20with%20many%20mobile%20phones%2C%20which%20can%20be%20a%20pain%20when%20trying%20to%20view%20them%20using%20a%20number%20of%20multimedia%20players.%20%20Fortunately%2C%20converting%20videos%20from%203gp%20to%20XviD%20AVI%20is%20easy%20with%20FFmpeg.%0D%0A%0D%0AUsually%2C%20th" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F&amp;title=Convert%203gp%20Videos%20to%20XviD%20AVI&amp;bodytext=3gp%20is%20the%20container%20format%20used%20when%20recording%20video%20with%20many%20mobile%20phones%2C%20which%20can%20be%20a%20pain%20when%20trying%20to%20view%20them%20using%20a%20number%20of%20multimedia%20players.%20%20Fortunately%2C%20converting%20videos%20from%203gp%20to%20XviD%20AVI%20is%20easy%20with%20FFmpeg.%0D%0A%0D%0AUsually%2C%20th" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Convert%203gp%20Videos%20to%20XviD%20AVI&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F&amp;title=Convert%203gp%20Videos%20to%20XviD%20AVI&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=3gp%20is%20the%20container%20format%20used%20when%20recording%20video%20with%20many%20mobile%20phones%2C%20which%20can%20be%20a%20pain%20when%20trying%20to%20view%20them%20using%20a%20number%20of%20multimedia%20players.%20%20Fortunately%2C%20converting%20videos%20from%203gp%20to%20XviD%20AVI%20is%20easy%20with%20FFmpeg.%0D%0A%0D%0AUsually%2C%20th" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F&amp;title=Convert%203gp%20Videos%20to%20XviD%20AVI&amp;annotation=3gp%20is%20the%20container%20format%20used%20when%20recording%20video%20with%20many%20mobile%20phones%2C%20which%20can%20be%20a%20pain%20when%20trying%20to%20view%20them%20using%20a%20number%20of%20multimedia%20players.%20%20Fortunately%2C%20converting%20videos%20from%203gp%20to%20XviD%20AVI%20is%20easy%20with%20FFmpeg.%0D%0A%0D%0AUsually%2C%20th" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fconvert-3gp-videos-to-xvid-avi%2F&amp;title=Convert%203gp%20Videos%20to%20XviD%20AVI" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/extract-ac3-dolby-digital-with-ffmpeg/' rel='bookmark' title='Permanent Link: Extract AC3 Dolby Digital with FFMpeg'>Extract AC3 Dolby Digital with FFMpeg</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/' rel='bookmark' title='Permanent Link: Add Stereo Audio Tracks to MKV Files'>Add Stereo Audio Tracks to MKV Files</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/convert-3gp-videos-to-xvid-avi/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Extract Audio from Video Files to WAV using FFmpeg</title>
		<link>http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/</link>
		<comments>http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 04:49:47 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[FFMpeg]]></category>
		<category><![CDATA[MKV]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=537</guid>
		<description><![CDATA[Previously, I described how to Extract Audio from Video Files to WAV using Mplayer. Another method using FFmpeg instead of Mplayer was also pointed out in the post titled Add Stereo Audio Tracks to MKV Files, and I figured it would be useful to outline the quick one-step process in a post all by itself. [...]


Related posts:<ol><li><a href='http://savvyadmin.com/extract-ac3-dolby-digital-with-ffmpeg/' rel='bookmark' title='Permanent Link: Extract AC3 Dolby Digital with FFMpeg'>Extract AC3 Dolby Digital with FFMpeg</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using Mplayer'>Extract Audio from Video Files to WAV using Mplayer</a></li>
<li><a href='http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/' rel='bookmark' title='Permanent Link: Add Stereo Audio Tracks to MKV Files'>Add Stereo Audio Tracks to MKV Files</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Previously, I described how to <a href="http://www.savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/" target="_blank">Extract Audio from Video Files to WAV using Mplayer</a>.  Another method using FFmpeg instead of Mplayer was also pointed out in the post titled <a href="http://www.savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/" target="_blank">Add Stereo Audio Tracks to MKV Files</a>, and I figured it would be useful to outline the quick one-step process in a post all by itself.</p>
<p>Here&#8217;s an example of extracting the audio from a video file called <code>video.mkv</code> and saving it to a file called <code>audio.wav</code>.  This very well could have been an AVI, MPEG, or any other video format that FFmpeg can decode.</p>
<blockquote><p><code><strong>ffmpeg -i video.mkv -acodec pcm_s16le -ac 2 audio.wav</strong></code></p></blockquote>
<p>It should also be mentioned that your source video file may have multiple audio channels or streams.  For example, you may have both English AC3 and DTS channels, but you may also have other audio streams for other languages, directors comments, etc.  If you want more control over which stream you are using, first identify them all with ffmpeg.</p>
<blockquote><p><code><strong>ffmpeg -i video.mkv</strong><br />
[snipped for brevity]<br />
Input #0, matroska, from 'video.mkv':<br />
  Duration: 01:30:38.78, start: 0.000000, bitrate: N/A<br />
    Stream #0.0(eng): Video: h264, yuv420p, 1280x720, PAR 1:1 DAR 16:9, 23.98 tbr, 1k tbn, 47.95 tbc<br />
    Stream <strong><em>#0.1(eng)</em></strong>: Audio: <strong><em>ac3</em></strong>, 48000 Hz, 5.1, s16<br />
    Stream #0.2(eng): Subtitle: 0x0000<br />
    Stream <strong><em>#0.3(heb)</em></strong>: Audio: <strong><em>mp3</em></strong>, 48000 Hz, stereo, s16<br />
    Stream #0.4(heb): Subtitle: 0x0000<br />
    Stream #0.5: Attachment: 0x0000<br />
    Stream #0.6: Attachment: 0x0000<br />
At least one output file must be specified</code></p></blockquote>
<p>From the example above, you see that Stream #0.0 is labeled as being an English video stream with h264 encoding.  Stream #0.1 and #0.3 are both audio streams, but #0.1 is English AC3 5.1 and #0.3 is Hebrew MP3 stereo.  Simply reference the stream id with the -map option in the following format.</p>
<blockquote><p><code><strong>ffmpeg -i video.mkv -map 0:1 -acodec pcm_s16le -ac 2 audio.wav</strong><br />
[snipped for brevity]<br />
Output #0, wav, to 'audio.wav':<br />
    Stream #0.0(eng): Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s<br />
Stream mapping:<br />
  Stream #0.1 -> #0.0<br />
[snipped for brevity]</code></p></blockquote>
<p>Now that you have a PCM WAV file, you can manipulated it however you like, e.g. encode to MP3, OGG, FLAC, etc.</p>
<blockquote><p><code><strong>lame -V0 -q0 --vbr-new audio.wav audio.mp3<br />
oggenc -q6 audio.wav<br />
flac audio.wav</strong></code></p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F&amp;t=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20FFmpeg" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20FFmpeg%20-%20http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20FFmpeg&amp;notes=Previously%2C%20I%20described%20how%20to%20Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer.%20%20Another%20method%20using%20FFmpeg%20instead%20of%20Mplayer%20was%20also%20pointed%20out%20in%20the%20post%20titled%20Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files%2C%20and%20I%20figured%20it%20would%20be%20useful%20to%20outl" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20FFmpeg&amp;bodytext=Previously%2C%20I%20described%20how%20to%20Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer.%20%20Another%20method%20using%20FFmpeg%20instead%20of%20Mplayer%20was%20also%20pointed%20out%20in%20the%20post%20titled%20Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files%2C%20and%20I%20figured%20it%20would%20be%20useful%20to%20outl" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20FFmpeg&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20FFmpeg&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=Previously%2C%20I%20described%20how%20to%20Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer.%20%20Another%20method%20using%20FFmpeg%20instead%20of%20Mplayer%20was%20also%20pointed%20out%20in%20the%20post%20titled%20Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files%2C%20and%20I%20figured%20it%20would%20be%20useful%20to%20outl" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20FFmpeg&amp;annotation=Previously%2C%20I%20described%20how%20to%20Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer.%20%20Another%20method%20using%20FFmpeg%20instead%20of%20Mplayer%20was%20also%20pointed%20out%20in%20the%20post%20titled%20Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files%2C%20and%20I%20figured%20it%20would%20be%20useful%20to%20outl" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-ffmpeg%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20FFmpeg" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/extract-ac3-dolby-digital-with-ffmpeg/' rel='bookmark' title='Permanent Link: Extract AC3 Dolby Digital with FFMpeg'>Extract AC3 Dolby Digital with FFMpeg</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using Mplayer'>Extract Audio from Video Files to WAV using Mplayer</a></li>
<li><a href='http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/' rel='bookmark' title='Permanent Link: Add Stereo Audio Tracks to MKV Files'>Add Stereo Audio Tracks to MKV Files</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quickly Identify Video File Attributes</title>
		<link>http://savvyadmin.com/quickly-identify-video-file-attributes/</link>
		<comments>http://savvyadmin.com/quickly-identify-video-file-attributes/#comments</comments>
		<pubDate>Tue, 03 Nov 2009 22:59:12 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[CLI]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=433</guid>
		<description><![CDATA[If you want to gain quick insight into the basic properties of a video file from the Linux command line, there&#8217;s a few really easy methods. The information you might be interested in are audio and video codecs, resolution, frame rates, bitrates, etc. Using mplayer, you can see some basic information about a video file. [...]


Related posts:<ol><li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using Mplayer'>Extract Audio from Video Files to WAV using Mplayer</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/adding-chapters-to-videos-using-mkv-containers/' rel='bookmark' title='Permanent Link: Adding Chapters to Videos Using MKV Containers'>Adding Chapters to Videos Using MKV Containers</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you want to gain quick insight into the basic properties of a video file from the Linux command line, there&#8217;s a few really easy methods.  The information you might be interested in are audio and video codecs, resolution, frame rates, bitrates, etc.</p>
<p>Using <code><em>mplayer</em></code>, you can see some basic information about a video file.  For example, the following video is using the WMV3 video codec at the resolution of 1280&#215;720 (720p), the bitrate of 3000 kbps, etc.</p>
<blockquote><p><code><strong>mplayer video.wmv -vo null -ao null -frames 0 2>&#038;1 /dev/null | egrep "(VIDEO|AUDIO)"</strong><br />
VIDEO:  [WMV3]  1280x720  24bpp  1000.000 fps  3000.0 kbps (366.2 kbyte/s)<br />
AUDIO: 44100 Hz, 2 ch, s16le, 96.0 kbit/6.80% (ratio: 12003->176400)</code></p></blockquote>
<p>The audio rate is shown to be 44100 Hz using 2-Channel stereo, but the codec is not listed.  You can get additional information with the -identify option.</p>
<blockquote><p><code><strong>mplayer video.wmv -identify -vo null -ao null -frames 0 2>&#038;1 /dev/null | egrep "(^ID|VIDEO|AUDIO)"</strong><br />
ID_AUDIO_ID=1<br />
ID_VIDEO_ID=2<br />
VIDEO:  [WMV3]  1280x720  24bpp  1000.000 fps  3000.0 kbps (366.2 kbyte/s)<br />
ID_CLIP_INFO_NAME0=name<br />
ID_CLIP_INFO_VALUE0=<br />
ID_CLIP_INFO_NAME1=author<br />
ID_CLIP_INFO_VALUE1=<br />
ID_CLIP_INFO_NAME2=copyright<br />
ID_CLIP_INFO_VALUE2=<br />
ID_CLIP_INFO_NAME3=comments<br />
ID_CLIP_INFO_VALUE3=<br />
ID_CLIP_INFO_N=4<br />
ID_FILENAME=video.wmv<br />
ID_DEMUXER=asf<br />
ID_VIDEO_FORMAT=WMV3<br />
ID_VIDEO_BITRATE=3000000<br />
ID_VIDEO_WIDTH=1280<br />
ID_VIDEO_HEIGHT=720<br />
ID_VIDEO_FPS=1000.000<br />
ID_VIDEO_ASPECT=1.7778<br />
ID_AUDIO_FORMAT=353<br />
ID_AUDIO_BITRATE=0<br />
ID_AUDIO_RATE=0<br />
ID_AUDIO_NCH=0<br />
ID_LENGTH=2116.00<br />
ID_VIDEO_ASPECT=1.7778<br />
ID_VIDEO_CODEC=wmv9dmo<br />
AUDIO: 44100 Hz, 2 ch, s16le, 96.0 kbit/6.80% (ratio: 12003->176400)<br />
ID_AUDIO_BITRATE=96024<br />
ID_AUDIO_RATE=44100<br />
ID_AUDIO_NCH=2<br />
ID_AUDIO_CODEC=ffwmav2</code></p></blockquote>
<p>Another great tool for identifying video attributes is <code><em>idvid</em></code>.  <code><em>idvid</em></code> comes with the <code><em>tovid</em></code> package, so be sure to install it from your repository.  It is a bit slow, but the output is very clean and easy to interpret.</p>
<blockquote><p><code><strong>idvid video.wmv</strong><br />
--------------------------------<br />
idvid<br />
Video identification script<br />
Part of the tovid suite, version 0.31</p>
<p>http://www.tovid.org</p>
<p>--------------------------------<br />
Analyzing file: 'video.wmv'. This may take several minutes...<br />
=========================================================<br />
               File: video.wmv<br />
              Width: 1280 pixels<br />
             Height: 720 pixels<br />
       Aspect ratio: 1.77:1<br />
             Frames: 63352<br />
           Duration: 00:35:13 hours/mins/secs<br />
          Framerate: 1000.000 frames per second<br />
       Video format: WMV3<br />
      Video bitrate: 3000000 bits per second<br />
---------------------------<br />
Audio track 1 (Stream 0.0, AID 0):<br />
---------------------------<br />
              Codec: wmav2<br />
            Bitrate: 0000 bits per second<br />
      Sampling rate: 44100 Hz<br />
=========================================================<br />
Audio is compliant with the following formats:<br />
  Not compliant with (S)VCD or DVD<br />
Video is compliant with the following formats:<br />
  Not compliant with (S)VCD or DVD<br />
This video does not seem to be compliant with (S)VCD or DVD<br />
standards. If you burn it to a video disc, it may not work.<br />
=========================================================</code></p></blockquote>
<p>Finally, another tool that works very well is <code><em>exiftool</em></code>.  It&#8217;s available in the <code><em>libimage-exiftool-perl</em></code> package.  The output is also very straight forward, and easy to interpret.  It&#8217;s also a lot faster than <code><em>idvid</em></code> because the tool only displays metadata, which in some cases can be misleading.  <code><em>Mplayer</em></code> and <code><em>tovid</em></code> actually probe the video, providing very accurate information at the cost of speed.</p>
<blockquote><p><code><strong>exiftool video.wmv</strong><br />
ExifTool Version Number         : 7.30<br />
File Name                       : video.wmv<br />
Directory                       : .<br />
File Modification Date/Time     : 2009:04:20 09:21:58<br />
File Type                       : WMV<br />
MIME Type                       : video/x-ms-wmv<br />
File ID                         : 12341234-1234-1234-1234-123412341234<br />
File Size                       : 823200182<br />
Creation Date                   : 2009:03:31 02:52:55Z<br />
Data Packets                    : 102833<br />
Play Duration                   : 35:16<br />
Send Duration                   : 35:13<br />
Preroll                         : 3000<br />
Flags                           : 2<br />
Min Packet Size                 : 8000<br />
Max Packet Size                 : 8000<br />
Max Bitrate                     : 3122812<br />
Is VBR                          : False<br />
Audio Codec Name                : Windows Media Audio 9.2<br />
Audio Codec Description         :  96 kbps, 44 kHz, stereo 1-pass CBR<br />
Video Codec Name                : Windows Media Video 9<br />
Video Codec Description         : Professional<br />
Audio Codec ID                  : Windows Media Audio V2 V7 V8 V9 / DivX audio (WMA) / Alex AC3 Audio<br />
Audio Channels                  : 2<br />
Audio Sample Rate               : 44100<br />
Stream Type                     : Video<br />
Error Correction Type           : No Error Correction<br />
Time Offset                     : 0 s<br />
Stream Number                   : 2<br />
Image Width                     : 1280<br />
Image Height                    : 720<br />
Title                           :<br />
Author                          :<br />
Copyright                       :<br />
Description                     :<br />
Rating                          :<br />
Image Size                      : 1280x720</code></p></blockquote>
<p>As always, comments and additional tips are welcome!</p>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;t=Quickly%20Identify%20Video%20File%20Attributes" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Quickly%20Identify%20Video%20File%20Attributes%20-%20http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes&amp;notes=If%20you%20want%20to%20gain%20quick%20insight%20into%20the%20basic%20properties%20of%20a%20video%20file%20from%20the%20Linux%20command%20line%2C%20there%27s%20a%20few%20really%20easy%20methods.%20%20The%20information%20you%20might%20be%20interested%20in%20are%20audio%20and%20video%20codecs%2C%20resolution%2C%20frame%20rates%2C%20bitrates%2C%20etc" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes&amp;bodytext=If%20you%20want%20to%20gain%20quick%20insight%20into%20the%20basic%20properties%20of%20a%20video%20file%20from%20the%20Linux%20command%20line%2C%20there%27s%20a%20few%20really%20easy%20methods.%20%20The%20information%20you%20might%20be%20interested%20in%20are%20audio%20and%20video%20codecs%2C%20resolution%2C%20frame%20rates%2C%20bitrates%2C%20etc" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Quickly%20Identify%20Video%20File%20Attributes&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=If%20you%20want%20to%20gain%20quick%20insight%20into%20the%20basic%20properties%20of%20a%20video%20file%20from%20the%20Linux%20command%20line%2C%20there%27s%20a%20few%20really%20easy%20methods.%20%20The%20information%20you%20might%20be%20interested%20in%20are%20audio%20and%20video%20codecs%2C%20resolution%2C%20frame%20rates%2C%20bitrates%2C%20etc" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes&amp;annotation=If%20you%20want%20to%20gain%20quick%20insight%20into%20the%20basic%20properties%20of%20a%20video%20file%20from%20the%20Linux%20command%20line%2C%20there%27s%20a%20few%20really%20easy%20methods.%20%20The%20information%20you%20might%20be%20interested%20in%20are%20audio%20and%20video%20codecs%2C%20resolution%2C%20frame%20rates%2C%20bitrates%2C%20etc" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fquickly-identify-video-file-attributes%2F&amp;title=Quickly%20Identify%20Video%20File%20Attributes" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using Mplayer'>Extract Audio from Video Files to WAV using Mplayer</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/adding-chapters-to-videos-using-mkv-containers/' rel='bookmark' title='Permanent Link: Adding Chapters to Videos Using MKV Containers'>Adding Chapters to Videos Using MKV Containers</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/quickly-identify-video-file-attributes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Extract Audio from Video Files to WAV using Mplayer</title>
		<link>http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/</link>
		<comments>http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/#comments</comments>
		<pubDate>Sun, 11 Oct 2009 20:24:09 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=424</guid>
		<description><![CDATA[You can extract the audio from a video file using mplayer and save the result to a WAV file, which you can then manipulate to your hearts content. For example, you may want to compress the audio to a stereo MP3 or OGG. The following command instruct that the audio output (-ao) should be redirected [...]


Related posts:<ol><li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/quickly-identify-video-file-attributes/' rel='bookmark' title='Permanent Link: Quickly Identify Video File Attributes'>Quickly Identify Video File Attributes</a></li>
<li><a href='http://savvyadmin.com/convert-mkv-to-xvid-with-mencoder/' rel='bookmark' title='Permanent Link: Convert MKV to Xvid with Mencoder'>Convert MKV to Xvid with Mencoder</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>You can extract the audio from a video file using mplayer and save the result to a WAV file, which you can then manipulate to your hearts content.  For example, you may want to compress the audio to a stereo MP3 or OGG.</p>
<p>The following command instruct that the audio output (-ao) should be redirected out to a PCM WAV file as fast as possible, while suppressing all video output.</p>
<blockquote><p><code><strong>mplayer -ao pcm:fast:file=audio.wav -vo null -vc null video.avi</strong></code></p></blockquote>
<p>Convert the resulting WAV to MP3.  The following is a great way to convert your WAV files to a high quality Variable Bitrate MP3.  See the man page for a decent tutorial on the available options.</p>
<blockquote><p><code><strong>lame -V0 -q0 --vbr-new audio.wav audio.mp3</strong></code></p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F&amp;t=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer%20-%20http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer&amp;notes=You%20can%20extract%20the%20audio%20from%20a%20video%20file%20using%20mplayer%20and%20save%20the%20result%20to%20a%20WAV%20file%2C%20which%20you%20can%20then%20manipulate%20to%20your%20hearts%20content.%20%20For%20example%2C%20you%20may%20want%20to%20compress%20the%20audio%20to%20a%20stereo%20MP3%20or%20OGG.%0D%0A%0D%0AThe%20following%20command%20instr" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer&amp;bodytext=You%20can%20extract%20the%20audio%20from%20a%20video%20file%20using%20mplayer%20and%20save%20the%20result%20to%20a%20WAV%20file%2C%20which%20you%20can%20then%20manipulate%20to%20your%20hearts%20content.%20%20For%20example%2C%20you%20may%20want%20to%20compress%20the%20audio%20to%20a%20stereo%20MP3%20or%20OGG.%0D%0A%0D%0AThe%20following%20command%20instr" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=You%20can%20extract%20the%20audio%20from%20a%20video%20file%20using%20mplayer%20and%20save%20the%20result%20to%20a%20WAV%20file%2C%20which%20you%20can%20then%20manipulate%20to%20your%20hearts%20content.%20%20For%20example%2C%20you%20may%20want%20to%20compress%20the%20audio%20to%20a%20stereo%20MP3%20or%20OGG.%0D%0A%0D%0AThe%20following%20command%20instr" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer&amp;annotation=You%20can%20extract%20the%20audio%20from%20a%20video%20file%20using%20mplayer%20and%20save%20the%20result%20to%20a%20WAV%20file%2C%20which%20you%20can%20then%20manipulate%20to%20your%20hearts%20content.%20%20For%20example%2C%20you%20may%20want%20to%20compress%20the%20audio%20to%20a%20stereo%20MP3%20or%20OGG.%0D%0A%0D%0AThe%20following%20command%20instr" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fextract-audio-from-video-files-to-wav-using-mplayer%2F&amp;title=Extract%20Audio%20from%20Video%20Files%20to%20WAV%20using%20Mplayer" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
<li><a href='http://savvyadmin.com/quickly-identify-video-file-attributes/' rel='bookmark' title='Permanent Link: Quickly Identify Video File Attributes'>Quickly Identify Video File Attributes</a></li>
<li><a href='http://savvyadmin.com/convert-mkv-to-xvid-with-mencoder/' rel='bookmark' title='Permanent Link: Convert MKV to Xvid with Mencoder'>Convert MKV to Xvid with Mencoder</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-mplayer/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Add Stereo Audio Tracks to MKV Files</title>
		<link>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/</link>
		<comments>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 22:33:50 +0000</pubDate>
		<dc:creator>gmendoza</dc:creator>
				<category><![CDATA[Tech Tips]]></category>
		<category><![CDATA[AC3]]></category>
		<category><![CDATA[Audio]]></category>
		<category><![CDATA[Dolby Digital]]></category>
		<category><![CDATA[FFMpeg]]></category>
		<category><![CDATA[LAME]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Matroska]]></category>
		<category><![CDATA[MKV]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[Multimedia]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.savvyadmin.com/?p=403</guid>
		<description><![CDATA[If you have Matroska Video (MKV) files encoded with AC3 Dolby Digital 5.1 or DTS audio tracks, you may want to simply extract the audio, convert it to a 2-channel stereo format like WAV, MP3 OGG, etc, and then add it back into the MKV as a separate audio track. This is useful when your [...]


Related posts:<ol><li><a href='http://savvyadmin.com/convert-mkv-to-xvid-with-mencoder/' rel='bookmark' title='Permanent Link: Convert MKV to Xvid with Mencoder'>Convert MKV to Xvid with Mencoder</a></li>
<li><a href='http://savvyadmin.com/adding-chapters-to-videos-using-mkv-containers/' rel='bookmark' title='Permanent Link: Adding Chapters to Videos Using MKV Containers'>Adding Chapters to Videos Using MKV Containers</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>If you have <a href="http://www.matroska.org" target="_blank">Matroska Video (MKV) files</a> encoded with AC3 Dolby Digital 5.1 or DTS audio tracks, you may want to simply extract the audio, convert it to a 2-channel stereo format like WAV, MP3 OGG, etc, and then add it back into the MKV as a separate audio track.  This is useful when your media player (e.g. <a href="http://www.westerndigital.com/en/products/products.asp?driveid=572">Western Digital Media Player WDAVN00</a>) will not downscale the audio from a digital format like AC3 or DTS to stereo when you don&#8217;t have a receiver or TV with a built in Dolby Digital decoder.  Now you&#8217;ll have the choice of either audio format depending on your technical requirements.</p>
<p>The great thing about the <a href="http://www.matroska.org/">Matroska multimedia container</a> is that you can easily manipulate these files without having to re-encode, saving lots of time.  I&#8217;ll be using <strong><em>mkvextract</em></strong> to extract the AC3 audio, <strong><em>ffmpeg</em></strong> to convert ac3 to mp3, and finally <strong><em>mkvmerge</em></strong> to add and remux the new audio track to the MKV container.  All of these are available to a number of platforms, but in my examples, I&#8217;m using Linux.  Check out the <a href="http://www.bunkus.org/videotools/mkvtoolnix/" target="_blank">MKVToolnix</a> and <a href="http://ffmpeg.org/" target="_blank">FFMpeg</a> websites for more info on the software.</p>
<p>If using Ubuntu Linux, install the relevant <strong><em>mkvtoolnix</em></strong>,  <em><strong>mkvtoolnix-gui</strong> </em>and <strong><em>ffmpeg</em></strong> packages.</p>
<blockquote><p><code><strong>sudo apt-get install mkvtoolnix mkvtoolnix-gui ffmpeg libavcodec-unstripped-52</strong></code></p></blockquote>
<p>To view the existing tracks of the MKV, use the <em>mkvmerge -i</em> option.  In the following example, you see my &#8220;<strong>Cool.Video.mkv</strong>&#8221; file has an MPEG4 video in track 1, an AC3 Dolby Digital audio file in track 2, and subtitles in track 3.</p>
<blockquote><p><code><strong>mkvmerge -i Cool.Movie.mkv </strong><br />
File 'Cool.Movie.mkv': container: Matroska<br />
Track ID 1: video (V_MPEG4/ISO/AVC)<br />
Track ID 2: audio (A_AC3)<br />
Track ID 3: subtitles (S_TEXT/UTF8)</code></p></blockquote>
<p>Using <em>mkvextract</em>, extract the AC3 Dolby Digital audio from track 2, saving it to a file called audio.ac3.</p>
<blockquote><p><code><strong>mkvextract tracks Cool.Movie.mkv 2:audio.ac3</strong><br />
Extracting track 2 with the CodecID 'A_AC3' to the file 'audio.ac3'. Container format: Dolby Digital (AC3)<br />
Progress: 100%</code></p>
<p><code><strong>ls -lh audio.ac3</strong><br />
-rw-r--r-- 1 gmendoza gmendoza 432M 2009-09-26 11:58 audio.ac3</code></p></blockquote>
<p>Convert the 6-channel ac3 file to a 2-channel stereo MP3 using <em>ffmpeg</em>.  If you prefer a higher audio bitrate, adjust the -ab value as desired.  e.g. 256, 384, etc, and adjust the audio rate to your liking as well.</p>
<blockquote><p><code><strong>ffmpeg -i audio.ac3 -acodec libmp3lame -ab 160k -ac 2 audio.mp3</strong><br />
[output omitted for brevity]</code></p>
<p><code><strong>ls -lh audio.*</strong><br />
-rw-r--r-- 1 gmendoza gmendoza 432M 2009-09-26 11:58 audio.ac3<br />
-rw-r--r-- 1 gmendoza gmendoza  87M 2009-09-26 12:08 audio.mp3</code></p></blockquote>
<p>To simplify things, you could actually skip the digital format extraction process by running ffmpeg against the MKV file directly.</p>
<blockquote><p><code><strong>ffmpeg -i Cool.Movie.mkv -acodec libmp3lame -ab 160k -ac 2 audio.mp3</strong></code></p></blockquote>
<p>If you prefer encoding with more advanced options, you could extract the audio as a 2-channel WAV file instead, and then process it with LAME, Oggenc, or some other encoder of your choosing.  The following shows the extraction to WAV, and then conversion to various formats for fun, e.g. MP3, OGG, and FLAC.</p>
<blockquote><p><code><strong>ffmpeg -i Cool.Movie.mkv -acodec pcm_s16le -ac 2 audio.wav<br />
lame -V0 -q0 --vbr-new audio.wav audio.mp3<br />
oggenc -q6 audio.wav<br />
flac audio.wav</strong></code></p></blockquote>
<p>Use <em>mkvmerge</em> to combine the original MKV with the MP3 audio track to create a new file called Cool.Movie.New.mkv.  Make sure you have enough disk space for both the original and new MKV file.</p>
<blockquote><p><code><strong>mkvmerge -o Cool.Movie.New.mkv Cool.Movie.mkv audio.mp3</strong><br />
mkvmerge v2.4.1 ('Use Me') built on Dec 13 2008 21:03:46<br />
'Cool.Movie.mkv': Using the Matroska demultiplexer.<br />
'audio.mp3': Using the MP2/MP3 demultiplexer.<br />
Warning: 'audio.mp3': Skipping 32 bytes at the beginning (no valid MP3 header found).<br />
'Cool.Movie.mkv' track 1: Using the MPEG-4 part 10 (AVC) video output module.<br />
'Cool.Movie.mkv' track 2: Using the AC3 output module.<br />
'Cool.Movie.mkv' track 3: Using the text subtitle output module.<br />
'audio.mp3' track 0: Using the MPEG audio output module.<br />
The file 'Cool.Movie.New.mkv' has been opened for writing.<br />
Progress: 100%<br />
The cue entries (the index) are being written...<br />
Muxing took 270 seconds.</code></p></blockquote>
<p>Verify that the audio track has been added.  You can see Track ID 4 has been successfully added.</p>
<blockquote><p><code><strong>mkvmerge -i New.Cool.Movie.mkv </strong><br />
File 'New.Cool.Movie.mkv': container: Matroska<br />
Track ID 1: video (V_MPEG4/ISO/AVC)<br />
Track ID 2: audio (A_AC3)<br />
Track ID 3: subtitles (S_TEXT/UTF8)<br />
Track ID 4: audio (A_MPEG/L3)</code></p></blockquote>
<p>That&#8217;s really all there is to it.  There are quite a few options available when editing MKV container files.  For example, I wanted nice descriptions for my tracks since various media players will read and display them for you during menu navigation.  I recommend using the mkvmerge gui application as shown in this screenshot.</p>
<p style="text-align: center;"><a href="http://www.savvyadmin.com/wp-content/uploads/2009/09/mkvmerge-gui.png" target="_blank"><img class="aligncenter size-medium wp-image-410" title="mkvmerge-gui" src="http://www.savvyadmin.com/wp-content/uploads/2009/09/mkvmerge-gui-300x175.png" alt="mkvmerge-gui" width="300" height="175" /></a></p>
<p>It&#8217;s really just a front-end application to mkvmerge, and the following text shows the commands that were used to specify the language for each tag, re-order the audio tracks, disable subtitles by default, and give useful descriptions to each Track ID.</p>
<blockquote><p><code><strong>mkvmerge -o "Cool.Movie.New.mkv"  \<br />
--language 1:eng \<br />
--track-name "1:Cool Movie (MPEG4)" \<br />
--default-track 1:yes \<br />
--display-dimensions 1:40x17 \<br />
--language 2:eng \<br />
--track-name "2:Dolby Digital 5.1 (AC3)" \<br />
--default-track 2:yes \<br />
--language 3:eng \<br />
--track-name "3:English Subtitles" \<br />
--default-track 3:no \<br />
-a 2 -d 1 -s 3 Cool.Movie.mkv \<br />
--language 0:eng \<br />
--track-name "0:2-Channel Stereo (MP3)" \<br />
--default-track 0:no \<br />
-a 0 -D -S audio.mp3 \<br />
--track-order 0:1,0:2,1:0,0:3</strong></code></p>
<p><code><strong>mkvmerge -i Cool.Movie.New.mkv</strong><br />
File 'Cool.Movie.New.mkv': container: Matroska<br />
Track ID 1: video (V_MPEG4/ISO/AVC)<br />
Track ID 2: audio (A_AC3)<br />
Track ID 3: audio (A_MPEG/L3)<br />
Track ID 4: subtitles (S_TEXT/UTF8)</code></p></blockquote>

<div class="sociable">
<div class="sociable_tagline">
<strong>Share and Enjoy:</strong>
</div>
<ul>
	<li class="sociablefirst"><a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;partner=sociable" title="Print"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;t=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files" title="Facebook"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://twitter.com/home?status=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files%20-%20http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F" title="Twitter"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://delicious.com/post?url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;notes=If%20you%20have%20Matroska%20Video%20%28MKV%29%20files%20encoded%20with%20AC3%20Dolby%20Digital%205.1%20or%20DTS%20audio%20tracks%2C%20you%20may%20want%20to%20simply%20extract%20the%20audio%2C%20convert%20it%20to%20a%202-channel%20stereo%20format%20like%20WAV%2C%20MP3%20OGG%2C%20etc%2C%20and%20then%20add%20it%20back%20into%20the%20MKV%20as%20a%20separate%20a" title="del.icio.us"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://savvyadmin.com/feed/" title="RSS"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/rss.png" title="RSS" alt="RSS" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;bodytext=If%20you%20have%20Matroska%20Video%20%28MKV%29%20files%20encoded%20with%20AC3%20Dolby%20Digital%205.1%20or%20DTS%20audio%20tracks%2C%20you%20may%20want%20to%20simply%20extract%20the%20audio%2C%20convert%20it%20to%20a%202-channel%20stereo%20format%20like%20WAV%2C%20MP3%20OGG%2C%20etc%2C%20and%20then%20add%20it%20back%20into%20the%20MKV%20as%20a%20separate%20a" title="Digg"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="mailto:?subject=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;body=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F" title="email"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;source=SavvyAdmin.com+For+savvy+admins+everywhere...&amp;summary=If%20you%20have%20Matroska%20Video%20%28MKV%29%20files%20encoded%20with%20AC3%20Dolby%20Digital%205.1%20or%20DTS%20audio%20tracks%2C%20you%20may%20want%20to%20simply%20extract%20the%20audio%2C%20convert%20it%20to%20a%202-channel%20stereo%20format%20like%20WAV%2C%20MP3%20OGG%2C%20etc%2C%20and%20then%20add%20it%20back%20into%20the%20MKV%20as%20a%20separate%20a" title="LinkedIn"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/linkedin.png" title="LinkedIn" alt="LinkedIn" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://identi.ca/notice/new?status_textarea=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F" title="Identi.ca"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/identica.png" title="Identi.ca" alt="Identi.ca" class="sociable-hovers" /></a></li>
	<li><a rel="nofollow"  href="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files&amp;annotation=If%20you%20have%20Matroska%20Video%20%28MKV%29%20files%20encoded%20with%20AC3%20Dolby%20Digital%205.1%20or%20DTS%20audio%20tracks%2C%20you%20may%20want%20to%20simply%20extract%20the%20audio%2C%20convert%20it%20to%20a%202-channel%20stereo%20format%20like%20WAV%2C%20MP3%20OGG%2C%20etc%2C%20and%20then%20add%20it%20back%20into%20the%20MKV%20as%20a%20separate%20a" title="Google Bookmarks"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a></li>
	<li class="sociablelast"><a rel="nofollow"  href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fsavvyadmin.com%2Fadd-stereo-audio-tracks-to-mkv-files%2F&amp;title=Add%20Stereo%20Audio%20Tracks%20to%20MKV%20Files" title="StumbleUpon"><img src="http://savvyadmin.com/wp-content/plugins/sociable/images/stumbleupon.png" title="StumbleUpon" alt="StumbleUpon" class="sociable-hovers" /></a></li>
</ul>
</div>


<p>Related posts:<ol><li><a href='http://savvyadmin.com/convert-mkv-to-xvid-with-mencoder/' rel='bookmark' title='Permanent Link: Convert MKV to Xvid with Mencoder'>Convert MKV to Xvid with Mencoder</a></li>
<li><a href='http://savvyadmin.com/adding-chapters-to-videos-using-mkv-containers/' rel='bookmark' title='Permanent Link: Adding Chapters to Videos Using MKV Containers'>Adding Chapters to Videos Using MKV Containers</a></li>
<li><a href='http://savvyadmin.com/extract-audio-from-video-files-to-wav-using-ffmpeg/' rel='bookmark' title='Permanent Link: Extract Audio from Video Files to WAV using FFmpeg'>Extract Audio from Video Files to WAV using FFmpeg</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://savvyadmin.com/add-stereo-audio-tracks-to-mkv-files/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
