Results 1 to 5 of 5

Thread: RTSP override duration

  1. #1
    Join Date
    May 2009
    Posts
    19

    Default RTSP override duration

    I need to override client request to do some access control over the stream.
    Basically I need only two things: set the video start time and video duration. I can do it on HTTP and RTMP but not on RTSP.

    I thing

    rtpSession.setRTSPPlayRangeStart(60*1000); / rtpSession.setRTSPPlayRangeStop(75*1000);
    or
    rtpSession.getRTSPStream().setVODStartTimeTC(60*1000L); rtpSession.getRTSPStream().setVODPlayLen(15*1000L);

    should work, but actually none of them working.


    The code below should do the following: start the video file from the 60. seconds and stops at 15. seconds.

    To test, I used VLC with these URL: rtsp://localhost:1935/test/mp4:sample.mp4

    Here is the code:

    package hu.vizibirka.test;
    
    import com.wowza.wms.module.ModuleBase;
    import com.wowza.wms.rtp.model.IRTSPActionNotify;
    import com.wowza.wms.rtp.model.RTPSession;
    import com.wowza.wms.rtsp.RTSPRequestMessage;
    import com.wowza.wms.rtsp.RTSPResponseMessages;
    
    public class TestModule extends ModuleBase implements IRTSPActionNotify {
        @Override
        public void onDescribe(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) { }
        @Override
        public void onAnnounce(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {}
        @Override
        public void onSetParameter(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {}
        @Override
        public void onGetParameter(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {}
        @Override
        public void onOptions(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {}
        @Override
        public void onPause(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {}
        @Override
        public void onRecord(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {}
        @Override
        public void onRedirect(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {}
        @Override
        public void onTeardown(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {}
    
        @Override
        public void onPlay(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {
            //Not working
            rtpSession.setRTSPPlayRangeStart(60*1000);
            rtpSession.setRTSPPlayRangeStop(75*1000);
            //Not working too
            rtpSession.getRTSPStream().setVODStartTimeTC(60*1000L);
            rtpSession.getRTSPStream().setVODPlayLen(15*1000L);
        }
    
        @Override
        public void onSetup(RTPSession rtpSession, RTSPRequestMessage rtspRequestMessage, RTSPResponseMessages rtspResponseMessages) {
    
            //Not working
            rtpSession.setRTSPPlayRangeStart(60*1000);
            rtpSession.setRTSPPlayRangeStop(75*1000);
    
            //Not working too
            rtpSession.getRTSPStream().setVODStartTimeTC(60*1000L);
            rtpSession.getRTSPStream().setVODPlayLen(15*1000L);
        }
    
        public void onRTPSessionCreate(RTPSession rtpSession){
             rtpSession.addActionListener(this);
        }
    
        public void onRTPSessionDestroy(RTPSession rtpSession){
            rtpSession.removeActionListener(this);
        }
    }

  2. #2
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    There is not a way to do this for RTSP playback. And I don't think it is a likely add any time soon.

    Richard

  3. #3
    Join Date
    May 2009
    Posts
    19

    Default

    Richard thank you for your response.

    If this not the right way to do that, what these methods are for?

    What it the right way to do it?

    I'm asking them because I have a project where the duration/start time override is a mandatory requirement. It works on RTMP/HLS but not on RTSP.

  4. #4
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Again, there is not a way to do this with Wowza and RTSP playback at present.

    Richard

  5. #5
    Join Date
    May 2009
    Posts
    19

    Default

    Thank you for the clarification.

Similar Threads

  1. Limit the stream play duration in RTSP
    By er.kmanoj in forum On-Demand Streaming
    Replies: 2
    Last Post: 05-20-2014, 11:33 AM
  2. Override Wowza RTSP connection behavior
    By FBrunido in forum General Forum
    Replies: 3
    Last Post: 12-19-2013, 05:02 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •