Linux/CentOS2012. 9. 7. 09:35

모바일 스트리밍 관련 서버가 필요하여서 알아보던중 같은 mp4 파일로 아이폰과 안드로이드에 서비스가 되어 야한다고 하여서 찾아보던중...
iphone은 어차피 http 80 port로 서비스를 그냥 하면되고  android는 http로는 스트리밍 서비스가안되어 rtsp로 서비스를 해야 되야 됐다.

그래서 검색하다 찾은것이 DSS(Darwin Streaming Server)였다. 모 검색한 간단한 설명을 붙이면

 애플사의 퀵타임 스트리밍 서버는 애플의 소스 공개 정책에 따라 윈도우즈와 매킨토시 양쪽을 모두 지원하는 다윈 스트리밍 서버(Darwin Streaming Server) 프로그램이 소스까지 공개되어 있기 때문에 누구든지 무료로 설치하여 사용할 수 있고, 동영상, MP3등의 디지털미디어를 실시간으로 배포하고 라이브 이벤트를 실현시킬 수 있으며, Linux, Solaris, Windows NT/2000 등 가장 대중적인 엔터프라이즈급 플랫폼을 지원합니다.


이 서버 프로그램은 업계 표준 스트리밍 프로토콜인 RTP/RTSP를 지원하며, 음성과 이미지의 고품질으로 인기가 높습니다.
id qtss
# useradd qtss <--- 수행 시에 그룹에 관한 오류가 발생할 경우, 다음과 같은 명령으로 user를 생성한다.

useradd: group qtss exists - if you want to add this user to that group, use -g.
# useradd -g qtss qtss

# id qtss

uid=505(qtss) gid=505(qtss) groups=505(qtss)


# cd /usr/local/src
# wget http://dss.macosforge.org/downloads/DarwinStreamingSrvr6.0.3-Source.tar
# tar xvf DarwinStreamingSrvr6.0.3-Source.tar
# wget http://www.abrahamsson.com/dss-6.0.3.patch
# patch -p0 < dss-6.0.3.patch
# cd DarwinStreamingSrvr6.0.3-Source
# ./buildtarball
# cd DarwinStreamingSrvr-Linux
# ./Install
Installing Darwin Streaming Server

Checking for and Killing currently running Darwin Streaming Server
...(생략)...

characters long
Enter DSS Administrator Username : (Admin Username 입력)

DSS Administrator Password cannot contain spaces, or quotes, either single or double, and cannot be more than 80
characters long
Enter DSS Administrator Password: (패스워드 입력)
Re-enter DSS Administrator Password: (패스 워드 확인)
Adding userName admin
Setup Complete!

 이렇게 진행되었으면 설치는 완료 되것이다.

# netstat -nlp

해보면 아래와 같은 포트가 열려진것을 확인해볼수 있을것이다. 

tcp        0      0 0.0.0.0:8000                0.0.0.0:*                   LISTEN      4273/DarwinStreamin 
tcp        0      0 0.0.0.0:8001                0.0.0.0:*                   LISTEN      4273/DarwinStreamin 
tcp        0      0 0.0.0.0:1220                0.0.0.0:*                   LISTEN      4316/perl           
tcp        0      0 0.0.0.0:554                 0.0.0.0:*                   LISTEN      4273/DarwinStreamin  
tcp        0      0 0.0.0.0:7070                0.0.0.0:*                   LISTEN      4273/DarwinStreamin 
......

 기본영상이 올라가는 기본경로는 
/usr/local/movies
이니 적당한 폴더를 생성하여 사용하는것이 좋을것이다.

 

http://Server주소:1220 으로 접속해 보면 관리 화면으로 접속해 볼수 있을것 이다.

처음 접속하면 새로운 패스워드를 접해주면 되고

80포트 사용이라든지 디렉토리 경로 설정이라든지 SSL 사용 설정을 하게 되고

관리 페이지로 들어가게 될것이다.

여기서 여러가지 설정값을 사용할수 있고

Play list 메뉴에서 영상을 추가해주면된다.

그리고 virtualhosts에서 해당 디렉토리(예 /usr/local/movies)를 설정하여 하여 http와 rtsp가 같은 곳을 바로보게 한다면

소스를 iphone 접속과 android 접속을 구분해 준다면 같은 파일을 가지고 스트리밍 서비스를 할수 있다.

# ps aux
root 23117 0.0 0.0 4348 464 ? Ss 11:38 0:00 /usr/local/sbin/DarwinStreamingServer
qtss 23118 0.0 0.0 46016 2380 ? Sl 11:38 0:00 /usr/local/sbin/DarwinStreamingServer
qtss 23119 0.0 0.1 9628 3908 ? Ss 11:38 0:00 /usr/bin/perl /usr/local/sbin/streamingadminserver.pl


로그인 화면이 나오면 Admin Username 과 Password 입력합니다.

MP3보안에 대한 페이지가 나옵니다.

해당 서버에 OPENSSL이 설치되어 있는 경우에는 보안을 이용한 SSL송신이 가능합니다. 없으면 NEXT

콘텐츠가 위치할 디렉토리를 설정합니다. 디폴트가 편합니다.

출력포트를 80번으로 할것인지 물어봅니다. 그냥 넘어갑니다.

Playlists 목록에 들어가 New Movie Playlist 에서 원하는 파일(기본으로 샘플 파일이 있음) 추가 한 후 저장합니다.

마지막으로 QuickTime Player 실행한 후 URL열기에서
rtsp://해당서버IP/파일이름.mp4 실행하면 완료!!
rtsp://xxx.xxx.xxx.xxx/sample_100kbit.mp4



------------------------------------------------------------------------------------------------------------------


Darwin Streaming Server (DSS) 설치

애플사의 퀵타임 스트리밍 서버는 애플의 소스 공개 정책에 따라 윈도우즈와 매킨토시 양쪽을 모두 지원하는 다윈 스트리밍 서버(Darwin Streaming Server) 프로그램이 소스까지 공개되어 있기 때문에 누구든지 무료로 설치하여 사용할 수 있고, 동영상, MP3등의 디지털미디어를 실시간으로 배포하고 라이브 이벤트를 실현시킬 수 있으며, Linux, Solaris, Windows NT/2000 등 가장 대중적인 엔터프라이즈급 플랫폼을 지원한다.

이 서버 프로그램은 업계 표준 스트리밍 프로토콜인 RTP/RTSP를 지원하며, 음성과 이미지의 고품질으로 인기가 높다.

그럼, 이제 소스를 다운 받아 설치해보자.
소스는 http://developer.apple.com/darwin/projects/streaming/ 에서 구할수 있다.

다운받은 파일을 /usr/local/에 카피한 후 압축을 푼다.


# cp DarwinStreamingSrvr4.1.3-Linux.tar.gz /usr/local/
# cd /usr/local/
# tar xvzf DarwinStreamingSrvr4.1.3-Linux.tar.gz


압축을 푼 파일을 보면 친절하게도 인스톨 파일이 있다. 그럼 인스톨 파일을 실행시킨다.


# ls
3rdPartyAcknowledgements.rtf qtpasswd sample.mp3
AdminHtml qtusers streamingadminserver.pl
DarwinStreamingServer readme.pdf StreamingLoadTool
Install relayconfig.xml-Sample streamingloadtool.conf
MP3Broadcaster sample_100kbit.mov StreamingServerModules
perlpath.pl sample_100kbit.mp4 streamingserver.xml
PlaylistBroadcaster sample_300kbit.mov streamingserver.xml-sample
qtgroups sample_300kbit.mp4
# ./Install
Installing Darwin Streaming Server

Checking for and Killing currently running Darwin Streaming Server
...(생략)...

Installation Complete

Darwin Streaming Server Setup

DSS Administrator Username cannot contain spaces, or quotes, either single or double, and cannot be more than 255
characters long
Enter DSS Administrator Username : (Admin Username 입력)

DSS Administrator Password cannot contain spaces, or quotes, either single or double, and cannot be more than 80
characters long
Enter DSS Administrator Password: (패스워드 입력)
Re-enter DSS Administrator Password: (패스워드 확인)
Adding userName admin
Setup Complete!
#


여기까지 하면 설치는 모두 끝났다.

 

Darwin Streaming Server (DSS) 설정

그럼 이제 DSS(Darwin Streming Server)의 서버 설정을 해보자.

웹브라우져를 띄워서 http://IP_Address:1220 를 입력하자. (1220 포트는 DSS(Darwin Streming Server)의 관리자 페이지 접속을 위한 포트이다.)
로그인 화면이 나오면 지정한 Admin 계정과 패스워드를 넣고 다음으로 넘어가면, MP3 Broadcast를 위한 패스워드 설정이 나온다. 설정을 하고 다음으로 넘어간다.
다음으로 Secure Administration 설정이 나온다. 설정하고 또 넘어간다.
이제 Media Folder 설정이 나온다. 관리를 편하게 하기 위해 media 계정을 생성하고, 계정의 홈 디렉토리를 이용하면 나중에 관리하기 용이하다. 설정을 하였으면 넘어간다.
끝으로 Streaming on Port 80 설정이 나온다. 설정하고 완료한다.

여기까지를 모두 마치면, DSS(Darwin Streming Server) 관리자 페이지가 보일 것이고, 서버상태를 요약한 메인 화면이 보인다.


---------------------------------------------------------------------------------------------------------


Friday, August 29, 2008

Darwin Streaming Server 6.0.3 on Linux

digg_url="http://cwshep.blogspot.com/2008/08/darwin-streaming-server-603-on-linux.html";0diggsdigg

Quick tutorial for installing DSS on Ubuntu 8.04.1 64bit (x86_64).

Most of these details can be found here: http://dss.macosforge.org/trac/ticket/6

Hopefully they will integrate these patches in to the next release, but until then here are the build instructions for Ubuntu:

Download DSS 6.0.3: http://static.macosforge.org/dss/downloads/DarwinStreamingSrvr6.0.3-Source.tar

Download this patch: http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-6.0.3.patch (Thank you Sverker Abrahamsson!)

And this patch: http://dss.macosforge.org/trac/raw-attachment/ticket/6/dss-hh-20080728-1.patch

Finally get the modified Install script: http://dss.macosforge.org/trac/raw-attachment/ticket/6/Install

The basic process is:

1. Get the build dependencies from the repositories.
2. Set up the qtss user (this is because the Install script does it in a way that is incompatible with Ubuntu)
3. Extract the source code.
4. Apply both patches.
5. Replace the Install script and chmod +x it.
6. Compile.
7. Install.

Notably for ssl admin you need the openssl and libnet-ssleay-perl packages, unfortunately even with these packages I was unable to get ssl admin to work.

I created the modified Install script; you can do a diff with the original if you want to see what I changed. Mostly just the paths were broken, but I am guessing that some other modules and such will probably not work.

Here is the bash script I used to do everything (including automatically download everything):


#!/bin/bash

sudo apt-get 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




Update 2/2/2009: I changed the links to all point to dss.macosforge.org, which is a much more reliable host. Everyone should also take a look at that thread, as there are a lot of updates, including a newer patch from Horace Hsieh. I haven't played with this in a while, but if I get a chance I will try to update this with the newer patch. Please let me know if there are any problems (I just turned comment notifications on :/).

 

출처: http://blog.vinestory.com/87 

 

 

Automating startup of Darwin Streaming Server

Recently I have been using Darwin Streaming Media Server for some small movies. However, I quickly found out that when I rebooted the server Darwin does not automatically start up with it. It was necessary to start it manually each time the server was rebooted or started. Needless to day I find this very inconvenient. So I decided to write a startup script. It was really very easy, as you will see below.

I am using Fedora Core 4 and did a normal install of Darwin 5.5 from Apple.

Then I added the following script as the directory /etc/rc.d/init.d/darwinssd with darwinssd being the filename, not a directory.
You will need to be superuser in order to write to this directory.

# vi /etc/rc.d/init.d/darwinssd

#!/bin/bash
#
# created by Adam Culp of Unique Web Sites, Inc.
# at www.uniquewebsites.com
#
# darwinssd     Startup script for the Darwin Streaming Server
#
# chkconfig: 345 85 15
# description: Darwin Streaming Server startup/shutdown script
# processname: darwinssd
# pidfile: /var/run/darwinssd.pid
 
darwinssd=/usr/local/sbin/DarwinStreamingServer
RETVAL=0
 
# Source function library.
. /etc/rc.d/init.d/functions
 
case "$1" in
start)
echo -n "Starting Darwin Streaming Server[darwinssd]: "
daemon $darwinssd
RETVAL=$?
echo
touch /var/lock/subsys/darwinssd
;;
stop)
echo -n "Shutting down Darwin Streaming Server[darwinssd]: "
killproc $darwinssd
RETVAL=$?
echo
rm -f /var/lock/subsys/darwinssd
rm -f /var/run/darwinssd.pid
;;
status)
status $darwinssd
;;
restart)
$0 stop
$0 start
;;
reload)
echo -n "Reloading darwinssd: "
killproc $darwinssd -HUP
echo
;;
*)
echo "Usage: $0 {start|stop|restart|reload|status}"
exit 1
 
esac
 
exit 0

Of course you will also need to change the permissions on the file darwinssd to be -rwxr-xr-x (or 755).

# chmod -c 755 darwinssd

 

At this point you can treat darwinssd as if it was any other daemon. You can add it to the starup with:(must be root user for this command)

# chkconfig darwinssd on

# chkconfig --level 35 darwinssd on  <--- runlevel 35: autorun

As a superuser you would type it as:

# /sbin/chkconfig darwinssd on

It also has other features such as start, stop, restart, and reload.
The same applies here for any of these commands:

# service darwinssd restart

or as superuser

# /sbin/service darwinssd restart

 

출처: http://www.geekyboy.com/archives/9

 

 

 

Darwin Streaming Server


This article was for the following Ubuntu versions tested:

  • Feisty Fawn 7.04 Gutsy Fawn 7.04
  • Dapper Drake 6.06 (Long Term Support)

Darwin Streaming Server is the free version of QuickTime commercial server from Apple. Here are some of it's features:

  • Support for open standards: MP3, MPEG-4, H.264/AVC, RTP, RTSP
  • Open Source pursuant to Apple Public Source License
  • No term, no user restrictions, etc.
  • Free

In addition, the server through a Web interface, a simple configuration, even from another computer.



The Darwin server is suited for on-demand streaming, where the audio / video data is already in coded form as a file and available on demand by a user of each other. In connection with the Live encoder mp4live from mpeg4ip project, but it can also live streaming applications (eg Internet-TV).

The following instructions should assist in the installation and configuration of the Darwin server.

Preparation

For the installation of the Darwin Streaming Server, the following two packages need to be installed:

Libstdc + +5 (is already installed by default)
Checkinstall (Dapper)

To the Darwin streaming server after installation test can also be a good player for playback. This can be either locally on the server, or even better on a second computer to the server network is installed. It is proposed to take this opportunity to install the VLC media player with MPEG-4 support, but there are certainly other players to use.

The Darwin Streaming Server is not as a finished package for Ubuntu or Debian available, but must via Web browser as tar file from Apple's Web Download (registration required). The installation is described here the package Official Release - DSS 5.5.5 -> Linux -> streaming server is required, which the Linux binaries. The file is then downloaded and unpacked in the home directory.

Installation

After unpacking a terminal is opened and executed the following commands:

cd DarwinStreamingSrvrlinux Linux
sudo addgroup --system qtss
sudo adduser --system --no-create-home --ingroup qtss qtss

Gutsy Fawn

Under Ubuntu 7.04 Dapper Fawn the command is:

sudo. / Install

Dapper Drake

Under Ubuntu 6.06 Dapper Drake is the call warrant against:

sudo checkinstall - pkgname = darwin-server - pkgversion = 5.5.5. / Install

Here is a brief explanation of what the different commands effect:

  1. Change in the scale when unpacking subdirectory
  2. Creating a user group "qtss" (otherwise the installation doesn't work)
  3. Creating a user "qtss" (as before, but strangely ubuntu not necessary?)
  4. Calling the installation routine

After entering the last command line, the installation routine automatically and directed all the necessary directories and so spontaneous. It will also name and password for the administrator of the Darwin server queried. After completing the installation, the Darwin server automatically.

The installation of the server software is closed and the terminal can be closed.

Directories

The following table presents an overview of the most important files and directories of the Darwin server:

/usr/local/sbin/Darwin Streaming Server ---- Server Software
/usr/local/sbin/streamingadminserver.pl ---- Web Frontend
/etc/streaming ---- Configuration Dir
/etc/streaming/streamingserver.xml ---- Configuration File Server
/var/streaming/logs ---- Logs
/usr/local/movies ---- Default directory for video files

Then, the file /etc/streaming/streamingserver.xml must be given write privledges, otherwise no configuration can be saved:

sudo chmod 755 /etc/streaming/streamingserver.xml

Configuration and Test

The configuration of the Darwin server via a web interface and the following link called:

http://<Server-IP>:1220

After signing up as an administrator using the software installation previously elected login information can now be made more settings. When you first call up the site initially queried following information:

  • MP3 Broadcast Password
  • Secure Administration
  • Media Folder: /usr/local/movies
  • Streaming on Port 80 Streaming on Port 80

It is important here first is that the path to the video files (Media Folder) correctly specified, all other issues can safely with the "Next" button skipped.In the specified directory /usr/local/movies are already some demo videos, for the first function tests can be used. It is therefore appropriate that this requirement to make changes at any time are on the configuration menu. After defining these four points will eventually configuration mask for the Darwin server, in other settings can be made. Leave the configuration screen by clicking on "Sign Out" (left column bottom).

Now you can test whether the Darwin server works as desired. This is the VLC media player opened and the menu "File -> Open Network Stream" stream following address:

rtsp://<Server-IP>/sample_100kbit.mp4

If everything is installed correctly, you should now be a player in the supplied sample videos will be shown. Congratulations!

Start Server

During power of the computer is not of the Darwin server automatically, but servers and web interface must either in a terminal on the following two lines of command

sudo /usr/local/sbin/DarwinStreamingServer
/usr/local/sbin/streamingadminserver.pl

Or by corresponding entries in the Start menu manually invoked. As servers and web interface can also start automatically, is contributing startup. In addition, there are init scripts for the Darwin server and the admin interface.

MPEG-4 video streaming

In order to use the server as streaming video-on-demand server videos must be in MPEG-4 format (file extension .mp4). Using the under video editing or DVD rippin tools. Videos in Quicktime format (. Mov) could also be used, but are probably less interesting.

However, before an MPEG-4 video with the Darwin server can be streamed must have known in advance hint tracks in the data stream added. They are required to fast forward and rewind the video. For inserting the hint tracks use Tool MP4Box in the package:

  • gpac (multiverse, [2])

The syntax for the command call for inserting the hint tracks reads:

MP4Box -hint dateiname.mp4

With the option-unhint can be inserted information may also be removed.

Alternatively, can the hint tracks with the tool mp4creator from the MPEG4IP project.

After inserting the hint tracks, the video file only in the video directory of the Darwin server will be copied or moved, immediately thereafter, the video for the call may be accessed via the web interface also includes a playlist can be created.

MP3 audio streaming

With the Darwin server can not only MPEG-4 videos, but also MP3 audio files stream. As you can create MP3 files, for example, in the contribution rip CDs. To existing MP3 files on stream, must first play lists, which, thanks to the existing web interfaces but made relatively quickly. (Guide in German, not included)

The MP3 player, the create play lists at the address:

http://<Server-IP>:8000/Mountpunkt

 

--- Re

Command
Code:
/usr/local/sbin/streamingadminserver.pl
must be run as root too
Code:
sudo /usr/local/sbin/streamingadminserver.pl
or otherwise you'll get an error
Code:
Couldn't find the en language messages file! at /usr/local/sbin/streamingadminserver.pl line 2167.
Killing the server
Code:
root@mansikki:~# ps -Af | grep -i stream
root      5857     1  0 11:28 ?        00:00:00 /usr/local/sbin/DarwinStreamingServer
qtss      5858  5857  0 11:28 ?        00:00:00 /usr/local/sbin/DarwinStreamingServer
qtss      6061     1  0 11:32 ?        00:00:00 /usr/bin/perl /usr/local/sbin/streamingadminserver.pl
root      6233  6205  0 11:35 pts/9    00:00:00 grep -i stream

killall DarwinStreamingServer 
kill 6061

 

--- Re 

There is file /etc/streaming/qtusers
to manage the file use qtpasswd tool as follows:
/usr/bin/qtpasswd -c -p password administrator

 

'Linux > CentOS' 카테고리의 다른 글

CentOS Iptables 방화벽 포트 OPEN  (0) 2012.09.07
Wowza Media Server 설치  (0) 2012.09.07
부팅 시에 네트워크 자동 시작  (0) 2012.09.05
사용자 계정 추가  (0) 2012.09.03
CentOS VNC 설정 및 사용법  (0) 2012.08.31
Posted by iWithJoy