<?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>Onlydarksets &#187; babgvant</title>
	<atom:link href="http://onlydarksets.com/tag/babgvant/feed/" rel="self" type="application/rss+xml" />
	<link>http://onlydarksets.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 14 Jan 2010 14:36:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Transcoding in Sage</title>
		<link>http://onlydarksets.com/2009/02/04/transcoding-in-sage-2/</link>
		<comments>http://onlydarksets.com/2009/02/04/transcoding-in-sage-2/#comments</comments>
		<pubDate>Wed, 04 Feb 2009 16:30:45 +0000</pubDate>
		<dc:creator>onlydarksets</dc:creator>
				<category><![CDATA[DVRMSToolbox]]></category>
		<category><![CDATA[SageTV]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[babgvant]]></category>
		<category><![CDATA[ffmpeg]]></category>

		<guid isPermaLink="false">http://onlydarksets.wordpress.com/?p=402</guid>
		<description><![CDATA[I finally got around to rebuilding my HTPC (does anyone call them that anymore?) yesterday, so now I need to set my sights on getting file conversions working again.  I&#8217;m pretty set on using DTb for file monitoring and processing control.  For transcoding, I was going to use VLC (or possibly Handbrake), but I might [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to rebuilding my HTPC (does anyone call them that anymore?) yesterday, so now I need to set my sights on getting file conversions working again.  I&#8217;m pretty set on using <a href="http://www.babgvant.com/" target="_blank">DTb</a> for file monitoring and processing control.  For transcoding, <a href="http://onlydarksets.com/2008/07/06/mp4-tagging/" target="_self">I was going to use VLC</a> (or possibly <a href="http://handbrake.fr/" target="_blank">Handbrake</a>), but I might look at <a href="http://ffdshow.faireal.net/mirror/ffmpeg/" target="_blank">ffmpeg</a> instead.  Also, Sage <a href="http://www.google.com/search?q=SageTVTranscoder+site%3Asagetv.com" target="_blank">includes a transcoder</a>, which is apparently based on ffmpeg, but I&#8217;m not sure it adds anything over ffmpeg for me.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://onlydarksets.com/2009/02/04/transcoding-in-sage-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Importing archived WMV videos into SageTV&#8217;s &#8220;My TV&#8221;</title>
		<link>http://onlydarksets.com/2009/01/12/importing-archived-wmv-videos-into-sagetvs-my-tv/</link>
		<comments>http://onlydarksets.com/2009/01/12/importing-archived-wmv-videos-into-sagetvs-my-tv/#comments</comments>
		<pubDate>Tue, 13 Jan 2009 03:05:43 +0000</pubDate>
		<dc:creator>onlydarksets</dc:creator>
				<category><![CDATA[SageTV]]></category>
		<category><![CDATA[Windows Media Center]]></category>
		<category><![CDATA[babgvant]]></category>

		<guid isPermaLink="false">http://onlydarksets.wordpress.com/?p=709</guid>
		<description><![CDATA[I have a ton of archived TV shows recorded in Vista Media Center that I processed with DVRMSToolbox (i.e., removed commercials, converted to WMV, and copied over all of the metadata), but they didn&#8217;t fit in well in Sage&#8217;s &#8220;Videos&#8221; structure.  After converting a few shows using SageMC, I realized that you can have pretty [...]]]></description>
			<content:encoded><![CDATA[<p>I have a <strong>ton</strong> of archived TV shows recorded in Vista Media Center that I processed with DVRMSToolbox (i.e., removed commercials, converted to WMV, and copied over all of the metadata), but they didn&#8217;t fit in well in Sage&#8217;s &#8220;Videos&#8221; structure.  After converting a few shows using SageMC, I realized that you can have pretty much any video file type show up in &#8220;My TV&#8221;, so I spent some time figuring out how to migrate all of these shows using a VB script.</p>
<p>Turns out you can access most of Windows Media Player via WSH, so that made it pretty easy to <a href="http://www.microsoft.com/technet/scriptcenter/funzone/player.mspx" target="_blank">grab all of the metadata</a> once everything was loaded into WMP &#8211; you just have to <a href="http://msdn.microsoft.com/en-us/library/bb249601(VS.85).aspx" target="_blank">know where to look</a>.  The XML layout for the Sage Webserver is <a href="http://tools.assembla.com/sageplugins/wiki/SageXmlInfo" target="_blank">pretty well documented</a>, although the source code to Andy&#8217;s excellent <a href="http://babgvant.com/files/folders/sagetools/entry9734.aspx" target="_blank">MigrateMCtoSage utility</a> made it much easier to figure out the bare minimums.  The hardest part was actually finding <a href="http://onlydarksets.com/2009/01/12/creating-an-xml-document-in-wsh/" target="_blank">the XML writer for WSH</a>.</p>
<p>Note that this should also work for AVIs, which is the other main <a href="http://support.microsoft.com/kb/316992" target="_blank">container format supported by WMP</a>.  However, AVI tagging is pretty abysmal in WMP, mostly because it doesn&#8217;t write the tags back to the file.  I have found a couple of apps to do this, but nothing I would wholeheartedly recommend.</p>
<p><strong>Backup you wiz.bin file before proceeding &#8211; you need to shut down the Sage service to do this properly.</strong></p>
<ol>
<li><a href="http://82kxpa.blu.livefilestore.com/y1pMpUgNT9RlJQFn9ZHLzRImUGDfDu21Oi4IJH3sJ1zHoeB5ft-BrO0FGbl2dCZLjJGM8a68MWyzQaK-y_X-_1T_Q/CreateVideoXML.zip?download" target="_blank">Download</a> and unzip CreateVideoXML.vbs<br />
<em>Optional: Open in a text editor and edit the output and temp files</em></li>
<li>Import your videos into WMP and clean up the metadata</li>
<li>Run CreateVideoXML.vbs</li>
<li>Open Sage Webserver and import the resulting XML file (by default: C:\Playlist.xml)
<ol>
<li>Check the <strong>Import TV files</strong> box</li>
<li>Check the <strong>Overwrite Existing Show Information</strong> box</li>
<li>Check the <strong>Overwrite Existing Sage TV File Information</strong> box</li>
<li>Check the <strong>Use imported Airing data to determine startTime</strong> option (THIS IS VERY IMPORTANT)</li>
<li>Uncheck everything else</li>
</ol>
</li>
</ol>
<p>After import, your videos will show up under &#8220;My TV&#8221;.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://onlydarksets.com/2009/01/12/importing-archived-wmv-videos-into-sagetvs-my-tv/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Converting SageTV recordings to Zune/iPod/iPhone, version 2.0</title>
		<link>http://onlydarksets.com/2009/01/02/converting-sagetv-recordings-to-zuneipodiphone-version-20/</link>
		<comments>http://onlydarksets.com/2009/01/02/converting-sagetv-recordings-to-zuneipodiphone-version-20/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 19:18:54 +0000</pubDate>
		<dc:creator>onlydarksets</dc:creator>
				<category><![CDATA[DVRMSToolbox]]></category>
		<category><![CDATA[Music/Video Players]]></category>
		<category><![CDATA[SageTV]]></category>
		<category><![CDATA[Windows Mobile]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[babgvant]]></category>
		<category><![CDATA[DTb HowTo]]></category>

		<guid isPermaLink="false">http://onlydarksets.wordpress.com/?p=644</guid>
		<description><![CDATA[I posted a method for converting SageTV files to iPod/iPhone compliant files a while back, but a number of the files weren&#8217;t converting properly.  I also had problems with mencoder cutting commercials out of the files.  So, I retooled the approach, and I am now getting 100% success, using the approach outlined below. NOTE: Several [...]]]></description>
			<content:encoded><![CDATA[<p>I posted <a href="http://onlydarksets.com/2008/09/19/convert-sage-recordings-to-iphone/">a method for converting SageTV files to iPod/iPhone compliant files</a> a while back, but a number of the files weren&#8217;t converting properly.  I also had problems with mencoder cutting commercials out of the files.  So, I retooled the approach, and I am now getting 100% success, using the approach outlined below.</p>
<p><span style="text-decoration: underline;"><strong>NOTE</strong></span>: Several of the non-alphanumeric characters do not copy and paste correctly.  If you have any problems (especially with the RunExternal actions), check that the quotes and dashes are correct.  Thanks to Steve for pointing that out in the comments.</p>
<p><span id="more-644"></span></p>
<p><strong><span style="text-decoration: underline;">Tools Used</span></strong></p>
<ul>
<li><a href="http://www.sagetv.com/" target="_blank">SageTV</a>: records TV shows</li>
<li><a href="http://www.babgvant.com/" target="_blank">DVRMSToolbox</a>: monitors recording folder and orchestrates conversion<a href="http://www.mplayerhq.hu/" target="_blank"></a>
<ul>
<li><a href="http://tools.assembla.com/sageplugins/wiki/WebServer" target="_blank">SageTV Web Interface</a>: provides metadata to DVRMSToolbox</li>
<li><a href="http://www.kaashoek.com/comskip/" target="_blank">ComSkip</a> or <a href="http://www.dragonglobal.biz/showanalyzer.html" target="_blank">ShowAnalyzer</a>: finds commercials in TV show files for DTb</li>
</ul>
</li>
<li><a href="http://www.mplayerhq.hu/" target="_blank">mencoder</a> (<em>bundled with mplayer</em>): removes commercials</li>
<li><a href="http://www.handbrake.fr/" target="_blank">Handbrake</a>: converts to h.264/aac in mp4 container</li>
<li><a href="http://atomicparsley.sourceforge.net/" target="_blank">AtomicParsley</a>: writes metadata to mp4</li>
<li><a href="http://www.donationcoder.com/Software/Skrommel/index.html#MoveOut" target="_blank">MoveOut</a>: puts converted files in the &#8220;right&#8221; place</li>
</ul>
<p><strong><span style="text-decoration: underline;">My Files</span></strong></p>
<ul>
<li><a href="http://82kxpa.blu.livefilestore.com/y1pJD8mEQQfG4iLyVVOqD3bH89iue009CKfcbVEsdwdqr19OCpEH6NS70sCTbp97YTEyapUD-bEhmc/ConvertHDusingHandbrakeComSkip.zip?download" target="_blank">&#8220;Convert to Zune/iPod/iPhone&#8221; Profile</a></li>
<li><a href="http://82kxpa.blu.livefilestore.com/y1pMsaYuwkhyqnqGmETLXmuUjlPWZigTWNnNK7GDMLiU28IiPOFDR07ctxD3oHioAWvEJgDzMh5yG2SbXroxfdxww/addToItunes.zip?download" target="_blank">&#8220;Add to iTunes&#8221; Javascript</a> (NOTE: I have tested this as a standalone script, but it is not incorporated into the workflow below)</li>
</ul>
<p><strong><span style="text-decoration: underline;">Step 1: Installation and SageTV</span></strong></p>
<p>Obviously, you need to have all of the above tools installed and SageTV configured and running and recording shows.  DVRMSToolbox (DTb) should be running and monitoring the SageTV recorded TV folder(s).</p>
<p><strong><span style="text-decoration: underline;">Step 2: Setup the DTb Profile</span></strong></p>
<p>The problem I experienced with mencoder was due to the stdout mucking up DTb.  Turns out DTb has a RunExternalNoStatus action that ignores the output, thus obviating the problem.  Using this action for AtomicParsley sped up that app&#8217;s processing by tenfold (due to the huge amount of output of AP).  So, as a general rule, if you have having trouble getting an external app to run well (or at all) in DTb, try RunExternalNoStatus.</p>
<p>Now, for the meat of the process.  DTb orchestrates the various external applications.  The logical flow is:</p>
<ol>
<li>Scan the TV show file for commercials.</li>
<li>Use mencoder to create a new TV show file without the commercials.</li>
<li>Use Handbrake to convert the file from MPEG to MP4 (h.264/AAC).</li>
<li>Use AtomicParsley to write metadata to the MP4 file (e.g., show, episode, air date, etc.).</li>
<li>Use DTb to rename the show to a friendly format (e.g., &#8220;Fringe &#8211; 2008-12-03 &#8211; Safe.mp4&#8243;).</li>
<li>Use MoveOut to move the shows to the correct folders (if necessary).</li>
</ol>
<p>As implemented, here are the Actions and parameters:</p>
<ol>
<li><strong>FWThrottle</strong>: <em>limit the number of files that are processed simultaneously</em>
<ol>
<li>UseDefaultSettings: &lt;checked&gt;</li>
<li>ContextFile: InputFile</li>
<li>Throttle: Checked</li>
<li>ContinueOnFail: &lt;unchecked&gt;</li>
</ol>
</li>
<li><strong>CreateTimeout</strong>: <em>sets a timeout &#8211; trust me, the first time mencoder hangs on &#8220;Dora the Explorer&#8221; and you don’t have “Lost” waiting for you in the morning like you were expecting, you’ll be glad.</em>
<ol>
<li>Timeout Minutes: 240</li>
<li>ContinueOnFail: &lt;unchecked&gt;</li>
</ol>
</li>
<li><strong>ChangeContextValue</strong>: <em>create a new context to store the location of the commercial file created by ComSkip/SA</em>
<ol>
<li>SourceContext: InputFile</li>
<li>TargetContext: SageEDLFile</li>
<li>CreateNewContext: &lt;checked&gt;</li>
<li>NewContextName: SageEDLFile</li>
<li>FindRegex: ^((.*\\)(.*)\.(.*))\z</li>
<li>ReplaceRegex: $2$3.edl</li>
<li>ContinueOnFail: &lt;checked&gt; (<em>it&#8217;s OK to keep going if we fail for some reason &#8211; we just won&#8217;t get commercials cut out</em>)</li>
</ol>
</li>
<li><strong>ChangeContextValue</strong>: <em>update OutputFile context to allow for MP4 extension</em>
<ol>
<li>SourceContext: OutputFile</li>
<li>TargetContext: OutputFile</li>
<li>CreateNewContext: &lt;unchecked&gt;</li>
<li>FindRegex: ^((.*\\)(.*)\.(.*))\z</li>
<li>ReplaceRegex: $2$3.mp4</li>
<li>ContinueOnFail: &lt;unchecked&gt;</li>
</ol>
</li>
<li><strong>ChangeContextValue</strong>: <em>create a new context to specify location of the resulting commercial-free MPEG file</em>
<ol>
<li>SourceContext: OutputFile</li>
<li>TargetContext: CutMpegFile</li>
<li>CreateNewContext: &lt;checked&gt;</li>
<li>NewContextName: CutMpegFile</li>
<li>FindRegex: ^((.*\\)(.*)\.(.*))\z</li>
<li>ReplaceRegex: $2$3.mpg</li>
<li>ContinueOnFail: &lt;unchecked&gt;</li>
</ol>
</li>
<li><em><span style="font-style:normal;"><strong>FindCommercials</strong>: </span>run ComSkip/SA to find commercials and write to EDL file</em>
<ol>
<li>UseDefaultSettings: &lt;checked&gt;</li>
<li>ContextFile: InputFile</li>
<li>ContinueOnFail: &lt;checked&gt; (<em>again, worst case is we have commercials in the final MP4 file</em>)</li>
</ol>
</li>
<li><strong>RunExternalNoStatus</strong>: <em>run mencoder to cut out commercials</em>
<ol>
<li>ProcessName: &lt;fullpath&gt;\mencoder.exe</li>
<li>ReadError: &lt;unchecked&gt;</li>
<li>ArgumentsContext: “%InputFile%” -edl “%SageEDLFile%” -oac copy -ovc copy -of mpeg -o “%CutMpegFile%.mpg” -mpegopts muxrate=36000 -quiet</li>
<li>ContinueOnFail: &lt;unchecked&gt;</li>
</ol>
</li>
<li><strong>RunExternalNoStatus</strong>: <em>run Handbrake to convert to MP4</em>
<ol>
<li>ProcessName: &lt;fullpath\handbrakeCLI.exe</li>
<li>ReadError: &lt;unchecked&gt;</li>
<li>ArgumentsContext: &lt;experiment with the Handbrake GUI using a sample file to get the settings you want&gt;</li>
<li>ContinueOnFail: &lt;unchecked&gt;</li>
</ol>
</li>
<li><strong>MigrateMetadataToContext</strong>: <em>workaround to get a nicely formatted &#8220;original air date&#8221;</em>
<ol>
<li>Metadata Pattern: %originalAirDate%</li>
<li>TargetContext: OutputFile</li>
<li>CreateNewContext: &lt;checked&gt;</li>
<li>NewContextName: DateAndEpisode</li>
<li>FindRegex: ((\d+-)+\d+)</li>
<li>ReplaceRegex: $1</li>
<li>ContinueOnFail: &lt;unchecked&gt;</li>
</ol>
</li>
<li><strong>RunExternalNoStatus</strong>: run <em>AtomicParsley to add basic metadata to MP4</em>
<ol>
<li>Processname: &lt;fullpath&gt;\AtomicParsley.exe</li>
<li>ReadError: &lt;unchecked&gt;</li>
<li>ArgumentsContext: “%OutputFile%” &#8211;genre “TV Shows”  &#8211;stik “TV Show”  &#8211;TVNetwork %channelName%  &#8211;TVShowName “%Title%”  &#8211;TVEpisode “%episode%”  &#8211;description “%description%”  &#8211;category=”%category%”</li>
<li>ContinueOnFail: &lt;checked&gt; (<em>no need to crash just for the metadata</em>)</li>
</ol>
</li>
<li><strong>AdvancedFileRename</strong>: rename the output file to something meaningful
<ol>
<li>ContextFile: OutputFile</li>
<li>NamePattern: %Title% &#8211; %originalAirDate% &#8211; %episode%</li>
<li>WhenFileExists: AppendGuid</li>
</ol>
</li>
<li><strong>FileOperation</strong>: delete temporary MPEG file
<ol>
<li>ContextFile: CutMpegFile</li>
<li>DestinationPath: &lt;blank&gt;</li>
<li>WhatOperation: Delete</li>
</ol>
</li>
<li><strong>FileOperation</strong>: move MP4 to the output directory
<ol>
<li>ContextFile: OutputFile</li>
<li>DestinationPath: &lt;destination directory&gt;</li>
<li>WhatOperation: Move</li>
</ol>
</li>
</ol>
<p><strong><span style="text-decoration: underline;">Step 3: Move the files</span></strong></p>
<p>I use MoveOut to then put some files in the kids&#8217; directory, some in the wife&#8217;s Zune directory, and some in my directory.  You could do this all with DTb, but I find it easier to use a separate app.</p>
<p><strong><span style="text-decoration: underline;">What&#8217;s Next?</span></strong></p>
<p>Zune users are all set &#8211; the ZMP automatically monitors folders, so the next time you sync your Zune, it will pick up the new MP4 files.  iPod/iPhone users, however, have to manually import the folder prior to each sync.  There are two options for getting around this.  First, you can add an extra &#8220;RunExternal&#8221; action that <a href="http://babgvant.com/files/folders/dvrmstoolbox/entry5857.aspx" target="_blank">runs a Javascript to import the files into iTunes</a> (available in the linked download, courtesy of <a href="http://babgvant.com/forums/p/644/3220.aspx#3220" target="_blank">Coyote</a>).  Second, you can try to get the <a href="http://lifehacker.com/software/itunes/hack-attack-automatically-sync-itunes-to-any-folders-175161.php" target="_blank">iTunes Library Updater</a> to work, although there are mixed results with iTunes 7+.  I don&#8217;t have iTunes installed on my SageTV server, so this isn&#8217;t really an issue for me.</p>
<p><a href="http://forums.sagetv.com/forums/showthread.php?t=38115" target="_blank">jelwood is working on an alternate approach using Quicktime chapters</a> instead of actually cutting out the commercials.  Because not every medium I am watching these on supports Quicktime chapters (including SageTV and the Zune), I am sticking with the mencoder route.  However, this is a better option if storage space is not an issue or you have problems with ComSkip/SA getting the commercials &#8220;not quite right&#8221;.</p>
<p>Also, <a href="http://babgvant.com/forums/p/2100/11560.aspx#11560" target="_blank">jelwood has created a patched version of AtomicParsley</a> that allows you to set the sort order to the original air date.  I include the air date in my titles out of preference, so this is not necessary for me, but incorporating this is trivial.</p>
<p>Anything else?</p>
<p><em><strong>EDIT (2009-03-18)</strong>: DTb 1.2.1.6 added the MigrateMetadataToContext, which makes it easier to format the original air date to a friendlier format.</em></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://onlydarksets.com/2009/01/02/converting-sagetv-recordings-to-zuneipodiphone-version-20/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Commercial Viewer: Another great tool from babgvant</title>
		<link>http://onlydarksets.com/2008/12/26/commercial-viewer-another-great-tool-from-babgvant/</link>
		<comments>http://onlydarksets.com/2008/12/26/commercial-viewer-another-great-tool-from-babgvant/#comments</comments>
		<pubDate>Fri, 26 Dec 2008 09:48:47 +0000</pubDate>
		<dc:creator>onlydarksets</dc:creator>
				<category><![CDATA[DVRMSToolbox]]></category>
		<category><![CDATA[SageTV]]></category>
		<category><![CDATA[babgvant]]></category>

		<guid isPermaLink="false">http://onlydarksets.wordpress.com/?p=633</guid>
		<description><![CDATA[UPDATE: Andy has already released an update.  Get the binary here.  I have updated the screenshot below. Andy has posted yet another great tool on his site: Commercial Viewer.  This tool loads a video file and its associated EDL commercial file and lets you modify the values to fine-tune the commercial segments.  This isn&#8217;t a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>UPDATE</strong>: Andy has already <a href="http://babgvant.com/blogs/andyvt/archive/2008/12/26/commercial-viewer-1-0-0-1.aspx" target="_blank">released an update</a>.  Get the binary <a href="http://babgvant.com/files/folders/sagetools/entry11510.aspx" target="_blank">here</a>.  I have updated the screenshot below.</p>
<p>Andy has posted yet <strong>another</strong> great tool on his site: <a href="http://babgvant.com/blogs/andyvt/archive/2008/12/23/commercial-viewer.aspx" target="_blank">Commercial Viewer</a>.  This tool loads a video file and its associated EDL commercial file and lets you modify the values to fine-tune the commercial segments.  This isn&#8217;t a tool for every show that gets recorded &#8211; I use this for shows I want to archive indefinitely.</p>
<p><a href="http://onlydarksets.files.wordpress.com/2008/12/commercialviewer1001.jpg"><img class="alignnone size-medium wp-image-641" title="commercialviewer1001" src="http://onlydarksets.files.wordpress.com/2008/12/commercialviewer1001.jpg?w=300" alt="commercialviewer1001" width="300" height="155" /></a></p>
<p>In the screenshot above, you can see the app.  Once you select a video, it also loads the associated EDL file (of course, you have to run SA or ComSkip on the video file first).  You can preview the video, <span style="text-decoration:line-through;">although you can&#8217;t jump to an arbitrary spot (i.e., there is no slider)</span> and you can jump to an arbitrary spot by clicking on the green/red slider (updated per Andy&#8217;s comment below &#8211; the perils of 5a posting).  You can select a commercial segment using the list on the right.  The two text boxes display the start and end times of the commercial segment, and you can jump to either of those spots.</p>
<p>Get it <a href="http://babgvant.com/files/folders/sagetools/entry11510.aspx" target="_blank">here</a>.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://onlydarksets.com/2008/12/26/commercial-viewer-another-great-tool-from-babgvant/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Convert Sage recordings to iPhone</title>
		<link>http://onlydarksets.com/2008/09/19/convert-sage-recordings-to-iphone/</link>
		<comments>http://onlydarksets.com/2008/09/19/convert-sage-recordings-to-iphone/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 15:21:22 +0000</pubDate>
		<dc:creator>onlydarksets</dc:creator>
				<category><![CDATA[DVRMSToolbox]]></category>
		<category><![CDATA[Music/Video Players]]></category>
		<category><![CDATA[SageTV]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[babgvant]]></category>
		<category><![CDATA[ffmpeg]]></category>

		<guid isPermaLink="false">http://onlydarksets.wordpress.com/?p=408</guid>
		<description><![CDATA[I have posted an updated method.  I STRONGLY SUGGEST YOU USE IT INSTEAD!  I leave the below for posterity&#8230;   NOTE: mencoder is not cutting commercials properly on my system.  Everything else is working fine.  I&#8217;ll post an update when I get it working. Here is how I&#8217;m converting SageTV recordings to iPhone-compatible (and Touch/iPod-compatible) [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://onlydarksets.com/2009/01/02/converting-sagetv-recordings-to-zuneipodiphone-version-20/"><strong>I have posted an updated method</strong></a><strong>.  I STRONGLY SUGGEST YOU USE IT INSTEAD!  I leave the below for posterity&#8230;</strong></p>
<p> </p>
<p><em><strong>NOTE</strong>: mencoder is not cutting commercials properly on my system.  Everything else is working fine.  I&#8217;ll post an update when I get it working.</em></p>
<p>Here is how I&#8217;m converting SageTV recordings to iPhone-compatible (and Touch/iPod-compatible) MP4 videos.  <span style="text-decoration:underline;"><strong>This will also work for the Zune!</strong></span></p>
<p>At a high level, the steps (and applications used) are:</p>
<ol>
<li><a href="http://www.babgvant.com/" target="_blank">DVRMSToolbox</a>: monitor the recordings directories, identify which shows to process, grab the metadata that is later written to the MP4, and control program flow</li>
<li><a href="http://www.kaashoek.com/comskip/" target="_blank">comskip</a> or <a href="http://www.dragonglobal.biz/showanalyzer.html" target="_blank">ShowAnalyzer</a>: Scan for commercials</li>
<li><a href="http://www.mplayerhq.hu/" target="_blank">mencoder</a>: Cut commercials</li>
<li><a href="http://babgvant.com/files/folders/misc/entry4997.aspx" target="_blank">ffmpeg</a>: Convert to MP4 (<em>note: I had problems with <a href="http://tripp.arrozcru.org/" target="_self">the latest Windows build of ffmpeg</a>, but <a href="http://babgvant.com/files/folders/misc/entry4997.aspx">the one from babgvant.com</a> worked fine</em>)
<ol>
<li>Option 2 is to use mencoder to cut out commercials and convert to MP4 in single pass, and then use <a href="http://nic.dnsalias.com/" target="_blank">NicMP4Box</a> to fix the MP4 container to make it iPod-compatible
<ul>
<li><em>Apparently mencoder&#8217;s <a href="http://mulder.dummwiedeutsch.de/home/?page=projects" target="_blank">current implementation</a> (2008-09-17) of lavf <a href="http://lists.mplayerhq.hu/pipermail/mencoder-users/2007-December/007696.html" target="_blank">correctly handles the MP4 container</a>, but I haven&#8217;t verified this.  If true, you can skip this step.</em></li>
<li><em>Also (apparently), <a href="http://rob.opendot.cl/index.php/useful-stuff/ipod-video-guide/" target="_blank">the latest SVN of AtomicParsley can fix this</a>, but you have to build it yourself.<br />
</em></li>
</ul>
</li>
</ol>
</li>
<li><a href="http://atomicparsley.sourceforge.net/" target="_blank">AtomicParsley</a>: Write metadata to identify as TV Shows (plus any other info we have)</li>
</ol>
<p>I am assuming basic familiarity with DTb, so I&#8217;ll talk about how to setup the Profile to process a Sage recording, but I am not addressing installing DTb or setting up the processing condition.</p>
<p>More after the break&#8230;</p>
<p><span id="more-408"></span></p>
<h3>DTb: Setup the Profiles</h3>
<p><em>Note you will need to create one profile for SD and one for HD.  The only difference will be profile indicated in the the call to mencoder/ffmpeg (step 6).</em></p>
<ol>
<li>Throttle to prevent unlimited workers from running</li>
<li>Set a timeout (trust me &#8211; the first time mencoder hangs and you don&#8217;t have &#8220;Lost&#8221; waiting for you in the morning like you were expecting, you&#8217;ll be glad)</li>
<li>Update OutputFile context to allow for MP4 extension:<br />
FIND IN OutputFile: ^((.*\)(.*).(.*))z<br />
REPLACE IN OutputFile: $2$3.mp4</li>
<li>Create a new context to specify the Sage commercial file location:<br />
FIND IN InputFile: ^((.*\)(.*).(.*))z<br />
REPLACE IN SageEDLFile: $2$3.edl</li>
<li>Find commercials</li>
<li><strong>Option 1 &#8211; ffmpeg<br />
</strong><em>Note: this process is tried and true, but you suffer a performance hit since mencoder has to rewrite the entire file to cut the commercials.</em> </p>
<ol>
<li>Cut commercials with mencoder<br />
mencoder &#8220;%InputFile%&#8221; -edl &#8220;%SageEDLFile%&#8221; -oac copy -ovc copy -of mpeg -o &#8220;%OutputFile%.mpg&#8221;</li>
<li>Convert with ffmpeg<br />
Profile: X264 with AAC</li>
</ol>
</li>
<li><strong>Option 2 &#8211; mencoder<br />
</strong><em>Note: mencoder does not have the best implementation of the mp4 container, and I have had problems getting the conversion to work properly.  However, if you can get it to work, the overall process is faster)</em> </p>
<ol>
<li>Cut and convert with mencoder<br />
mencoder &#8220;%InputFile%&#8221; -edl &#8220;%SageEDLFile%&#8221; -profile x264IPod-SD -o &#8220;%OutputFile%.tmp.mp4&#8243;</li>
<li>Remux MP4 with NicMP4Box<br />
NicMP4Box -add &#8220;%OutputFile%.TMP.mp4&#8243; &#8220;%OutputFile%&#8221;</li>
</ol>
</li>
<li>Add basic metadata to MP4:<br />
AtomicParsley &#8220;%OutputFile%&#8221; &#8211;genre &#8220;TV Shows&#8221; &#8211;stik &#8220;TV Show&#8221; &#8211;TVNetwork %channelName% &#8211;TVShowName &#8220;%Title%&#8221; &#8211;TVEpisode &#8220;%episode%&#8221; &#8211;description &#8220;%description%&#8221; &#8211;category=&#8221;%category%&#8221;</li>
<li>Rename the output file to something meaningful:<br />
CONTEXT: OutputFile<br />
PATTERN: %Title% &#8211; %<span class="t">originalAirDate</span>% &#8211; %episode%</li>
</ol>
<h3>Setup the Profiles</h3>
<p>I use two profiles, one for HD sources and one for SD.  I resize to 640&#215;480 or 640&#215;360, since that&#8217;s the max resolution the iPhone can handle (Zune can handle 720&#215;480).</p>
<p>A couple of other notes:</p>
<ul>
<li>You must use H.264 or MPEG-4 with AAC audio &#8211; the iPhone supports nothing else.</li>
<li>You can mess with the bitrates (<strong>bitrate=x</strong>), but keep in mind the bitrate maximums (<strong>vbv_maxrate=x</strong>) that the iPhone supports (currently 1500).</li>
<li>The maximum IDC is currently 30 (<strong>level_idc=30</strong>)</li>
<li>Cabac is not supported (<strong>nocabac</strong>)</li>
</ul>
<h4>Option 1: ffmpeg</h4>
<p>Here&#8217;s the ffmpeg profile that&#8217;s working for me right now (note the &#8220;-ac 2&#8243; parameter for the audio encoding &#8211; this was the only way I could get the sound to play on the iPhone):</p>
<p>&lt;profile&gt;<br />
&lt;name&gt;MPEG-4 with AAC HD&lt;/name&gt;<br />
&lt;description&gt;MPEG-4 with AAC HD (iPhone-compatible Archive)&lt;/description&gt;<br />
&lt;extension&gt;mp4&lt;/extension&gt;<br />
&lt;video&gt;-vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2&lt;/video&gt;<br />
&lt;audio&gt;-acodec libfaac -ac 2 -ab 128000&lt;/audio&gt;<br />
&lt;/profile&gt;</p>
<p>Here are some other command lines that I&#8217;ve found, mostly from <a href="http://babgvant.com/forums/t/990.aspx?PageIndex=1" target="_blank">here</a>, in case you want to tinker:</p>
<ul>
<li>ffmpeg -y -benchmark -threads 2 -i &#8220;input.dvr-ms&#8221; -async 1 -deinterlace -s qvga -vcodec libx264 -b 384000 -bufsize 384 -coder 0 -level 13 -acodec libfaac &#8220;output.mp4&#8243;</li>
<li>4:3 and 16:9:
<ul>
<li>ffmpeg -y -benchmark -threads 2 -i &#8220;%CutDvrmsFile%&#8221; -async 1 -deinterlace -croptop 0 -cropbottom 4 -cropleft 8 -cropright 6 -s 704:480 -vcodec libx264 -b 832k -maxrate 960k -bufsize 384k -coder 1 -level 13  -flags +loop -cmp +chroma -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -flags2 +wpred+mixed_refs+8x8dct+brdo -me umh -trellis 2 -bidir_refine 1 -refs 3 -b_strategy 1 -directpred 2 -subq 5 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -aspect 4:3 -acodec libfaac -ab 128k &#8220;%OutputFile%&#8221;</li>
<li>ffmpeg -y -benchmark -threads 2 -i &#8220;%CutDvrmsFile%&#8221; -async 1 -deinterlace -croptop 56 -cropbottom 60 -cropleft 8 -cropright 6 -s 704:368 -vcodec libx264 -b 832k -maxrate 960k -bufsize 384k -coder 1 -level 13  -flags +loop -cmp +chroma -partitions +parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -flags2 +wpred+mixed_refs+8x8dct+brdo -me umh -trellis 2 -bidir_refine 1 -refs 3 -b_strategy 1 -directpred 2 -subq 5 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -qcomp 0.6 -qmin 10 -qmax 51 -qdiff 4 -aspect 16:9 -acodec libfaac -ab 128k &#8220;%OutputFile%&#8221;</li>
</ul>
</li>
<li>ffmpeg -i <span style="color:#ff0000;"><em><strong>input</strong></em></span> -acodec libfaac -ab 128kb -vcodec mpeg4 -b 1200kb -mbd 2 -flags +4mv+trell -aic 2 -cmp 2 -subcmp 2 -s 640&#215;360 -title <span style="color:#ff0000;"><strong>X</strong></span> <span style="color:#ff0000;"><strong>output</strong></span>.mp4<br />
(from <a href="http://http://ffmpeg.mplayerhq.hu/faq.html#SEC25" target="_blank">http://ffmpeg.mplayerhq.hu/faq.html#SEC25</a>)</li>
</ul>
<h4>Option 2: mencoder</h4>
<blockquote><p>[x264IPod-SD]<br />
profile-desc=&#8221;H.264/AAC MP4 SD for iPhone &#8211;After this, use NicMP4Box to remux&#8211;&#8221;<br />
lavdopts=threads=2<br />
vf=pp=md,scale=640:-10,harddup<br />
ovc=x264=yes<br />
x264encopts=turbo=1:bitrate=768:vbv_maxrate=1500:vbv_bufsize=244:nocabac:level_idc=30:threads=2<br />
oac=faac=yes<br />
faacopts=br=128:object=2:mpeg=4:raw=yes<br />
of=lavf=yes<br />
lavfopts=format=mp4<br />
#DtbExtension=mp4<br />
#dtbhres=&#8221;-vf pp=md,scale={0}:-10,harddup&#8221;</p></blockquote>
<blockquote><p>[x264IPod-HD]<br />
profile-desc=&#8221;H.264/AAC MP4 SD for iPhone &#8211;After this, use NicMP4Box to remux&#8211;&#8221;<br />
lavdopts=threads=2<br />
vf=pp=md,scale=640:-10,harddup<br />
ovc=x264=yes<br />
x264encopts=turbo=1:bitrate=1200:vbv_maxrate=1500:vbv_bufsize=244:nocabac:level_idc=30:threads=2<br />
oac=faac=yes<br />
faacopts=br=128:object=2:mpeg=4:raw=yes<br />
of=lavf=yes<br />
lavfopts=format=mp4<br />
#DtbExtension=mp4<br />
#dtbhres=&#8221;-vf pp=md,scale={0}:-10,harddup&#8221;</p></blockquote>
<h3>Resources:</h3>
<ul>
<li><a href="http://lists.mplayerhq.hu/pipermail/mencoder-users/2007-December/007692.html" target="_blank">http://lists.mplayerhq.hu/pipermail/mencoder-users/2007-December/007692.html</a></li>
<li><a href="http://rob.opendot.cl/index.php/useful-stuff/ipod-video-guide/" target="_blank">http://rob.opendot.cl/index.php/useful-stuff/ipod-video-guide/</a></li>
<li>Getting mencoder to cut commercials with muxing errors:
<ul>
<li><a href="http://forum.videohelp.com/topic346473.html" target="_blank">http://forum.videohelp.com/topic346473.html</a></li>
<li><a href="http://readlist.com/lists/mplayerhq.hu/mencoder-users/0/3146.html" target="_blank">http://readlist.com/lists/mplayerhq.hu/mencoder-users/0/3146.html</a></li>
<li><a href="http://lists.mplayerhq.hu/pipermail/mencoder-users/2006-June/003369.html" target="_blank">Increase muxrate to 36000</a></li>
<li><a href="http://www.tivocommunity.com/tivo-vb/showthread.php?p=6776831" target="_blank">-noskip option</a></li>
</ul>
</li>
</ul>
<h3>Related posts:</h3>
<ul>
<li><a href="http://onlydarksets.com/2008/09/16/transcoding-in-sage/">http://onlydarksets.com/2008/09/16/transcoding-in-sage/</a></li>
<li><a href="http://onlydarksets.com/2008/07/06/mp4-tagging/">http://onlydarksets.com/2008/07/06/mp4-tagging/</a></li>
<li><a href="http://onlydarksets.com/2008/06/13/convert-for-iphone-using-mencoderffmpeg/">http://onlydarksets.com/2008/06/13/convert-for-iphone-using-mencoderffmpeg/</a></li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://onlydarksets.com/2008/09/19/convert-sage-recordings-to-iphone/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Transcoding for iPhone in Sage</title>
		<link>http://onlydarksets.com/2008/09/16/transcoding-in-sage/</link>
		<comments>http://onlydarksets.com/2008/09/16/transcoding-in-sage/#comments</comments>
		<pubDate>Tue, 16 Sep 2008 18:49:38 +0000</pubDate>
		<dc:creator>onlydarksets</dc:creator>
				<category><![CDATA[DVRMSToolbox]]></category>
		<category><![CDATA[SageTV]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[babgvant]]></category>
		<category><![CDATA[ffmpeg]]></category>

		<guid isPermaLink="false">http://onlydarksets.wordpress.com/?p=403</guid>
		<description><![CDATA[I finally got around to rebuilding my HTPC (does anyone call them that anymore?) yesterday, so now I need to set my sights on getting file conversions working again.  I&#8217;m pretty set on using DTb for file monitoring and processing control.  For transcoding, I was going to use VLC (or possibly Handbrake), but I might [...]]]></description>
			<content:encoded><![CDATA[<p>I finally got around to rebuilding my HTPC (does anyone call them that anymore?) yesterday, so now I need to set my sights on getting file conversions working again.  I&#8217;m pretty set on using <a href="http://www.babgvant.com/" target="_blank">DTb</a> for file monitoring and processing control.  For transcoding, <a href="http://onlydarksets.com/2008/07/06/mp4-tagging/" target="_self">I was going to use VLC</a> (or possibly <a href="http://handbrake.fr/" target="_blank">Handbrake</a>), but I might look at <a href="http://ffmpeg.mplayerhq.hu/" target="_blank">ffmpeg</a> instead.  Also, Sage <a href="http://www.google.com/search?q=SageTVTranscoder+site%3Asagetv.com" target="_blank">includes a transcoder</a>, which is apparently based on ffmpeg, but I&#8217;m not sure it adds anything over ffmpeg for me.</p>
<p>A couple more resources:</p>
<ul>
<li><a href="ftp://ftp4.mplayerhq.hu/MPlayer/releases/win32/MPlayer-mingw32-1.0rc2.zip" target="_blank">mencoder build</a> that can <a href="http://babgvant.com/forums/t/1937.aspx" target="_blank">cut/merge MPEG files without recoding</a></li>
<li><a href="http://ffdshow.faireal.net/mirror/ffmpeg/" target="_blank">ffmpeg</a> Windows binaries</li>
<li><a href="http://atomicparsley.sourceforge.net/" target="_blank">Atomic Parsley</a> (for writing MP4 metadata)</li>
<li><a href="http://babgvant.com/forums/p/644/3220.aspx#3220" target="_blank">Atomic Parsely Windows GUI</a> (just found this &#8211; haven&#8217;t tested it)</li>
<li><a href="http://babgvant.com/forums/p/644/3220.aspx#3220" target="_blank">Coyote&#8217;s iPod guide for DTb</a></li>
</ul>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://onlydarksets.com/2008/09/16/transcoding-in-sage/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>This was an easy decision</title>
		<link>http://onlydarksets.com/2008/08/01/this-was-an-easy-decision/</link>
		<comments>http://onlydarksets.com/2008/08/01/this-was-an-easy-decision/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 15:21:42 +0000</pubDate>
		<dc:creator>onlydarksets</dc:creator>
				<category><![CDATA[SageTV]]></category>
		<category><![CDATA[babgvant]]></category>

		<guid isPermaLink="false">http://onlydarksets.wordpress.com/?p=326</guid>
		<description><![CDATA[I can&#8217;t believe how far Sage has come since v4.  With SageMC on top, this does pretty much everything I want, with no hacking and a reasonable amount of tweaking. Following Andy&#8217;s lead, I just upgraded my license from Sage 4 to 6 and ordered an extender.]]></description>
			<content:encoded><![CDATA[<p>I can&#8217;t believe how far Sage has come since v4.  With SageMC on top, this does pretty much everything I want, with no hacking and a reasonable amount of tweaking.</p>
<p>Following <a href="http://babgvant.com/blogs/andyvt/archive/2008/07/27/clarity.aspx">Andy&#8217;s lead</a>, I just upgraded my license from Sage 4 to 6 and ordered an extender.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://onlydarksets.com/2008/08/01/this-was-an-easy-decision/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Use Windows Media Center remote to start SageTV</title>
		<link>http://onlydarksets.com/2008/07/29/use-windows-media-center-remote-to-start-sagetv/</link>
		<comments>http://onlydarksets.com/2008/07/29/use-windows-media-center-remote-to-start-sagetv/#comments</comments>
		<pubDate>Tue, 29 Jul 2008 12:58:59 +0000</pubDate>
		<dc:creator>onlydarksets</dc:creator>
				<category><![CDATA[SageTV]]></category>
		<category><![CDATA[babgvant]]></category>

		<guid isPermaLink="false">http://onlydarksets.wordpress.com/?p=297</guid>
		<description><![CDATA[Andy has made the switch, and has already started cranking out enhancements.  This one allows you to use the green button on the MCE/VMC remotes to start Sage instead of MCE/VMC.]]></description>
			<content:encoded><![CDATA[<p>Andy has <a href="http://babgvant.com/blogs/andyvt/archive/2008/07/27/clarity.aspx">made the switch</a>, and has already started cranking out enhancements.  <a href="http://babgvant.com/blogs/andyvt/archive/2008/07/28/sagetray.aspx">This one</a> allows you to use the green button on the MCE/VMC remotes to start Sage instead of MCE/VMC.</p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save">Share/Save</a> </p>]]></content:encoded>
			<wfw:commentRss>http://onlydarksets.com/2008/07/29/use-windows-media-center-remote-to-start-sagetv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
