android - java.lang.RuntimeException: start failed -


i'm trying start record video, program crushes in line "recorder.start();". program stable @ huawei d1 (8 mpx) , on htc desure c (5 mpx) program has started giving errors

error:

w/dalvikvm(18833): threadid=1: thread exiting uncaught exception (group=0x40a8b228) e/androidruntime(18833): fatal exception: main e/androidruntime(18833): java.lang.runtimeexception: start failed. 

code:

    public void startrec(surfaceholder surfaceholder, string videoname) {         camera.stoppreview();         camera.unlock();         recorder.setcamera(camera);         setrecorderparams();         recorder.setpreviewdisplay(surfaceholder.getsurface());               recorder.setoutputfile(videoname);         try {             recorder.prepare();             recorder.start();         } catch (illegalstateexception e) {             e.printstacktrace();         } catch (ioexception e) {             e.printstacktrace();         }     }      public void setrecorderparams() {            recorder.setvideosource(mediarecorder.videosource.camera);         recorder.setoutputformat(mediarecorder.outputformat.mpeg_4);         recorder.setvideoencoder(mediarecorder.videoencoder.h264);         recorder.setvideoencodingbitrate(30000);         recorder.setvideosize(640, 480);     } 

solution in posting right parameters recorder. devices don't provide video encoders or output formats.

videoencoder parameters


Comments

Popular posts from this blog

How to mention the localhost in android -

php - Calling a template part from a post -

c# - String.format() DateTime With Arabic culture -