[Libav-user] how to use qscale in lib av api

Steffen Steffen.Roeber at hella.com
Tue Apr 30 12:17:19 CEST 2013


I try to use qscale. But the value (whether 1 or 31) does not change the
output file size:

      avcodec_get_context_defaults3(formatContext->streams[0]->codec,
codec);
      if (formatContext->oformat->flags & AVFMT_GLOBALHEADER)
      {
        formatContext->streams[0]->codec->flags |= CODEC_FLAG_GLOBAL_HEADER;
      }
      formatContext->streams[0]->codec->codec_id = codec->id;
      formatContext->streams[0]->codec->codec_type = codec->type;
      formatContext->streams[0]->codec->width = i_image.getWidth();
      formatContext->streams[0]->codec->height = i_image.getHeight();
      formatContext->streams[0]->codec->time_base.num = factor;
      formatContext->streams[0]->codec->time_base.den = f;
      formatContext->streams[0]->codec->bit_rate = bitrate;
      if (qscale >= 0)
      {
        formatContext->streams[0]->codec->flags |= CODEC_FLAG_QSCALE;
        formatContext->streams[0]->codec->global_quality = FF_QP2LAMBDA *
qscale;
      }



--
View this message in context: http://libav-users.943685.n4.nabble.com/how-to-use-qscale-in-lib-av-api-tp4657440.html
Sent from the libav-users mailing list archive at Nabble.com.


More information about the Libav-user mailing list