I am trying to use libavcodec (ffmpeg) to encode raw pixel data in mp4 format. Everything is going well, and I get a .avi file with decent quality, but sometimes the codec gives a warning "the encoded frame is too big." And when he does, part of some frames (usually the bottom of the frame) looks distorted or everything is messed up. Can anyone tell me when this warning will be given. Below are the settings that I use for the encoder:
qmax = 6; qmin = 2; bit_rate = 200000; // if I increase this, I get more warnings. width = 1360; height = 768; time_base.den = 15; // frames per second time_base.num = 1; gop_size = 48; pix_fmt = PIX_FMT_YUV420P;
Hi,
, , ffmpeg 2 . , 1080p 3 , 2 .
, / .
, . rc_buffer_size. , :
ctx->bit_rate = 500000; 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;
In the code example, I found something like:
outbuf_size = 100000; outbuf = malloc(outbuf_size); [...] out_size = avcodec_encode_video(c, outbuf, outbuf_size, picture);
Pressing outbuf_sizefor a greater degree eliminates the problem.
outbuf_size
Source: https://habr.com/ru/post/1768056/More articles:Calling a method inside a 32-bit .NET dll from a 64-bit version of .NET using reflection - reflectionWorking with binary data in PHP - phpRegex, I need to improve a method to get src and alt from an image - c #Использование метода SPListCollection.Add(String, String, String, String, Int32, String, SPListTemplate.QuickLaunchOptions) в sharepoint - listA regular or grep regular expression matches two lines that are almost the same - regexEclipse ide cannot resolve variables in newly written functions - javaHow to add multiple sorting options on a category page in magento? - phpMigrator.Net - create from existing database - .netHow to set richtext field in pencil to custom width? - firefox-addonAgnostic automatic deployment - javaAll Articles