According to Wikipedia,
LIVE555 Streaming Media is a set of open source (LGPL) C++ libraries developed
by Live Networks, Inc. for multimedia streaming. The libraries support open
standards such as RTP/RTCP and RTSP for streaming, and can also manage video
RTP payload formats such as H.264, H.265, MPEG, VP8, and DV, and audio RTP
payload formats such as MPEG, AAC, AMR, AC-3 and Vorbis. It is used
internally by well-known software such as VLC and mplayer.
The software distribution also includes a complete RTSP server application,
RTSP clients and a RTSP proxy server.
Live555 is the go to project for many developers when it comes to anything
related to RTSP, be it a client or a server. It is written in C++, nice, clean
and super stable code and on top of that you can extend it very easily. Apart
from that, it comes with few of the tools that includes:
HLSProxy: It converts a live RTSP stream (e.g., from a network camera) into a set of HLS (“HTTP Live Streaming”) segments that can be viewed in a HLS-compliant browserMediaServer: It is a complete RTSP server application. It can stream several kinds of media file.ProxyServer: It is a unicast RTSP server - built from the “LIVE555 Streaming Media” software - that acts as a ‘proxy’ for one or more ‘back-end’ unicast or multicast RTSP/RTP streams
In this post I will be talking about, building live555 and using Live555 Media
Server for streaming local video files over RTSP.
To build Live555:
Download and extract the source code.
curl -o live555-latest.tar.gz http://www.live555.com/liveMedia/public/live555-latest.tar.gz tar -xvf live555-latest.tar.gzGenerate
Makefile. Live555 does not use tools likeautomakeorcmakeit has it’s own scripts to generate build files.cd live ./genMakefiles <os-platform>In this case the script
genMakefilesis a shell script, that concatenates multiple parts of aMakefile. Here the first argument to this script<os-platform>is actually the os for which you want to buildlive555. (I know this is obivous :P). If in case you are not sure what should be the argument in your case. Check for the file starting withconfig.for your operating system in the same directory. You will seeconfig.freebsd,config.linux,config.macosx-catalinaetc. Find the one for yourosand use that string as the first argument. for example,./genMakefiles linuxOnce this is done, you will find the
Makefilecreated in the same directory. The next step is simple, just build the application.To build and install
live555run:make -j3 sudo make install
Once this is done, you will find the binaries
hlsProxy/live555HLSProxymediaServer/live555ProxyServerproxyServer/live555MediaServer
To stream the video files over RTSP, we have to use live555MediaServer.
live555MediaServer supports following formats
.264=> aH.264Video Elementary Stream file.265=> aH.265Video Elementary Stream file.aac=> anAACAudio (ADTS format) file.ac3=> anAC-3Audio file.amr=> anAMRAudio file.dv"=> aDVVideo file.m4e=> aMPEG-4Video Elementary Stream file.mkv=> aMatroskaaudio+video+(optional)subtitles file.mp3=> a MPEG-1 or 2 Audio file.mpg=> a MPEG-1 or 2 Program Stream (audio+video) file.oggor.ogvor.opus=> an Ogg audio and/or video file.ts"=> a MPEG Transport Stream file (a.tsxindex file - if present - provides server ‘trick play’ support).vob=> aVOB(MPEG-2 video with AC-3 audio) file.wav=> aWAVAudio file.webm=> aWebMaudio(Vorbis)+video(VP8) file
Unfortunately this tool does not stream an .mp4 file.
If you want to stream a video which is an mp4 file, you can
convert it very easily from to .mkv or .webm using ffmpeg, the command is
as follows.
ffmpeg -i <input-mp4-file-name>.mp4 -o <output-mkv-file-name>.mkvor
ffmpeg -i <input-mp4-file-name>.mp4 -o <output-webm-file-name>.webmOnce you have converted the video file to the appropriate format that live555 can stream, you are good to go.
just go to the directory containing your video file and run
./live555MediaServerTo access this stream using your RTSP client in my case I use the
VLC, link will be as follows (you will find these
details in the live555MediaServer’s output also.)
rtsp://<your-ip>:8554/<filename>
for example your ip is 192.168.1.4 and the filename is video_file.mkv
then your rtsp link will be
rtsp://192.168.1.4:8554/video_file.mkv
So; in conclusion, Live555MediaServer is a great tool if you want to stream
your video files over RTSP.
sources: