• 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 » Embedded Software » Multimedia Software Codecs » Multimedia Software Codecs forum » H264 Bit Rate / Quality Settings (DM6467)
Share
Multimedia Software Codecs
  • Forum
Options
  • Subscribe via RSS

Forums

H264 Bit Rate / Quality Settings (DM6467)

  • BrandyJ
    Posted by BrandyJ
    on Aug 17 2011 10:56 AM
    Genius4370 points

    hello,

    I am using the Video Encoding h264enc 720p h264 base profile video encoder version 1.20.02 for the dm6467t.  I am having a problem with bit rate.  I need to keep the bit rate low but I can seem to do that without generating lots of zero frames.

    For example, if I have a stream of 720x480 images at a frame rate of 8fps then I need to average about ~12000 bytes for each encoder frame.  However, if ask for a bit rate of something that should be able to handle this like 800000 bits, I often see that a single frame will take up almost the entire bit count and then the rest of the frames in that second will end up being zero frames or skipped.

    I can't seem to understand how best to configure my codec to do what I want.  The I frames can take up more of the bit rate, but I can't have this many skipped frames.

    I found this link for a different component:

    http://processors.wiki.ti.com/index.php/DM36x_Rate_Control_Modes

    Is there a similar link for dm6467?  How can I best control the bitrate for the encoder?  What are my options?

    Thanks,

    Brandy

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mahantesh S Madiwalar
    Posted by Mahantesh S Madiwalar
    on Aug 18 2011 09:56 AM
    Intellectual1790 points

    Hi Brandy,

    I will come back on this probably on Monday.

    Regards,

    Mahantesh

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • BrandyJ
    Posted by BrandyJ
    on Aug 18 2011 10:06 AM
    Genius4370 points

    ok thanks.  Is there any more information you need?

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • BrandyJ
    Posted by BrandyJ
    on Aug 18 2011 14:34 PM
    Genius4370 points

    Hello again Mahantesh,

    Thanks for your support.  I would like to add another query, is it possible to add HRD sequence to this encoder?  If it cannot support this automatically, how could I do it from the application side?  Is there any information I could use about this SEI (Supplemental Enhancement Information) to manually create this data to send with the SPS/PPS headers?  I am see that the decoders are not able to properly decode becuase my frame rate is much smaller than 30 fps.

    Brandy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mahantesh S Madiwalar
    Posted by Mahantesh S Madiwalar
    on Sep 05 2011 09:28 AM
    Intellectual1790 points

    Hi Brandy,

    1. To avoid many frame skips can you try with using VBR mode of RC and please check your QP values as well. No similar docs were available for DM6467 codecs.

    2. The encoder generates the bits stream which is conforming to NAL unit stream.

    But, your following query is not clear, can you please put in other words,

    is it possible to add HRD sequence to this encoder?

    Regards,

    Mahantesh

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • BrandyJ
    Posted by BrandyJ
    on Sep 06 2011 11:13 AM
    Genius4370 points

    Hi Mahantesh,

    Thanks for not forgetting about me :)

    First let me comment on your comments, then I will share with you my progress.

    1.  I cannot use VBR becuase then there is not enough compression of image.  What I mean is, the output buffer size is too large and I can not effectively stream the video image.

    2.  I have used a buffer analyzer and can see that the NAL units are correct but they are limited.  There is a SPS/PPS only with IDR frames and slice header with every frame.

    What I need are timing NAL units.  There is someting called the VUI parameters inside the SPS.  If you enable this flag, then a lot of timing options are available, including the NAL_HRD paramters and the VLC_HRD parameters.  Once these are enabled in the SPS then you can use the SEI message pic_timing and buffer_period.

    Since we last chatted, I was able to correctly format my own version of the SPS, PPS and various SEI messages manually.  I am no longer using the headers that are generated by the encoder.  I merely overwrite them with my SPS/PPS and the additional data.

    However, now I am struggle to determine what values to place in these message pic_timing and buffer_period.  I have looked at the H264 specification but it is difficult to decode.  Do you have any expertise in this subject now that I have explained it more?  What should the values be in the cpb_removal_delay and the dpb_output_delay?  Perhaps a collegue from the DM365 codec team could help since they seem to have done this already inside their codec?

    Here what my headers look like right now.  Sorry about the formatting.

    Thanks for your help,

    Brandy

    _________________________________________________________________________________________________________

       [00]seq_parameter_set_rbsp() {
        profile_idc                                    = 66 (Baseline)
        constraint_set0_flag                           = 1 (true)
        constraint_set1_flag                           = 0 (false)
        constraint_set2_flag                           = 0 (false)
        constraint_set3_flag                           = 0 (false)
        reserved_zero_4bits                            = 0 (false)
        level_idc                                      = 40
        seq_parameter_set_id                           = 0
        if (profile_idc == 100 || profile_idc == 110 || profile_idc == 122 || profile_idc == 144) {
        log2_max_frame_num_minus4                      = 0 (4)
        pic_order_cnt_type                             = 0
        if (pic_order_cnt_type == 0)
        else if (pic_order_cnt_type == 1) {
        num_ref_frames                                 = 1
        gaps_in_frame_num_value_allowed_flag           = 0
        pic_width_in_mbs_minus1                        = 44 (720)
        pic_height_in_map_units_minus1                 = 29 (480)
        frame_mbs_only_flag                            = 1
        if (!frame_mbs_only_flag)
        direct_8x8_inference_flag                      = 0 (false)
        frame_cropping_flag                            = 0 (false)
        if (frame_cropping_flag) {
        vui_parameters_present_flag                    = 1 (true)
        if (vui_parameters_present_flag)
          vui_parameters() {
            aspect_ratio_info_present_flag             = 0 (false)
            if (aspect_ratio_info_present_flag) {
            overscan_info_present_flag                 = 0 (false)
            if (overscan_info_present_flag)
            video_signal_type_present_flag             = 1 (true)
            if (video_signal_type_present_flag) {
            chroma_location_info_present_flag          = 0 (false)
            if (chroma_loc_info_present_flag) {
            timing_info_present_flag                   = 0 (false)
            if (timing_info_present_flag) {
            nal_hrd_parameters_present_flag            = 1 (true)
            if (nal_hrd_parameters_present_flag)
              nal_hrd_parameters() {
                cpb_cnt_minus1                         = 0 (1)
                bit_rate_scale                         = 1
                cpb_size_scale                         = 3
                for (SchedSelIdx = 0; SchedSelIdx <= cpb_cnt_minus1; SchedSelIdx++) {
                initial_cpb_removal_delay_length_minus1 = 23
                cpb_removal_delay_length_minus1        = 22
                dpb_output_delay_length_minus1         = 22
                time_offset_length                     = 0
                }
              }
            vcl_hrd_parameters_present_flag            = 1 (true)
            if (vcl_hrd_parameters_present_flag)
            if (nal_hrd_parameters_present_flag || vcl_hrd_parameters_present_flag)
            pic_struct_present_flag                    = 0 (false)
            bitstream_restriction_flag                 = 0 (false)
            if (bitstream_restriction_flag) {
            }
          }
        }
      [00]pic_parameter_set_rbsp() {
      [00]slice_header() {
      [00]sei() {                                      = 35
      [01]sei() {                                      = 20
        buffering_period() {
          seq_parameter_set_id                         = 0
          if (NalHrdBpPresentFlag) {
            for (SchedSelIdx = 0; SchedSelIdx <= cpb_cnt_minus1; SchedSelIdx++) {
              initial_cpb_removal_delay[00]            = 9000
              initial_cpb_removal_delay_offset[00]     = 0
              }
            }
          if (VclHrdBpPresentFlag) {
          }
        }
      [02]sei() {                                      = 14
        pic_timing() {
          if (CpbDpbDelaysPresentFlag) {
            cpb_removal_delay                          = 0
            dpb_output_delay                           = 0
            }
          if (pic_struct_present_flag) {
          }
        }

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mahantesh S Madiwalar
    Posted by Mahantesh S Madiwalar
    on Sep 20 2011 08:43 AM
    Intellectual1790 points

    Hi Brandy,

    Can you please, specify your use cases or config parameters used, so that it will be easy to recomend for VUI and SEI messages.

    Regards,

    Mahantesh

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • BrandyJ
    Posted by BrandyJ
    on Sep 20 2011 08:51 AM
    Genius4370 points

    Sure.  My video stream is expected to be at 8fps.  The quality values are set to default and I am using CBR set to 800,000.  I need to keep the compressed frame size to around 12000 bits for a 720x480 frame.

    I am currently starting to think about extending the encParams struct to expose the quality parameters to see if I can figure out how to decrease the quality a bit and so that the encoder will produce fewer zero byte frames.

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Claudio Filipponi
    Posted by Claudio Filipponi
    on Sep 26 2011 11:26 AM
    Intellectual680 points

    Hello,

    I'm using dm6467 to encode video in h264.

    I have also a similar problem.

    My contraints are:

     

    video CBR, 128000 bps ( very low), with an IDR frame every second ( framerate 30fps ).

    How can I configure the encoder to avoid frame skip?

     

    With dm365 I had not problems, but dm6467 seems to have a poor bitrate control, right?

     

    Thanks

    Claudio

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • BrandyJ
    Posted by BrandyJ
    on Sep 27 2011 07:26 AM
    Genius4370 points

    Hi Claudio,

    I have had a thought to try to extend the parameters as described with the IH264VENC_DynamicParameters.  I have not yet had a chance.  I hoping with these extended parameters that we could control the quality a bit better and be able to tell the codec to produce less quality in order to share the bits better across the stream.

    If I find that some parameter set is working, I will post it for you.  Perhaps you could also hint if you get to it before me.

    Also, I find that TI tends to ignore older posts - you might be better off starting a new post and I will suscribe to your post to see if they respond with some ideas for you.

    Good luck!

    Brandy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Claudio Filipponi
    Posted by Claudio Filipponi
    on Sep 27 2011 07:47 AM
    Intellectual680 points

    Hi!

    Working on the extended parameters seems to produce some result.

    QPISlice, QPSlice, RateCtrlQpMax and  RateCtrlQpMin are the involved parameters.

    So, depending on the bitrate required ( in CBR mode),  I set different value of these QP params.

     

     

    Good luck!
    Claudio

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mahantesh S Madiwalar
    Posted by Mahantesh S Madiwalar
    on Sep 30 2011 02:50 AM
    Intellectual1790 points

    Hi,

    Hope your problem get resolved, thanks for each other's help. Please get back if you have any other issues. TI will never ignore to reply the queries, however there might be some delay if we are busy with some other urgent tasks.

    Regards,

    Mahantesh  

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Claudio Filipponi
    Posted by Claudio Filipponi
    on Nov 17 2011 13:56 PM
    Intellectual680 points

    Hello Mahantesh,

    Quantitation parameters seems to help to avoid frame skip in CBR.

    However, the constant bitrate is really an issue when IDR frames are forced ( like 1 every 30 frames ).

    For me is really a problem, I need a good CBR at low bitrate, forcing 1 IDR every 30-60 frames.

     

    Do you have any suggestion?
    Please help

    regards.

    PS: any chance to have control bitrate like dm365?

     

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • BrandyJ
    Posted by BrandyJ
    on Nov 17 2011 14:00 PM
    Genius4370 points

    Hello Mahantesh,

    This is the problem I see too.  It is inevitable that when I have to generate an IDR frame that there will be zero frames surronding it.  I also need a good, low CBR while still forcing IDR frames every 60 frames.

    Thanks,
    Brandy

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Mahantesh S Madiwalar
    Posted by Mahantesh S Madiwalar
    on Nov 18 2011 08:38 AM
    Intellectual1790 points

    Hi Guys,

    I will probably come back on this on Monday.

    Regards,

    Mahantesh

     

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
123
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