I have to build a test server (C++ application) to familiarize with the RTSP implementation of the GStreamer library.
My task is to make something like this:
MP4 video file ==> RTSP application ==> Network stream ==> VLC Client which reproduces the video.
I think it's one of the simplest things for this library, it's like an "Hello World" of RTSP, however, i cannot find an example of this.
How may i accomplish this? Where may i find a quick step-by-step explanation of the GStreamer operation?
Cheers
Related
How can I get RTSP stream on server from WebRTC and then use it for my own purposes, for example, to retranslate it somewhere. Maybe there is some solution or library?
Any help is much appreciated!
Denis
If you are willing to hook into the webrtc code then this can be done easily by doing the following:
Build a native webrtc C++ client on server
If the codec used is H.264, tap the output (encoded frames) from H264 RTP receiver.
Use a third party library such as (http://www.live555.com/openRTSP/) to build a RTSP server out of it.
If vp8, you might as well tap the output of vp8 decoder and then use ffmpeg to create rtsp stream out of it. Or consider webm may be?
Looking for something I know exists but I have not found it yet. I am able to download the rtmp stream and save it to a file, but my goal is to download the steam and play it without saving it. I have learned that an mp4 will not play until a download is complete so this does me no good. Any help on sending the rtmp stream to an hls or something a roku player would recognize is greatly appreciated.
Thanks
-UPDATE-
It is possible. I have used a bat file to run rtmpdump and ffmpeg to pull a live stream to a private channel. Don't have all the bugs out yet but working on it. The bat is called from cgi script on my server.
No way. i tried alot but i didn't find a way. There is a program called wowza.You can try that.But you cannot turn your computer off,or you can upload to amazon cloudfront.It will cost you some money.
I need to develop an app what is capable of receiving a RTSP Stream.
I tried to find solutions/tutorials in the internet for the whole day now, but without any success.
I read a lot about using FFMPEG or Live555 (more FFMPEG, also I read that Live555 is not necessary when using the newest version of FFMPEG), but nowhere I looked it was described in a form I could understand, when I found questions on stackoverflow the answers were really short and I could not figure out what they tried to explain.
So now I need to ask myself.
I used "Homebrew" to download and install FFMPEG, now when I look at my dir /usr/local/
I can see this, the installed files are contained in subfolders of "Cellar"
I also tried to have a look at these projects:RTSPPlay by Mooncatventures and kxmovie by kolyvan.
I did not really figure out how to work with these projects, the Documentation is indefinite and "murky".
Well, when I tried to compile these projects the kxmovie failes with errors that are like "missing avformat.h",
I added the dylibs from the usr/local/cellar/ffmpeg/1.2.1/lib to the project but it seems that this is not the right method.
Nearly the same Issue with the RTSPPlay xcodeprj, it gives back the error that an "Entitlements.plist" is missing, after removing the linkings to that file completely I am getting 99+ Apple Mach-O Linker Errors, honestly I could not understand why.
I wanted to try the Live555 too but I cant see through all these obscure and confusing files, again I could not oversee the documentation and how to build the libraries for iphoneos (I read it is the easiest way to receive RTSP Stream but it was the same stack of confusing files as the other projects had)
Maybe if someone tried with these Projects or developed an Application himself could help me with his/her SourceCode or if somebody is seeing through all the Content of FFMPEG / Homebrew made dir's he/she could maybe explain me how to use it, that would probably help me and all the other desperate developers who are searching for a solution.
Just a little edit: I am trying to receive a RTSP H.264 decoded Video Stream.
Thanks in advance, Maurice Arikoglu.
(If you need any kind of SourceCode, Links, ScreenShots etc. please let me know)
For anyone who is searching for a working RTSP Player Library have a look at Durfu's Mooncat Fork I've found online, it is working perfectly fine on iOS 8. There is a sample code included, if you struggle with the implementation I can help you.
I've examined many of those projects that you mentioned, and experienced on those well..
You can use ffmpeg libraries to make a rtsp streaming client, as ffmpeg supports rtsp protocol... But there is an important issue which I've seen in my tests that ffmpeg's rtsp protocol has some important issues when using UDP transport layer for streaming... Even with the latest version (2.01) many RTP packets are dropping during streaming so images become glitchy sometimes... If you use TCP or http transport layer, then it works well...
For live555 project, this library works well with both UDP and TCP transports when streaming rtsp streams.. But ffmpeg is so much powerful/has many capabilities than live555.
If you decide to use ffmpeg then, basically, you should follow the below steps,
make a connection - avformat_open_input
find audio/video codecs - avcodec_find_decoder
open audio/video codecs - avcodec_open2
read encoded packets from file/network stream in a loop - av_read_frame
A.
a. decode audio packets - avcodec_decode_audio4
b. fill audio buffers with audiounit/audioqueue framework
B. a. decode video packets - avcodec_decode_video2
b. convert yuv pictures to rgb pictures - sws_scale or opengles shaders
good luck...
most browsers can directly display a HTTP MJPEG Stream... while they can´t display h.264 via RTSP without the help of plugins...
I have a security cam that can only stream h.264 via RTSP so I can´t view the live video on my browser (nor iPhone etc.) and I do not want to install any APPs or Plugins...
But I have a Linux Server... I would like to retrieve the h.264 on my server and restream it in MJPEG, so I can browse to my server and see the MJPEG stream via HTTP...
After three days googling around and trying a lot with live555, ffmpeg, VLC and other tools I still did not get it running...
What is the right way to achieve my goal (with free tools like ffmpeg, live555 or whatsever needed...)?
thanks for any help.
I found the answer by myself... using vlc it was important to use quotation marks :sout'....' which I did not know... now it works as expected..
These days, I was researching the software architechture for iPhone Streaming (Base on MMS protocol).
As we know, in order to playback MMS audio stream, we should call libMMS to read wma stream data from remote media server, and then call FFmpeg to decode the stream data from wma format into PCM data buffer, and finally, enqueue the PCM data buffer into iPhone’s audioqueue to generate real sound.
The introduction above just describe the working process of iPhone streaming. If we only need to implement this simple functionality, that is not difficult. Just follow the introduction above to call libMMS, FFMpeg and audioqueue step by step, we can achieve the streaming function. Actually, I have implemented the code last week.
But, what I need is not only a simple streaming function! I need a software architechture makes FFmpeg accessing libMMS just like accessing local filesystem!
Does anybody know how to hook the libMMS interfaces like mms_read/mms_seek onto FFmpeg filesystem interfaces like av_read_frame/av_seek_frame?
I think I have to answer my own question again this time……
After several weeks reseach and debuging, I got the truth finally.
Actually, we don’t need to “hook” libMMS onto FFMpeg. Why? Because the FFMpeg already has its native mms protocol process module “mms_protocol” (see in mms_protocol.c in FFMpeg).
All we need to do is just configuring the FFMpeg to enable the mms module like this (see in config.h in FFMpeg):
#define ENABLE_MMS_PROTOCOL 1
#define CONFIG_MMS_PROTOCOL 1
After this configuration, FFMpeg will add mms protocol into its protocol list. (Actually, the protocol list has already contained “local file system protocol”). As result, the FFMpeg could be able to treat the “mms://hostserver/abc” media file like local media file. Therefore, we can still open and read the mms media file using:
av_open_input_file();
av_read_frame();
like we did on local media file before!
By the way, in my ffmpeg version, there are still many bugs in libAVFormat module for proccessing mms protocol. It took one week for me to debug it, however, I think it will be much shorter for the guy as smart as you:-)