:: h264 streaming on Lighttpd

:: What is
please take a look at this.

:: installing dependency
[ linux:~ ] # zypper in fam fam-devel libgio-fam pkg-config pcre-devel

:: Download Lighttpd 1.4.23
we using lighttpd version 1.4.23 to run mod_h264_streaming on the system.
[ linux:~ ] # mkdir download
[ linux:~ ] # cd download/
[ linux:download ] # wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.23.tar.gz
[ linux:download ] # tar -xzf lighttpd-1.4.23.tar.gz

:: Get h264 from Lighttp 1.4.18 svn
[ downloading packages ]
[ linux:~ ] # cd download/
[ linux:download ] # svn export http://h264.code-shop.com/svn/h264/tags/mod_h264_streaming-2.0/lighttpd-1.4.18 lighttpd-1.4.18
[ linux:download ] # svn export --force http://h264.code-shop.com/svn/h264/tags/mod_h264_streaming-2.0/mp4split lighttpd-1.4.18/src

[ copy moov.* and mod_h264 file ]
[ linux:download ] # cp lighttpd-1.4.18/src/moov.* lighttpd-1.4.23/src/ 
[ linux:download ] # cp lighttpd-1.4.18/src/mod_h264_streaming.c lighttpd-1.4.23/src/

[ edit Makefile.am file ]
[ linux:download ] # vi lighttpd-1.4.23/src/Makefile.am 
#
# add this line after mod_flv_streaming portion:
lib_LTLIBRARIES += mod_h264_streaming.la
mod_h264_streaming_la_SOURCES = mod_h264_streaming.c moov.c
mod_h264_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_h264_streaming_la_LIBADD = $(common_libadd) 

:: Compile and install lighttpd with h264
[ linux:download ] # cd lighttpd-1.4.23/ 
[ linux:lighttpd-1.4.23 ] # ./autogen.sh 
[ linux:lighttpd-1.4.23 ] # ./configure 
[ linux:lighttpd-1.4.23 ] # make && make install
if you want to enable pcre on lighttpd you can do this - centos - (thanks to rob moen):
[ linux:download ] # yum install pcre-devel 
[ linux:download ] # cd lighttpd-1.4.23/ 
[ linux:lighttpd-1.4.23 ] # ./autogen.sh 
[ linux:lighttpd-1.4.23 ] # ./configure --with-pcre
[ linux:lighttpd-1.4.23 ] # make && make install

:: Configuring mod_h264_streaming on lighttpd.conf 1.4.23
[ linux:lighttpd-1.4.23 ] # mkdir /etc/lighttpd
[ linux:lighttpd-1.4.23 ] # cp ./doc/lighttpd.conf /etc/lighttpd/
[ linux:lighttpd-1.4.23 ] # mkdir /var/log/lighttpd
[ linux:lighttpd-1.4.23 ] # touch /var/log/lighttpd/error.log
[ linux:lighttpd-1.4.23 ] # vi /etc/lighttpd/lighttpd.conf
#
# on server.modules add mod_h264_streaming,
# and actived mod_expire and mod_secdownload, and other modules
server.modules              = (
etc...
"mod_expire",
"mod_secdownload",
"mod_h264_streaming" )
#
# add this h264 streaming extensions
h264-streaming.extensions = ( ".mp4", ".flv" )

:: Starting Lighttpd 1.4.23
[ linux:lighttpd-1.4.23 ] # /usr/local/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf &  
or
[ linux:lighttpd-1.4.23 ] # /usr/local/sbin/lighttpd-angel -D -f /etc/lighttpd/lighttpd.conf &
if lighttpd running, you can killed the daemon with:
[ linux:lighttpd-1.4.23 ] #  killall lighttpd

:: testing
upload/download file.mp4 on your web server directory, some like :
[ linux:~ ] # cd /srv/www/htdocs
[ linux:htdocs ] # wget http://h264.code-shop.com:83/iphone.mp4
open browser and goto :
http://yoursite.tld/iphone.mp4

:: Links
+ GoogleLinux
+ VeenCa

2 komentar:

rob said...

Nice! This helped me a lot! It's great because you only recompile into a shelled location, then copy what you need. I did this on CentOS and the only modification I needed first was to install pcre-devel

yum install pcre-devel
./configure --prefix=/root/download/test/lighttpd-1.4.18 --with-pcre

blackonsole said...

hi rob..

thank you, you'r very welcome..
i've updated this post too..

Post a Comment

:: Cheap Web Hosting :: ~ only from Rp. 900/mo; 250Mb/mo of Bandwidth ~ :: Web Hosting Murah Meriah :: ~ mulai dari Rp. 900/bln; Bandwidth 250Mb/bln ~