<?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>Random Tech Articles &#187; Unix</title>
	<atom:link href="http://www.analogrithems.com/rant/category/unix/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.analogrithems.com/rant</link>
	<description>If I have seen a little further it is by standing on the shoulders of Giants. - Newton</description>
	<lastBuildDate>Thu, 02 Feb 2012 20:07:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<item>
		<title>Convert avi/mkv/mp4 to dvd in OSX or Someother *nix derivative</title>
		<link>http://www.analogrithems.com/rant/2011/02/11/convert-avimkvmp4-to-dvd-in-osx-or-someother-nix-derivative/</link>
		<comments>http://www.analogrithems.com/rant/2011/02/11/convert-avimkvmp4-to-dvd-in-osx-or-someother-nix-derivative/#comments</comments>
		<pubDate>Sat, 12 Feb 2011 00:22:58 +0000</pubDate>
		<dc:creator>analogrithems</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[OSX]]></category>
		<category><![CDATA[Unix]]></category>
		<category><![CDATA[Video]]></category>

		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=202</guid>
		<description><![CDATA[I often need to convert avi, mkv, mp4 or some other video format to generic DVD.  Using a Mac, I&#8217;ve found that this processes is a pain in the ass.  It surprises me that there are very few tools for &#8230; <a href="http://www.analogrithems.com/rant/2011/02/11/convert-avimkvmp4-to-dvd-in-osx-or-someother-nix-derivative/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Fwww.analogrithems.com%2Frant%2F%3Fp%3D202&count=horizontal&related=&text=Convert%20avi%2Fmkv%2Fmp4%20to%20dvd%20in%20OSX%20or%20Someother%20%2Anix%20derivative' class='twitter-share-button' data-text='Convert avi/mkv/mp4 to dvd in OSX or Someother *nix derivative' data-url='http://www.analogrithems.com/rant/?p=202' data-counturl='http://www.analogrithems.com/rant/2011/02/11/convert-avimkvmp4-to-dvd-in-osx-or-someother-nix-derivative/' data-count='horizontal' data-via='analogrithems'></a><p>I often need to convert avi, mkv, mp4 or some other video format to generic DVD.  Using a Mac, I&#8217;ve found that this processes is a pain in the ass.  It surprises me that there are very few tools for pulling this together.  I spent a few days searching and see that there was a few tools, but they were either dead projects, or not stable.  Don&#8217;t get me wrong, FFMpegX is pretty good at converting video formats, but trying to use it to actually make a dvd with subtitles just doesn&#8217;t work for me.  I did notice that it was based of the opensource ffmpeg, dvdauthor and cdrtools projects, so I decided to use my Darwin Ports system to install the packages (With all prerequisites)  and use the command line tools to do all the conversion.</p>
<p>sudo port install ffmpeg</p>
<p>sudo port install dvdauthor</p>
<p>sudo port install cdrtools</p>
<p>I had no clue how easy the command line tools would be to use and decided to document for my own use later.  Most of my info came from <a href="http://atomized.org/2005/03/converting-divxxvid-avi-to-dvd-with-ffmpeg/">http://atomized.org/2005/03/converting-divxxvid-avi-to-dvd-with-ffmpeg/</a></p>
<p><span style="text-decoration: underline;"><strong>Step 1)  Convert Source file to DVD video format</strong></span></p>
<p>The first thing you need to do is convert the video file to a mpeg2 file with the proper video dimensions 720&#215;480.  Luckily the FFMpeg package has a predefined template for it &#8216;-target ntsc-dvd, or -target pal-dvd for europe&#8217;.  Since I have a widescreen plasma screen, I use the 16:9 aspect ratio, if you have a more square tv, or if you just want your file more square use the &#8216;-aspect 4:3&#8242;  The ffmpeg <a href="http://www.ffmpeg.org/faq.html">faq</a> has some great info on additional options like converting videos to play on game consoles or smart phones or even to just a different format.  FFMPEG can be downloaded from <a href="http://www.ffmpeg.org">http://www.ffmpeg.org</a> for non-osx systems</p>
<p>ffmpeg -i MyMovie.avi -target ntsc-dvd -aspect 16:9 -sameq MyMovie.mpg</p>
<p><strong><span style="text-decoration: underline;">Step 2) Add Subtitles (If Needed)</span></strong></p>
<p>The easiest way to add subtitles to your newly created mpeg2 file is with DVDAuthor&#8217;s spumux tool.  This tool is a bit confusing to use, so I&#8217;ll try to make this as simple as possible.  First you need to make a xml config file for each subtitle you want to add.  Here is the one I make, and tend to use over and over by copying the file and changing the subfile name inside. Get the DVDauthor tools here <a href="http://dvdauthor.sourceforge.net">http://dvdauthor.sourceforge.net</a></p>
<p>&lt;subpictures&gt;<br />
&lt;stream&gt;<br />
&lt;textsub filename=&#8221;ongbak.3.english.srt&#8221; characterset=&#8221;ISO8859-1&#8243;<br />
fontsize=&#8221;28.0&#8243; font=&#8221;Geneva.ttf&#8221;<br />
horizontal-alignment=&#8221;center&#8221;<br />
vertical-alignment=&#8221;bottom&#8221; left-margin=&#8221;40&#8243;<br />
right-margin=&#8221;40&#8243;<br />
top-margin=&#8221;20&#8243; bottom-margin=&#8221;30&#8243;<br />
subtitle-fps=&#8221;25&#8243;<br />
movie-fps=&#8221;25&#8243; movie-width=&#8221;720&#8243; movie-height=&#8221;480&#8243;<br />
force=&#8221;yes&#8221;<br />
/&gt;<br />
&lt;/stream&gt;<br />
&lt;/subpictures&gt;</p>
<p>Here is a simple breakdown of what is going on in this config. Better definition found here <a href="http://dvdauthor.sourceforge.net/doc/spumux.html">http://dvdauthor.sourceforge.net/doc/spumux.html</a></p>
<ul>
<li><strong>filename</strong> &#8211; This is the subtitle file you will be attaching.</li>
<li><strong>characterset</strong> &#8211; This is the characterset for your subtitle text to use in the film.  For english you can use ISO8859-1, for other languages reference http://en.wikipedia.org/wiki/Character_encoding</li>
<li><strong>fontsize</strong> &#8211; This is the size of the font to display in the movie</li>
<li><strong>font</strong> &#8211; Which font to show as.  The fonts used by spumux are locate in ~/.spumux/</li>
<li><strong>horizontal-alignment</strong> &#8211; Where to place the subtitles in the film, {left, right, center}</li>
<li><strong>vertical-alignment </strong>- Where to place the subtitles on the film {top, center, bottom}</li>
<li><strong>right-margin</strong> &#8211; Don&#8217;t really understand these</li>
<li><strong>left-margin</strong> &#8211; Don&#8217;t really understand these</li>
<li><strong>top-margin</strong> &#8211; Don&#8217;t really understand these</li>
<li><strong>bottom-margin</strong> &#8211; Don&#8217;t really understand these</li>
<li><strong>subtitle-fps</strong> &#8211; Just set this to 25, for DVD</li>
<li><strong>movie-fps</strong> &#8211; Just set this to 25, for DVD</li>
<li><strong>movie-width</strong> &#8211; for DVD set to 720 for wide or 640 4:3</li>
<li><strong>movie-height</strong> &#8211; for dvd set to 480</li>
<li><strong>force</strong> &#8211; turns the subtitle without being selected</li>
</ul>
<p>spumux -s 0 -P MyMovie.xml &lt; MyMovie.mpg &gt; MyMovie.sub.eng.mpg</p>
<p><strong><span style="text-decoration: underline;">Step 3) Convert mpg to Video_TS format, this is called DVD authoring</span></strong></p>
<p>Now that we have our file encoded to the mpeg2 (AKA DVD) format and perhaps even the subtitles, it&#8217;s time to get the mpeg file turned into the more recognizable video_ts structure.   You can get the full lowdown on all the dvdauthor arguments from <a href="http://dvdauthor.sourceforge.net/doc/r1741.html">http://dvdauthor.sourceforge.net/doc/r1741.html</a></p>
<p>dvdauthor &#8211;title -f MyMovie.sub.eng.mpg -o MyMovie</p>
<p>the -o MyMovie means create a output directory with the VIDEO_TS subdirectory &amp; files inside</p>
<p><span style="text-decoration: underline;"><strong>Step 4) Create the DVD menu system</strong></span></p>
<p>Now that the mpeg file is in the video_ts directory structure (and is broken into vob files). You need to make the dvd menu.  Personally I don&#8217;t care for advanced menus.  I just want my movies to start, so I use the following command to just make an empty menu that just auto starts the movie.</p>
<p>dvdauthor -T -o MyMovie</p>
<p><strong><span style="text-decoration: underline;">Step 5) Create ISO image from finished VIDEO_TS directory</span></strong></p>
<p>Now that we have our functioning dvd video, lets convert it to an ISO that we can burn.  I do this with the mkisofs command from the cdrtools package.  It&#8217;s pretty simple, just use the following.  You can get cdrtools from  <a href="http://cdrecord.berlios.de/">http://cdrecord.berlios.de/</a></p>
<p>mkisofs -dvd-video -o MyMovie.iso MyMovie/</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.analogrithems.com/rant/2011/02/11/convert-avimkvmp4-to-dvd-in-osx-or-someother-nix-derivative/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.analogrithems.com/rant/2011/02/11/convert-avimkvmp4-to-dvd-in-osx-or-someother-nix-derivative/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Debugging Unix</title>
		<link>http://www.analogrithems.com/rant/2009/06/14/debugging-unix/</link>
		<comments>http://www.analogrithems.com/rant/2009/06/14/debugging-unix/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 23:15:44 +0000</pubDate>
		<dc:creator>analogrithems</dc:creator>
				<category><![CDATA[Irix]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Solaris]]></category>
		<category><![CDATA[Unix]]></category>

		<guid isPermaLink="false">http://www.analogrithems.com/rant/?p=56</guid>
		<description><![CDATA[When ever I come across a command or service in Unix that crashes or fails to run properly I quickly go to the trace tools to trace the system commands.  I often find that If I just follow the system &#8230; <a href="http://www.analogrithems.com/rant/2009/06/14/debugging-unix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<a href='http://twitter.com/share?url=http%3A%2F%2Fwww.analogrithems.com%2Frant%2F%3Fp%3D56&count=horizontal&related=&text=Debugging%20Unix' class='twitter-share-button' data-text='Debugging Unix' data-url='http://www.analogrithems.com/rant/?p=56' data-counturl='http://www.analogrithems.com/rant/2009/06/14/debugging-unix/' data-count='horizontal' data-via='analogrithems'></a><p>When ever I come across a command or service in Unix that crashes or fails to run properly I quickly go to the trace tools to trace the system commands.  I often find that If I just follow the system trace i can usually see what was supposed to happen and didn&#8217;t.  Unfortunatley not every unix flavor uses the same tracing commands.</p>
<p>In linux it is very simple prefix any command with <strong>strace</strong> and it will give you lots of system trace info.</p>
<p>In Solaris use the <strong>truss</strong> command.</p>
<p>In Irix use the <strong>par</strong> command.</p>
<p class="facebook"><a href="http://www.facebook.com/share.php?u=http://www.analogrithems.com/rant/2009/06/14/debugging-unix/" target="_blank" title="Share on Facebook">Share on Facebook</a></p>]]></content:encoded>
			<wfw:commentRss>http://www.analogrithems.com/rant/2009/06/14/debugging-unix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk: basic

Served from: www.analogrithems.com @ 2012-02-05 02:04:30 -->
