= Smooth Streaming Module for Apache = [http://h264.code-shop.com/trac/wiki/Smooth-Streaming-H264 back][[PageOutline]] ---- == Dependencies == We will be using [http://httpd.apache.org/docs/2.0/programs/apxs.html apxs2], the APache eXtenSion tool, to build and install the module for the Apache server. Make sure you have apxs2 installed: {{{ sudo apt-get install apache2-threaded-dev }}} == Download == Download the source of the H264 Streaming Module for Apache. {{{ cd ~ wget http://h264.code-shop.com/download/apache_mod_h264_streaming-2.2.0.tar.gz tar -zxvf apache_mod_h264_streaming-2.2.0.tar.gz }}} If you plan to play Multi Bit Rate H.264 encoded videos, you will also need the command line tool 'mp4split' to create the Smooth Streaming manifest files. {{{ wget http://h264.code-shop.com/download/mp4split-2.2.0.tar.gz tar -zxvf mp4split-2.2.0.tar.gz }}} == Build == {{{ cd ~/apache_mod_h264_streaming-2.2.0 make sudo make install }}} {{{ cd ~/mp4split-2.2.0 ./configure make sudo make install }}} === Configuration === We're going to tell Apache that files ending in .ismv (“IIS Smooth Streaming Media Video (Audio)”) are going to be handled by the h264_streaming_module. The requests made by Silverlight are actually in a different form, but we will be rewriting them to files with a .ismv extension. In your httpd.conf: {{{ LoadModule h264_streaming_module /usr/lib/apache2/modules/mod_h264_streaming.so AddHandler h264-streaming.extensions .mp4 .ismv }}} In your .htaccess: {{{ RewriteEngine On RewriteCond %{QUERY_STRING} ^.+$ RewriteRule ^(.*)\.ism/manifest$ $1.mp4?manifest=1 [L] RewriteRule ^(.*)\.ism/Fragments\((.*)=([0-9]+)\)(.*)$ $1.mp4?$2=$3 [L] RewriteRule ^(.*)/(.*)\.ism/QualityLevels\(([0-9]+)\)/Fragments\((.*)=([0-9]+)\)(.*)$ $1/$2.ism/$2_$3.ismv?$4=$5 [L] RewriteRule ^(.*)\.ism/QualityLevels\(([0-9]+)\)/Fragments\((.*)=([0-9]+)\)(.*)$ $1.ism/$1_$2.ismv?$3=$4 [L] }}} Note that you have to allow Apache to read the .htaccess file (i.e. 'AllowOverride FileInfo') or, even better, move the rewrite rules to a section in your main server configuration file. == License == This version is free if you agree to the [http://creativecommons.org/licenses/by-nc-sa/3.0/ noncommercial license]. Please mention its use on your website, in the lines of 'This website uses H264 pseudo video streaming technology by [http://h264.code-shop.com CodeShop]'. Our commercial license is very inexpensive, see the following page to check if you need a [wiki:Mod-H264-Streaming-License-Version2 commercial license]. == Next == - [wiki:Smooth-Streaming-Encoding Encoding Smooth Streaming videos]. - [wiki:Smooth-Streaming-Playing Playing Smooth Streaming videos]. == Feedback == If you have any questions, thoughts or ideas on Smooth Streaming you can leave a message on our [topic:41 forum].