Tuesday, February 2, 2010

Darwin Streaming Server On RHEL/Fedora for Mobile Phones

Step 1

yum -y install vlc

yum -y install perl-Net-SSLeay

wget http://www.abrahamsson.com/DarwinStreamingServer-6.0.3-1.i386.rpm

wget http://www.abrahamsson.com/DarwinStreamingServer-Samples-6.0.3-1.i386.rpm

wget http://www.abrahamsson.com/DarwinStreamingServer-6.0.3-1.src.rpm # if you got .rpm

wget http://www.abrahamsson.com/DarwinStreamingServer-Utils-6.0.3-1.i386.rpm

wget http://www.abrahamsson.com/DarwinStreamingServer-debuginfo-6.0.3-1.i386.rpm

wget http://www.abrahamsson.com/dss-6.0.3.patch #patch for Linux x86-64 platform

Disabling MP3 streaming

You may choose to run a different server, such as Icecast or Shoutcast for MP3 streaming. If you do that, you may like to disable MP3 streaming in Darwin Streaming Server. Do this by changing the option for mp3_streaming_enabled under the MODULE section for QTSSMP3StreamingModule from true to false. E.g.:



...
false
..




Disabling all authentication

You can disable all authentication for the whole of Darwin Streaming Server by editing the file /etc/streaming/streamingserver.xml and by changing the option for Authenticate under the MODULE section for QTSSAdminModule from true to false. E.g.:



...
false
...




options if require patch -p0 < dss-6.0.3.patchkillall -9 DarwinStreamingServerTo change the administrator account from the default password of “password” use the following command:qtpasswd administratorSo DSS starts at boot up run the following:chkconfig --level 345 dss on Configuring Darwin Streaming ServerNow open a browser and point the address to http://:1220 and log in with the username administrator and the password you choose when running qtpasswd.

You can now test your install by opening QuickTime on a client (either Windows or the Mac) and using one of the sample files installed by Darwin.

File > Open URL and type rtsp:///sample_300kbit.mov

Save the file and upload the file to server. Move the file to /var/dss/movies; open QuickTime and select File > Open URL and type rtsp:///movie.mov and the file should stream.

http://wiki.videolan.org/Documentation:Streaming_HowTo/Streaming_a_live_video_feed_to_Darwin_Streaming_Server_for_Mobile_Phones

#vlc -vvv v4l2:///dev/video0:input=1:width=128:height=96:adev=hw.1,0:samplerate=32000 --sout '#transcode{venc=ffmpeg{keyint=1},vcodec=mp4v,vb=100k,acodec=mp4a,fps=10,ab=8k,channels=1,samplerate=16000}:rtp{mp4a-latm,dst=127.0.0.1,port-audio=20000,port-video=20002,ttl=127,name=CHANNEL,sdp=file:///usr/local/movies/channel.sdp}'

where:

* v4l2:///dev/video0 is the video device you want you want to stream,
* input=1 is the input channel of the video device (0 - tv tuner, 1 - composite),
* width=128:height=96 is the width and height of the input video signal to fetch by VLC,
* adev=hw.1,0 is the alsa audio device to capture audio from,
* samplerate=32000 is the input sample rate of the audio live feed,
* venc=ffmpeg is the encoder used (in this case it's ffmpeg, but you can use x264),
* {keyint=1} is the advanced ffmpeg encoder switches,
* vcodec=mp4v is video codec used to encode this live video feed (in this case it's MPEG4),
* vb=100k is the video bitrate (100 kbits/s is this case),
* acodec=mp4a is the audio codec used (is this case it's AAC),
* fps=10 is the frame rate of the video feed,
* ab=8k is the audio bitrate (is this case 8 kbits/s),
* mp4a-latm is only used for aac audio, it activates a different payload format for aac,
* dst=127.0.0.1 is the destination IP, where Darwin Streaming Server is hosted,
* ttl=127 is the value of the TTL (Time To Live) of your IP packets (which means that the stream will be able to cross 126 routers),
* sdp=file:///usr/local/movies/channel.sdp is where to create the SDP file for live streaming with Darwin Streaming Server (it should be inside of the DSS movies folder),
* name=CHANNEL is the name of the live video feed.

Tested on Nokia N73 and SE K800.


There is a small problem with some Nokia phones and Darwin Streaming Servers, that need a line to be edited in the created SDP file (for example):

* from b=RR:0 to b=RR:800

After running this command from console, you can access it from your mobile phone or VLC or any player that supports RTSP protocol

* rtsp://192.168.1.2/channel.sdp

where

* 192.168.1.2 is the IP address of the machine where DSS is running.

 
 
 
 
Posted by Picasa

 
 
 
 
Posted by Picasa

 
 
 
 
Posted by Picasa



Step 2

#!/bin/bash

sudo yum install build-essential wget
sudo addgroup --system qtss
sudo adduser --system --no-create-home --ingroup qtss qtss

wget http://static.macosforge.org/dss/downloads/DarwinStreamingSrvr6.0.3-Source.tar
tar -xvf DarwinStreamingSrvr6.0.3-Source.tar
mv DarwinStreamingSrvr6.0.3-Source DarwinStreamingSrvr6.0.3-Source.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-6.0.3.patch
patch -p0 < dss-6.0.3.patch
mv DarwinStreamingSrvr6.0.3-Source.orig DarwinStreamingSrvr6.0.3-Source
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-hh-20080728-1.patch
patch -p0 < dss-hh-20080728-1.patch
#need to answer n then y
cd DarwinStreamingSrvr6.0.3-Source
mv Install Install.orig
wget http://dss.macosforge.org/trac/raw-attachment/ticket/6/Install
chmod +x Install
./Buildit
sudo ./Install

Monday, February 1, 2010

Straming Server Linux Red 5 Installation

REyou need to have:
# http://java.com/en/download/linux_manual.jsp
# chmod 755 jdk-1_5_0-linux-i586.bin
#./jdk-1_5_0-linux-i586.bin

Install Apache Ant Ant 1.7:

wget http://apache.mirror.transip.nl/ant/binaries/apache-ant-1.7.0-bin.tar.gz
tar -zxf apache-ant-1.7.0-bin.tar.gz
sudo mv apache-ant-1.7.0 /opt/ant # you don't need this
export ANT_HOME=/opt/ant
sudo ln -s /opt/ant/bin/ant /usr/bin/ant # shortcut - you sould now be able to use ant

now let’s get red5

svn co http://red5.googlecode.com/svn/java/server/trunk red5

#or

wget http://dl.fancycode.com/red5/0.6.3/src/red5-0.6.3.tar.gz
tar -zxf red5-0.6.3.tar.gz
mv red5-0.6.3 red5

now we have red5 directory containing red5 sources.

next step is compilation - before that we might want to provide proper patches to java and ant

export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/
export ANT_HOME=/opt/ant/ # or other directory if you don't have root

now let’s compile

cd red5
/opt/ant/bin/ant prepare
/opt/ant/bin/ant dist

now directory “dist” contains compiled and ready to run server

cd dist
sh red5.sh

# or
# ant server

red5 should now run http server on port 5080 and rtmp service on port 1935

so let’s navigate to:

http://localhost:5080/demos

Sunday, January 31, 2010

Squid Proxy server

The Squid is a good proxy server. Its configuration is very simple. Please use the following procedures.

1) Most of the standard distributions have squid packages in its repository. If you are using fedora, RHEL or centos please do the following procedurea

# yum install squid -y

If your in debian or Ubundu please use the following,

# apt-get install squid

2) Now open the squid configuration file “squid.conf” . In general it will be in /etc/squid/squid.conf . Now modify/ add the following lines.

visible_hostname machine-name
http_port 3128
cache_dir ufs /var/spool/squid 1000 16 256
access_log /var/log/squid/access.log squid

3) Now add the following in the acl section.

acl our_networks src xxx.xxx.xxx.xxx/xx
http_access allow our_networks

Here the xxx.xxx.xxx.xxx/xx is your local IP /netmask

4) Now start the squid server

# /etc/rc.d/init.d/squid start

5) Now configure your web browser as follows. ( It is my firefox configuration )

Go to Preferences -> connection settings -> manual Proxy configurations
Now configure your proxy server IP and port ( 3128)
Now click Ok.

This is the most simplest proxy server configurations over network.

Saturday, January 30, 2010

What is the difference between "su -" and "su" ?

The main difference between su - and su is that the former makes the shell a login shell. This is very important especially if the user is going to su from a regular user account to a root (superuser) account. Normal users do not usually have /sbin/ and /usr/sbin/ in their search path. Therefore if a normal user wants to execute the command ifconfig, for example, after doing su, he usually gets the error message:

bash: ifconfig: command not found

With su -, on the other hand, root's .bashrc and .bash_profile and other special environment settings get sourced and this puts the sbin directories into the search path. Below is a sample session:

[testuser@localhost ~]$ su
Password:
[root@localhost testuser]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/home/testuser/bin
[root@localhost testuser]# ifconfig
bash: ifconfig: command not found
[root@localhost testuser]# exit
exit
[testuser@localhost ~]$ su -
Password:
[root@localhost ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:A0:CC:39:75:41
inet addr:192.168.44.146 Bcast:172.16.45.255 Mask:255.255.254.0
inet6 addr: fe80::2a0:ccff:fe39:7541/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21619559 errors:1 dropped:0 overruns:0 frame:87
TX packets:21190195 errors:4 dropped:0 overruns:4 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1509569968 (1.4 GiB) TX bytes:2280347397 (2.1 GiB)
Interrupt:177 Base address:0x6800

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6159 errors:0 dropped:0 overruns:0 frame:0
TX packets:6159 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3784618 (3.6 MiB) TX bytes:3784618 (3.6 MiB)