Rtsp setRate() - Update: working for fast rewind

This forum is about all development around libVLC.
mundu
Blank Cone
Blank Cone
Posts: 53
Joined: 25 May 2011 19:56
VLC version: 2.1.5
Operating System: Linux

Rtsp setRate() - Update: working for fast rewind

Postby mundu » 26 May 2011 00:03

As Vlc rtsp client is based on Live555 rtsp library shouldn't Vlc be able to set a negative rate for fast rewind?

Code: Select all

int libvlc_media_player_set_rate( libvlc_media_player_t *p_mi, float rate ) { if (rate < 0.) { libvlc_printerr ("Playing backward not supported"); return -1; }
Last edited by mundu on 28 May 2011 17:42, edited 1 time in total.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: Rtsp setRate()

Postby Sébastien Escudier » 26 May 2011 08:20

rewind is not supported in vlc.

Rémi Denis-Courmont
Developer
Developer
Posts: 15231
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: Rtsp setRate()

Postby Rémi Denis-Courmont » 26 May 2011 09:21

And probably never will be, as hardly any video file format and codec supports rewinding at a computationally reasonable cost.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Rtsp setRate()

Postby Jean-Baptiste Kempf » 26 May 2011 11:22

It does work with some RTSP servers, like AneVIA"s
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: Rtsp setRate()

Postby Sébastien Escudier » 26 May 2011 11:24

would be nice to have a test url

Jean-Baptiste Kempf
Site Administrator
Site Administrator
Posts: 37523
Joined: 22 Jul 2005 15:29
VLC version: 4.0.0-git
Operating System: Linux, Windows, Mac
Location: Cone, France
Contact:

Re: Rtsp setRate()

Postby Jean-Baptiste Kempf » 26 May 2011 11:46

Ask jpsaman.
Jean-Baptiste Kempf
http://www.jbkempf.com/ - http://www.jbkempf.com/blog/category/Videolan
VLC media player developer, VideoLAN President and Sites administrator
If you want an answer to your question, just be specific and precise. Don't use Private Messages.

mundu
Blank Cone
Blank Cone
Posts: 53
Joined: 25 May 2011 19:56
VLC version: 2.1.5
Operating System: Linux

Re: Rtsp setRate()

Postby mundu » 26 May 2011 16:55

At the moment i'm running a Live555 RTSP server, serving transport stream files. I don't have any test stream available for you guys to test it. I was really expecting vlc to properly rewind a movie due that setRate(2) works fine.

At first i was thinking in using Gstreamer to fast forward and fast rewind. The problem is Gstreamer can't seek properly, it sends the seek request (Play command with range), the server starts streaming frames from that range but the client video freezes for a minute or more.

I'm actually using VLCJ bindings, and i really wasn't expecting to code any of the VLC's source code.
Use the "-z <scale>" option to request fast-forward play (<scale> > 1.0), slow play (0 < <scale> < 1.0), or reverse play (<scale> < 0.0). (The default value is 1.0: normal play.)
This is the live555 RTSP Client support in the Live555 official website.

Do you think that overpassing that test in the source code, libvlc will be able to send a Play command with a negative scale? I only need to test this as the frames come from the server i think Vlc won't have a problem demuxing the stream.

mundu
Blank Cone
Blank Cone
Posts: 53
Joined: 25 May 2011 19:56
VLC version: 2.1.5
Operating System: Linux

Re: Rtsp setRate()

Postby mundu » 26 May 2011 16:56

It does work with some RTSP servers, like AneVIA"s
I find that very hard to believe. What's the command you use? Libvlc 1.1.9 source code states that it's not supported a negative rate!

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: Rtsp setRate()

Postby Sébastien Escudier » 26 May 2011 17:02

j-b meant some rtsp servers can do rewind. Not that vlc works with them.
Maybe you could send me an url to test in private ?
otherwise I can't really help you.

mundu
Blank Cone
Blank Cone
Posts: 53
Joined: 25 May 2011 19:56
VLC version: 2.1.5
Operating System: Linux

Re: Rtsp setRate()

Postby mundu » 26 May 2011 17:43

Live555 Rtsp server that I'm using can do rewind, for that I'm sure because I used it's RTSP testing tool. I'm just curious on how Vlc can't support this as it's based on Live555 rtsp client library.

For this experimentation I'm using my laptop and currently at home so it will be impossible to give a testing URL as I don't have bandwidth for testing purposes.

The Vlc testing should be something like this:

Code: Select all

Setup "video/MP2T" subsession (client ports 60656-60657) Created output file: "video-MP2T-1" Sending request: PLAY rtsp://192.168.1.201:8554/test.ts/ RTSP/1.0 CSeq: 5 User-Agent: ./openRTSP (LIVE555 Streaming Media v2011.03.14) Session: 3F1EC0B2 Scale: -2.000000 Range: npt=30.000-0.000
The server response is the following:

Code: Select all

Received 212 new bytes of response data. Received a complete PLAY response: RTSP/1.0 200 OK CSeq: 5 Date: Thu, May 26 2011 15:29:34 GMT Scale: -2.000000 Range: npt=30.000-0.000 Session: 3F1EC0B2 RTP-Info: url=rtsp://192.168.1.201:8554/test.ts/track1;seq=62219;rtptime=1756668699

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: Rtsp setRate()

Postby Sébastien Escudier » 27 May 2011 08:23

then could you send the file you are using with live555 server and the procedure to test the rewind function ?

mundu
Blank Cone
Blank Cone
Posts: 53
Joined: 25 May 2011 19:56
VLC version: 2.1.5
Operating System: Linux

Re: Rtsp setRate()

Postby mundu » 27 May 2011 13:43

Ok so here it goes. There is three samples : one relates to the transport stream file, the other is the Index file to support Trick Play, and the last one is the desired output of a fast rewind situation.
http://paginas.fe.up.pt/~ee05154/samples/

This is the desired command.

Code: Select all

Setup "video/MP2T" subsession (client ports 38118-38119) Created output file: "video-MP2T-1" Sending request: PLAY rtsp://172.16.2.196:8554/Redbull_720.ts/ RTSP/1.0 CSeq: 5 User-Agent: ./openRTSP (LIVE555 Streaming Media v2011.03.14) Session: 1ABC44B7 Scale: -4.000000 Range: npt=100.000-0.000
I don't know if the range matters, because when Vlc sets the rate to a positive number it doesn't specify range and it works! However this is the only example I have fully working, so I guess the same method is needed.

Thank you for your help.

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: Rtsp setRate()

Postby Sébastien Escudier » 27 May 2011 15:31

thanks for the files.
But I meant the procedure to stream it with live555 server?
And what is the codec, I can't play the file with vlc...

mundu
Blank Cone
Blank Cone
Posts: 53
Joined: 25 May 2011 19:56
VLC version: 2.1.5
Operating System: Linux

Re: Rtsp setRate()

Postby mundu » 27 May 2011 16:14

To test it, simply install Live555 and use testonDemandRTSPServer and do the following:

Code: Select all

// A MPEG-2 Transport Stream: { char const* streamName = "mpeg2TransportStreamTest"; char const* inputFileName = "Redbull_720.ts"; char const* indexFileName = "Redbull_720.tsx";
Files will have to be in the same directory. The program will output the stream URL.

About the Codec I don't know which one plays TS. I currently see "demux "live555"" (demux "ts") and decoder "avcodec".

mundu
Blank Cone
Blank Cone
Posts: 53
Joined: 25 May 2011 19:56
VLC version: 2.1.5
Operating System: Linux

Re: Rtsp setRate()

Postby mundu » 27 May 2011 18:10

Well after wondering around the source code i commented the original set_rate implementation. Pointing the VLCJ bindings to my build...and voila:

Code: Select all

PLAY rtsp://172.16.2.196:8554/Redbull_720.ts/ RTSP/1.0 CSeq: 11 User-Agent: LibVLC/1.1.9 (LIVE555 Streaming Media v2010.11.17) Session: 68C9705 Scale: -2.000000 RTSP/1.0 200 OK CSeq: 11 Date: Fri, May 27 2011 14:41:49 GMT Scale: -2.000000 Session: 68C97056 RTP-Info: url=rtsp://172.16.2.196:8554/Redbull_720.ts/track1;seq=13622;rtptime=2101514686
Accepting a negative rate while STREAMING the desired content VLC is able to fast rewind easily! As Vlc isn't parsing the file itself and is only receiving the TS frames, demuxing each TS packet and decoding the video frame that comes through the RTSP stream doesn't require much.

However there's seems to be a slight bug when updating the position. When fast fowarding the movie and requesting to play at the same rate, Vlc isn't able to parse the correct time. Can anyone point to me where Vlc updates the position? Saving the current position and calculating the position at setRate(1) may be an option. Any ideas?

Thanks

Sébastien Escudier
Big Cone-huna
Big Cone-huna
Posts: 853
Joined: 06 Nov 2008 08:38
Operating System: linux

Re: Rtsp setRate() - Update: working for fast rewind

Postby Sébastien Escudier » 31 May 2011 15:12

ok thanks, I am able to test it.
Let's talk about this on the mailing list (I believe you are Nuno Mota)

About the position update, I think it is even worse in rewind mode.... it's not going backward.


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 9 guests