Hi,

trying to do the equivalent of FFmpeg command-line output option "-q:v 3" on library level I came up with the following code (error checking stripped off):

    AVCodecContext *enc_ctx = NULL;
    const AVCodec *codec = avcodec_find_encoder_by_name("mjpeg");
    int ret;

    enc_ctx = avcodec_alloc_context3(codec);
    enc_ctx->flags |= AV_CODEC_FLAG_QSCALE;
    enc_ctx->global_quality = FF_QP2LAMBDA * 3.0;
    ret = avcodec_open2(enc_ctx, enc_ctx->codec, NULL);

Unfortunately it doesn't seem to have any effect on the output image size. Is there something obvious that I'm missing?

Regards,
Tobias

_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to