1 Reply Latest reply on Jun 13, 2011 3:05 PM by captfoss

    Tutorial or Samples to stream from rtsp ip camera

    868264
      hello,

      Please i need a tutorial or a sample code to stream from an ip camera (vivotek) using rtsp

      i used normal way :

      -----

      MediaLocator ml = new MediaLocator("rtsp://10.129.3.9:554/live2.sdp");
                     DataSource dt = new DataSource();
                     dt.setLocator(ml);
                     player = Manager.createPlayer(dt);
                     player.addControllerListener(this);
                     

                     player.start();
      -----

      but it didn't work :
      -----

      Exception in thread "JMF thread: com.sun.media.content.rtsp.Handler@1e2ca7[ com.sun.media.content.rtsp.Handler@1e2ca7 ] ( realizeThread)" java.lang.NumberFormatException: empty String

      -----
        • 1. Re: Tutorial or Samples to stream from rtsp ip camera
          captfoss
          865261 wrote:
          i used normal way :
                         DataSource dt = new DataSource();
                         dt.setLocator(ml);
          That is not the normal way, and I wouldn't expect that to work.
          DataSource dt = Manager.createDataSource(ml)
          Would be the proper, normal way to do that.
          Exception in thread "JMF thread: com.sun.media.content.rtsp.Handler@1e2ca7[ com.sun.media.content.rtsp.Handler@1e2ca7 ] ( realizeThread)" java.lang.NumberFormatException: empty String
          That either means
          1) Your datasource wasn't initiated correctly, as indicated above
          2) Your RTSP server isn't compatible with JMF.

          Fix your DataSource code, and see if that fixes it.