Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Android™ Development

Reply
Highlighted
New Contributor
Posts: 3
Registered: ‎04-07-2014
My Device: Q10
My Carrier: 5554962458

camcorder profile android runtime record video blackberry 10

[ Edited ]

I am porting an android app to bb10 that records video, but when i select one of the camcorder profile availables,

it always record with a high resolution, i cant record a video with a low resolution(that's what i want) can anybody help me? . 

 

The video always get recorded those are my parameters:

 

protected void startRecording() throws IOException 

{

   mrec = new MediaRecorder();  // Works well

   mCamera.unlock();

   mrec.setCamera(mCamera);

   mrec.setOrientationHint(90);

   mrec.setPreviewDisplay(surfaceHolder.getSurface());

   mrec.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);

   mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA);

   mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_LOW));

   java.util.Date date= new java.util.Date();

   String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(date.getTime());

   mrec.setOutputFile(Environment.getExternalStorageDirectory()+"/VID_"+timeStamp+".3gp"); 

   mrec.prepare();

   mrec.start();

}

 

 

also in the logcat the device prints this:

 

04-08 00:31:38.315: I/MediaProfiles(16224500): MediaProfiles::initProfilesLocked()
04-08 00:31:38.315: I/MediaProfiles(16224500): MediaProfiles::initCamcorderProfilesFromCache()
04-08 00:31:38.317: I/MediaProfiles(16224500): createCamcorderProfile: camera: 1, width: 320, height: 240, bitrate: 666666, quality: 7, duration: 60, timeLapse false
04-08 00:31:38.317: I/MediaProfiles(16224500): createCamcorderProfile: camera: 1, width: 320, height: 240, bitrate: 333333, quality: 1007, duration: 60, timeLapse true
04-08 00:31:38.317: I/MediaProfiles(16224500): createCamcorderProfile: camera: 1, width: 176, height: 144, bitrate: 220000, quality: 2, duration: 60, timeLapse false
04-08 00:31:38.317: I/MediaProfiles(16224500): createCamcorderProfile: camera: 1, width: 176, height: 144, bitrate: 110000, quality: 1002, duration: 60, timeLapse true
04-08 00:31:38.317: I/MediaProfiles(16224500): createCamcorderProfile: camera: 1, width: 352, height: 352, bitrate: 1075555, quality: 0, duration: 60, timeLapse false
04-08 00:31:38.318: I/MediaProfiles(16224500): createCamcorderProfile: camera: 1, width: 352, height: 352, bitrate: 537777, quality: 1000, duration: 60, timeLapse true
04-08 00:31:38.318: I/MediaProfiles(16224500): createCamcorderProfile: camera: 1, width: 720, height: 720, bitrate: 4500000, quality: 1, duration: 60, timeLapse false
04-08 00:31:38.318: I/MediaProfiles(16224500): createCamcorderProfile: camera: 1, width: 720, height: 720, bitrate: 2250000, quality: 1001, duration: 60, timeLapse true
04-08 00:31:38.318: I/MediaProfiles(16224500): createCamcorderProfile: camera: 0, width: 320, height: 240, bitrate: 666666, quality: 7, duration: 60, timeLapse false
04-08 00:31:38.319: I/MediaProfiles(16224500): createCamcorderProfile: camera: 0, width: 320, height: 240, bitrate: 333333, quality: 1007, duration: 60, timeLapse true
04-08 00:31:38.319: I/MediaProfiles(16224500): createCamcorderProfile: camera: 0, width: 176, height: 144, bitrate: 220000, quality: 2, duration: 60, timeLapse false
04-08 00:31:38.319: I/MediaProfiles(16224500): createCamcorderProfile: camera: 0, width: 176, height: 144, bitrate: 110000, quality: 1002, duration: 60, timeLapse true
04-08 00:31:38.319: I/MediaProfiles(16224500): createCamcorderProfile: camera: 0, width: 352, height: 352, bitrate: 1075555, quality: 0, duration: 60, timeLapse false
04-08 00:31:38.320: I/MediaProfiles(16224500): createCamcorderProfile: camera: 0, width: 352, height: 352, bitrate: 537777, quality: 1000, duration: 60, timeLapse true
04-08 00:31:38.320: I/MediaProfiles(16224500): createCamcorderProfile: camera: 0, width: 720, height: 720, bitrate: 4500000, quality: 1, duration: 60, timeLapse false
04-08 00:31:38.320: I/MediaProfiles(16224500): createCamcorderProfile: camera: 0, width: 720, height: 720, bitrate: 2250000, quality: 1001, duration: 60, timeLapse true

 

so i think the camcorder profiles exists, but why the video resolution is not a low resolution when i select QUALITY_LOW option??????

Retired
Posts: 264
Registered: ‎01-08-2013
My Device: BlackBerry 10 Dev Alpha B
My Carrier: Bell

Re: camcorder profile android runtime record video blackberry 10

Hey josephdev89,

 

What resolution are your final results in?

 

Have you had a look over here: https://developer.blackberry.com/android/apisupport/apisupport_video_encoding_support.html

Justin Jasmann | Android Application Development Consultant
Developer Relations
developer.blackberry.com
New Contributor
Posts: 3
Registered: ‎04-07-2014
My Device: Q10
My Carrier: 5554962458

Re: camcorder profile android runtime record video blackberry 10

Hello, thanks for check my post, the resolution of the videos is 720x720, and yes i have checked the link you posted. 

I also tested two options, i mean one using a camcorder profile and the other especifying all the parameters like this:

 

mrec.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);

mrec.setVideoSource(MediaRecorder.VideoSource.CAMERA);

//mrec.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_LOW));

mrec.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP);

mrec.setVideoEncoder(MediaRecorder.VideoEncoder.H264);

mrec.setVideoEncodingBitRate(56000);

mrec.setVideoFrameRate(12);

mrec.setVideoSize(176 , 144);

mrec.setAudioEncoder(MediaRecorder.AudioEncoder.AAC_ELD);

mrec.setAudioChannels(1);

mrec.setAudioEncodingBitRate(24000);

 

and even this this changes, the video resolution is very hight 720x720.

 

I review all the forum before and found this

 

http://supportforums.blackberry.com/t5/Android-Runtime-Development/Blackberry10-android-run-time-How...

 

 

its the same case tha mine, but i cant see the solution, can you help me to see??