<?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:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Slacy's Blog &#187; transcoding</title>
	<atom:link href="http://slacy.com/blog/tag/transcoding/feed/" rel="self" type="application/rss+xml" />
	<link>http://slacy.com/blog</link>
	<description>This site is solar powered!</description>
	<lastBuildDate>Tue, 01 May 2012 05:50:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>transcoding mp3-to-mp3 in mt-daapd</title>
		<link>http://slacy.com/blog/2009/08/transcoding-mp3-to-mp3-in-mt-daapd/</link>
		<comments>http://slacy.com/blog/2009/08/transcoding-mp3-to-mp3-in-mt-daapd/#comments</comments>
		<pubDate>Mon, 24 Aug 2009 20:44:16 +0000</pubDate>
		<dc:creator>slacy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[lame]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[mt-daapd]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[transcoding]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[vbr]]></category>

		<guid isPermaLink="false">http://slacy.com/blog/?p=935</guid>
		<description><![CDATA[Introduction mt-daapd is an iTunes daap-protocol server for Unix systems.  I&#8217;m using mt-daapd on by Ubuntu 9.04 system to stream music over the internet to my workplace.   The issue is that many of my mp3 files are 256kbps mp3 files, and streaming these takes up more bandwidth than necessary. mt-daapd includes a transcoding system called [...]]]></description>
			<content:encoded><![CDATA[<h2>Introduction</h2>
<p>mt-daapd is an iTunes daap-protocol server for Unix systems.  I&#8217;m using mt-daapd on by Ubuntu 9.04 system to stream music over the internet to my workplace.   The issue is that many of my mp3 files are 256kbps mp3 files, and streaming these takes up more bandwidth than necessary.</p>
<p>mt-daapd includes a transcoding system called &#8220;ssc&#8221; for &#8220;Server Side Conversion&#8221;.  This system works by either a shared-object plugin (i.e. ssc_ffmpeg) or via an external script file (i.e. ssc_script).</p>
<p>using the ssc_script functionality, one can invoke &#8216;lame&#8217; (the mp3 encoder) to transcode high bitrate mp3 files into lower bitrate mp3 files.  The setup for this in mt-daapd wasn&#8217;t very obvious, so I&#8217;ll document it here.</p>
<h2>Install mt-daapd</h2>
<p>The version of mt-daapd provided by Ubuntu 9.04 includes support for transcoding, so you can just run:<br />
<code><br />
$ sudo apt-get install mt-daapd</code></p>
<h2>Turn on ssc</h2>
<p>Edit your /etc/mt-daapd.conf file, and make sure you have the following lines in the correct places:</p>
<blockquote><p>ssc_codectypes = mpeg</p>
<p>always_transcode = mpeg</p>
<p>ssc_prog = /path/to/script/shown/below/mt-daapd-mp3-ssc.sh</p>
<p>[plugins]</p>
<p>plugins = ssc-script.so</p></blockquote>
<h2>Create mt-daapd-mp3-ssc.sh</h2>
<p>You&#8217;ll need to create a shell script to do the transcoding via ssc_scrpit / ssc_prog.  Here&#8217;s the script I&#8217;m using:</p>
<blockquote><p>#!/bin/bash</p>
<p>FILE=$1<br />
OFFSET=0</p>
<p>if [ "$2" == "" ]; then<br />
OFFSET=0<br />
else<br />
OFFSET=$2<br />
fi</p>
<p>if [ "$3" == "" ]; then<br />
FORGELEN=$3<br />
fi</p>
<p>lame -V6 &#8211;quiet &#8220;$FILE&#8221; -</p></blockquote>
<p>Note that I&#8217;m looking at the 2nd and 3rd args, but I&#8217;m not doing anything with them.  These arguments are used to make sure that seeking works properly in your daap client.  I don&#8217;t care about seeking, and doing it properly is somewhat hard, so I&#8217;ve just ignored those arguments.  I think that this could be accomplished properly using the program &#8216;mp3splt&#8217; but I haven&#8217;t looked into it enough to see what it would take.</p>
<p>Make sure the script above is put somewhere accessible by the user specified as &#8216;runas&#8217; in your mt-daapd.conf.   Make sure the script is executable by this user as well.</p>
<h2>Restart mt-daapd and see if it works</h2>
<p>Restart mt-daapd via:</p>
<blockquote><p>$ sudo /etc/init.d/mt-daapd restart</p></blockquote>
<p>Then reconnect your daap client (I use rhythmbox).  You can see if the script is working by running &#8220;ps auwxww | grep lame&#8221; just after pressing play on a song.  You should see your script executing lame and doing realtime transcoding.</p>
]]></content:encoded>
			<wfw:commentRss>http://slacy.com/blog/2009/08/transcoding-mp3-to-mp3-in-mt-daapd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
	</item>
		<item>
		<title>Transcoding AVIs from a Canon SD550 to FLV files for the web.</title>
		<link>http://slacy.com/blog/2007/11/transcoding-avis-from-a-canon-sd550-to-flv-files-for-the-web/</link>
		<comments>http://slacy.com/blog/2007/11/transcoding-avis-from-a-canon-sd550-to-flv-files-for-the-web/#comments</comments>
		<pubDate>Tue, 27 Nov 2007 04:22:18 +0000</pubDate>
		<dc:creator>slacy</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[canon sd550]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[sd550]]></category>
		<category><![CDATA[transcoding]]></category>

		<guid isPermaLink="false">http://slacy.com/blog/index.php/2007/11/26/transcoding-avis-from-a-canon-sd550-to-flv-files-for-the-web/</guid>
		<description><![CDATA[So, I&#8217;ve been wondering what to do with the AVI files that we&#8217;ve been taking using our Canon SD550 camera. The movies are great, but they&#8217;re HUGE. The camera only uses mjpeg compression, so there&#8217;s a lot of room for improvement in the compression. So, I looked at transcoding them to FLV files, since Gallery2 [...]]]></description>
			<content:encoded><![CDATA[<p>So, I&#8217;ve been wondering what to do with the AVI files that we&#8217;ve been taking using our Canon SD550 camera.  The movies are great, but they&#8217;re HUGE.  The camera only uses mjpeg compression, so there&#8217;s a lot of room for improvement in the compression.  So, I looked at transcoding them to FLV files, since Gallery2 has a built-in FLV player, so the files could be played right in Gallery.  </p>
<p>I came up with the following script that does a simple 2-pass encoding to produce a reasonable output file at 1.25Mbps.  I choose to go with a higher bitrate and higher quality, but this could be turned down to around 700kbps and still be reasonable.  Here&#8217;s the script:</p>
<blockquote><p>
#!/bin/bash<br />
input=$1<br />
output=./flv/${input/.avi/.flv}<br />
logdir=`dirname $output`<br />
mkdir -p $logdir<br />
logfile=$output.log<br />
ffmpeg -y -i $input -ar 11025 -ab 64k -aic -umv -b 1250k -r 30 -pass 1 $output -passlogfile $logfile<br />
ffmpeg -y -i $input -ar 11025 -ab 64k -aic -umv -b 1250k -r 30 -pass 2 $output -passlogfile $logfile<br />
rm $logfile*
</p></blockquote>
<p>And I run it like this:</p>
<blockquote><p>
# find . -iname &#8220;*.avi&#8221; | xargs -n1 -P2 ~/bin/flv_transcode.sh
</p></blockquote>
<p>It will create a toplevel &#8220;flv&#8221; directory, and put all the transcoded output in that subdirectory.   Mencoder can&#8217;t directly produce FLV output, so this ffmpeg-based solution is a bit easier.  Now, we just have to wait for Macromedia to support h264 files&#8230; </p>
]]></content:encoded>
			<wfw:commentRss>http://slacy.com/blog/2007/11/transcoding-avis-from-a-canon-sd550-to-flv-files-for-the-web/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
	</item>
	</channel>
</rss>

