• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Digital Signal Processors (DSP) » DaVinci™ Video Processors » DM816x, C6A816x and AM389x Processors Forum » How two change encode framerate?
Share
DaVinci™ Video Processors
  • Forums
  • Announcements
Options
  • Subscribe via RSS

How two change encode framerate?

How two change encode framerate?

This question is answered
Mary long
Posted by Mary long
on Jan 04 2013 19:33 PM
Intellectual335 points

Hi,I use DVRRDK 03.00.00.00 for development. Hardware platform is EVM8168.

My code is used for test encode performance.

read raw data from files(interlace data) --> IpcFramesOutHLOS --> IpcFramesInVideoM3 -->Enc -->IpcBitsOutVideoM3 --> IpcBitsInHLOS --->save bits to files.

however, no matter which data i set for inputframerate, the encoded data always 30fps.

I also change the frames rate send to Encode(very slow), the encoded data always 30fps.

I read encode link codec, can't find which place set the 30fps encode, all place i printf showes that the framerate is 25fps, which is equal to what i set.

Can somebody help me?

8168 1080i 8168 DVR_RDK 1080p/30 encode 8168 codecs 8168 codec h264
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Badri Narayanan
    Posted by Badri Narayanan
    on Jan 04 2013 22:13 PM
    Mastermind23340 points

    Which API are you using to set encoder frame rate.Also pls share all the params to the API you are using.When you say fps is 30 do you mean when you play the stream in a PC player like VLC ?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mary long
    Posted by Mary long
    on Jan 04 2013 23:58 PM
    Intellectual335 points

    I set encoder frame rate use "encPrm.chCreateParams[i].defaultDynamicParams.inputFrameRate".

    All params I set is like this.


    for (i=0; i<SRC_NUM_CH; i++) {
    encPrm.chCreateParams[i].format = IVIDEO_H264HP;
    encPrm.chCreateParams[i].profile = IH264_HIGH_PROFILE;
    encPrm.chCreateParams[i].dataLayout = IVIDEO_FIELD_SEPARATED;//IVIDEO_FIELD_INTERLEAVED;//progressive ignore the param
    encPrm.chCreateParams[i].fieldMergeEncodeEnable = FALSE;
    encPrm.chCreateParams[i].maxBitRate = (6 * 1000 * 1000);//-1;
    encPrm.chCreateParams[i].encodingPreset = 1; // 3; 1: high quality
    encPrm.chCreateParams[i].enableHighSpeed = 0;
    encPrm.chCreateParams[i].encodingPreset = XDM_DEFAULT;
    encPrm.chCreateParams[i].enableAnalyticinfo = 0;
    encPrm.chCreateParams[i].enableWaterMarking = 0;
    encPrm.chCreateParams[i].rateControlPreset = IVIDEO_STORAGE;
    encPrm.chCreateParams[i].defaultDynamicParams.inputFrameRate = gDemo_info.frameRate;
    encPrm.chCreateParams[i].defaultDynamicParams.targetBitRate = (4 * 1000 * 1000);
    encPrm.chCreateParams[i].defaultDynamicParams.intraFrameInterval = 20;
    encPrm.chCreateParams[i].defaultDynamicParams.interFrameInterval = 1;// 1: no B frame.
    encPrm.chCreateParams[i].defaultDynamicParams.mvAccuracy = IVIDENC2_MOTIONVECTOR_QUARTERPEL;
    encPrm.chCreateParams[i].defaultDynamicParams.rcAlg = 0 ;
    encPrm.chCreateParams[i].defaultDynamicParams.qpMin = 10;
    encPrm.chCreateParams[i].defaultDynamicParams.qpMax = 40;
    encPrm.chCreateParams[i].defaultDynamicParams.qpInit = -1;
    encPrm.chCreateParams[i].defaultDynamicParams.vbrDuration = 8;
    encPrm.chCreateParams[i].defaultDynamicParams.vbrSensitivity = 0;
    }

    I use Elecard StreamEye Tools to see how many fps the encoded data is. I also use another tools to get fps,
    30fps shows too.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Badri Narayanan
    Posted by Badri Narayanan
    on Jan 05 2013 00:52 AM
    Mastermind23340 points

    Instead of setting as create param can you use the following APIs after Venc_start to set the encoder fps

                    Venc_setInputFrameRate(chId, xxx); --> Set the input FPS rate here (The rate at which you are feeding frames to encLink)

                    params.frameRate = xxx;--> Set the output fps you want the encoder to produce here

                    params.targetBitRate = xxx -> Set corresponding bitrate for the specified frame rate


                    Venc_setDynamicParam(chId, 0, &params, VENC_FRAMERATE);


    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mary long
    Posted by Mary long
    on Jan 05 2013 03:15 AM
    Intellectual335 points

    Hi, Narayanan

    I add these in my codec, place then after enclink start.

    VENC_CHN_DYNAMIC_PARAM_S params;

    memset(&params, 0, sizeof(params));
    params.frameRate = 25;
    params.targetBitRate = 5000000;

    Venc_setInputFrameRate(0, 25);
    Venc_setDynamicParam(0, 0, &params, ENC_FRAMERATE);

    however, it seems not work, the out fps still 30.

    Is DVRRDK 3.0 support change fps when encode interlace data?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mary long
    Posted by Mary long
    on Jan 05 2013 05:10 AM
    Intellectual335 points

    Hi, Narayanan

    I use API Venc_getDynamicParam to get encode dynamic param, the frame rate equal to the value i set. 

    however, when i use tools to get fps, it is still 30 fps.

    Can you provide some suggesions for me? Ths~

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Badri Narayanan
    Posted by Badri Narayanan
    on Jan 05 2013 10:44 AM
    Mastermind23340 points

    Can you analyze the stream to check if timingInfo VUI parameters are present in the stream . If they are not present player may be assuming 30 fps by default.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mary long
    Posted by Mary long
    on Jan 05 2013 19:21 PM
    Intellectual335 points

    Hi, Narayanan

     the vui_parameters_present_flag equal 0. 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Badri Narayanan
    Posted by Badri Narayanan
    on Jan 05 2013 19:32 PM
    Mastermind23340 points

    Pls check if the following changes are present in your codebase:

    /dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_h264.c

    1.#define ENCLINK_H264_SETNALU_MASK_SPS(naluMask) ((naluMask) |= (1 << IH264_NALU_TYPE_SPS_WITH_VUI))

    2.enclink_h264_set_static_params()

        staticParams->vuiCodingParams.timingInfoPresentFlag = 1;

    The SPS should have VUI.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mary long
    Posted by Mary long
    on Jan 05 2013 20:04 PM
    Intellectual335 points

    Hi ,Narayanan

    I can find both of them in encLink_h264.c.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Badri Narayanan
    Posted by Badri Narayanan
    on Jan 06 2013 00:38 AM
    Mastermind23340 points

    Are you checking the SPS for VUI info ? Pls check the IDR frame after you set the frame rate. Can you try setting

        staticParams->vuiCodingParams.vuiCodingPreset = IH264_VUICODING_DEFAULT;

    and see if it makes any difference

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mary long
    Posted by Mary long
    on Jan 06 2013 01:17 AM
    Intellectual335 points

    Hi, Narayanan

    I set  staticParams->vuiCodingParams.vuiCodingPreset = IH264_VUICODING_DEFAULT in enclink_h264_set_static_params function, there is no difference than before.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mary long
    Posted by Mary long
    on Jan 06 2013 19:19 PM
    Intellectual335 points

    Hi Narayanan

    The SPS have no VUI info because of vui_parameters_present_flag equal 0.

    what's the mean of  "check the IDR frame after you set the frame rate"? 

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mary long
    Posted by Mary long
    on Jan 06 2013 20:53 PM
    Intellectual335 points

    Hi Narayanan

    I use tools to check the encoded bitstream, all I-Frames not an IDR-Frame, except for the first I-frame.

    I find that 

    • IDRFrameInterval is set to 1 (dvr_rdk/mcfw/src_bios6/links_m3video/iva_enc/encLink_h264.c )

    What should i do next, can you give me some suggustion? Ths~

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Badri Narayanan
    Posted by Badri Narayanan
    on Jan 06 2013 22:00 PM
    Verified Answer
    Verified by Mary long
    Mastermind23340 points

    Pls set encodingPreset in encLink ch create params to XDM_USER_DEFINED for configuration to take effect.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mary long
    Posted by Mary long
    on Jan 07 2013 01:05 AM
    Intellectual335 points

    Hi Narayanan

    I set encodingPresent in my codec.

          encPrm.chCreateParams[i].encodingPreset = XDM_USER_DEFINED;//XDM_DEFAULT;

    I also set  vuiCodingPreset in  enclink_h264.c 

          staticParams->vuiCodingParams.vuiCodingPreset = IH264_VUICODING_USERDEFINED;// IH264_VUICODING_DEFAULT;//
          staticParams->vuiCodingParams.hrdParamsPresentFlag = 1;
          staticParams->vuiCodingParams.timingInfoPresentFlag = 1; // 1

     the framerate can change now.

    Thank you very much. ~.~

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
12
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use