<?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/"
	xmlns:georss="http://www.georss.org/georss" >

<channel>
	<title>Ogre &#187; video</title>
	<atom:link href="http://rumsey.org/blog/tag/video/feed/" rel="self" type="application/rss+xml" />
	<link>http://rumsey.org/blog</link>
	<description></description>
	<lastBuildDate>Fri, 17 Feb 2012 00:55:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Movie encoder &#8220;daemon&#8221;</title>
		<link>http://rumsey.org/blog/2010/02/movie-encoder-daemon/</link>
		<comments>http://rumsey.org/blog/2010/02/movie-encoder-daemon/#comments</comments>
		<pubDate>Mon, 01 Mar 2010 00:21:01 +0000</pubDate>
		<dc:creator>Ogre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[iFlicks]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://rumsey.org/blog/?p=272</guid>
		<description><![CDATA[I sometimes have incoming high-def video in formats that are not directly compatible with AppleTV.  I had been using iFlicks and an El Gato Turbo.264 HD encoder (a USB dongle with H.264 hardware innit), but lately that started producing bad output &#8211; I think the hardware was going bad as even the official software had [...]]]></description>
			<content:encoded><![CDATA[<p>I sometimes have incoming high-def video in formats that are not directly compatible with AppleTV.  I had been using <a href="http://www.iflicksapp.com/">iFlicks</a> and an El Gato Turbo.264 HD encoder (a USB dongle with H.264 hardware innit), but lately that started producing bad output &#8211; I think the hardware was going bad as even the official software had the same results.  It was great while it lasted, it allowed the poor overworked Mac Mini that was doing the encoding to do 720p transcodes faster than real-time.  I should note that iFlicks&#8217; author has actually recommended not using the El Gato thing, he mentions audio sync problems, but I never saw that, just frequent badly encoded video after mine started to go bad.</p>
<p>I&#8217;ve now switched back to software encoding using Handbrake.  To that end, I wrote a tiny little daemon that watches for files in one directory, encodes them, then moves them to the folder that iFlicks is watching and trashes the original.  iFlicks will then add meta-data (it searches <a href="http://thetvdb.com">thetvdb.com</a> based on the file name), and finally send the file off to iTunes (which will then sync it to AppleTV.  WHEW that&#8217;s a lot of steps, you see why I need to write myself things to help?)</p>
<p>iFlicks can do software encoding itself, but it just uses Quicktime, which is a whole hell of a lot slower than Handbrake.  Handbrake still doesn&#8217;t do 720p at real-time on a Mac Mini, but it&#8217;s only about half real-time, as opposed to Quicktime, which was taking 4-8 hours to encode an hour of video.</p>
<p>The script also gives me <a href="http://growl.info/">Growl</a> notifications, and I have the <a href="http://prowl.weks.net/">Prowl</a> app on my phone, so I get push notifications when encodings start and finish too.</p>
<p>Code after the jump.<br />
<span id="more-272"></span></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/env python</span>
&nbsp;
<span style="color: #808080; font-style: italic;"># Normal usage: movieconverter /Users/ogre/HDDownloads</span>
&nbsp;
HANDBRAKE=<span style="color: #483d8b;">'/Users/ogre/bin/HandBrakeCLI'</span>
DESTDIR=<span style="color: #483d8b;">'/Users/ogre/SBDownloads'</span>
TRASH=<span style="color: #483d8b;">'/Users/ogre/.Trash'</span>
ERRORS=<span style="color: #483d8b;">'/Users/ogre/Movies/Errors'</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">sys</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">os</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">shutil</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">time</span>
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">glob</span>
&nbsp;
ENCODING_DONE = <span style="color: #483d8b;">'Encoding Done'</span>
ENCODING_STARTED = <span style="color: #483d8b;">'Encoding Started'</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">try</span>:
    <span style="color: #ff7700;font-weight:bold;">import</span> Growl
    useGrowl = <span style="color: #008000;">True</span>
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Using growl for notifications'</span>
<span style="color: #ff7700;font-weight:bold;">except</span>:
    <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'NOT using growl for notifications, could not import Growl'</span>
    useGrowl = <span style="color: #008000;">False</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> useGrowl:
    growl = Growl.<span style="color: black;">GrowlNotifier</span><span style="color: black;">&#40;</span>applicationName=<span style="color: #483d8b;">&quot;Movie Encoder&quot;</span>,
                                notifications=<span style="color: black;">&#91;</span>ENCODING_DONE, ENCODING_STARTED<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    growl.<span style="color: black;">register</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Watching %s for movies'</span> <span style="color: #66cc66;">%</span><span style="color: black;">&#40;</span> <span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #ff4500;">1</span>:
    files = <span style="color: #dc143c;">glob</span>.<span style="color: #dc143c;">glob</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'%s/*.mkv'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">sys</span>.<span style="color: black;">argv</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">for</span> f <span style="color: #ff7700;font-weight:bold;">in</span> files:
        <span style="color: black;">&#40;</span>name,ext<span style="color: black;">&#41;</span> = <span style="color: #dc143c;">os</span>.<span style="color: black;">path</span>.<span style="color: black;">splitext</span><span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span>
        output = name + <span style="color: #483d8b;">'.m4v'</span>
        <span style="color: #dc143c;">cmd</span> = <span style="color: #483d8b;">'%s -i &quot;%s&quot; -o &quot;%s&quot; --preset=AppleTV'</span> <span style="color: #66cc66;">%</span><span style="color: black;">&#40;</span>HANDBRAKE, f, output<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Found %s, running %s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>f, <span style="color: #dc143c;">cmd</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> useGrowl:
            growl.<span style="color: black;">notify</span><span style="color: black;">&#40;</span>ENCODING_STARTED, ENCODING_STARTED,
                         <span style="color: #483d8b;">'Starting encode: %s =&gt; %s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>f, output<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        result = <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">cmd</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> result == <span style="color: #ff4500;">0</span>:
            <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Handbrake complete, moving %s to %s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>output, DESTDIR<span style="color: black;">&#41;</span>
            <span style="color: #808080; font-style: italic;"># iFlicks gets stuck when moving the file this way??</span>
            <span style="color: #808080; font-style: italic;">#shutil.move(output, DESTDIR)</span>
            <span style="color: #dc143c;">os</span>.<span style="color: black;">system</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'mv &quot;%s&quot; &quot;%s/&quot;'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>output, DESTDIR<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Moving %s to trash'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>f<span style="color: black;">&#41;</span>
            <span style="color: #dc143c;">shutil</span>.<span style="color: black;">move</span><span style="color: black;">&#40;</span>f, TRASH<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> useGrowl:
                growl.<span style="color: black;">notify</span><span style="color: black;">&#40;</span>ENCODING_DONE, ENCODING_DONE,
                             <span style="color: #483d8b;">'Finished encoding %s =&gt; %s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>f, output<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            <span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Handbrake returned error code %d, moving file %s to %s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>result<span style="color: black;">&#41;</span>
            <span style="color: #dc143c;">shutil</span>.<span style="color: black;">move</span><span style="color: black;">&#40;</span>f, ERRORS<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #dc143c;">time</span>.<span style="color: black;">sleep</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">10</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://rumsey.org/blog/2010/02/movie-encoder-daemon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>An important video</title>
		<link>http://rumsey.org/blog/2009/01/an-important-video/</link>
		<comments>http://rumsey.org/blog/2009/01/an-important-video/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 22:21:16 +0000</pubDate>
		<dc:creator>Ogre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://rumsey.org/blog/?p=196</guid>
		<description><![CDATA[I have received information that it is no longer Christmas, and therefore this blog needs to be updated. So this post is to wish you a Merry Martin Luther King Jr. Day. In celebration, here is an important video that every American should watch.]]></description>
			<content:encoded><![CDATA[<p>I have received information that it is no longer Christmas, and therefore this blog needs to be updated.  So this post is to wish you a Merry Martin Luther King Jr. Day.  In celebration, here is an important video that every American should watch.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/MytfhzcSF-Y&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/MytfhzcSF-Y&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://rumsey.org/blog/2009/01/an-important-video/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Merry Christmas</title>
		<link>http://rumsey.org/blog/2008/12/merry-christmas/</link>
		<comments>http://rumsey.org/blog/2008/12/merry-christmas/#comments</comments>
		<pubDate>Sat, 20 Dec 2008 00:38:01 +0000</pubDate>
		<dc:creator>Ogre</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[christmas]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[travel]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[wow]]></category>

		<guid isPermaLink="false">http://rumsey.org/blog/?p=192</guid>
		<description><![CDATA[Someone said &#8220;ship it!&#8221; and I misunderstood, so I&#8217;m on a ship until after Christmas.  Since I know millions of people&#8217;s lives are not complete without checking this blog for updates several times a day, here is something to tide you over. Also]]></description>
			<content:encoded><![CDATA[<p>Someone said &#8220;ship it!&#8221; and I misunderstood, so I&#8217;m on a ship until after Christmas.  Since I know millions of people&#8217;s lives are not complete without checking this blog for updates several times a day, here is something to tide you over.</p>
<p><object width="480" height="295" data="http://www.youtube.com/v/nFquKJ7EKaw&amp;hl=en&amp;fs=1" type="application/x-shockwave-flash"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/nFquKJ7EKaw&amp;hl=en&amp;fs=1" /><param name="allowfullscreen" value="true" /></object></p>
<p>Also</p>
<p><img class="alignnone size-full wp-image-193" title="wowbushshoe" src="http://rumsey.org/blog/wp-content/uploads/2008/12/wowbushshoe.gif" alt="wowbushshoe" width="340" height="256" /></p>
]]></content:encoded>
			<wfw:commentRss>http://rumsey.org/blog/2008/12/merry-christmas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You must use the force</title>
		<link>http://rumsey.org/blog/2008/11/you-must-use-the-force/</link>
		<comments>http://rumsey.org/blog/2008/11/you-must-use-the-force/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 05:24:40 +0000</pubDate>
		<dc:creator>Ogre</dc:creator>
				<category><![CDATA[humor]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://rumsey.org/blog/?p=150</guid>
		<description><![CDATA[The greatest YouTube video ever.  Or at least today.]]></description>
			<content:encoded><![CDATA[<p>The greatest YouTube video ever.  Or at least today.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/lk5_OSsawz4&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/lk5_OSsawz4&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://rumsey.org/blog/2008/11/you-must-use-the-force/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>I&#8217;m a TV Star</title>
		<link>http://rumsey.org/blog/2008/04/im-a-tv-star/</link>
		<comments>http://rumsey.org/blog/2008/04/im-a-tv-star/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 18:51:02 +0000</pubDate>
		<dc:creator>Ogre</dc:creator>
				<category><![CDATA[lnorigb]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://rumsey.org/blog/?p=128</guid>
		<description><![CDATA[Or at least the back of my head is. I&#8217;m in there, front and center, right behind Paul&#8217;s stalkergroupie (lnor) and her mom. Things I learned at this taping: Getting all monitors to display everything in the correct aspect ratio all the time is so difficult that even a major network television show can&#8217;t get [...]]]></description>
			<content:encoded><![CDATA[<p>Or at least the back of my head is.  I&#8217;m in there, front and center, right behind Paul&#8217;s <del>stalker</del>groupie (lnor) and her mom.</p>
<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/NSdgiTVYrec&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/NSdgiTVYrec&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
<p>Things I learned at this taping:</p>
<list>
<li>Getting all monitors to display everything in the correct aspect ratio all the time is so difficult that  even a major network television show can&#8217;t get it right.  Before the show they had an old episode playing on the widescreen studio monitors, and parts of it were squashed vertically.
<li>Jimmy Kimmel &#8220;Live&#8221; is so not live that they taped another musical performance from The Swell Season the night we were there, and it doesn&#8217;t air until Friday.
</list>
]]></content:encoded>
			<wfw:commentRss>http://rumsey.org/blog/2008/04/im-a-tv-star/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I love the whole world</title>
		<link>http://rumsey.org/blog/2008/04/i-love-the-whole-world/</link>
		<comments>http://rumsey.org/blog/2008/04/i-love-the-whole-world/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 18:56:46 +0000</pubDate>
		<dc:creator>Ogre</dc:creator>
				<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://rumsey.org/blog/?p=126</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><object width="425" height="355"><param name="movie" value="http://www.youtube.com/v/V5BxymuiAxQ&#038;hl=en"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/V5BxymuiAxQ&#038;hl=en" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://rumsey.org/blog/2008/04/i-love-the-whole-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

