Hello,
I am trying to encode 1080p H264 video. The code below is taken from the
'max' preset in the ffmpeg library.
Since I want good quality I am using qmin 10 and qmax 30 (default is 51,
which gives poor results).
However, with these quantizer settings, libav crashes when encoding. Using
quantizer settings qmax >= 35 works.
Lower resolutions take qmax = 30, but crash when I use values lower dan 30.
Does anyone know what I should change to prevent libav from crashing with
the best possible quality?
pVideoContext->time_base.den =
STREAM_FRAME_RATE;//time_base.den;//STREAM_FRAME_RATE;
pVideoContext->time_base.num = 1;//time_base.num;//1;
pVideoContext->pix_fmt = STREAM_PIX_FMT;
pVideoContext->flags = CODEC_FLAG_LOOP_FILTER |
CODEC_FLAG_GLOBAL_HEADER;
pVideoContext->coder_type = FF_CODER_TYPE_AC;
pVideoContext->partitions |= X264_PART_I4X4; /* Analyze i4x4 */
pVideoContext->partitions |= X264_PART_I8X8; /* Analyze i8x8 (requires
8x8 transform) */
pVideoContext->partitions |= X264_PART_P8X8; /* Analyze p16x8, p8x16
and p8x8 */
pVideoContext->partitions |= X264_PART_P4X4; /* Analyze p8x4, p4x8,
p4x4 */
pVideoContext->partitions |= X264_PART_B8X8; /* Analyze b16x8, b8x16
and b8x8 */
pVideoContext->thread_count = 0;
pVideoContext->me_method = 8;
pVideoContext->me_subpel_quality = 8;
pVideoContext->me_range = 16;
pVideoContext->me_cmp |= FF_CMP_CHROMA;
pVideoContext->keyint_min = 25;
pVideoContext->scenechange_threshold = 40;
pVideoContext->i_quant_factor = 0.71f;
pVideoContext->b_frame_strategy = 2;
pVideoContext->qcompress = 0.6f;
pVideoContext->qmin = 10; // qmin = 10*
pVideoContext->qmax = 30; //qmax = 51 **
pVideoContext->max_qdiff = 4; // qdiff=4 **
// Encoder won't open when set! pVideoContext->max_b_frames = 16;
pVideoContext->refs = 4;
pVideoContext->directpred = 3;
pVideoContext->trellis = 1;
pVideoContext->flags2 |= CODEC_FLAG2_WPRED | CODEC_FLAG2_MIXED_REFS |
CODEC_FLAG2_8X8DCT | CODEC_FLAG2_FASTPSKIP;
pVideoContext->gop_size = 250;
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user