我正在开发一个项目,我需要从IPCamera中读取输入流.我可以通过rtsp url获取此信息.
显示IPCamera流.我可以通过使用 -
videoView = (VideoView) this.findViewById(R.id.videoView1); MediaController mc = new MediaController(this); videoView.setMediaController(mc); videoView.setVideoURI(Uri.parse("rtsp://xxxxxxxx/camera1")); videoView.requestFocus();
现在我想将此流记录到MP4文件中.同样我使用mediarecorder.Here我被卡住了.
MediaRecorder mediaRecorder = new MediaRecorder(); //mediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); mediaRecorder.setOutputFormat(MediaRecorder.OutputFormat.DEFAULT); mediaRecorder.setOutputFile("rtsp://xxxxxxxxx/camera1"); try { mediaRecorder.prepare(); } catch (IllegalStateException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } mediaRecorder.start();
谢谢