0

I try to get an IP camera view on wifi camera board, directly, using nexus s phone. Using VideoView, I can get the video on the Internet, http and rtsp address, but I can't get the camera image on the board(rtsp board) through direct wifi connection.

below is the simple and short code, easy to understand, and error msg. plz, help me. thanks

String vidAddress = "rtsp://192.168.100.1/cam1/h264/";
VideoView vidView;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    vidView = (VideoView) findViewById(R.id.myVideo);
    Uri vidUri = Uri.parse(vidAddress);
    vidView.setVideoURI(vidUri);
    vidView.requestFocus();
    vidView.start();
}

03-16 19:07:26.091  27449-27449/com.example.administrator.rtspapplication D/MediaPlayer﹕ Couldn't open file on client side, trying server side
03-16 19:07:26.450  27449-27453/com.example.administrator.rtspapplication D/dalvikvm﹕ GC_CONCURRENT freed 176K, 3% free 8340K/8583K, paused 143ms+3ms, total 182ms
03-16 19:07:26.450  27449-27449/com.example.administrator.rtspapplication D/dalvikvm﹕ WAIT_FOR_CONCURRENT_GC blocked 6ms
03-16 19:07:26.524  27449-27449/com.example.administrator.rtspapplication I/Choreographer﹕ Skipped 72 frames!  The application may be doing too much work on its main thread.
03-16 19:07:27.110  27449-27449/com.example.administrator.rtspapplication D/MediaPlayer﹕ getMetadata
03-16 19:07:28.309  27449-27461/com.example.administrator.rtspapplication W/IMediaDeathNotifier﹕ media server died
03-16 19:07:28.309  27449-27461/com.example.administrator.rtspapplication E/MediaPlayer﹕ error (100, 0)
03-16 19:07:28.317  27449-27460/com.example.administrator.rtspapplication W/AudioSystem﹕ AudioFlinger server died!
03-16 19:07:28.434  27449-27449/com.example.administrator.rtspapplication E/MediaPlayer﹕ Error (100,0)
03-16 19:07:28.434  27449-27449/com.example.administrator.rtspapplication D/VideoView﹕ Error: 100,0
hoomi
  • 1,882
  • 2
  • 16
  • 17
John
  • 1
  • 1
  • What do you mean by direct wifi? Does that mean Wi-Fi direct? – hoomi Mar 16 '15 at 12:30
  • You're trying to stream a video, meaning that you're getting video data from the network. Network operations on the main UI thread are forbidden. (I'm surprised this didn't crash your application.) Create a separate thread, and try to perform the operation there. – sigmabeta Mar 16 '15 at 12:59
  • I'm a beginer in Android. Anyway, above code can work well, when I get the video source on the Internet. But my situation is that I have a board that makes rtsp server - camera stream - and make a wifi connection, so I can get a camera stream through VLC player using above URL.(directly connect board and phone) But I can not get the camera stream using my code(short and simple code). – John Mar 17 '15 at 16:35

0 Answers0