<?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>mFabrik - mobile sites, apps, HTML5 and CMS software development &#187; libx264</title>
	<atom:link href="http://blog.mfabrik.com/tag/libx264/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mfabrik.com</link>
	<description>Freedom delivered.</description>
	<lastBuildDate>Wed, 03 Aug 2011 09:47:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to encode h264 video files for Nokia Series 60 standalone playback</title>
		<link>http://blog.mfabrik.com/2008/09/23/how-to-encode-h264-video-files-for-nokia-series-60-standalone-playback/</link>
		<comments>http://blog.mfabrik.com/2008/09/23/how-to-encode-h264-video-files-for-nokia-series-60-standalone-playback/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 23:27:32 +0000</pubDate>
		<dc:creator>Mikko Ohtamaa</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[series 60]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[aac]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[dvd]]></category>
		<category><![CDATA[encoding]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[h264]]></category>
		<category><![CDATA[libfaac]]></category>
		<category><![CDATA[libx264]]></category>
		<category><![CDATA[movie]]></category>
		<category><![CDATA[n95]]></category>
		<category><![CDATA[tutorial]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[x264]]></category>

		<guid isPermaLink="false">http://blog.redinnovation.com/?p=118</guid>
		<description><![CDATA[Bored with Spiderman 3 which came with your Nokia N95 8 GB? This guide shortly tells how to get movies into your N95 on Ubuntu Linux using ffmpeg video encoder. The aim is to encode video suitable for playback from Nokia N-series (N95, N78, others) mobile phone memory card. We use h264 + AAC codecs [...]]]></description>
			<content:encoded><![CDATA[<p>Bored with Spiderman 3 which came with your Nokia N95 8 GB? This guide shortly tells how to get movies into your N95 on Ubuntu Linux using <a href="http://ffmpeg.mplayerhq.hu/">ffmpeg</a> video encoder. The aim is to encode video suitable for playback from Nokia N-series (N95, N78, others) mobile phone memory card. We use <a href="http://en.wikipedia.org/wiki/H.264">h264</a> + AAC codecs which provides the best quality/compression rate for Nokia phones currently.</p>
<p>Ubuntu does not distribute proprietary codes. First thing you need to do is to <a href="https://wiki.ubuntu.com/ffmpeg">rebuild ffmpeg</a>.  Since Ubuntu 8.04 Hardy Heron ships with ffmpeg from 2007, which is aeons old in video codec years, <strong>you need to build libx264 and ffmpeg from SVN sources</strong>. <a href="http://ubuntuforums.org/showthread.php?t=786095&amp;highlight=libx264">Here are detailed, valid, instructions</a>. Note that FFMPEG trunk is not currently stable (September 2008), so <a href="http://ffmpeg.mplayerhq.hu/">you need to use revision 15261</a> which needs <a href="http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/2008-September/053527.html">this little patch</a>. Indeed, this is a very difficult month to start your career in the dark world of video encoders.</p>
<p>To make it legal and support open source codec development,  please <a href="http://blog.canonical.com/?p=37">pay for your codecs</a>.</p>
<p>Then we use this guide by <a href="http://rob.opendot.cl/index.php/useful-stuff/ffmpeg-x264-encoding-guide/">Robert Swain</a>. We have a tiny sub 2,4&#8243; screen, we do not care about the quality and do one pass encoding. By empirical research, I have found that the following MPEG-4 profile parameters are compatible with N95 8 GB and provide the optimal result. You can vary video and audio bitrate depending on your taste.</p>
<p>Here is a script which recursivelu encodes all detected video files suitable for mobile format:</p>
<pre>#!/bin/sh
#
# Optimal movie encoding for Nokia N-series mobile phones
#
# Copyright 2008 Red Innovation Ltd.
#
# Say hi if you find this useful.
# We do some professional mobile video publishing, so if you
# need a helping hand please call us.
#
# Usage: Run encode.sh in any folder and all video files are recursively converted to mobile phone suitable format
#
# Note: We expect all the source material be in 16:9 aspect ration
#
# Also see http://www.nseries.com/index.html#l=support,search,faq,general,video%20encoding,53848
#

VIDEO_BITRATE=300k

AUDIO_BITRATE=72k

# Assume locally build ffmpeg + x264 in /usr/local/bin
# http://ubuntuforums.org/showthread.php?t=786095
export LD_LIBRARY_PATH=/usr/local/lib

# Search all source AVI, MPG and WMV video files
# Place all encoded files to the same folder with the source, with added .mp4 extension
find . -iname "*.avi" -or -iname "*.wmv" -or -iname "*.mpg" | while read src ; do
        srcfile=`basename "$src"`
	srcfolder=`dirname "$src"`
	dstfile="$srcfolder"/"$srcfile".mp4

	# The magical string!
	# Size and cropping is for 16:9 source material, so that 320:240 display will have black bars.
	# Fex pixels off... note that h264 sizes must be multiplies of 16, use 256x144 for streaming
	# N95 RealMedia player does not seem to respect MPEG-4 embedded aspect ration info.
	/usr/local/bin/ffmpeg -y -i "$srcfile" -acodec libfaac -ab $AUDIO_BITRATE -s 320x176 -aspect 16:9 -vcodec libx264 -b $VIDEO_BITRATE -qcomp 0.6 -qmin 16 -qmax 51 -qdiff 4 -flags +loop -cmp +chroma -subq 7 -refs 6 -g 250 -keyint_min 25 -rc_eq 'blurCplx^(1-qComp)' -sc_threshold 40 -me_range 12 -i_qfactor 0.71 -directpred 3 "$dstfile"

done</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.mfabrik.com/2008/09/23/how-to-encode-h264-video-files-for-nokia-series-60-standalone-playback/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

