Skip to content

Commit bbc5aa1

Browse files
qmin/qmax=1 seems to be required for high quality images
1 parent ca8760b commit bbc5aa1

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/zm_stream.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,19 @@ bool StreamBase::initContexts(int p_width, int p_height, unsigned int quality) {
6161
Error("Could not allocate jpeg codec context");
6262
return false;
6363
}
64-
65-
/*
66-
mJpegCodecContext->bit_rate = bitrate;
67-
*/
64+
mJpegCodecContext->bit_rate = 2000000;
6865
mJpegCodecContext->width = p_width;
6966
mJpegCodecContext->height = p_height;
70-
mJpegCodecContext->qcompress = quality/100; // 0-1
67+
mJpegCodecContext->qcompress = quality/100.0; // 0-1
68+
mJpegCodecContext->qmax = 1;
69+
mJpegCodecContext->qmin = 1; //quality/100.0; // 0-1
70+
mJpegCodecContext->global_quality = quality/100.0; // 0-1
71+
/*
72+
mJpegCodecContext->qscale = 1;
73+
*/
7174
mJpegCodecContext->time_base= (AVRational) {1,25};
7275
mJpegCodecContext->pix_fmt = AV_PIX_FMT_YUVJ420P;
76+
Debug(1, "initting to %dx%d qcompress %f", p_width, p_height, quality/100.0);
7377

7478
if (avcodec_open2(mJpegCodecContext, mJpegCodec, NULL) < 0) {
7579
Error("Could not open mjpeg codec");

0 commit comments

Comments
 (0)