Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

Question [Q]Sample Camera App with poor fps

OP chuaniyang

2nd March 2014, 09:34 AM   |  #1  
OP Member
Flag Taipei
Thanks Meter: 9
 
36 posts
Join Date:Joined: Aug 2010
More
Hey, guys

I just write a sample application for video recording.

All function works. but the record video file only 15 fps.

on the same environment, stock camera app can recording at 29 fps.

Am I missing something ?

Main code about recording is here :
Code:
    private void startRecord(){
        try{
            mRecorder=new MediaRecorder();
            mCamera.unlock();
            mRecorder.setCamera(mCamera);
            mRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);
            mRecorder.setOrientationHint(getRotation());
            mRecorder.setOutputFormat(MediaRecorder.OutputFormat.MPEG_4);
            mRecorder.setVideoSize(1920, 1080);
            mRecorder.setVideoEncodingBitRate(20000000);
            mRecorder.setVideoEncoder(MediaRecorder.VideoEncoder.H264);
            mRecorder.setVideoFrameRate(30);
            mRecorder.setPreviewDisplay(mHolder.getSurface());
            mCurrentVideoPath=getOutputMediaFile(MEDIA_TYPE_VIDEO).toString();
            mRecorder.setOutputFile(mCurrentVideoPath);
            mRecorder.prepare();
            mRecorder.start();
            recording=true;
            Toast.makeText(getBaseContext(), "Start Recording.", Toast.LENGTH_SHORT).show();
        }catch(Exception e){
            e.printStackTrace();
            mRecorder.release();
            mRecorder=null;
            mCamera.lock();
            recording=false;
            Toast.makeText(getBaseContext(), "Recording Fail.", Toast.LENGTH_SHORT).show();
        }
    }
Whole Project can be find at this link below :
https://github.com/alex-yang/MyCamera

thanks for helping.
Last edited by chuaniyang; 2nd March 2014 at 09:37 AM.
The Following User Says Thank You to chuaniyang For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
camera, fps, video
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes