fengqingxin / ipcamera-for-android

Automatically exported from code.google.com/p/ipcamera-for-android
0 stars 0 forks source link

Video Recording Problem #63

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
HI all ,

    Concept :
         Record the live raw video streaming from URL "rtsp://192.168.2.160:554/live.sdp" (through IPCAM)  encoded into H264 format save it into SDcard using hardware Accelerometer in Android ICS 

so far video is streaming is working fine in android java.

I 'm get the following error while trying to record Video from URL live 
streaming :

Error log:

02-25 19:03:14.116: E/AndroidRuntime(26978): FATAL EXCEPTION: main
02-25 19:03:14.116: E/AndroidRuntime(26978): Process: com.tcs.video, PID: 26978
02-25 19:03:14.116: E/AndroidRuntime(26978): 
java.lang.IllegalArgumentException: Invalid video source
02-25 19:03:14.116: E/AndroidRuntime(26978): at 
android.media.MediaRecorder.setVideoSource(Native Method)
     try to set the video encoder without setting the video source first & java.lang.IllegalArgumentException:   
Media recorder setOutputFormat called in an invalid state: 1
MediaPlayer error (1, -2147483648)
Vitamio[Player] [h264 @ 0x66f7a850] error while decoding MB 34 17
Vitamio[Player] [h264 @ 0x66f7a850] out of range intra chroma pred mode at 34 17

My code  as follow:

private String path = "rtsp://192.168.2.160:554/live.sdp";
recorder = new MediaRecorder();
            recorder.reset();
            recorder.setVideoSource(VideoRecorder.STREAM_VIDEO ); //error line
           recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
           recorder.setVideoEncoder(VideoEncoder.H264);
            recorder.setOutputFile("/sdcard/new.mp4");
            recorder.setPreviewDisplay(mPreview.getHolder().getSurface());
            recorder.setPreviewDisplay(holder.getSurface());
           recorder.prepare();
                recorder.start();

Manifest file permission

  <uses-permission android:name="android.permission.RECORD_VIDEO" />
 <uses-permission android:name="android.permission.INTERNET"/>
  <uses-permission android:name="android.permission.RECORD_AUDIO"/>

Please help me out.

Thanks
Bhagavath

Original issue reported on code.google.com by bhagavath812anish on 26 Feb 2014 at 10:12