I'm currently learning how to use SRS and I believe it will mostly fit my needs. However, I need to be able to create a VOD (video on demand) of the user's live video. How would I accomplish this?
Thanks!
AJ
SRS is a realtime server, design for life streaming and WebRTC. While VoD(Video on Demand) is delivered by file-based web server, like Nginx or ATS, because Vod is actually files, whatever HLS, MP4 or DASH.
Very glad SRS fits your need, and you really need a set of tools to build your video platform, which normally should support live streaming, video conference and VoD.
Apart from Vod, the HLS for live streaming, should also be delivered by file based servers, because HLS is also file based protocol, see NGINX HLS Cluster, although it's generated by SRS or FFmpeg.
Let's see the stream flow:
Encoder -RTMP-> SRS -+-> RTMP/HTTP-FLV --------> Live Player(flv.js/fijkplayer)
FFmpeg/OBS |
|
|
+--RTMP-> FFmpeg -> HLS/MP4 --+
| | (file-based) (Live/Vod)
+-->HLS/FLV/MP4---->----------+-> web servers --> Player
Please keep in mind that:
SRS is designed for streaming, like RTMP/HTTP-FLV/WebRTC/SRT etc.
Although SRS could covert RTMP to HLS/FLV/MP4, but FFmpeg also could do this, and please use file-based web server like Nginx or ATS to deliver the files of HLS/DASH, see NGINX HLS Cluster.
VoD should directly use file-based web server to deliver, it's simple, see NGINX HLS Cluster. Please never use SRS to do this.
Related
I'm trying to stream the video of my C++ 3D application (similar to streaming a game).
I have encoded an H.264 video stream with the ffmpeg library (i.e. internally to my application) and can push it to a local address, e.g. rtp://127.0.0.1:6666, which can be played by VLC or other player (locally).
I'm not particularly wedded to h.264 at this point, or rtp. I could send as srtp if that would help.
I'd like to use WebRTC to set up a connection across different machines, but can't see in the examples how to make use of this pre-existing stream - the video and audio examples are understandably focused on getting data from devices like connected web cams, or the display.
Is what I'm thinking feasible? I.e. ideally I'd just point webRTC at my rtp://127.0.0.1:6666 address and that would be the video stream source.
I am writing out an sdp file as well which can be read by VLC, could I use this in a similar way?
As noted in the comment below there is an example out there using go to weave some magic that enables an rtp stream to be shown in a browser via webRTC.
I am trying to find a more "standard" way to be able to set the source of a video track in webRTC to be the URL of an encoded stream. If there isn't one, that is valuable information to me too, as I can change tack and use a webrtc library to send frames directly.
Unfortunately FFMPEG doesn't support WebRTC output. It lacks support for ICE and DTLS-SRTP.
You will need to use a RTP -> WebRTC bridge. I wrote rtp-to-webrtc that can do this. You can do this with lots of different WebRTC clients/servers!
If you have a particular language/paradigm that you prefer happy to provide examples for those.
I have a Dahua IP camera with a microphone. I would like to get the audio stream playing on a website like a live radio.
I have a raspberry pi which I was planning to use with ffmpeg, but I haven't had much success in bridging the gap between that and my website to form an audio stream.
Can this be done via sftp/ftp with mp3 files and some fancy php/javascript to play like a live radio?
Do I need to use another service? (would like to minimise costs as much as possible!)
Thanks!
Peter
Browsers can't play RTSP source directly so you need a streaming server to get the RTSP stream and convert it to something suitable for HTML5 playback (HLS/DASH).
This can be done with Wowza SE (the free developer license could be used for 10 subscribers).
You can see how this works with the VideoNow.Live - IP Camera Restreaming feature and see how this is done by taking a peek at the open source code of the Live Streaming HTML5 RTSP WP plugin that powers that solution.
I have an IP camera which sends out a live stream in RTSP over UDP and I want to display this stream in the browser, and I want it to work on the major browsers and on mobile (both iOs and Android). To achieve this I want to convert the stream to HTTP Live Streaming (HLS) on the server before sending it to the client. Now I've read that not very long ago Apple added support for fragmented MP4 (fMP4) as format for the stream, whereas normally the stream would be sent in MPEG-TS format. And fMP4 is also the format that MPEG-DASH supports, and MPEG-DASH might be the industry standard in a few years.
Now my question is, what the advantages and disadvantages of both fMP4 and MPEG-TS are?
EDIT: According to the technical notes for HLS from Apple, live streams must be encoded as MPEG-TS streams (https://developer.apple.com/library/content/technotes/tn2224/_index.html#//apple_ref/doc/uid/DTS40009745-CH1-ENCODEYOURVARIANTS). Is there a reason for this or is this information outdated?
fMP4 is likely to replace TS as a standard. It has less overhead and is required for HEVC, but the main advantage is compatibility with DASH - i.e. you can generate both HLS and DASH using the same files, which helps with compute and storage costs. For your particular use case, HLS TS probably has the more coverage (due to old devices and players) than HLS fMP4, but HLS+DASH fMP4 is what I would choose.
Preface
I have read this two part tutorial (Part-1 and Part-2) by Steamroot on MPEG-DASH, and below is my understanding (please correct me if I am wrong):
The video needs to be encoded into multiple bit-rates using FFmpeg.
The encoded videos need to be transcoded (dashified) using MP4Box.
The dashified videos can be served using a web server.
Problem
I intend to live-stream an event and I need help to understand the following:
Can I club the FFmpeg and MP4Box commands into a single step? Maybe through a wrapper program so that I do not have to run them separately? Is there any other or better solution?
How do I send the dashified content to the web server? FTP? Would any vanilla web server do?
Lastly, a friend had hinted that I could also use GStreamer to achieve my objective. But, I could not find any good resource on the internet for the same. So, where (and how) does GStreamer fit in the above process?
What is the format you will be getting out of your camera for your live-event? There are a lot of solutions a lot more adapted for live streaming (the tutorial I wrote is for VOD streams only). You can check out simple solutions like Wowza Streaming Server, Nible streamer (free), etc, that take a RTMP stream and transform it into other formats (HLS, DASH, etc...).
Most of the livestreaming platforms can even do that for you (livestream.com, youtube, twitch, or even facebook now)
The dashified content will be requested as HTTP ressources by the browser or other players. In the case of a VoD stream, indeed you just need to make the dash segments available through a web-server. For live content, you need something smarter, that will encode, package the segments and make them available on the fly.
Gstreamer can transcode and transmux the original content, and can do it on the fly. You will be able to get different formats as outputs, like RTMP, HLS, and probably even mpeg-dash. Then you still need to make your content available via a webserver.
In conclusion, if you just want to transmit an occasional live event, it's probably a lot easier a platform that will ingest your RTMP stream and do all the complicated steps for you.
My client has a requirement where he needs me to transcode a source file into a proxy with a unique burn in on it per playback.
For the proxy I will be using ffmpeg, nothing fancy, but ideally the users can play back the file as it is being transcoded since it may take up to several minutes to complete the transcoding.
Another restriction is that the player does not support HLS and other live streaming options and can only accept MP4s as a source.
Any ideas/suggestions would be great.
It seems you have conflicting requirements. mp4 is VERY poorly suited for live streaming. It is 'possible' to create a fake moov and have the player perform byte ranges. But it is very inefficient. You really need a player or platform that supports streaming formats such as fmp4 (fragmented mp4/dash) hls, ts, flv, rtmp, rtc, etc.