RecordingProxy::releaseRecordingFrame repeating in log every 25ms while recording on Android phone

StackOverflow https://stackoverflow.com/questions/23343121

  •  11-07-2023
  •  | 
  •  

Pergunta

When I video record in my home made app I get these two lines repeating every 25ms or so (it then fills a log file in no time):

04-28 09:33:07.705: V/Camera(3161): RecordingProxy::releaseRecordingFrame
04-28 09:33:07.705: V/Camera(3161): releaseRecordingFrame

I don't think this is normal since I also get often an infamous "media server died" error or the movie just crash. This is on an 4.0.4 Samsung Discover device. I don't see these log lines on my LG optimus one devices.

You'd find these lines of logs in the code here each time a "// callback from camera service when timestamped frame is ready". Is it normal? I read that putting too much into log would eventualy slow down/ bug an app. More code following. Thanks!

Here is the log in video start:

04-28 09:33:05.635: V/Camera-JNI(3161): unlock
04-28 09:33:05.635: V/Camera-JNI(3161): get_native_camera: context=0x1287378, camera=0x1473a88
04-28 09:33:05.635: V/Camera-JNI(3161): get_native_camera: context=0x1287378, camera=0x1473a88
04-28 09:33:05.635: V/Camera(3161): getProxy
04-28 09:33:05.645: V/MediaProfilesJNI(3161): native_get_camcorder_profile: 0 1
04-28 09:33:05.665: D/ASC(3161): mounted
04-28 09:33:05.685: V/VoirCam(3161): ts 1398691985695
04-28 09:33:05.925: V/Camera(3161): RecordingProxy::startRecording
04-28 09:33:05.925: V/Camera(3161): reconnect
04-28 09:33:05.925: V/Camera(3161): startRecording
04-28 09:33:06.305: V/Camera(3161): RecordingProxy::releaseRecordingFrame
04-28 09:33:06.305: V/Camera(3161): releaseRecordingFrame
04-28 09:33:06.325: V/Camera(3161): RecordingProxy::releaseRecordingFrame
04-28 09:33:06.325: V/Camera(3161): releaseRecordingFrame
04-28 09:33:06.325: V/Camera(3161): RecordingProxy::releaseRecordingFrame
04-28 09:33:06.325: V/Camera(3161): releaseRecordingFrame
04-28 09:33:06.345: V/Camera(3161): RecordingProxy::releaseRecordingFrame
04-28 09:33:06.345: V/Camera(3161): releaseRecordingFrame
04-28 09:33:06.375: V/Camera(3161): RecordingProxy::releaseRecordingFrame
04-28 09:33:06.375: V/Camera(3161): releaseRecordingFrame

and on stop:

04-28 09:29:38.555: V/Camera(3161): RecordingProxy::releaseRecordingFrame
04-28 09:29:38.555: V/Camera(3161): releaseRecordingFrame
04-28 09:29:38.695: V/Camera(3161): RecordingProxy::releaseRecordingFrame
04-28 09:29:38.695: V/Camera(3161): releaseRecordingFrame
04-28 09:29:38.705: V/Camera(3161): RecordingProxy::stopRecording
04-28 09:29:38.705: V/Camera(3161): stopRecording
04-28 09:29:39.065: V/Camera-JNI(3161): lock
04-28 09:29:39.065: V/Camera-JNI(3161): get_native_camera: context=0x1287378, camera=0x1473a88
04-28 09:29:39.065: V/Camera-JNI(3161): lock
04-28 09:29:39.065: V/Camera-JNI(3161): get_native_camera: context=0x1287378, camera=0x1473a88

Recording starts like this:

    if (prepareVideoRecorder()) {
        mMediaRecorder.start();
   }

My prepareVideoRecorder function is:

private boolean prepareVideoRecorder(){

mMediaRecorder = new MediaRecorder();
// Step 1: Unlock and set camera to MediaRecorder
mCamera.unlock();
mMediaRecorder.setCamera(mCamera);
// Step 2: Set sources
mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);
    mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
    CamcorderProfile camcorderProfile = CamcorderProfile.get(CamcorderProfile.QUALITY_HIGH);

    camcorderProfile.videoCodec = MediaRecorder.VideoEncoder.H264;
  camcorderProfile.audioCodec = MediaRecorder.AudioEncoder.AAC;
    camcorderProfile.fileFormat = MediaRecorder.OutputFormat.MPEG_4;


// Step 3: Set a CamcorderProfile (requires API Level 8 or higher)

mMediaRecorder.setProfile(camcorderProfile);
// Step 4: Set output file

mMediaRecorder.setOutputFile(getOutputMediaFile(MEDIA_TYPE_VIDEO).toString());

mMediaRecorder.setPreviewDisplay(mPreview.getHolder().getSurface());


// Step 6: Prepare configured MediaRecorder
try {
    mMediaRecorder.prepare();
} catch (IllegalStateException e) {
    Log.d(TAG, "IllegalStateException preparing MediaRecorder: " + e.getMessage());
    releaseMediaRecorder();
    return false;
} catch (IOException e) {
    Log.d(TAG, "IOException preparing MediaRecorder: " + e.getMessage());
    releaseMediaRecorder();
    return false;
}
return true;

}

Foi útil?

Solução

That message is not expected to appear, but perhaps not for the reason you'd expect.

In the Android sources, verbose-level logging (ALOGV) is compiled out by default. To enable it, you define the symbol LOG_NDEBUG to be zero before including the Log.h header. Looking at the source file that came up in your androidcodesearch.com link, you can see this #define -- commented out -- on line 18. If you were debugging the Camera implementation, you'd start by uncommenting that line.

It appears that whoever built the system you're using (Samsung?) enabled verbose logging for this file and left it on, so messages that were only intended to be visible during debugging are always on.

I haven't looked at this code before, but I'd guess that function might normally run once per frame. So what you're seeing is probably "normal".

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top