Hi greatinnovus.
I could not give you any suggestions because I'm still getting errors.
In fact, I supposed is the your same error as our codes are very
similar. At the moment Jason Proctor is the only one who claims to be
successful in video capturing, maybe he could help us resolve the
issue.
Here is my current code:
==============================
public class VideoCapture extends Activity
implements SurfaceHolder.Callback {
private static final String TAG = "Video Capture";
private SurfaceView surfaceView;
private SurfaceHolder surfaceHolder;
private MediaRecorder recorder;
private String videoFile = "";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
surfaceView = (SurfaceView)findViewById(R.id.surface);
surfaceHolder = surfaceView.getHolder();
surfaceHolder.addCallback(this);
surfaceHolder.setType
(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
if (isExternalStorageReady()) {
this.setupVideoPath();
setRequestedOrientation
(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
prepareVideoCapture();
}
}
public void setupVideoPath() {
File sdcardpath = new File(Environment.getExternalStorageDirectory
(), "videotest.3gp");
this.videoFile = sdcardpath.getAbsolutePath();
Log.i(TAG, "Video output path is: " + this.videoFile);
}
public boolean isExternalStorageReady() {
// Is SD card present and writable?
return Environment.getExternalStorageState().equals
(Environment.MEDIA_MOUNTED);
}
public void prepareVideoCapture() {
/* Create a MediaRecorder */
recorder = new MediaRecorder();
Log.i(TAG, "Media recorder created");
recorder.setAudioSource(MediaRecorder.AudioSource.MIC);
recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);
recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB);
recorder.setVideoEncoder(MediaRecorder.VideoEncoder.H263);
recorder.setPreviewDisplay(surfaceHolder.getSurface());
Log.i(TAG, "Preview Display set to surface holder!");
recorder.setOutputFile(this.videoFile);
Log.i(TAG, "Media recorder parameters set");
try {
recorder.prepare();
} catch (IllegalStateException e) {
Log.e(TAG, e.toString());
} catch (IOException e) {
Log.e(TAG, "THE ERROR IS HERE!: " + e.toString());
}
Log.i(TAG, "Media recorder prepared for video capture!");
try {
recorder.start();
} catch (IllegalStateException e) {
Log.e(TAG, e.toString());
}
Log.i(TAG, "Video capture started!!");
}
//
============================================================================
// SURFACE CALLBACK IMPLEMENTATION
//
============================================================================
public void surfaceCreated(SurfaceHolder holder) {
Log.e(TAG, "surfaceCreated");
}
public void surfaceChanged(SurfaceHolder holder, int format, int
w, int h) {
Log.e(TAG, "surfaceChanged");
}
public void surfaceDestroyed(SurfaceHolder holder) {
Log.e(TAG, "surfaceDestroyed");
}
//
============================================================================
protected void onStop() {
// Stops the media recorder object
recorder.stop();
recorder.release();
Log.e(TAG, "onStop");
super.onStop();
}
}
And this is the LogCat output:
=================================
08-20 15:13:58.611: INFO/Video Capture(722): Video output path is: /
sdcard/videotest.3gp
08-20 15:13:58.651: INFO/Video Capture(722): Media recorder created
08-20 15:13:58.762: INFO/Video Capture(722): Preview Display set to
surface holder!
08-20 15:13:58.762: INFO/Video Capture(722): Media recorder parameters
set
08-20 15:13:58.901: INFO/DEBUG(551): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
08-20 15:13:58.911: INFO/DEBUG(551): Build fingerprint: 'generic/sdk/
generic/:1.5/CUPCAKE/148875:eng/test-keys'
08-20 15:13:58.911: INFO/DEBUG(551): pid: 722, tid: 722 >>>
jtrek.video <<<
08-20 15:13:58.921: INFO/DEBUG(551): signal 11 (SIGSEGV), fault addr
00000018
08-20 15:13:58.930: INFO/DEBUG(551): r0 ffffef40 r1 ffffece8 r2
41095b28 r3 00000000
08-20 15:13:58.930: INFO/DEBUG(551): r4 435a4428 r5 ab308358 r6
0000a9d0 r7 be99e4e0
08-20 15:13:58.930: INFO/DEBUG(551): r8 be99e500 r9 41049ce0 10
41e24304 fp 00001070
08-20 15:13:58.942: INFO/DEBUG(551): ip ad083e50 sp be99e4d8 lr
ad03dcf5 pc ab305408 cpsr 80000030
08-20 15:13:59.031: INFO/DEBUG(551): #00 pc 00005408 /
system/lib/libmedia_jni.so
08-20 15:13:59.041: INFO/DEBUG(551): #01 pc 0000e3b4 /
system/lib/libdvm.so
08-20 15:13:59.050: INFO/DEBUG(551): #02 pc 00040a8a /
system/lib/libdvm.so
08-20 15:13:59.060: INFO/DEBUG(551): #03 pc 00029430 /
system/lib/libdvm.so
08-20 15:13:59.060: INFO/DEBUG(551): #04 pc 00017610 /
system/lib/libdvm.so
08-20 15:13:59.072: INFO/DEBUG(551): #05 pc 00052268 /
system/lib/libdvm.so
08-20 15:13:59.081: INFO/DEBUG(551): #06 pc 000596ee /
system/lib/libdvm.so
08-20 15:13:59.090: INFO/DEBUG(551): #07 pc 00013118 /
system/lib/libdvm.so
08-20 15:13:59.090: INFO/DEBUG(551): #08 pc 00017b1c /
system/lib/libdvm.so
08-20 15:13:59.100: INFO/DEBUG(551): #09 pc 00017560 /
system/lib/libdvm.so
08-20 15:13:59.112: INFO/DEBUG(551): #10 pc 000520ec /
system/lib/libdvm.so
08-20 15:13:59.112: INFO/DEBUG(551): #11 pc 0003f0f8 /
system/lib/libdvm.so
08-20 15:13:59.122: INFO/DEBUG(551): #12 pc 00031ac2 /
system/lib/libdvm.so
08-20 15:13:59.131: INFO/DEBUG(551): #13 pc 00028280 /
system/lib/libandroid_runtime.so
08-20 15:13:59.141: INFO/DEBUG(551): #14 pc 00028d7e /
system/lib/libandroid_runtime.so
08-20 15:13:59.141: INFO/DEBUG(551): #15 pc 00008bf2 /
system/bin/app_process
08-20 15:13:59.151: INFO/DEBUG(551): #16 pc 0001fd1a /
system/lib/libc.so
08-20 15:13:59.161: INFO/DEBUG(551): #17 pc 0000bcb2 /
system/lib/libc.so
08-20 15:13:59.171: INFO/DEBUG(551): #18 pc b000157e /
system/bin/linker
08-20 15:13:59.171: INFO/DEBUG(551): stack:
08-20 15:13:59.184: INFO/DEBUG(551): be99e498 435a4428
08-20 15:13:59.191: INFO/DEBUG(551): be99e49c ad03edab /system/
lib/libdvm.so
08-20 15:13:59.191: INFO/DEBUG(551): be99e4a0 ad082c50
08-20 15:13:59.191: INFO/DEBUG(551): be99e4a4 41095b28
08-20 15:13:59.201: INFO/DEBUG(551): be99e4a8 0000a9d0 [heap]
08-20 15:13:59.201: INFO/DEBUG(551): be99e4ac ab308828
08-20 15:13:59.212: INFO/DEBUG(551): be99e4b0 ad082888
08-20 15:13:59.212: INFO/DEBUG(551): be99e4b4 435a2320
08-20 15:13:59.212: INFO/DEBUG(551): be99e4b8 be99e4e0 [stack]
08-20 15:13:59.212: INFO/DEBUG(551): be99e4bc ab30488d /system/
lib/libmedia_jni.so
08-20 15:13:59.212: INFO/DEBUG(551): be99e4c0 40018e70
08-20 15:13:59.212: INFO/DEBUG(551): be99e4c4 435a4428
08-20 15:13:59.221: INFO/DEBUG(551): be99e4c8 ab308358
08-20 15:13:59.221: INFO/DEBUG(551): be99e4cc 0000a9d0 [heap]
08-20 15:13:59.221: INFO/DEBUG(551): be99e4d0 df002777
08-20 15:13:59.231: INFO/DEBUG(551): be99e4d4 e3a070ad
08-20 15:13:59.231: INFO/DEBUG(551): #00 be99e4d8 00000000
08-20 15:13:59.231: INFO/DEBUG(551): be99e4dc 00000000
08-20 15:13:59.231: INFO/DEBUG(551): be99e4e0 00000000
08-20 15:13:59.241: INFO/DEBUG(551): be99e4e4 0018f938 [heap]
08-20 15:13:59.241: INFO/DEBUG(551): be99e4e8 be99e520 [stack]
08-20 15:13:59.241: INFO/DEBUG(551): be99e4ec be99e520 [stack]
08-20 15:13:59.241: INFO/DEBUG(551): be99e4f0 00000000
08-20 15:13:59.251: INFO/DEBUG(551): be99e4f4 ab3053c9 /system/
lib/libmedia_jni.so
08-20 15:13:59.251: INFO/DEBUG(551): be99e4f8 41049ce8
08-20 15:13:59.261: INFO/DEBUG(551): be99e4fc ad00e3b8 /system/
lib/libdvm.so
08-20 15:13:59.261: INFO/DEBUG(551): #01 be99e500 411296e0
08-20 15:13:59.261: INFO/DEBUG(551): be99e504 0000bc60 [heap]
08-20 15:13:59.261: INFO/DEBUG(551): be99e508 ab3053c9 /system/
lib/libmedia_jni.so
08-20 15:13:59.261: INFO/DEBUG(551): be99e50c 00000000
08-20 15:13:59.261: INFO/DEBUG(551): be99e510 411296e0
08-20 15:13:59.261: INFO/DEBUG(551): be99e514 00003ea1
08-20 15:13:59.261: INFO/DEBUG(551): be99e518 be99e520 [stack]
08-20 15:13:59.261: INFO/DEBUG(551): be99e51c ad040a8d /system/
lib/libdvm.so
And then the application died.
Anyone could help us here?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---