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

Native Development

Reply
Contributor
Posts: 18
Registered: ‎03-30-2012
My Device: Playbook
My Carrier: Ropdgers

Setting video bitrate

Hi,

 

I am trying to set video bitrate using:

 

camera_set_video_property(mCameraHandle, CAMERA_IMGPROP_VIDEOCODEC, CAMERA_VIDEOCODEC_H264,
                        CAMERA_IMGPROP_AUDIOCODEC, CAMERA_AUDIOCODEC_AAC);

 

camera_set_videoencoder_parameter(mCameraHandle, CAMERA_H264AVC_BITRATE, 300000,
                        CAMERA_H264AVC_RATECONTROL, CAMERA_H264AVC_RATECONTROL_CBR
                        CAMERA_H264AVC_PROFILE, CAMERA_H264AVC_PROFILE_CONSTRAINEDBASELINE,
                        CAMERA_H264AVC_LEVEL, CAMERA_H264AVC_LEVEL_12);

 

I included <camera/camera_api.h>  but I get the errors "'CAMERA_H264AVC_BITRATE' was not declared in this scope". What do I need to include to solve this?


Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Setting video bitrate

Hi,

 

You might have to include this file as well;

 

camera_h264avc.h:    CAMERA_H264AVC_BITRATE = 0,

 

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 18
Registered: ‎03-30-2012
My Device: Playbook
My Carrier: Ropdgers

Re: Setting video bitrate

Thank you for the reply. I tried including camera_h264avc.h but get an unresolved inclusion error. I get the same error with camera_encoder.h . Any help is appreciated.
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Setting video bitrate

Hi,

 

Can you share the full compilation error?

 

My last post had the path missing - I ran grep from inside the camera subfolder... For completeness it should be:

 

camera/camera_h264avc.h:    CAMERA_H264AVC_BITRATE = 0,

 

 

 

 

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 18
Registered: ‎03-30-2012
My Device: Playbook
My Carrier: Ropdgers

Re: Setting video bitrate

In the header file I have :

#include <camera/camera_api.h>
#include <camera/camera_h264avc.h>

camera_api.h works well. Error is:

fatal error: camera/camera_h264avc.h: No such file or directory


The function is
camera_set_videoencoder_parameter(mCameraHandle, CAMERA_H264AVC_BITRATE, 300000,
CAMERA_H264AVC_RATECONTROL, CAMERA_H264AVC_RATECONTROL_CBR
CAMERA_H264AVC_PROFILE, CAMERA_H264AVC_PROFILE_CONSTRAINEDBASELINE,
CAMERA_H264AVC_LEVEL, CAMERA_H264AVC_LEVEL_12);
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Setting video bitrate

Which version of the NDK do you have installed? I don't see any bugs logged about this file missing...

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 18
Registered: ‎03-30-2012
My Device: Playbook
My Carrier: Ropdgers

Re: Setting video bitrate

NDK 10.1, Momentics 10.2. I reinstalled the NDK when moving to Momentics 10.2
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Setting video bitrate

Perhaps a reinstall is required... Or a remove/install of the headers/tooling part anyway...

 

As a work around the missing file you could define the enum and set that variable to 0...

--
Rob is no longer associated with BlackBerry.
Contributor
Posts: 18
Registered: ‎03-30-2012
My Device: Playbook
My Carrier: Ropdgers

Re: Setting video bitrate

I was not able to find the values for AMERA_H264AVC_RATECONTROL_CBR, CAMERA_H264AVC_PROFILE_CONSTRAINEDBASELINE, CAMERA_H264AVC_LEVEL_12

do you know where these are listed?
Highlighted
Retired
Posts: 418
Registered: ‎07-18-2012
My Device: Q10
My Carrier: Bell Canada

Re: Setting video bitrate

Hi, I'd already PM the whole header to you...
--
Rob is no longer associated with BlackBerry.