Page 1 of 2 12 LastLast
Results 1 to 10 of 14

Thread: RTSP protocol options

  1. #1
    Join Date
    Jan 2013
    Posts
    25

    Default RTSP protocol options

    Hi,

    I'm developing an ip camera application.
    All rtsp streams are started and stopped with the mediacaster.startStream and mediacaster.stopStream functions.

    Files are being saved on disk with the startRecordingSegmentBySchedule example i've found in the tutorial.

    However im stuck with 3 questions:

    1. Is it possible to stop and start the audio and/or video of the incoming rtsp stream (to save bandwith when they are not needed)
    I've tried with stream.setReceiveAudio(false) and stream.setReceiveVideo(false) but nothing happens.

    2. Is it possible to send an audio stream back over the same rtsp stream.
    I know most ip cameras support some type of audio return channel, however I'm not sure if this is part of the rtsp standard.

    3. Is there an easy way (or example/tutorial) of joining all the split files, that have been created by the startRecordingSegmentBySchedule function?
    Or do i manually have to create a playlist of some sort?
    My goal is to make a seekable stream, that will be served to a flash client, based on all the individual files on the server.

    Any help with these questions will be highly appreciated.

    Kind regards,
    Jim

  2. #2
    Join Date
    Jan 2013
    Posts
    25

    Default

    I've looked at the specification document of our cameras:

    http://www.onvif.org/specs/stream/ON...-Spec-v221.pdf
    section: 5.3 Back Channel Connection

    Is it possible i can use wowza with this rtsp extension?

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

    Default

    You should be able to re-stream the RTSP output. Take a look at this guide:
    http://www.wowza.com/forums/content....-re-streaming)

    Richard

  4. #4
    Join Date
    Jan 2013
    Posts
    25

    Default

    I've read that thread extensively, but it doesn't answer my questions:

    1. can i selectively disable the audio or video track? (the rtspStreamAudioTrack and rtspStreamVideoTrack Booleans, in the application.xml disable it for all streams.

    2. does wowza support bi-directional audio, over one rtsp connection?

    3. see first post.

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

    Default

    Jim,

    3) For vod playback you can join using this method, but it only works for Flash RTMP clients:
    http://www.wowza.com/forums/content....sh-RTMP-client

    For live, you can join with Stream class streams, and this works across client types, and as input to the Wowza Transcoder and PushPublish. The scheduler is one example:
    http://www.wowza.com/forums/content....rver-listener)

    2) This is not supported using Wowza as far as I know.

    1) I have used IMediaStream.setReceiveVideo(false) in IMediaStreamActionNotify3.onPlay() to control this in rtsp playback in VLC. I did not test on any mobile clients:
    package test;
    
    import com.wowza.util.IOPerformanceCounter;
    import com.wowza.wms.amf.*;
    import com.wowza.wms.application.*;
    import com.wowza.wms.client.IClient;
    import com.wowza.wms.module.*;
    import com.wowza.wms.request.RequestFunction;
    import com.wowza.wms.stream.*;
    import com.wowza.wms.media.model.*;
    
    public class ModuleSoundOnly extends ModuleBase
    {
    
    	class StreamListener implements IMediaStreamActionNotify3
    	{
    		public void onMetaData(IMediaStream stream, AMFPacket metaDataPacket)
    		{
    			System.out.println("onMetaData[" + stream.getContextStr() + "]: " + metaDataPacket.toString());
    		}
    
    		public void onPauseRaw(IMediaStream stream, boolean isPause, double location)
    		{
    			System.out.println("onPauseRaw[" + stream.getContextStr() + "]: isPause:" + isPause + " location:" + location);
    		}
    
    		public void onPause(IMediaStream stream, boolean isPause, double location)
    		{
    			System.out.println("onPause[" + stream.getContextStr() + "]: isPause:" + isPause + " location:" + location);
    		}
    
    public void onPlay(IMediaStream stream, String streamName, double playStart, double playLen, int playReset)
    {
    	stream.setReceiveVideo(false);
    }
    
    		public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
    		{
    			System.out.println("onPublish[" + stream.getContextStr() + "]: isRecord:" + isRecord + " isAppend:" + isAppend);
    		}
    
    		public void onSeek(IMediaStream stream, double location)
    		{
    			System.out.println("onSeek[" + stream.getContextStr() + "]: location:" + location);
    		}
    
    		public void onStop(IMediaStream stream)
    		{			
    			IOPerformanceCounter perf = stream.getMediaIOPerformance();
    			getLogger().info("OutBytesRate for " + stream.getName() + ": " + perf.getMessagesOutBytes());
    		}
    
    		public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
    		{
    			System.out.println("onUnPublish[" + stream.getContextStr() + "]: streamName:" + streamName + " isRecord:" + isRecord + " isAppend:" + isAppend);
    		}
    
    		public void onCodecInfoAudio(IMediaStream stream,
    				MediaCodecInfoAudio codecInfoAudio) {
    			System.out.println("onCodecInfoAudio[" + stream.getContextStr() + " Audio Codec" + codecInfoAudio.toCodecsStr() + "]: ");
    		}
    
    		public void onCodecInfoVideo(IMediaStream stream,
    				MediaCodecInfoVideo codecInfoVideo) {
    			System.out.println("onCodecInfoVideo[" + stream.getContextStr() + " Video Codec" + codecInfoVideo.toCodecsStr() + "]: ");
    		}
    	}
    
    	public void play(IClient client, RequestFunction function,
    	        AMFDataList params) {
    		IMediaStream stream = getStream(client, function);
    		
    		String[] querystring = stream.getQueryStr().split("&");
    		String qs1 = querystring[0];
    				
    		//stream.setReceiveVideo(false);
    		
    	}
    	public void onStreamCreate(IMediaStream stream)
    	{
    		getLogger().info("onStreamCreate["+stream+"]: clientId:" + stream.getClientId());
    		IMediaStreamActionNotify2 actionNotify = new StreamListener();
    
    		WMSProperties props = stream.getProperties();
    		synchronized (props)
    		{
    			props.put("streamActionNotifier", actionNotify);
    		}
    		stream.addClientListener(actionNotify);
    	}
    
    	public void onStreamDestroy(IMediaStream stream)
    	{
    		getLogger().info("onStreamDestroy["+stream+"]: clientId:" + stream.getClientId());
    
    		IMediaStreamActionNotify2 actionNotify = null;
    		WMSProperties props = stream.getProperties();
    		synchronized (props)
    		{
    			actionNotify = (IMediaStreamActionNotify2) stream.getProperties().get("streamActionNotifier");
    		}
    		if (actionNotify != null)
    		{
    			stream.removeClientListener(actionNotify);
    			getLogger().info("removeClientListener: " + stream.getSrc());
    		}
    	}
    
    }
    Richard

  6. #6
    Join Date
    Jan 2013
    Posts
    25

    Default

    I'm trying to do the same on the published stream, so in the onPublish() method. But this doesn't seem to have any effect.
    It would be great if i could selectively stop the audio from the incoming stream to save bandwidth between "broadcaster" and server.

    Kind regards, Jim

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

    Default

    No, I don't think that can work. Only on the play streams

    Richard

  8. #8
    Join Date
    Jan 2013
    Posts
    25

    Default

    Quote Originally Posted by rrlanham View Post
    3) For vod playback you can join using this method, but it only works for Flash RTMP clients:
    http://www.wowza.com/forums/content....sh-RTMP-client

    For live, you can join with Stream class streams, and this works across client types, and as input to the Wowza Transcoder and PushPublish. The scheduler is one example:
    http://www.wowza.com/forums/content....rver-listener)
    Can you help me a bit more with this?
    I've tried playing the recorded .flv files that were created with the LiveStreamRecorderFLV class. (just by putting them in /content folder, and calling the /vod url)
    However i get the famous "File is missing 'moov' atom" error. (i am not trying to play a file that is not closed properly)

    Kind regards, Jim

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

    Default

    Sounds like you recorded a .flv file but are playing it back with mp4: prefix. If so, remove the mp4: prefix from the stream name.

    Otherwise, the recording may be corrupt. If there is .tmp file next to it with the same name, that indicates the recording did complete successfully. There is nothing you can do with such a file.

    Richard

  10. #10
    Join Date
    Jan 2013
    Posts
    25

    Default

    Quote Originally Posted by rrlanham View Post
    Sounds like you recorded a .flv file but are playing it back with mp4: prefix. If so, remove the mp4: prefix from the stream name.
    Otherwise, the recording may be corrupt. If there is .tmp file next to it with the same name, that indicates the recording did complete successfully. There is nothing you can do with such a file.
    Richard
    Yes im recording .flv, but im playing it back with the folowing url: rtsp://192.168.1.153:1935/vod/1.flv
    The files are split every x minutes (startRecordingSegmentBySchedule), so the moment a new file is created, i should be able to use the old one right?

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 10-18-2013, 11:22 PM
  2. Playing VOD MP3 in RTSP protocol
    By rrperez in forum Video On Demand Streaming Discussion
    Replies: 1
    Last Post: 05-10-2012, 06:14 AM

Posting Permissions

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