Hi, Jason, thank you. That really helped a lot. I no longer see onDestroy being called all the time.
Before setting the orientation to LANDSCAPE, the preview display was wrong. The display was rotated 90 degrees and the picture a bit distorted After setting the orientation everything looks the way I would I expect it to be; When in portrait, the preview is in portrait as well as the captured video, and when in landscape both preview and capture is in landscape. In my opinion, this setting should be the default setting. For future reference, here is a snippet of my code. recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); recorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setVideoEncoder(MediaRecorder.VideoEncoder.MPEG_4_SP); recorder.setOutputFile(filePath); CameraView.thisCameraView.setRequestedOrientation (ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE); recorder.setPreviewDisplay(sv); recorder.prepare(); recorder.start(); CameraView is my activity displaying the preview, that includes my SurfaceView class (sv is the surface of the holder) and camera object. Thanks, Anders On May 7, 8:56 pm, Jason Proctor <ja...@particularplace.com> wrote: > yes. the movie file is correctly formed, but the picture is messed > up. i've not tried correcting the metadata in the file, but that > *should* fix it. > > either way, AuthorDriver or whoever should be telling > QualcommCameraHardware what's going on, IMHO. > > > > >Wait, when you say corruption, you really mean that there's a mismatch > >between the metadata and the actual frame size, is that correct? > > >On May 7, 11:17 am, Jason Proctor <ja...@particularplace.com> wrote: > >> i don't change it, it gets changed by the "Author Driver" presumably > >> to avoid colliding with the status bar or somesuch. > > >> here's some log output which might illustrate what's going on -- > > >> 05-07 11:13:51.516: WARN/AuthorDriver(35): Intended width(480) > >> exceeds the max allowed width(352). Max width is used instead. 05-07 > >> 11:13:51.516: WARN/AuthorDriver(35): Intended height(295) exceeds the > >> max allowed height(288). Max height is used instead. > >> however, a bit later on it seems that nobody has told the camera this -- > > >> 05-07 11:13:51.686: VERBOSE/QualcommCameraHardware(35): requested > >> size 480 x 320 05-07 11:13:51.686: > >> VERBOSE/QualcommCameraHardware(35): actual size 480 x 320 > >> so the codec is encoding for 480x320, but the surface is only > >> delivering 352x288. hence the corruption. > > >> hth > >> j > > >> >This is a limitation of the hardware, the preview size and encoded > >> >size must be the same. > > >> >I'm not sure how you were able to change the preview size though. I'd > >> >like to know the code sequence you used, because it's not supposed to > >> >be possible. > > >> >On May 6, 11:11 am, Jason Proctor <ja...@particularplace.com> wrote: > >> >> just a tiny fyi here is that i did manage to get video recording > >> >> working fine in my app. > > >> >> there is however a problem if the surface view fills its parent and > >> >> the parent is the entire screen. if that happens, then the camera's > >> >> view of things gets resized but nobody tells the codec, and hence the > >> >> movie is messed up. it's encoded for one size but the movie metainfo > >> >> says something else. > > >> >> making the size something smaller than the screen made it work, but > >> >> it *is* a bug IMHO. > > >> >> -- > >> >> jason.software.particle > > >> -- > >> jason.software.particle > > -- > jason.software.particle --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---