This discussion is archived
1 Reply Latest reply: Jun 13, 2011 8:05 AM by captfoss RSS

Tutorial or Samples to stream from rtsp ip camera

868264 Newbie
Currently Being Moderated
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 Pro
    Currently Being Moderated
    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.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points