Multimedia Development --- compile, use, and test under live555 vs2010/vs2013

Source: Internet
Author: User
Tags visual studio 2010
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/(official website)

 

Iii. Compilation Step 1 (command mode in win7)

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:

call "E:\Program Files\Microsoft Visual Studio 10.0\VC\vcvarsall.bat"cd liveMedianmake /B -f liveMedia.makcd ../groupsocknmake /B -f groupsock.makcd ../UsageEnvironmentnmake /B -f UsageEnvironment.makcd ../BasicUsageEnvironmentnmake /B -f BasicUsageEnvironment.makcd ../testProgsnmake /B -f testProgs.makcd ../mediaServernmake /B -f mediaServer.mak

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

6. Compilation result:

6-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

 

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

 

DescriptionMing: If you want to use vs2010 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 (win7 + vs2010)

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. Set the project output directory.

  Path: E: \ My document \ Visual Studio 2010 \ projects \ mylive555 \ Lib

  Method: Project-"properties-" General-"output directory

5. Compile the solution

  Result: Generate basicusageenvironment. Lib, groupsock. Lib, usageenvironment. Lib, and livemedia. Lib under the lib directory.

 

Download the compiled live555 (Lib and header file)

  Method 1The environment is win7, including the compiled live555, extracted 4 Lib, mylive555header, and.Download(SLAM)

  Method 2, Environment win7 + vs2010, including the entire project,Download(SLAM)

 

Iv use instance

1. Add a database

① Step 1:

Method 1. Copy the four library libraries generated by compilation to "*: \ Program Files \ Microsoft Visual Studio 10.0 \ Vc \ Lib"

Method 2. Copy the four library libraries generated by compilation to the CPP file of the current project.

Method 3: add the four lib libraries generated by compilation to the project as global libraries.

② Step 2:

Method 1. Fill in [menu] "Project-> properties-> Configuration properties-> connector-> input-> additional dependencies"

"Libusageenvironment. Lib; liblivemedia. Lib; libgroupsock. Lib; libbasicusageenvironment. Lib; ws2_32.lib"

Another reminder: In vs2010, multiple lib libraries must be separated by semicolons or carriage return. It cannot be used with spaces. Remember! Believe it or not, I have been here for a while, and I am not here ~

  Method 2. Pragma Method  

#pragma comment (lib, "Ws2_32.lib")  #pragma comment (lib, "libBasicUsageEnvironment.lib")#pragma comment (lib, "libgroupsock.lib")#pragma comment (lib, "libliveMedia.lib")#pragma comment (lib, "libUsageEnvironment.lib")


2. Add a header file

NOTE: If method 2 is used for compilation, this step can be omitted.

① Step 1: Put all. H files together, such as mylive555header, and then add include

② Step 2:

Method 1. "Project-> properties-> Configuration properties-> C/C ++-> General-> additional inclusion directories"

Method 2: "tools-> options-> projects and solutions-> C ++ directory", select the corresponding platform, and add the required "include files" Directory (this method does not work with vs2010)

 

3 test code

Use the example in testprogs directly. I use testondemandrtspserver. cpp. The test is successful, as shown in figure

 

 

V test live555 Server Mode 1: (use ffplay.exe to play)

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

 

Add the latest live555 (live555.2014.5.14) Project compiled under vs2013 on February 20

: Http://download.csdn.net/detail/zgzhaobo/7376487

 

 

Http://www.cnblogs.com/hummersofdie/archive/2013/04/23/3037184.html

Multimedia Development --- compile, use, and test under live555 vs2010/vs2013

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.