Video-On-Demand (VOD) is a subscriber paradigm wherein users can select a pre-recorded stream to watch if and when they wish to do so. As opposed to live streaming content, VOD content is stored on the streaming server, or on a CDN (see Using AWS S3 for Video On Demand, for on-demand consumption.
No special configuration changes are required to get VOD working with Red5 Pro. VOD works out of the box with Red5 Pro.
Setting up video on demand using Red5 Pro is a very simple process. To complete the setup successfully you would need a few simple basic components:
To record a file using a mobile client using the Red5 Pro Streaming SDK, set
R5Record type to Record instead of Live.
Using the Red5 Pro iOS Streaming SDK:
self.publishStream!.publish(Testbed.getParameter("stream1") as! String, type: R5RecordTypeRecord)
Using the Red5 Pro Android Streaming SDK:
To record with Flash or WebRTC, set
record instead of
live. See the HTML5 SDK docs for more information.
You will find a
/streams directory listed under the app directory you are publishing to. For example, if you publish to a webapp called vod, you will see this directory in
/webapps/vod/streams. While you are publishing/recording, you will see the placeholder files (
And, when you stop broadcasting, there will be a Flash Video (flv) file in the directory with your stream name (i.e.,
You can convert the
flv file to an
mp4 file using transcode post processing.
In addition to the FLV, mobile and WebRTC clients will automatically record an HLS stream (for Flash, you need to force HLS recording).
Red5 Pro supports the following media formats for streaming:
In order for Red5 Pro to be able to stream a recorded media to client, it needs to be in a format understood by Red5 Pro, supported by the protocol used (RTMP/RTSP) and also readable by the client side player.
A file format is like a container which holds audio and/or video data in a single file. Each file format in turn allows storing data encoded in specific codecs only. To keep things simple, we won't be venturing into the depth of codecs and encoding here. Let us, however, take a look at the basic video formats that are compatible with Red5 Pro and the codecs they support.
Commonly used video formats for VOD transmission:
If you want to subscribe to your recorded stream using the Red5 Pro client SDK, you simply need to include the file extension (so "stream.flv", or "file.mp4") when calling the subscribe method.
The client is smart enough to look for the recorded file in the "streams" subdirectory if you include a file extension. Without the extension, it assumes the stream is live.
You can view the list of available
flv files in the live streams directory by visiting
You can also view the available
HLS (m3u8) files by visiting
You can also use a desktop player such as VLC to subscribe to a recorded file. VLC can subscribe to FLV, MP4, and HLS video on demand.
With VLC media player, Open Media
Go to the Network Tab, and type in the URL of your stream (for example,
then press open to view.