Streaming Media Platform Setup

Source: Internet
Author: User

1 goals

Want to build a streaming platform (similar music platform), through the streaming media platform to maintain the relevant streaming media resources.

2 Main Function requirements

Key features can include: Streaming content Maintenance (information maintenance, streaming file upload, etc.), support for RTSP (real-time streaming Protocol, live streaming protocol) and RTP/RTCP (real-time Trancport Protocol /RTP control Protocol, the real-time Transfer Protocol/RTP-controlled protocol) for streaming media playback. The performance parameters given by the DSS are: Default 1000 users are online at the same time, can be modified to a maximum of 9999, provided that the bandwidth is large enough.

3 Design Implementation Plan

Because the department does not have a similar project construction case, the project team personnel can not master the streaming media technology. To complete the project construction work within the duration. Search through the Internet. Find an open source streaming platform Project Darwin streaming Server. Through two development of DSS-related functions, it uses its streaming ability. The performance metrics given in the DSS project meet the requirements in the requirements documentation (not via LR validation).

3.1 DSS Open Source product introduction

Darwin Streaming server is referred to as DSS. DSS is an open source live Streaming server program provided by Apple. The whole program is written in C + +, in the design of high-performance, simple, modular and other program design principles, in order to achieve efficient procedures, scalability is good. And DSS is an open source, standard-based streaming media server that can run on Windows NT and Windows 2000, as well as several UNIX implementations, including Mac OS X,linux,freebsd, and on the Solaris operating system. Darwin Streaming Server provides music (mp3) with video (3GP, MP4, MOV) streaming playback capabilities.

For a more detailed description of the function, see:

http://hi.baidu.com/dmkj2008/item/a2085a30e0738e80c3cf2956

Forwarding function: If the server pressure is large or the function expands, can use the DSS relay function, depending on the pressure test result.

Reference resources:

Http://www.jsjyedu.cn/zxlw/48254_2.html

http://www.jtben.com/document/1120414

3.2 DSS Construction

2.1 Installation Commands

Tar zxf darwinstreamingsrvr5.5.5-linux.tar.gz

CD Darwinstreamingsrvrlinux-linux

./install

Please enter a new administrator user Name:admin

Please enter a new administrator Password:your_password

2.2 To see if the installation was successful

ID QTSS

uid=501 (QTSS) gid=502 (QTSS) groups=502 (QTSS)

PS aux | grep Darwin

Root .../usr/local/sbin/darwinstreamingserver.

Qtss .../usr/local/sbin/darwinstreamingserver.

Netstat-ntulp | grep Darwin

TCP 0.0.0.0:8001

TCP 0.0.0.0:554

TCP 0.0.0.0:7070

UDP 127.0.0.1:6970

UDP 192.168.0.1:6970

UDP 127.0.0.1:6971

UDP 192.168.0.1:6971

UDP 127.0.0.1:6976

UDP 127.0.0.1:6977

UDP 127.0.0.1:6978

UDP 127.0.0.1:6979

2.3 Start command

Start the service (the installation has started and does not need to be restarted)

Start Darwin streaming Server

/usr/local/sbin/darwinstreamingserver

Start the Web management interface (TCP port 1220) (the installation is started and does not need to be restarted)

/usr/local/sbin/streamingadminserver.pl

2.4 Close Command

Kill-9 Darwin Streaming Server process

2.5 Error while loading shared Libraries:libstdc++.so.6:cannot open Shared object file:no such file or directory

Recommendation: Create a new dynamic library corresponding file profile *.conf on/etc/ld.so.conf.d/,

Fill in the file with the absolute path to the dynamic library

This example:

Vim/etc/ld.so.conf.d/ld. Darwin.so.conf

/usr/local/lib

Copy libstdc++.so.6 to/usr/local/lib at the same time

Run: Ldconfig/etc/ld.so.cache

3 Management Interface Configuration 3.1 connection to the management interface to set

Open browser, connect to http://darwin.streaming.server:1220/

The first time you enter the management interface, the following settings are required:

MP3 broadcast Password: set MP3 broadcast password

Secure Administration:web management interface to enable SSL security online (if required, this setting is NO)

Media Folder: Set the multimedia file storage path (default/usr/local/movies, this time is set to default, if the modified path does not affect the target directory)

Streaming on port 80: Whether streaming data is transmitted in port (as required, this setting is NO)

Above, the DSS is built to complete.

3.3 Audio encoding

3.3.1 Software Installation

3.3.1.1 ACC Sound Coding

Tar Xvfz faac-1.28.tar.gz

CD faac-1.28

./configure--prefix=/usr/local--enable-shared--without-mp4v2

Make

FAQ:

Make times wrong

If g++-dhave_config_h-i.-I.-I. /.. -I.. /.. /include-wall-g-o2-mt 3gp.o-md-mp-mf ". deps/3gp. Tpo "-c-o 3GP.O 3gp.cpp; \

Then Mv-f ". deps/3gp. Tpo "". deps/3gp. Po "; Else Rm-f ". deps/3gp. Tpo "; Exit 1; Fi

Mpeg4ip.h:126:error:new declaration? Onst char* strcasestr (const char*, const char*)?

Vim +126 Common/mp4v2/mpeg4ip.h

Delete this row, save exit

Char *strcasestr (const char *haystack, const char *needle);

Make clean

Make install

3.3.1.2 AMR_NB Sound Coding

Tar xvf amrnb-7.0.0.2.tar.bz2

CD amrnb-7.0.0.2

./configure--prefix=/usr/local--enable-shared

Make

Make install

Please skip this step because the network issue is not installed.

3.3.1.3 FFmpeg

1. Tar xvfj ffmpeg-0.4.9-p20051120.tar.bz2

Get the extracted directory is ffmpeg-0.4.9-p20051120, the name is too long, using the MV command to change to FFmpeg

MV Ffmpeg-0.4.9-p20051120 FFmpeg

CD Ffmpeg/libavcodec

mkdir amr_float simultaneously extracts 26104-700.zip's leaf file cp to Amr_float

Perform:

Declare-x ld_library_path= "/usr/local/lib:/u01/software/stream/faac-1.28:/u01/software/stream/amr nb-7.0.0.2"

2. Configuration

./configure--prefix=/usr/local/ffmpeg--enable-shared--enable-faac--enable-amr_nb--disable-ffplay

Where:--enable-shared is allowed to compile the dynamic library, in the future programming to use this several dynamic libraries. --prefix set the installation directory.

3. Compile and install

Make

Make install

4, after installation in/usr/local/ffmpeg will see that there are three directories

lib Dynamic link library location

Include programming to use the header file

The directory where the bin execution file resides

5, in order to facilitate the programming later, we put Lib three link library libavcodec.so libavformat.so libavutil.so copy to/usr/lib. Copy the FFmpeg directory under the Include directory to/usr/include.

6, Ln-s/usr/local/ffmpeg/bin/ffmpeg/usr/bin/ffmpeg

7, vi/etc/ld.so.conf add/usr/local/lib

After saving, execute Ldconfig

3.3.1.4 installation of audio streaming software

The audio fluidization function is as follows:

Hint Tracks is a series of instructions in a MP4 container file
Tell a server how to transmit packets. Hint tracks always refer
To another track, most likely a audio or video media track.

This series of instructions tells the server when to send the packet,
What type of RTP header to add, if there are any extra data in the
Packet, and how much data to send in the packet. To save on space,
A hint can contain a pointer to the media track, instead of duplicating
That data.

Installation process:

Tar Xvfz mpeg4ip-1.6.1.tar.gz

CD mpeg4ip-1.6.1

./bootstrap--prefix=/usr/local/mpeg4ip--enable-ffmpeg=/usr/local/ffmpeg--disable-player--disable-server

If the error is as follows: Util/testnasm.sh:line 8:test: =: unary operator expected

Please:

Check for the following text in the "Configure" file:

Billsnasm_arg= ' Nasm-r | Tr '. ' ""

and replace The-r with-v

Save and run bootstrap again.

Make

Errors such as: T char* strcasestr (const char*, const char*

Operation:

Vim +126 Include/mpeg4ip.h

Make install

Add default command

[Email protected] ~]# cd/usr/bin/

[Email protected] bin]# ln-s/USR/LOCAL/MP

[Email protected] bin]# ln-s/usr/local/mpeg4ip/bin/mp4info/usr/bin//mp4info

Tar zxvf gpac-0.5.0.tar.gz

Tar zxvf gpac_extra_libs-0.4.5.tar.gz

CD Gpac

Cp-r. /gpac_extra_libs/* extra_lib/

chmod +x Configure

./configure

Make

Make Lib

Make Apps

Make install

Whereis Mp4box

Add default command

[Email protected] bin]# Cd/usr/bin

[Email protected] bin]# ln-s/usr/local/bin/mp4box mp4box

[email protected] bin]# ll m*

Mail Mp4box

[email protected] bin]# ll Mp4box

lrwxrwxrwx. 1 root root 26 March 17:04 Mp4box-/usr/local/gpac/bin/mp4box

[Email protected] bin]# cd/home/tapapp/darwinstreamingsrvrlinux-linux/

[Email protected] darwinstreamingsrvrlinux-linux]# Mp4box-hint Outfile.mp4

Hinting file with PATH-MTU 1450 Bytes

Hinting track ID 1-type "mp4a:mp4a" (mpeg4-generic)-BW + kbps

Saving outfile.mp4:0.500 secs interleaving

[Email protected] darwinstreamingsrvrlinux-linux]# Mp4info Outfile.mp4

./mp4info Version 2.0.0

/home/tapapp/darwinstreamingsrvrlinux-linux/outfile.mp4:

Readatom: "/home/tapapp/darwinstreamingsrvrlinux-linux/outfile.mp4": Atom Type〆nc is suspect

Track Type Info

1 Audio MPEG-4 AAC LC, 88.960 secs, 0 kbps, 8000 Hz

65536 hint Payload (NULL) for track 1

Readatom: "/home/tapapp/darwinstreamingsrvrlinux-linux/outfile.mp4": Atom Type〆nc is suspect

Description: For some special files, first ffmpeg-i xxx.mp4-vcodec copy-acodec copy xxx_new.mp4 then execute Mp4box-hint xxx_new.mp4

3.3.2 MP3 Format Audio transcoding

Convert audio encoding to AAC MP4 format file

Ffmpeg-i sample.mp3-acodec aac-ac 2-ar 8000-ab 96-vol

Convert audio encoded to AMR_NB MP4 format file

Ffmpeg-i sample.mp3-ac 1-acodec Amr_nb-ar 8000-ab 96-vol

Specific Operating Procedures:

650) this.width=650; "title=" 5 ' hnv{8wbu7aqb_wg493{%i.png "src=" http://s1.51cto.com/wyfs02/M01/85/AC/ Wkiol1esguedhyjkaaatyb_1-9m814.png-wh_500x0-wm_3-wmp_4-s_3302624824.png "alt=" wKioL1esGUeDhYjkAAAtyb_ 1-9m814.png-wh_50 "/>

3.3.3 VLC generates SDP files

VLC-VVV sample_100kbit.mp4--sout ' #rtp {dst=10.4.121.194, msx=ts, port=1234, SDP=RTSP://10.4.121.194:554/TEST.SDP} '

3.4 Audio File storage

Follow the Linux file directory store:

$DSS _home/Audio encoding Format (AMR,ACC)/Audio Classification 1 (literature, comedy, etc.)/audio classification two-level coding (poetry prose, foreign classics, etc.)/book name Code/product package (optional)/audio file. mp4

Example: $DSS _home/acc/1001/1001001/01/01.mp4

Cons: Chinese not supported

3.5 RTSP Service Control

There is a problem!

Already handled by socket forwarding

3.6 Performance Testing

3.6.1 Streamingloadtool

Command:./streamingloadtool–n203

When the user reaches 203, the test command error comes with the test tool.

Ps:-u command is not good, you must modify the URL of streamingloadtool.conf

3.6.2 Live555

Installing LIVE555 uses its tools to rstpclient test performance.

./genmakefiles Linux

Make

Make install

Invoke the pressure tool script./test2.sh Test2 for a silent success script faster. Can be viewed through the DSS platform

./test1.sh Test1 executes once every 2 seconds, slower and with a hint of successful failure.

3.6.3 LR Test

Not tested.

Available Playback addresses:

Rtsp://10.4.121.56/sample_300kbit.mp4

This article is from the "breath of rain after the taste of the Soil" blog, please be sure to keep this source http://tongl.blog.51cto.com/4470985/1836864

Streaming Media Platform Setup

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.