How to Install Mod-h264-Streaming With Lighttpd Web Server
What Is Mod-H264-Streaming ?
The H264 Streaming Module is a plugin for your existing Apache/Lighttpd/Nginx webserver. Its features are as follows:
Timeshifting seek Enable your viewers to immediately jump to any part of the video regardless of the length of the video or whether it has all been downloaded yet.
Virtual video clips also enables possibilities for Adaptive Streaming.
An easy way for making previews available, say for example when you want to differentiate between registered and unregistered users. Here's a little tutorial for the different web servers on url rewriting and virtual video clips.
Network efficiency The next version will feature 'bandwidth shaping' allowing you to stream videos and only use the bandwidth required to view the video over the network.
Encoding
If you are already using the widely adopted MPEG4/H264 industry standard, there is no need to re-encode your MP4 videos, you can use your existing video files.
Download Old Lighttpd 1.4.18 with mod h264 streaming
#cd root
#wget http://h264.code-shop.com/download/lighttpd-1.4.18_mod_h264_streaming-2....
#tar -zxvf lighttpd-1.4.18_mod_h264_streaming-2.2.9.tar.gz
Download New Lighttpd 1.4.26
#cd /root
#wget http://download.lighttpd.net/lighttpd/releases-1.4.x/lighttpd-1.4.26.tar.gz
#tar -zxvf lighttpd-1.4.26.tar.gz
Note : new Lighttpd 1.4.26 didn't have mod h264 streaming modules so we need to take the modules from lighttpd 1.4.18
Copy the module's files from the 1.4.18 source distribution to your source distribution (lighttpd-1.4.x).
#cp lighttpd-1.4.18/src/mod_h264_streaming.c lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/mod_streaming_export.h lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/moov.c lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/moov.h lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/mp4_io.c lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/mp4_io.h lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/mp4_reader.c lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/mp4_reader.h lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/mp4_writer.c lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/mp4_writer.h lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/mp4_process.c lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/mp4_process.h lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/output_bucket.c lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/output_bucket.h lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/output_mp4.c lighttpd-1.4.26/src/
#cp lighttpd-1.4.18/src/output_mp4.h lighttpd-1.4.26/src/
Edit Makefile.am
#vi lighttpd-1.4.26/src/Makefile.am
### (Add few lines below after 'mod_flv_streaming')
lib_LTLIBRARIES += mod_h264_streaming.la
mod_h264_streaming_la_SOURCES = mod_h264_streaming.c \
mod_streaming_export.h \
moov.c moov.h \
mp4_io.c mp4_io.h \
mp4_reader.c mp4_reader.h \
mp4_writer.c mp4_writer.h \
mp4_process.c mp4_process.h \
output_bucket.c output_bucket.h \
output_mp4.c output_mp4.h
mod_h264_streaming_la_CFLAGS = $(AM_CFLAGS) -DBUILDING_H264_STREAMING
mod_h264_streaming_la_LDFLAGS = -module -export-dynamic -avoid-version -no-undefined
mod_h264_streaming_la_LIBADD = $(common_libadd)
Kill all process lighttpd
#killall -9 lighttpd
Recompiling lighttpd 1.4.26
#cd lighttpd-1.4.26
#./autogen.sh
#./configure --enable-maintainer-mode
#make && make install
Backup & Edit lighttpd.conf
#vi /etc/lighttpd/lighttpd.conf
# change on server.modules
#
server.modules = (
...
...
"mod_expire",
"mod_secdownload",
"mod_h264_streaming",
)
#
# add this h264 streaming extensions
h264-streaming.extensions = ( ".mp4", ".flv" )
Starting Up Lighttpd Daemon
#/usr/local/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf &
Testing open a mp4 streaming files
#cd /home/domains/wowtutorial.org/htdocs/
#wget http://h264.code-shop.com:83/iphone.mp4
Try to access iphone.mp4 files from browser like example below :
http://wowtutorial.org/iphone.mp4
We also can testing out from console like below
#wget -S "http://wowtutorial.org/iphone.mp4"
--2010-07-20 21:30:10-- http://wowtutorial.org/iphone.mp4
Connecting to xxx.xxx.xxx.xxx:80... connected.
HTTP request sent, awaiting response...
HTTP/1.0 200 OK
X-Mod-H264-Streaming: version=2.2.9
Content-Type: video/mp4
ETag: "164781047"
Last-Modified: Wed, 21 Jul 2010 03:56:30 GMT
Content-Length: 101322001
Connection: close
Date: Wed, 21 Jul 2010 04:30:22 GMT
Server: lighttpd/1.4.26
Length: 101322001 (97M) [video/mp4]
Note :
- If you can see your browser playing the iphone.mp4 files it's mean you are successfully configure h264 streaming with lighttpd
- Sometime your browser do not support mp4 so it will ask you to download your iphone.mp4 file and you can just play the file with quicktime / winamp
If you have a depencency problem when you recompiling h264 module, You need to install dependency into your server :
Example with opensuse :
#zypper in fam fam-devel libgio-fam pkg-config autoconf
Recent blog posts |
Recent comments
|
Comments
autogen error
getting:
[root@blat lighttpd-1.4.26]# ./autogen.sh
libtoolize 1.5.x wasn't found, exiting
autogen problem
you can install libtoolize / libtool first before you execute the autogen.sh
hope this can help , thx
http range request
Hi, could you please tell me why this module is really needed in webserver, does h264 not support http range-request ? What extra advantage we get using this module if I try to run this video from my Chrome browser.
hi, h264 is suppose to be for
hi, h264 is suppose to be for a streaming webserver like tube sites.
if you do not running any tube sites you don't need to install this modules
anyway could you please provide me more detaul about http range-request ??
hmmmm
says "plugin-version doesn't match lighttpd-version for h264_streaming" even trying the other things, any other ideas?
follow my steps carefully i
follow my steps carefully
i usually installing mod-h264 streaming with lighttpd with my tutorial and it's working like charm
hei bob, may be you need to
hei bob, may be you need to upgrade h264_streaming to the latest version.
i usually do that if i compile a new webserver
Module mismatch...
Having compiled the h264 module for lighttpd from the 1.4.18 sources and moved the module to a server running 1.4.26 I get the following error:
"plugin-version doesn't match lighttpd-version for h264_streaming"
If there's any way around this I'd love to know.
Thanks.
Had the same problem after reinstalling
This is what I found on another website and worked for me:
Make sure that DAEMON in your startup script (/etc/init.d/lighttpd) is set to point to the locally build version.
Basically I edited /etc/init.d/lighttpd and found that it was a path problem. Cheers.
hi valentin, i didn't using
hi valentin,
i didn't using any init script for my tutorial.
basicly we just need to put a lighttpd daemon into the /etc/init.d/boot.local (suse)or /etc/rc.local (linux variant & bsd )
Post new comment