James
James

Reputation: 71

How do I prepare a server's file for RTSP streaming?

On my Android client, I have the path of a file on my Java server:

serverVidPathString;

How can I make it so I can stream the server's file using RTSP to the client?

Example for the client code:

urlVid = "rtsp://"+serverVidPathString;
Uri video = Uri.parse(urlVid);
videoView.setVideoURI(video);
videoView.start();

Upvotes: 1

Views: 600

Answers (1)

Mick
Mick

Reputation: 25471

RTSP (Real Time Streaming protocol) just used to set up and control the streaming session.

It allows the client and the server describe the stream and the types of stream the client can play, and also allows the client issue commands like Play, Pause etc.

The actual media, video in your case, is not sent over RTSP - it is sent via a separate transport protocol such as RTP (Real Time Transport Protocol).

Taking a step back, if your video is a static video file, i.e. not a live stream, you may find it easier to simply use HTTP streaming to serve the file, or if you really need it one of the ABR (Adaptive Bit Rate) protocols, although the complexity rises here again.

You can set up a very simple static server using node to test this and then test the URL from this simple server in your Android app - there are several examples available such as:

You will want to make sure that 'acceptRanges' option is set to true - this allows the client to download the video chunk by chunk so it can tart playback immediately, rather than wait for the whole file to download.

Upvotes: 1

Related Questions