<?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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Patryk Zawadzki</title>
	<atom:link href="http://blogs.gnome.org/patrys/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/patrys</link>
	<description>Tales of a whining gnome</description>
	<pubDate>Mon, 29 Sep 2008 13:56:43 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-nc-sa/2.5/pl/</creativeCommons:license>		<item>
		<title>How to determine the first day of week</title>
		<link>http://blogs.gnome.org/patrys/2008/09/29/how-to-determine-the-first-day-of-week/</link>
		<comments>http://blogs.gnome.org/patrys/2008/09/29/how-to-determine-the-first-day-of-week/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 13:25:48 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[GNOME]]></category>

		<category><![CDATA[Project Hamster]]></category>

		<category><![CDATA[l10n]]></category>

		<category><![CDATA[locale]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/?p=15</guid>
		<description><![CDATA[Today we got a report for bug #554256 in Hamster. The first day of week was reported as Sunday for some locales that certainly used Monday. I did some research and found that before Hamster relied on a simple check to determine the result:

Run locale first_weekday (by the way, we have to use os.popen here [...]]]></description>
			<content:encoded><![CDATA[<p>Today we got a report for <a href="http://bugzilla.gnome.org/show_bug.cgi?id=554256">bug #554256</a> in Hamster. The first day of week was reported as Sunday for some locales that certainly used Monday. I did some research and found that before Hamster relied on a simple check to determine the result:</p>
<ul>
<li>Run <code>locale first_weekday</code> (by the way, we have to use <code>os.popen</code> here as these don&#8217;t seem to be accessible from Python)</li>
<li>If the result is 1, use Sunday, else use Monday (literally, it would treat 2 and 6 as Monday)</li>
</ul>
<p>That seemed to work at least for some countries but was wrong which became apparent when more people started using Hamster (and to put myself in shame: I didn&#8217;t notice this before but it was also broken for me). It seems the correct version is:</p>
<ul>
<li>Run <code>locale first_weekday week-1stday</code></li>
<li>Parse <code>week-1stday</code> as date with <code>%Y%m%d</code></li>
<li>Move the result <code>first_weekday - 1</code> days forward</li>
<li>Check the weekday of the result</li>
</ul>
<h3>Rationale:</h3>
<p>While <code>locale</code> manual pages are horribly outdated, all web searches point to <code>week-1stday</code> as the beginning of the first week of tracked Unix time. <code>first_weekday</code> is the 1-based offset of that week&#8217;s start day. It seems it&#8217;s only there so you can specify <code>first_weekday=2</code> and <code>first_workday=1</code> for the rare cases where working days span across two weeks.</p>
<p>Please do correct me if this is wrong as all of the above are assumptions based on glibc code and Google results. Hope the above helps someone in the future.</p>
<p><strong>Update:</strong> vuntz was kind enough to point me to <code>gtkcalendar.c</code>, part of GTK+. It does the same thing described above so it seems the method is correct.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/09/29/how-to-determine-the-first-day-of-week/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Happy hamsters</title>
		<link>http://blogs.gnome.org/patrys/2008/08/05/happy-hamsters/</link>
		<comments>http://blogs.gnome.org/patrys/2008/08/05/happy-hamsters/#comments</comments>
		<pubDate>Tue, 05 Aug 2008 10:40:14 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[Empathy]]></category>

		<category><![CDATA[GNOME]]></category>

		<category><![CDATA[PolicyKit]]></category>

		<category><![CDATA[Project Hamster]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/2008/08/05/happy-hamsters/</guid>
		<description><![CDATA[Project Hamster is now part of GNOME! Along with Empathy and some blessed external dependencies. Do not underestimate them however for they are some truly powerful libs including libcanberra, Clutter, Conduit and PolicyKit.
Some new pains are now (temporarily) part of my life. As PH&#8217;s father, Toms, is away I am the one responsible for the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://live.gnome.org/ProjectHamster">Project Hamster</a> is now <a href="http://mail.gnome.org/archives/devel-announce-list/2008-August/msg00001.html">part of GNOME</a>! Along with Empathy and some blessed external dependencies. Do not underestimate them however for they are some truly powerful libs including libcanberra, Clutter, Conduit and PolicyKit.</p>
<p>Some new pains are now (temporarily) part of my life. As PH&#8217;s father, Toms, is away I am the one responsible for the SVN migration, releasing 2.23.6 and cooperating with i18n and a11y teams. I think we should start by making the stats accessible but I&#8217;ll concentrate on moving to GNOME infrastructure for now. Hope the rest of the team gets their SVN accounts up and running soon.</p>
<p>As for Empathy, great stuff. If you like it as much as I do, you can help me convince Xavier to <a href="http://bugzilla.gnome.org/show_bug.cgi?id=545678">make it a bit prettier and more readable</a>. Hooray for lobbying!</p>
<p><strong>Edit:</strong> hamster-applet 2.23.6 is out, following the upcoming GNOME 2.23.6 release.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/08/05/happy-hamsters/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Launchpad WTF</title>
		<link>http://blogs.gnome.org/patrys/2008/07/16/launchpad-wtf/</link>
		<comments>http://blogs.gnome.org/patrys/2008/07/16/launchpad-wtf/#comments</comments>
		<pubDate>Wed, 16 Jul 2008 12:03:25 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[Launchpad]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/2008/07/16/launchpad-wtf/</guid>
		<description><![CDATA[PLD Linux finally moved to the awesomeness called Launchpad. Back in April it was a beautiful green site with a slick interface. Now we get an acid-propelled trip to the Mac OS 9 era:

Seriously, WTF is the blue bar? The ugliest tabs ever. And where did the action box go? Now you can probably get [...]]]></description>
			<content:encoded><![CDATA[<p>PLD Linux finally moved to the awesomeness called Launchpad. Back in April it was a beautiful green site with a slick interface. Now we get an acid-propelled trip to the Mac OS 9 era:</p>
<p><a href="http://www.flickr.com/photos/patrys/2673369909/" title="PLD Linux Distribution in Launchpad by patrys, on Flickr"><img src="http://farm4.static.flickr.com/3084/2673369909_3aec0807d4.jpg" width="500" height="380" alt="PLD Linux Distribution in Launchpad" /></a></p>
<p>Seriously, WTF is the blue bar? The ugliest tabs ever. And where did the action box go? Now you can probably get used to it but here comes the beta:</p>
<p><a href="http://www.flickr.com/photos/patrys/2673369925/" title="PLD Linux Distribution in Launchpad beta by patrys, on Flickr"><img src="http://farm4.static.flickr.com/3237/2673369925_ca4e8d4bc0.jpg" width="500" height="380" alt="PLD Linux Distribution in Launchpad beta" /></a></p>
<p>Guys, the 1995 is calling and wants to have its sites back. WTF? It&#8217;s not only ugly, what the hell happened to all the navigation? Hope it never makes it into production. Please, I can has the green Launchpad? Kthxbye.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/07/16/launchpad-wtf/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Improved one canvas workflow</title>
		<link>http://blogs.gnome.org/patrys/2008/07/14/improved-one-canvas-workflow/</link>
		<comments>http://blogs.gnome.org/patrys/2008/07/14/improved-one-canvas-workflow/#comments</comments>
		<pubDate>Mon, 14 Jul 2008 13:33:43 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[GNOME]]></category>

		<category><![CDATA[icons]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/2008/07/14/improved-one-canvas-workflow/</guid>
		<description><![CDATA[Jimmac&#8217;s post got me thinking. His script did the job for a single icon. Why not improve upon it to allow multiple icons sharing a single SVG file? Immediately decided to give it a go and after a few iterations the result works as follows:

You start by creating a template SVG.
For each icon (not size) [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://jimmac.musichall.cz/log/?p=436">Jimmac&#8217;s post</a> got me thinking. His script did the job for a single icon. Why not improve upon it to allow multiple icons sharing a single SVG file? Immediately decided to give it a go and after a few iterations the result works as follows:</p>
<ol>
<li>You start by creating a template SVG.</li>
<li>For each icon (not size) you create a layer <del>and set its name to <code>context/icon-name</code>. You can use a different syntax but it has to contain at least one slash. The rest of the layers are treated as drawing aids</del>.</li>
<li>For each layer you create a sublayer and give it a name starting with <q>plate</q>. Inkscape requires you to have distinct layer labels so a simple <code>plate</code> won&#8217;t do for multiple icons but you are free to use names such as <q>plate for foo.</q></li>
<li>The plate consists of a set of rectangles. Each rectangle will result in a separate PNG and the size is taken verbatim from the rectangles (so make sure you don&#8217;t end up with ten decimal places in width or height).</li>
<li>The plate also needs two text objects: one with label set to <code>context</code> and one with label set to <code>icon-name</code>. The text you put there is used to create the directory structure.</li>
<li>Save your template to a directory called <code>svg</code>. Make sure you hide the plate layers before saving.</li>
<li>Download the <a href='http://wirusy.room-303.com/OneCanvas/split-icons'>Split Icons</a> script.</li>
<li>Run the script. If you pass a path (or several paths), it will only process the files from the command line. If you don&#8217;t pass anything, it will process the whole <code>svg</code> directory.</li>
<li>Draw art!</li>
</ol>
<p>Here&#8217;s a <a href="http://wirusy.room-303.com/OneCanvas/icon-template.svg">template example</a>.</p>
<p>PS: b.g.o upload sucks. It will only accept <code>.gz</code> files and then will strip the dot from the original extension.</p>
<p><strong>Update:</strong> updated the script to handle the new format invented by jimmac. See the example above for details.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/07/14/improved-one-canvas-workflow/feed/</wfw:commentRss>
		</item>
		<item>
		<title>To git or not to git</title>
		<link>http://blogs.gnome.org/patrys/2008/06/27/to-git-or-not-to-git/</link>
		<comments>http://blogs.gnome.org/patrys/2008/06/27/to-git-or-not-to-git/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 09:00:13 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[GNOME]]></category>

		<category><![CDATA[bazaar]]></category>

		<category><![CDATA[dvcs]]></category>

		<category><![CDATA[git]]></category>

		<category><![CDATA[mercurial]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/2008/06/27/to-git-or-not-to-git/</guid>
		<description><![CDATA[These days most of the buzz is around choosing an appropriate DVCS for GNOME. Like, dude, what the hell?
It&#8217;s not like we&#8217;re choosing between CVS and SVN where one is the other plus cool features minus broken design. Today we should concentrate on using the most widely adopted DVCS, not on one with the cutest [...]]]></description>
			<content:encoded><![CDATA[<p>These days most of the <a href="http://treitter.livejournal.com/6573.html">buzz</a> is around choosing an appropriate DVCS for GNOME. Like, dude, what the hell?</p>
<p>It&#8217;s not like we&#8217;re choosing between CVS and SVN where one is the other plus cool features minus broken design. Today we should concentrate on using the most widely adopted DVCS, not on one with the cutest syntax. Features across the board are actually pretty much the same, the rest is just sugar coating.</p>
<p>Just take git and wrap it, add plugins, make it look like Bizarre or Peculiar. We certainly don&#8217;t want to tell new contributors to download and build 20+ source control tools just to build a single GNOME app from trunk. I can tell you for sure most of the devs want to get stuff done and they don&#8217;t give a poo about repository storage formats. We want to be able to easily commit changes and generate diffs, having a bunch of PostIt notes with various DVCS incantations is far from desired.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/06/27/to-git-or-not-to-git/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A good example of a bad trend</title>
		<link>http://blogs.gnome.org/patrys/2008/06/24/a-good-example-of-a-bad-trend/</link>
		<comments>http://blogs.gnome.org/patrys/2008/06/24/a-good-example-of-a-bad-trend/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 09:59:58 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[ConsoleKit]]></category>

		<category><![CDATA[GNOME]]></category>

		<category><![CDATA[PolicyKit]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/2008/06/24/a-good-example-of-a-bad-trend/</guid>
		<description><![CDATA[To add an example to my last note, here&#8217;s what happened recently.
One user posted the following:
I&#8217;ve noticed FOO desktop is no longer able to mount removable drives. I get the following:
org.freedesktop.hal.storage.mount-removable no &#60;-- (action, result )
What do I do?

And here&#8217;s the proposed solution:
Just edit /etc/PolicyKit/PolicyKit.conf and add the following part:
&#60;match action="org.freedesktop.hal.*"&#62;
&#60;return result="yes"/&#62;
&#60;/match&#62;

And they lived happily [...]]]></description>
			<content:encoded><![CDATA[<p>To add an example to <a href="http://blogs.gnome.org/patrys/2008/06/23/why-forums-are-a-bad-way-to-help-the-community/">my last note</a>, here&#8217;s what happened recently.</p>
<p>One user posted the following:</p>
<blockquote><p>I&#8217;ve noticed FOO desktop is no longer able to mount removable drives. I get the following:</p>
<pre>org.freedesktop.hal.storage.mount-removable no &lt;-- (action, result )</pre>
<p>What do I do?</p>
</blockquote>
<p>And here&#8217;s the proposed solution:</p>
<blockquote><p>Just edit <code>/etc/PolicyKit/PolicyKit.conf</code> and add the following part:</p>
<pre>&lt;match action="org.freedesktop.hal.*"&gt;
&lt;return result="yes"/&gt;
&lt;/match&gt;</pre>
</blockquote>
<p>And they lived happily ever after, right? Wrong. This is a great example of why asking the uneducated crowd to help you solve technical challenges is the best way to shoot yourself in the foot.</p>
<p>I doesn&#8217;t take rocket surgery to figure out that PolicyKit won&#8217;t allow certain actions to be accessed by certain users. In this case it only allows <em>active local sessions</em> to <em>mount removable volumes</em>. What constitutes an active local session? A session logged in locally (which is the case) and connected to ConsoleKit (which is not the case since FOO desktop environment does not seem to use ConsoleKit).</p>
<p>Now if the user asked in the proper place (file a bug or send the question to the proper mailing list) instead of the forums there would be two good answers:</p>
<ul>
<li>Teach FOO desktop how to register itself with ConsoleKit (by fixing the code or using means of <code>pam_consolekit</code>)</li>
<li>Tell PolicyKit to allow certain users to access the action (<code>polkit-auth --user foo --grant org.freedesktop.hal.storage.mount-removable</code>)</li>
</ul>
<p>Now do you see the problem? The original thread in a more illustrative form: <q>if my aunt comes to visit and she does not have the keys, how does she come in?</q> <q>Oh, that&#8217;s easy, just remove the locks.</q></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/06/24/a-good-example-of-a-bad-trend/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Why forums are a bad way to help the community</title>
		<link>http://blogs.gnome.org/patrys/2008/06/23/why-forums-are-a-bad-way-to-help-the-community/</link>
		<comments>http://blogs.gnome.org/patrys/2008/06/23/why-forums-are-a-bad-way-to-help-the-community/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 10:49:43 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[GNOME]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/2008/06/23/why-forums-are-a-bad-way-to-help-the-community/</guid>
		<description><![CDATA[Many people point to places like Ubuntu forums or Fedora forums or insert-your-distro-here resources as an example of how great Linux support is. It goes like this: if you have a problem just go and ask other people, wait for their replies and assemble the arcane scripting languages to publish a definitive HOWTO. This way [...]]]></description>
			<content:encoded><![CDATA[<p>Many people point to places like Ubuntu forums or Fedora forums or insert-your-distro-here resources as an example of how great Linux support is. It goes like this: if you have a problem just go and ask other people, wait for their replies and assemble the arcane scripting languages to publish a definitive HOWTO. This way if something doesn&#8217;t work you have a high chance of finding a thread or two with all the necessary scripts and workarounds. Great, huh? That&#8217;s where people fail.</p>
<p>Having a usable desktop system is all about having stuff working out of the box, not about being able to find a good enough workarounds. The latter often add to the confusion and FUD by offering the right console incantation backed up by technical descriptions that are utterly wrong. If you have a problem, file a bug. If something does not work, file a bug. If you see a ghost, call Ghost Busters. Filing bugs means fixing stuff at the proper place and by people with the right knowledge.</p>
<p>If you are afraid to file bugs upstream (where the software authors live), file them in your distro&#8217;s bug tracker. Nice developers should be able to forward it to the right place (and Launchpad makes it so much easier by allowing one to track upstream bugs). Just file it. Sure, do check if the exact same bug was reported earlier, do check if you have the latest packages available. But when everything else fails, file a bug. The worst it can get is that some developer will close it as already fixed or ask you for further details.</p>
<p>There&#8217;s no other way the developers know about your problems. It&#8217;s not like they spend 12 hours a day reading various forums and looking for problems to solve. In other words: if you don&#8217;t file a bug you have absolutely <em>no</em> right to complain about how your issue was not solved in the latest release. Be it Linux, GNOME or Windows, we can&#8217;t fix stuff unless someone tells us it&#8217;s broken.</p>
<p>PS: blog posts are no better than forums.</p>
<p><strong>Edit:</strong> I certainly didn&#8217;t mean to ditch GIMP HOWTOs and other resources showing you how to use the tools effectively. The point is HOWTOs are not the proper way to get the stuff working as intended.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/06/23/why-forums-are-a-bad-way-to-help-the-community/feed/</wfw:commentRss>
		</item>
		<item>
		<title>gstreamer wishlist</title>
		<link>http://blogs.gnome.org/patrys/2008/06/15/gstreamer-wishlist/</link>
		<comments>http://blogs.gnome.org/patrys/2008/06/15/gstreamer-wishlist/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 16:22:24 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[GNOME]]></category>

		<category><![CDATA[gstreamer]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/2008/06/15/gstreamer-wishlist/</guid>
		<description><![CDATA[This is sort of a followup to my earlier post about gstreamer. To make it rock even more, I&#8217;d like to see the following enhancements:

Integrate videoscale with pitivi&#8217;s wonderful smartvideoscale element. The main difference is that the latter keeps the aspect ration untouched by adding black stripes to the appropriate sides when scaling. The logic [...]]]></description>
			<content:encoded><![CDATA[<p>This is sort of a followup to <a href="http://blogs.gnome.org/patrys/2008/06/15/muxing-with-gstreamer/">my earlier post about gstreamer</a>. To make it rock even more, I&#8217;d like to see the following enhancements:</p>
<ul>
<li>Integrate <code>videoscale</code> with pitivi&#8217;s wonderful <code>smartvideoscale</code> element. The main difference is that the latter keeps the aspect ration untouched by adding black stripes to the appropriate sides when scaling. The logic here is pretty straightforward so any gstreamer hacker should be able to merge these two (<code>smartvideoscale</code> uses <code>videoscale</code> internally and is implemented in Python).</li>
<li>Implement an <code>encodebin</code> element to allow applications to use pre-defined profiles for encoding. See below for details</li>
</ul>
<h4>The <code>encodebin</code> proposal</h4>
<p>The way I see <code>encodebin</code> would make the element itself pretty simple. To make it useful, it should try to stay profile-agnostic and all specific details should be part of the profiles. Provided that <code>queue</code> can handle multiple streams, the profiles themselves could be as simple as that:</p>
<blockquote><pre><code>[gstreamer-profile]
Name=PlayStation 3 console
Name[pl]=Konsola PlayStation 3
Type=device
Icon=computer-gaming-sony-ps3
Pipeline="queue name=input input. ! ffmpegcolorspace ! x264enc ! queue ! output. input. ! queue ! audioconvert ! faac ! queue ! output. queue name=output"</code></pre>
</blockquote>
<p>The element itself would only have to enumerate the profiles and use the one indicated by the <code>profile</code> property. Placing the profiles in a common <code>%_datadir</code> location would allow external packages to add profiles for both common container formats and for specific devices (gaming consoles that only handle certain formats, mobile devices that require lower resolutions etc.).</p>
<p>Ideally the encodebin element should accept video, audio and subtitle streams (as choosing a font size requires you to know the output resolution). This would allow one to build a re-muxing application while focusing on the GUI and not on all the devices to support.</p>
<p>All comments welcome. <em>Disclaimer: I am certainly not a gstreamer hacker so I don&#8217;t know poo about gstreamer&#8217;s internals. Please be kind.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/06/15/gstreamer-wishlist/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Muxing with gstreamer</title>
		<link>http://blogs.gnome.org/patrys/2008/06/15/muxing-with-gstreamer/</link>
		<comments>http://blogs.gnome.org/patrys/2008/06/15/muxing-with-gstreamer/#comments</comments>
		<pubDate>Sun, 15 Jun 2008 12:33:14 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[GNOME]]></category>

		<category><![CDATA[gstreamer]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/2008/06/15/muxing-with-gstreamer/</guid>
		<description><![CDATA[Last week I tried to build a little GNOME application to convert movies and videos to formats supported by our PS3 and PSP consoles. I started by playing with the command line. Sounded simple enough. The only problem I has was subtitle support but the nice guys at #gstreamer answered all my questions and I [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I tried to build a little GNOME application to convert movies and videos to formats supported by our PS3 and PSP consoles. I started by playing with the command line. Sounded simple enough. The only problem I has was subtitle support but the nice guys at <code>#gstreamer</code> answered all my questions and I was ready to go. The first thing I tried was this:</p>
<blockquote><pre><code>gst-launch filesrc location=test.txt ! \
subparse subtitle-encoding=cp1250 ! subs. \
filesrc location=test.avi ! \
decodebin name=demuxer \
demuxer. ! queue ! ffmpegcolorspace ! \
textoverlay name=subs font-desc="Sans Bold 20" ! \
ffmpegcolorspace ! x264enc ! queue ! muxer. \
demuxer. ! queue ! audioconvert ! faac ! queue ! muxer. \
ffmux_mp4 name=muxer ! \
filesink location=output.mp4</code></pre>
</blockquote>
<p>It loos complicated but it&#8217;s not. It basically works like this:</p>
<ol>
<li><code>filesrc</code> opens  <code>test.txt</code></li>
<li><code>subparse</code> decodes the file as one of the supported subtitle formats and sets fallbac encoding to <code>cp1250</code> (unfortunately one of the most popular encodings used for subtitles in Poland)</li>
<li>another <code>filesrc</code> opens <code>test.avi</code></li>
<li><code>decodebin</code> detects the container format used, demuxes it and decodes the audio and video streams inside</li>
<li>the video stream gets passed to <code>textoverlay</code> which takes the subtitle stream decoded earlier and overlays it in the Sans Bold 20 font</li>
<li><code>x264enc</code> takes the resulting video stream from and encodes it into the H264 format used by PS3</li>
<li><code>faac</code> takes the audio stream and encodes it to the AAC format used by PS3</li>
<li><code>ffmux_mp4</code> takes both audio and video from the earlier elements and muxes it into the mp4 format</li>
<li><code>filesink</code> writes the results back to disk</li>
</ol>
<p>Unfortunately it turns out the mp4 muxer does not work as intended. Either that or all the sound encoders are broken. The resulting file plays fine in mplayer but any attempt to use it with gstreamer gives you smooth video with broken audio (one sample per half a second). Playing it bac on the PS3 is impossible as it claims the file is simply corrupt.</p>
<p>Then I thought <q>well, I can still use xvid, right?</q> Wrong. <code>xvidenc</code> + <code>lame</code> + <code>avimux</code> = broken file. Again, mplayer plays the video without any sound, gstreamer just hangs on the first frame. This time I&#8217;m pretty sure it&#8217;s my fault but I have no idea what params to pass to the encoders and the muxer. Even the avimux example from the gstreamer docs results in an unplayable file on my machine.</p>
<p>Simple idea: how about creating a <code>encodebin</code> element to mimick the decodebin behavior? It could work like this:</p>
<blockquote><pre><code>audiotestsrc ! encoder. \
videotestsrc ! encoder. \
encodebin name=encoder profile=ogg ! \
filesink location=output.ogm</code></pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/06/15/muxing-with-gstreamer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Banshee 1.0</title>
		<link>http://blogs.gnome.org/patrys/2008/06/11/banshee-10/</link>
		<comments>http://blogs.gnome.org/patrys/2008/06/11/banshee-10/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 15:26:42 +0000</pubDate>
		<dc:creator>patrys</dc:creator>
		
		<category><![CDATA[GNOME]]></category>

		<category><![CDATA[Banshee]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/patrys/2008/06/11/banshee-10/</guid>
		<description><![CDATA[
The new GUI rocks and the experience is great including all the little animation bits here and there. Hooah to the Banshee team. The Rhythmbox community has a new target to follow (and beat!).
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/patrys/2570301680/" title="Banshee 1.0 by patrys, on Flickr"><img src="http://farm4.static.flickr.com/3042/2570301680_69c3cbd74f.jpg" alt="Banshee 1.0" height="380" width="500" /></a></p>
<p>The new GUI rocks and the experience is great including all the little animation bits here and there. Hooah to the Banshee team. The Rhythmbox community has a new target to follow (and beat!).</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/patrys/2008/06/11/banshee-10/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
