Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1025147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T11:53:04+00:00 2026-05-16T11:53:04+00:00

I am attempting to encode video using libavcodec/libavformat. Audio works great, but when I

  • 0

I am attempting to encode video using libavcodec/libavformat. Audio works great, but when I try to encode video I get the following errors:

[libx264 @ 0x10182a000]broken ffmpeg default settings detected  
[libx264 @ 0x10182a000]use an encoding preset (vpre)  

easy to fix using the command line ffmpeg, but I am trying to do this in C.
my options are

AVStream *pVideoOutStream = av_new_stream(pOutFormatCtx, 0);  
AVCodecContext *pVideoOutCodecCtx  = pVideoOutStream->codec;  

pVideoOutCodecCtx->codec_id        = CODEC_ID_H264;    
pVideoOutCodecCtx->codec_type      = CODEC_TYPE_VIDEO;  
pVideoOutCodecCtx->bit_rate        = pVideoInCodecCtx->bit_rate;  
pVideoOutCodecCtx->width           = pVideoInCodecCtx->width;    
pVideoOutCodecCtx->height          = pVideoInCodecCtx->height;  
pVideoOutCodecCtx->pix_fmt         = pVideoInCodecCtx->pix_fmt;    
pVideoOutCodecCtx->sample_rate     = pVideoInCodecCtx->sample_rate;    
pVideoOutCodecCtx->gop_size        = 30;  

but avcodec_open() fails.

What other values do I need to set to make x264 happy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T11:53:05+00:00Added an answer on May 16, 2026 at 11:53 am

    Not sure whether you got it working, but the following parameters work for me.

    ctx->bit_rate = 500*1000;
    ctx->bit_rate_tolerance = 0;
    ctx->rc_max_rate = 0;
    ctx->rc_buffer_size = 0;
    ctx->gop_size = 40;
    ctx->max_b_frames = 3;
    ctx->b_frame_strategy = 1;
    ctx->coder_type = 1;
    ctx->me_cmp = 1;
    ctx->me_range = 16;
    ctx->qmin = 10;
    ctx->qmax = 51;
    ctx->scenechange_threshold = 40;
    ctx->flags |= CODEC_FLAG_LOOP_FILTER;
    ctx->me_method = ME_HEX;
    ctx->me_subpel_quality = 5;
    ctx->i_quant_factor = 0.71;
    ctx->qcompress = 0.6;
    ctx->max_qdiff = 4;
    ctx->directpred = 1;
    ctx->flags2 |= CODEC_FLAG2_FASTPSKIP;
    

    The error message broken ffmpeg default settings detected is displayed in the x264 library in x264/encoder/encoder.c when too many settings are the default ffmpeg settings (e.g. qmin = 2, qmax = 31, qcompress = 0.5), changing these three values to something else, e.g. qmin = 10, qmax = 51, qcompress = 0.6, resolves the error.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to following the tutorials found here: http://www.ifadey.com/2010/06/crud-using-jquery-and-codeigniter/ My code is updated to
Okay I'm attempting to use php to encode a json file I'm subsequently using
Attempting to get Spring internationalization working. I have used classpath:messages basename, created .properties files
Attempting/struggling to get registration and sign-up working within an active admin project. I have
I receive error messages when attempting to encode files in Expression Encoder when the
I'm using AS3 to base64 encode a JPG and pass it to Javascript. I'm
I'm attempting to pass the contents of a file into a Webview. Using the
I'm attempting to encode the encrypted id in the Url. Like this: http://www.calemadr.com/Membership/Welcome/9xCnCLIwzxzBuPEjqJFxC6XJdAZqQsIDqNrRUJoW6229IIeeL4eXl5n1cnYapg+N However,
I'm having what seems to be a rather strange error when attempting to encode
I am attempting to make a pie chart using a php file that gets

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.