This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Omap 4460:Setting max bits per frame

Hi all,

Based on android 4.0, can I set the max bits per frame for H264?

 In low bit rate network environment, some H264 frames are even larger than 100k bits when the encoder is in default settings.

 And at this case, it can encode only 1-2 frames per second.

So I want to set the max size of the the frame.But I can't find relevant parameters.

Thx

regards,

changwenliang

  • You can check code in next file

    http://git.omapzoom.org/?p=platform/frameworks/base.git;a=blob;f=media/libstagefright/OMXCodec.cpp;h=60d9bb727800c4a6c56fbdbe6ef889fc9700aae7;hb=refs/heads/master

    ./mydroid/frameworks/base/media/libstagefright/OMXCodec.cpp

    check function

    status_t OMXCodec::setParameter(const String8 &key, const String8 &value){

    ....
        else if (key == "video-param-nalsize-bytes") {

    ....
        else if (key == "video-param-nalsize-macroblocks") {

    I haven't check exactly how latests video decoder handles this changes at RX or how Android lib Stagefright does it, but that is the idea.

    Code is called from

    ./mydroid/frameworks/base/media/libmediaplayerservice/StagefrightRecorder.cpp

    under a similar function name/code

    status_t StagefrightRecorder::setParameter( const String8 &key, const String8 &value) {

    ....

    #ifdef OMAP_ENHANCEMENT
        } else if ((key == "video-param-insert-i-frame") ||
                   (key == "video-param-nalsize-bytes") ||
                   (key == "video-param-nalsize-macroblocks") ||
                   (key == "video-config-encoding-bitrate") ||
                   (key == "video-config-encoding-framerate")) {
            return mVidEncoder->setParameter(key, value);
    #endif