<?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>Tony Virelli - Web Developer - HTML, xHTML, PHP, MySQL, JavaScript&#187; Video</title>
	<atom:link href="http://tonyvirelli.com/category/blog/video/feed/" rel="self" type="application/rss+xml" />
	<link>http://tonyvirelli.com</link>
	<description>Tony Virelli - I share the information I have dealing with web design, technology, the internet and more</description>
	<lastBuildDate>Tue, 31 Jan 2012 14:57:08 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Streaming Videos to BlackBerry OS</title>
		<link>http://tonyvirelli.com/slider/streaming-videos-to-blackberry-os/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=streaming-videos-to-blackberry-os</link>
		<comments>http://tonyvirelli.com/slider/streaming-videos-to-blackberry-os/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 17:52:36 +0000</pubDate>
		<dc:creator>John Hass</dc:creator>
				<category><![CDATA[slider]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[blackberry]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[Darwin Streaming Server]]></category>
		<category><![CDATA[dss]]></category>
		<category><![CDATA[FFmpe]]></category>
		<category><![CDATA[gpac]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[iptables]]></category>
		<category><![CDATA[movies]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[mp4]]></category>
		<category><![CDATA[MP4Box]]></category>
		<category><![CDATA[streaming]]></category>

		<guid isPermaLink="false">http://tonyvirelli.com/?p=247</guid>
		<description><![CDATA[Welcome to my first blog post, the most information you will never read! Streaming to the blackberry is definitely more complicated then it needs to be.  Yesterday I was tasked with getting video to stream to blackberry devices. The site currently works fine on Android and iPhone devices, but our group agreed that blackberry was [...]]]></description>
			<content:encoded><![CDATA[<p>Welcome to my first blog post, the most information you will never read!</p>
<p>Streaming to the blackberry is definitely more complicated then it needs to be.  Yesterday I was tasked with getting video to stream to blackberry devices. The site currently works fine on Android and iPhone devices, but our group agreed that blackberry was a definite need.<br />
<span id="more-247"></span><br />
Since I am not a stranger to FFmpeg I thought ok this will take 2 minutes and then I can have a drink! Well I was mistaken.  You see, you can&#8217;t simply view the converted video files on a blackberry, you have to actually setup a RTSP server and stream them. Even then you can&#8217;t simply stream a mp4 using the streaming server. You have to add a hint to the meta data.</p>
<p>Are you confused yet? If so, or even if your not, let&#8217;s do this thing!</p>
<p>Keep in mind I use Centos as my server OS (whatever 5 is latest I think 5.4 I just do yum upgrade so I don&#8217;t keep track).</p>
<p><strong>The Streaming Server</strong></p>
<p>After much research I decided that the Darwin Streaming Server would be best suited for this purpose.</p>
<p>When following the steps it is best to be root.</p>
<p>Step 0. When building apps on Linux it&#8217;s best to be in /usr/src so go there &#8220;cd /usr/src&#8221;</p>
<p>Step 1.  I had to install all the development applications for centos this is done easily with the &#8220;group install&#8221; option this will include rpm utilities, gcc, automake etc. I ran the command: yum groupinstall &#8220;Development Tools&#8221; just like that quotes and all</p>
<p>Step 2. Get the Darwin Streaming Server srpm.  &#8220;wget &#8211;continue http://www.abrahamsson.com/DarwinStreamingServer-6.0.3-2.src.rpm&#8221;  I had some issues downloading from this site and I had to start the download over  a couple of times, so I used &#8211;continue to keep the download going.</p>
<p>Step 3.  Install the srpm &#8220;rpm -i DarwinStreamingServer-6.0.3-2.src.rpm&#8221; &#8220;cd /usr/src/redhat/SPECS/&#8221;</p>
<p>Step 4.  Build the source code &#8220;rpmbuild -bb DarwinStreamingServer.spec&#8221;</p>
<p>Step 5.  Install perl SSLeay for ssl support (we will not be using this but it does not hurt &#8220;cd /usr/src/redhat/RPMS/i386/&#8221; &#8220;yum install -y perl-Net-SSLeay&#8221;</p>
<p>Step 6.  Install Darwin Streaming Server. &#8220;rpm -U DarwinStreamingServer*&#8221;</p>
<p>Step 7. Freak out because it appears your console has locked up&#8230;  You need to freak out because it did.  Open an new SSH session (or console session).  Kill the Darwin Streaming Server session. &#8220;killall -9 DarwinStreamingServer&#8221;</p>
<p>Step 8. Set the password for Darwin Streaming Server.  &#8220;qtpasswd administrator&#8221;</p>
<p>Step 9. Set the server to start automatically &#8220;chkconfig &#8211;level 345 dss on&#8221;</p>
<p>Step 10.  Restart the server &#8220;/etc/init.d/dss restart&#8221; (some may fail don&#8217;t fret it&#8217;s just because they weren&#8217;t running&#8221;</p>
<p>Step 11.  (Optional) allow access to the web for iptables if your running ip tables. vi /etc/sysconfig/iptables<br />
Add the line replacing x.x.x.x with your ip address:<br />
&#8220;-A RH-Firewall-1-INPUT -p tcp -s x.x.x.x &#8211;destination-port 1220 -j ACCEPT&#8221;<br />
&#8220;-A RH-Firewall-1-INPUT -p tcp &#8211;dport 554 -j ACCEPT&#8221;<br />
&#8220;-A RH-Firewall-1-INPUT -p udp &#8211;dport 6970:9999 -j ACCEPT&#8221;</p>
<p>Save the file and restart iptables &#8220;/etc/init.d/iptables restart&#8221;</p>
<p>Step 12.  You can now open up your web browser (of course I recommend firefox) go to http://x.x.x.x:1220 where x.x.x.x is the ip address of your darwin streaming server.</p>
<p>Step 13. Login with the username &#8220;administrator&#8221; and the password is the password you setup with the qtpasswd command from above.</p>
<p>Step 14. You are now presented with a wizard that asks you some install and setup questions, see the following steps for the answers to the questions</p>
<p>Step 15.  Mp3 Broadcast password Leave all blank and press Next</p>
<p>Step 16. Secure Administration Leave check box unchecked and press Next.</p>
<p>Step 17. Media Folder I put all my movies in the default media folder /usr/local/movies Press Next</p>
<p>Step 18. Streaming on Port 80 I run apache on this server so I do not check the box. Press Finish.</p>
<p>The server should now be running&#8230;  Congratulations you are half way there.</p>
<p><strong>Converting files for use in Darwin Streaming Server</strong></p>
<p>We use FFmpeg, I assume you already have it installed and have used http://dag.wieers.com/rpm/ to install it.  I am going to use an FLV, but you could easily use anything that ffmpeg supports</p>
<p>Step 1. Convert the file. &#8220;/usr/local/bin/ffmpeg -i &#8220;&lt;input File&gt;.flv&#8221; -f mp4 -vcodec mpeg4 -r 15 -s 320&#215;240 -aspect 4:3 -acodec libfaac -ar 22050 -ac 1 ~/&lt;output file&gt;.mp4&#8243;</p>
<p>Options:<br />
-i &#8211; this is the input file or &#8220;the file we want to convert from&#8221;<br />
-f &#8211; this is the format we want to convert to in the case of our blackberry Mpeg4<br />
-vcodec &#8211; This is the codec version we want to use, in our case regular mpeg4<br />
-r &#8211; this is the frame rate, Blackberry supports 15fps<br />
-s &#8211; this is the screen resolution my 8830 curve supports 320&#215;240<br />
-aspect &#8211; this is the aspect ration 4:3 works perfectly on my curve, you can try 16:9 if your having issues<br />
-acodec &#8211; this is the audio codec aac works great on the blackberry<br />
-ar &#8211; this is the audio rate, depeding on what your doing this could be lower, but this way still makes the file smaller then FLV<br />
-ac &#8211; this is the number of audio channels, I watch movies on Speaker phone so mono is fine with me.</p>
<p>So this converts the video, but this won&#8217;t actually stream the video, if you stream this file you will get an &#8220;Error 415 Unsupported Media Type&#8221;, no I am not a liar this file will stream perfectly.  In order to use RTSP we must hint the file, this tells the player a bit of info about the file, chapters things like that.  MP4Box is well suited for this job.  It is packaged with gpac.</p>
<p><strong>Installing GPAC</strong></p>
<p>I was not able to install gpac completely, but I did get MP4Box and the library I needed so I will take you through those steps, don&#8217;t be scared when you get an error when compiling.</p>
<p>Step 1. Go to /usr/src and download gpac &#8220;cd /usr/src ; wget &#8211;continue http:<span style="color: #000000;font-weight: bold">//</span>downloads.sourceforge.net<span style="color: #000000;font-weight: bold">/</span>gpac<span style="color: #000000;font-weight: bold">/</span>gpac-0.4.5.tar.gz&#8221;</p>
<p>Step 2. configure the application &#8220;cd gpac ; sh ./configure; make&#8221;</p>
<p>Step 3. At this point it failed compilation, so I just copied the required things.  &#8220;cp bin/gcc/libgpac.so /usr/lib/ ; cp bin/gcc/MP4Box /usr/local/bin&#8221;</p>
<p>GPAC is now installed (sort of).</p>
<p><strong>Hint the mp4</strong></p>
<p>Step 1.  MP4Box ~/&lt;outfile&gt;.mp4 -hint</p>
<p>Step 2. move the file to dss &#8220;mv ~/&lt;outfile&gt;.mp4 /usr/local/movies&#8221;</p>
<p>You can now access your file by pointing your browser to http://x.x.x.x:554/&lt;outfile&gt;.mp4 replacing x.x.x.x with your Darwin Streaming Server and &lt;outfile&gt; with the filename of your mp4 that has been hinted.</p>
<p>I have tested this with blackberry OS 4.5 on my curve 8830 I watched movies for longer then an hour. I subscribe to BIS (Blackberry Internet Service), so unless your admin has rules about streaming on BES (Blackberry Enterprise Service) it should work on that as well&#8230;  Happy Streaming!</p>
]]></content:encoded>
			<wfw:commentRss>http://tonyvirelli.com/slider/streaming-videos-to-blackberry-os/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

