[Media] live555 live555-VS2008 compilation, use and testing ()

Source: Internet
Author: User
Tags visual studio 2010
[Media] live555 compilation, use and test under live555-VS22008

 

I live555 Introduction

Live555 is a cross-platform C ++ open-source project that provides solutions for streaming media. It supports standard streaming media transmission protocols such as RTP/RTCP, RTSP, and sip. Live555 provides streaming, receiving, and processing support for audio and video data in multiple audio and video encoding formats, including MPEG, H.263 +, DV, JPEG videos, and multiple audio encodings. At the same time, due to its good design, live555 is very easy to extend its support for other formats. Currently, live555 has been used to implement streaming media playing functions for multiple players, such as VLC (VideoLAN) and mplayer.

The source code of this project includes four basic libraries, various test codes, and ive555 Media Server. The four basic libraries are usageenvironment & taskscheduler, groupsock, livemedia, and basicusageenvironment.

II download

Live555 source code: Http://www.live555.com/liveMedia/public/ (official website)

 

Iii. Compilation Step 1 (command method in WINXP)

0 Summary: generate available makefiles for vs using genwindowsmakefiles. cmd

1. Modify win32config. Open the live \ win32config file and modify it as follows:

Tools32 = c: \ Program Files \ devstudio \ Vc

Tools32 = E: \ Program Files \ Microsoft Visual Studio 10.0 \ Vc

Change tools32 to your vs2010 path

Link_opts_0 = $ (linkdebug) msvcirt. Lib

Link_opts_0 = $ (linkdebug) msvcrt. Lib

The link Runtime Library requested by the compiler is different. I thought it could be changed to msvcrt100.lib, but I didn't find it.

2. Added makefile settings. Open live \ groupsock \ makefile. Head and modify it as follows:

Includes =-iinclude-I ../usageenvironment/include

Includes =-iinclude-I ../usageenvironment/include-dno_strstream

3. Create a makefile

  Method: Run Live \ genwindowsmakefiles. CMD to generate *. Mak files that can be compiled by.

4. Create the build. Bat command

Create live \ complie. BAT and add the following content:

5. Start Compilation: (under the command line) execute complie. bat

6. A compilation error is reported. You need to add a line in netcommon. H, typedef signed short int16_t;

7. Compilation result:

7-1Under the corresponding file, such

Generate the OBJ file corresponding to the CPP file (Object File intermediate code file, which is generated by the source file complie and is an o file in Linux)

Generate lib Library: libbasicusageenvironment. Lib, libgroupsock. Lib, libusageenvironment. Lib, liblivemedia. Lib

 

7-2Under the corresponding file, such as: generate the corresponding OBJ file and EXE file

 

DescriptionMing: If you want to use vs2008 to debug and track the code, you need to modify the code during compilation as follows:

Method 1: Modify nodebug in the *. Mak file. Without debug, nodebug = 1 (default); with debug, DEBUG = 1

Method 2: Add "nodebug = 1" in win32config (not recommended)

 

Method 2 (WINXP + vs2008)

If you need to debug and modify the source code by yourself, it is better to use the compiler method, which is also more conducive to source code analysis. The steps are as follows:

0 Summary: separate compilation of Lib for each library

 

1. Create a solution and a lib project as follows:

E:\My Document\Visual Studio 2010\Projects\myLive555\BasicUsageEnvironmentE:\My Document\Visual Studio 2010\Projects\myLive555\liveMediaE:\My Document\Visual Studio 2010\Projects\myLive555\groupsockE:\My Document\Visual Studio 2010\Projects\myLive555\BasicUsageEnvironment

  Complete Solution StructureFor example

2. Add a header file

Method 1: Use the Global Inclusion Method (absolute path ). The include files to be added include

E:\My Document\Visual Studio 2010\Projects\myLive555\BasicUsageEnvironment\includeE:\My Document\Visual Studio 2010\Projects\myLive555\liveMedia\includeE:\My Document\Visual Studio 2010\Projects\myLive555\groupsock\includeE:\My Document\Visual Studio 2010\Projects\myLive555\BasicUsageEnvironment\include

Method 2: Local (current project) Inclusion (relative path) is used ). Recommendation

Description: Project-> properties-> Configuration properties-> C/C ++-> General-> additional inclusion Directories

..\BasicUsageEnvironment\include..\groupsock\include..\liveMedia\include..\UsageEnvironment\include

 

3. Add a file.

Add all corresponding CPP files to the above lib project.

4. compile each project. A compilation error is reported. You need to add a line in netcommon. H, typedef signed short int16_t;

5. compile each project again. In the DEBUG directory, the following four static libraries are generated.

Generate basicusageenvironment. Lib, groupsock. Lib, usageenvironment. Lib, and livemedia. Lib in the DEBUG directory.

 

Test the live555 server (however, files in MP4 or FLV formats are not currently supported. test files with the h264 suffix) Method 1: (use ffplay.exe for playback)

1Store the media file in the same directory as live555mediaserver.exe.

2Run live555mediaserver.exe. the pop-up DOS box contains an address, as shown in figure

3Go to the ffplay folder under the client and DOS, and enter the following command:

Ffplay.exe rtsp: // 10.120.2.18/<Media File Name>

A video playing screen is displayed, as shown in figure

 

Method 2: (Directly Play network streams in VLC)

1Store the media file in the same directory as live555mediaserver.exe.

2Open VLC plaer, enable Network streaming, and enter RTSP, as shown in figure

3Click play to start playing, as shown in figure

 

 
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.