Compile Live555 using VS2005 Part 2
Part 1 gives you instruction on how to build Live555 in command. However, you will have to perform debug attached VS2005 with Live555 source code to running Live555MediaServer Process. This can be troublesome.
Part 2 gives you instruction on how to build Live555 as a VS2005 Project. I am assuming that you have some knowledge on VS2005 environment (create solution, add project, etc...)
1. Create an empty VS2005 C++ Solution as Live555
2. Within the Live555 solution, add 4 sub projects to Live555 solution
3. The naming of the sub-project is preferred to follow live555 naming as shown
Part 2 gives you instruction on how to build Live555 as a VS2005 Project. I am assuming that you have some knowledge on VS2005 environment (create solution, add project, etc...)
1. Create an empty VS2005 C++ Solution as Live555
2. Within the Live555 solution, add 4 sub projects to Live555 solution
3. The naming of the sub-project is preferred to follow live555 naming as shown
5. Now, copy each live555 folder into respective sub-project. From here, I will do an example for BasicUsage Environment project
6. Next, include all the file to BasicUsageEnvironment vcproj. Also, add additional include library.
7. Repeat step 5 and 6 for Groupsock, LiveMedia and UsageEnvironment.
8. For simplicity, compile each sub-project with project only build menu. This will help you to figure out any missing include file per sub-project basis.
9. If you manage to compile all 4 sub-project successfully, it is time to work on Live555 main project. Include only the following files at Live555 as this example only interested in build Live555MediaServer
10. Mark Live555 as main project and set the 4 sub-projects as project dependencies.
11. Include additional library
12. Include wsock32.lib as linkage dependency
13. Put a debug point at live555MediaServer.cpp main(), then, press F5 to compile and run in debug mode. The project should compile successfully and pause at the debug point. If you continue the program, it will run as command prompt application of Live555MediaServer.
14. If you want to build other testProgs, you will have to create separate project for each of the test application because each testProgs are standalone application
can you give me solution project?
ReplyDeletei tried using your way i can successfully build all subproject.when i debug live555 i am getting error
ReplyDelete1>------ Build started: Project: Live555, Configuration: Debug Win32 ------
1>DynamicRTSPServer.obj : error LNK2019: unresolved external symbol "protected: static int __cdecl RTSPServer::setUpOurSocket(class UsageEnvironment &,class Port &)" (?setUpOurSocket@RTSPServer@@KAHAAVUsageEnvironment@@AAVPort@@@Z) referenced in function "public: static class DynamicRTSPServer * __cdecl DynamicRTSPServer::createNew(class UsageEnvironment &,class Port,class UserAuthenticationDatabase *,unsigned int)" (?createNew@DynamicRTSPServer@@SAPAV1@AAVUsageEnvironment@@VPort@@PAVUserAuthenticationDatabase@@I@Z)
1>DynamicRTSPServer.obj : error LNK2019: unresolved external symbol "protected: __thiscall RTSPServer::RTSPServer(class UsageEnvironment &,int,class Port,class UserAuthenticationDatabase *,unsigned int)" (??0RTSPServer@@IAE@AAVUsageEnvironment@@HVPort@@PAVUserAuthenticationDatabase@@I@Z) referenced in function "private: __thiscall DynamicRTSPServer::DynamicRTSPServer(class UsageEnvironment &,int,class Port,class UserAuthenticationDatabase *,unsigned int)" (??0DynamicRTSPServer@@AAE@AAVUsageEnvironment@@HVPort@@PAVUserAuthenticationDatabase@@I@Z)
1>DynamicRTSPServer.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall Medium::isSource(void)const " (?isSource@Medium@@UBEIXZ)
1>DynamicRTSPServer.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall Medium::isSink(void)const " (?isSink@Medium@@UBEIXZ)
1>DynamicRTSPServer.obj : error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall Medium::isRTCPInstance(void)const " (?isRTCPInstance@Medium@@UBEIXZ)
It seems that your live555 have some code missing. From the error, it seems that you does not have LiveMedia. In particular, RTSPServer.cpp in LiveMedia
ReplyDeleteare you interested to watch my project. on that case i will send you the project.
ReplyDeletei have built LiveMedia successfully as static library and also it contains RTSPServer.cpp
ReplyDeleteWhat I do is to include all source code into a single VS project. May be, you should try to compile everything as 1 solution.
ReplyDeleteI don't mind seeing your project. Just tell me what you want to do with it and where to get your project. But, I may take some time.
Or, if you want my project, I can provide you. However, it is April 2010 code. Just tell me your choice
sure it will be better me if you send your project to me. i am waiting
ReplyDeleteHere you go. Please note that the link will expires in February 13, 2011
ReplyDeletehttps://www.yousendit.com/download/MzZINnFOdEM1UjQwTVE9PQ
thanks again..i have run it. it is working ..can you help me one thing? when i run program from testPrgos/testMPEG4VideoStreamer or testH264VideoStreamer program it is running perfectly but when i try to streaming using vlc or quicktime it is showing unsupported transport...can you help me?
ReplyDeletehi,,have you tried to play H264 video streaming using testH264VideoStreamer? i have tried using quictimeplayer and also using vlc player but it is showing unsupported transport in rtsp session.....? can you help me
ReplyDeleteI tried testMpeg4VideoStreamer and it works fine for me.
ReplyDeleteCan you try the m4e files from http://www.live555.com/liveMedia/public/m4e/
Your testMpeg4VideoStreamer RTSP URL should be RTSP://ip:8554/testStream by default
You said that VLC and quicktime shown unsupported transport.. Do you have any idea what is the SETUP RTSP message?
Also, please remember to change your filename at testMpeg4VideoStreamer.cpp
char const* inputFileName = "wwe.m4e";
Hi, I have to work with the live555...I had the same errors of irfan in compiling solution.
ReplyDeleteCould you send me the project, please?
Do you try to convert that project in VS2008?
There you goes. Please note that the expiry date is March 07, 2011 05:05 PST
ReplyDeletehttps://www.yousendit.com/download/T2pHb2VNNDJlaFJFQlE9PQ
Sorry, I never try to convert to VS2008.
This comment has been removed by the author.
ReplyDeleteThere has to be something missing in these steps. I am also coming up with the linking issue that everyone else had. sigh
ReplyDeleteStatic library does not need to link. So, you will not see linkage issue.
ReplyDeleteWhen create a exe, it will perform code linkage and if you have missing code or library during linkage, it will have your error.
Those linkage errors will hint what you are missing. I use hint because it is quite frustrating to see linkage error.
Hi Thompson, I am still facing irfan's and sancho's problem.. the linking error is the same:
ReplyDeleteerror LNK2019: unresolved external symbol "protected: static int __cdecl RTSPServer::setUpOurSocket(class UsageEnvironment &,class Port &)" (?setUpOurSocket@RTSPServer@@KAHAAVUsageEnvironment@@AAVPort@@@Z) referenced in function "public: static class DynamicRTSPServer * __cdecl DynamicRTSPServer::createNew(class UsageEnvironment &,class Port,class UserAuthenticationDatabase *,unsigned int)" (?createNew@DynamicRTSPServer@@SAPAV1@AAVUsageEnvironment@@VPort@@PAVUserAuthenticationDatabase@@I@Z)
and so on..
this is weird because if I click with "Go to Definition" on setUpOurSocket, the code can also find the line into RTSPServer.cpp.. can you help me getting rid of this weird error?
I've successfully compiled all the .lib projects as you've described!
Hi PaulWalker,
ReplyDeleteEven if you can find the RTSPServer.cpp via VS "Go to Definition", your library could still miss RTSPServer on linker level.
Some random ideas...
1. You are using DynamicRTSPServer. Can you build Live555 project successfully and the live555.exe created successfully?
2. If you are using VS2010, please check your property page -> Common Properties. Do you have BasicUsageEnvironment, Groupsock, LiveMedia and UsageEnvironment as reference? If yes, please check all of them if their Project reference properties - > Link Library Dependecies is TRUE.
3. Go to Solution properties -> Common Properties -> Project Dependencies. Check if you Live555 project depends on BasicUsageEnvironment, Groupsock, LiveMedia and UsageEnvironment?
4. Since you say that you can compiled all sub libraries, the next alternative is, can you try explicitly putting your library into linker -> input -> Additional Dependency?
Point 2) fixed my problem, thank you!!
ReplyDeleteI've been using VS for a while but never experienced such a problem, and I thought the "framework and references" screen was only for managed code.. you are totally right!
Nice!! It is good that it helps.
ReplyDeleteI'm working at VS2008, everything seems to be fine until I build LiveMedia solution, then I get 7 errors at Locale.cpp, like this:
ReplyDelete1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(37) : error C2065: 'LC_ALL' : undeclared identifier
1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(38) : error C2065: 'LC_NUMERIC' : undeclared identifier
1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(40) : error C2065: 'NULL' : undeclared identifier
1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(40) : error C3861: 'setlocale': identifier not found
1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(41) : error C3861: 'setlocale': identifier not found
1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(54) : error C2065: 'NULL' : undeclared identifier
1>c:\users\au79\documents\rtsp\live\livemedia\locale.cpp(55) : error C3861: 'setlocale': identifier not found
Why are those? I'm definitly a newbie!
The rest of solutions work fine.
Can you help me? Thank you ahead.
My only advice to you is to search the solution for LC_ALL, LC_NUMERIC, etc.. in the solution and check if they are defined.
ReplyDeleteif not, you can try defining
#define LC_NUMERIC 4
#define LC_ALL 0
in your solution
i added the header files and source files in only BasicUsageEnvironment folder in my project(VS 2010 express) and build only BasicUsageENvironment.but it is giving me an error
ReplyDelete1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\live5555\Debug\live5555.exe : fatal error LNK1120: 1 unresolved externals
what should i do?
Have you added all the library dependencies before building the BasicUsageEnvironment project?
DeleteIt seems like you have missing some lib files during linkage.
when i ran the project as said above i get the following errors
ReplyDelete1>------ Build started: Project: UsageEnvironment, Configuration: Debug Win32 ------
2>------ Build started: Project: LiveMedia, Configuration: Debug Win32 ------
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
1>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\livetry\Debug\UsageEnvironment.exe : fatal error LNK1120: 1 unresolved externals
3>------ Build started: Project: GroupSock, Configuration: Debug Win32 ------
3>libgroupsock.lib(NetInterface.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in Groupsock.obj
3>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
3>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
3>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\livetry\Debug\GroupSock.exe : fatal error LNK1120: 1 unresolved externals
2>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
2>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
2>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\livetry\Debug\LiveMedia.exe : fatal error LNK1120: 1 unresolved externals
4>------ Build started: Project: BasicUsageEnvironment, Configuration: Debug Win32 ------
4>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
4>MSVCRTD.lib(crtexe.obj) : error LNK2019: unresolved external symbol _main referenced in function ___tmainCRTStartup
4>c:\documents and settings\administrator\my documents\visual studio 2010\Projects\livetry\Debug\BasicUsageEnvironment.exe : fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 4 failed, 1 up-to-date, 0 skipped ==========
Actually, another though is that what VS project did you used for VS?
ReplyDeleteDid you create a Console project during VS project creation?
Ya i created a console based empty project in VS 2010 express...
ReplyDeleteYa i have added all the libraries
sir i also try to make a HTTP streaming project using the files(given in live media library)
ReplyDeleteByteStreamMemoryBufferSource.cpp,RTSPServerSupportingHTTPStreaming.cpp,DynamicRTSPServer.cpp,live555MediaServer.cpp
i didnt change any of the following file
But when i build the project by pressing F5 and open the stream using url http://ip address:portno/file name(.ts)
i give an heap corruption error.
What wrong i have done?Please guide me
Ok.. it seems that you are now able to compile your solution without link issue.
ReplyDeleteIf you never change those file, all I can say is look at the file that you input the URL string.
Or, are you using the command line application? If yes, which one are you using?
Which version of Live555 are you using? In the past, latest version of Live555 does not mean the best and work by default.
sir i had an query in my another code where do i ask that from you?
ReplyDeleteYou could post at this thread if related to live555
ReplyDeletesir i want to know i u have or know any link related to parsing of h264 file....so that i can know where its header start,its NAL unit....
ReplyDeleteH264 file as in mp4, raw data or?
ReplyDeleteDoes this post help http://thompsonng.blogspot.com/2010/11/mp4-file-format-part-2.html?
Hello sir
ReplyDeleteis there any way to know how to find out how much time does the live media server takes to stream a file an a URL and how much data does it send in a second ? and
how many bytes does live media server send each time while streaming?
I am assuming that you are talking about RTSP protocol.
ReplyDeleteYou should take a look at RTPTransmissionStats class.
http://www.live555.com/liveMedia/doxygen/html/classRTPTransmissionStats.html
Base on those information, you can calculate those information from total octet count, round trip delay, etc..
Sir i am not an experienced in the live media can u just guide me what file s should i add to a solution to find the time that live media server takes to stream a file an a URL and how much data does it send in a second ? and
ReplyDeletehow many bytes does live media server send each time while streaming?
I would be very thank full to you,i am in learning stage as i m an student
To use RTPTransmissionStats, you need to include RTPSink.cpp
ReplyDeleteAnd, you should have access to SimpleRTPSink in your program.
So, for your questions
1. Find time that the server take to stream a file
All you can do is take the time when you start the socket (RTPSink::startPlaying) and the time when you end the socket (RTPSink::stopPlaying). That should give you the time taken to play the file.
2. How much data send in second
You need to keep a time when start playing. For example, record time when RTPSink::startPlaying. Then, create a method that calculate data send per second as RTPSink::octetCount / (curTime - startTime)
3. How many bytes does server send.
That should be just RTPSink::octetCount()
Sir, I did all the things exactly like you said, but there are still some linker problems. They look like this:
ReplyDeleteError 2 error LNK2019: unresolved external symbol _initializeWinsockIfNecessary referenced in function "protected: __thiscall BasicUsageEnvironment::BasicUsageEnvironment(class TaskScheduler &)" (??0BasicUsageEnvironment@@IAE@AAVTaskScheduler@@@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\BasicUsageEnviroment.lib(BasicUsageEnvironment.obj) Live555
Error 3 error LNK2001: unresolved external symbol _initializeWinsockIfNecessary c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(GroupsockHelper.obj) Live555
Error 4 error LNK2019: unresolved external symbol _our_inet_addr referenced in function "public: __thiscall NetAddressList::NetAddressList(char const *)" (??0NetAddressList@@QAE@PBD@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(NetAddress.obj) Live555
Error 5 error LNK2001: unresolved external symbol _our_inet_addr c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(GroupsockHelper.obj) Live555
Error 6 error LNK2019: unresolved external symbol _our_srandom referenced in function "unsigned int __cdecl ourIPAddress(class UsageEnvironment &)" (?ourIPAddress@@YAIAAVUsageEnvironment@@@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(GroupsockHelper.obj) Live555
Error 7 error LNK2019: unresolved external symbol _our_random referenced in function "unsigned int __cdecl chooseRandomIPv4SSMAddress(class UsageEnvironment &)" (?chooseRandomIPv4SSMAddress@@YAIAAVUsageEnvironment@@@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\Groupsock.lib(GroupsockHelper.obj) Live555
Error 8 error LNK2001: unresolved external symbol _our_random c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTPSink.obj) Live555
Error 9 error LNK2001: unresolved external symbol _our_random c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTCP.obj) Live555
Error 10 error LNK2019: unresolved external symbol _our_random32 referenced in function "protected: void __thiscall RTSPServer::RTSPClientConnection::handleRequestBytes(int)" (?handleRequestBytes@RTSPClientConnection@RTSPServer@@IAEXH@Z) c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTSPServer.obj) Live555
Error 11 error LNK2001: unresolved external symbol _our_random32 c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTPSink.obj) Live555
Error 12 error LNK2001: unresolved external symbol _our_random32 c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Live555\LiveMedia.lib(RTPSource.obj) Live555
Error 13 error LNK1120: 5 unresolved externals c:\Users\jakub.protasiewicz\Documents\Visual Studio 2012\Projects\live555test\Debug\Live555.exe Live555
What else can I do? Please, help!
Just add Winsock32.lib in libraries
DeleteYou mean wsock32.lib in additional dependencies? Sir, I've already done that.
DeleteAnd it's still the same.
DeleteI was using VS2012. I did the same on VS2005 and it works fine.
DeleteThis comment has been removed by the author.
DeleteWARNING!!! There are some plain .c files (2 of them). Locate and add them! It took me 4 ours to figure it out finally that I only added *.cpp to every project.
DeleteCan you please tell how to find the packet size that we received in open rtsp client and test on demand rtsp server in live555
ReplyDeleteYou could use Wireshark to look at the network level and check what is the rtp packet size sent between RTSP server in live 555 to open rtsp client
ReplyDeletecan we fine ii programmatically?
ReplyDeleteHello sir,can you guide on creation and destroy of rtsp server in a thread that is if thread start we create rtsp server and on thread termination i am able to create rtsp server on thread start but don't know how to destroy it
ReplyDeleteTry using close(rtspServer); where rtspServer is your service instance
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteim using VS2010...i did every step except adding the .lib..because it was not in the project that i downloaded from live555....i get the following error...
ReplyDeleteError 45 error LNK1120: 44 unresolved externals
Error 44 error LNK2001: unresolved external symbol "class DelayInterval const DELAY_SECOND" (?DELAY_SECOND@@3VDelayInterval@@B)
Error 7 error LNK2001: unresolved external symbol "private: virtual bool __thiscall RTSPServer::isRTSPServer(void)const " (?isRTSPServer@RTSPServer@@EBE_NXZ)
Error 11 error LNK2001: unresolved external symbol "protected: virtual bool __thiscall RTSPServer::specialClientAccessCheck(int,struct sockaddr_in &,char const *)" (?specialClientAccessCheck@RTSPServer@@MAE_NHAAUsockaddr_in@@PBD@Z)
Error 12 error LNK2001: unresolved external symbol "protected: virtual bool __thiscall RTSPServer::specialClientUserAccessCheck(int,struct sockaddr_in &,char const *,char const *)" (?specialClientUserAccessCheck@RTSPServer@@MAE_NHAAUsockaddr_in@@PBD1@Z)
Error 13 error LNK2001: unresolved external symbol "protected: virtual class RTSPServer::RTSPClientConnection * __thiscall RTSPServerSupportingHTTPStreaming::createNewClientConnection(int,struct sockaddr_in)" (?createNewClientConnection@RTSPServerSupportingHTTPStreaming@@MAEPAVRTSPClientConnection@RTSPServer@@HUsockaddr_in@@@Z)
Error 14 error LNK2001: unresolved external symbol "protected: virtual class RTSPServer::RTSPClientSession * __thiscall RTSPServer::createNewClientSession(unsigned int)" (?createNewClientSession@RTSPServer@@MAEPAVRTSPClientSession@1@I@Z)
and many such errors
Have you attached the winsock32.lib,ws2_32.lib and liblivemedia.lib?
ReplyDeletewhere and how to attach?
ReplyDeleteHavent you compile the project as giben in the following link http://thompsonng.blogspot.in/search/label/Live555
ReplyDeleteThen you can use live 555 libraries as explained below
Open the project in VS2010 then open the solution explorer then right click the project name(what ever is your project name) go to linker--->Input--->Additional Dependencies add the following
WS2_32.Lib;
WinMM.lib;
..\live.2013.02.11\live\groupsock\libgroupsock.lib;
..\live.2013.02.11\live\BasicUsageEnvironment\libBasicUsageEnvironment.lib;
..\live.2013.02.11\live\UsageEnvironment\libUsageEnvironment.lib;
..\live.2013.02.11\live\liveMedia\libliveMedia.lib;
ya did the procedure as in tat link...I dint do the last two steps alone....I have all the .lib files tat u listed except the first two(WS2_32.Lib,
ReplyDeleteWinMM.lib)...where can I download ??
You don't need to download that,these are the window libraries just write there names as specified in my previous if you want to use these libraries in any of your project
DeleteAnd I get the error as "Error 230 error LNK1104: cannot open file 'libliveMedia.lib' " when i try to link and build it as you said.
ReplyDeleteJust can you tell are you using the live 555 libraries in any project ??
DeleteIf not then u don't need to do that that i said above.
ya I am using...
Deletethanks guys!!!it worked!!!!
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteHi guys. Appreciate and thanks for all the comments and updates.
ReplyDeleteI had updated a part 3 post that based on VS2010 and Live555 2013.02.27 build
Please see http://thompsonng.blogspot.sg/2013/03/compile-live555-using-vs2010-part-3.html
Can you please send me the solution project?
ReplyDeleteThanks.