<?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>Bold dream &#187; Android</title>
	<atom:link href="http://bolddream.com/category/android/feed/" rel="self" type="application/rss+xml" />
	<link>http://bolddream.com</link>
	<description>Imagination is limitless. So is stupidity.</description>
	<lastBuildDate>Tue, 02 Mar 2010 22:42:48 +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>Andoird custom SMS tone</title>
		<link>http://bolddream.com/2009/08/31/andoird-custom-sms-tone/</link>
		<comments>http://bolddream.com/2009/08/31/andoird-custom-sms-tone/#comments</comments>
		<pubDate>Mon, 31 Aug 2009 14:58:29 +0000</pubDate>
		<dc:creator>Emil Vladev</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://bolddream.com/?p=210</guid>
		<description><![CDATA[A few days ago I found a nice ringtone for SMS notifications, but couldn&#8217;t find a way to use it on my HTC Magic (except using a 3rd party app from the store). After a bit of digging I got it: On the SD card there must be a directory structure as follows: sdcard &#8970;media [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago I found a nice ringtone for SMS notifications, but couldn&#8217;t find a way to use it on my <a href="http://www.amazon.com/gp/product/B002C38LBS?ie=UTF8&#038;tag=bolddream-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B002C38LBS">HTC Magic</a> (except using a 3rd party app from the store). After a bit of digging I got it:</p>
<p>On the SD card there must be a directory structure as follows:<br />
<strong></p>
<pre>
sdcard
   &lfloor;media
      &lfloor;audio
         &lfloor;notifications
</pre>
<p></strong><br />
Every tone dropped in the <strong><code>notifications</code></strong> folder is visible from <em><code>Settings &rarr; Sound &#038; display &rarr; Notification ringtone</code></em>.</p>
]]></content:encoded>
			<wfw:commentRss>http://bolddream.com/2009/08/31/andoird-custom-sms-tone/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Converting video for Android</title>
		<link>http://bolddream.com/2009/07/15/converting-video-for-android/</link>
		<comments>http://bolddream.com/2009/07/15/converting-video-for-android/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 14:23:11 +0000</pubDate>
		<dc:creator>Emil Vladev</dc:creator>
				<category><![CDATA[Android]]></category>

		<guid isPermaLink="false">http://bolddream.com/?p=191</guid>
		<description><![CDATA[A few weeks ago I got myself a HTC Magic &#8211; an Android based mobile device that, among many things, has a phone in it. But not the phone is the part that I&#8217;m going to talk about &#8211; it&#8217;s the video player. According to the android spec only h.263, h.264 and MPEG-4 SP are [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I got myself a <a href="http://www.amazon.com/gp/product/B002C38LBS?ie=UTF8&#038;tag=bolddream-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=B002C38LBS">HTC Magic</a><img src="http://www.assoc-amazon.com/e/ir?t=bolddream-20&#038;l=as2&#038;o=1&#038;a=B002C38LBS" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> &#8211; an <a href="http://code.google.com/android/">Android</a> based mobile device that, among many things, has a phone in it. But not the phone is the part that I&#8217;m going to talk about &#8211; it&#8217;s the video player.</p>
<p><a href="http://developer.android.com/guide/appendix/media-formats.html">According to the android spec</a> only h.263, h.264 and MPEG-4 SP are supported. It seems that Xvid or whatever the most videos on the net are encoded with is unsupported (I tested it). Also, the optimal size of the video is 480&#215;352. What I wanted was the ability to watch clips and movies on the phone so I set on a mission to convert a simple .avi file to the needed .mp4 h.264 format.</p>
<p>The first try was <a href="http://ffmpeg.org/">ffmpeg</a>&#8230; FAIL! The ffmpeg shipped with Ubuntu doesn&#8217;t seem to be a proper one, some codecs are missing and the overall complexity of the ffmpeg turned me away. I started looking for something else&#8230;</p>
<p>&#8230;and I found <a href="http://handbrake.fr/">HandBrake</a>. Nice little application that comes even with a GUI. Superb&#8230; Or so I though. I tried using the GUI, but it kept crashing after a few minutes of progress. Then I toyed around with the command line version. After a bit of digging around the Web and the help pages of the app I managed to come up with a script to do all of the work. Here it is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">HandBrakeCLI \
    <span style="color: #660033;">--input</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #660033;">--output</span> <span style="color: #ff0000;">&quot;$2&quot;</span> <span style="color: #660033;">--format</span> mp4 <span style="color: #660033;">--encoder</span> x264 \
    <span style="color: #660033;">--x264opts</span> <span style="color: #007800;">level</span>=<span style="color: #000000;">30</span>:<span style="color: #007800;">bframes</span>=<span style="color: #000000;">0</span>:<span style="color: #007800;">cabac</span>=<span style="color: #000000;">0</span>:<span style="color: #007800;">ref</span>=<span style="color: #000000;">1</span>:vbv-maxrate=<span style="color: #000000;">1500</span>:vbv-bufsize=<span style="color: #000000;">2000</span>:<span style="color: #007800;">analyse</span>=all:<span style="color: #007800;">me</span>=umh:no-fast-pskip=<span style="color: #000000;">1</span> \
    <span style="color: #660033;">--vb</span> <span style="color: #000000;">320</span> <span style="color: #660033;">--rate</span> <span style="color: #000000;">23.976</span> <span style="color: #660033;">--aencoder</span> faac \
    <span style="color: #660033;">--mixdown</span> stereo <span style="color: #660033;">--ab</span> <span style="color: #000000;">96</span> <span style="color: #660033;">--arate</span> <span style="color: #000000;">44100</span> \
    <span style="color: #660033;">--maxHeight</span> <span style="color: #000000;">352</span> <span style="color: #660033;">--maxWidth</span> <span style="color: #000000;">480</span> <span style="color: #660033;">--two-pass</span></pre></div></div>

<p>As you can see I&#8217;m using the verbose version of the different options, because I believe that no matter how large the program is &#8211; 3 lines or 3M lines &#8211; it should be readable.</p>
<p>Usage of the script is simple as:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>encode input.avi output.mp4</pre></div></div>

<p>What it does is that it will convert the video to mp4, encoded to h.264 with a few options that will make the android device play it smoothly, and it will resize the video for optimal viewing, preserving the aspect ratio.</p>
<p>Oh, and it&#8217;s multithreaded as well, so it will take advantage of all the cores/CPUs available.</p>
<p>If you can think of an improvement &#8211; please let me know in the comments. Hope it will help someone.</p>
]]></content:encoded>
			<wfw:commentRss>http://bolddream.com/2009/07/15/converting-video-for-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
