You could try to export into PPM and use some other tool to convert into JPEG.
I looked into ffmpeg/libavcodec/mjpeg.c. I believe the quality is set to a fixed value.
Also you seem to convert a MJPEG video into JPEG still frames. I think in this case the code in ffmpeg/libavcodec/mjpeg2jpeg_bsf.c runs and the data isn't recoded. So the image quality wouldn't improve anyway.
This is the quantization table definition, I didn't see any reference to *val_?c where the values were scaled before use.
/* Set up the standard Huffman tables (cf. JPEG standard section K.3) */
/* IMPORTANT: these are only valid for 8-bit data precision! */
const uint8_t ff_mjpeg_bits_dc_luminance[17] =
{ /* 0-base */ 0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 };
const uint8_t ff_mjpeg_val_dc[12] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 };
const uint8_t ff_mjpeg_bits_dc_chrominance[17] =
{ /* 0-base */ 0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0 };
const uint8_t ff_mjpeg_bits_ac_luminance[17] =
{ /* 0-base */ 0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 0x7d };
const uint8_t ff_mjpeg_val_ac_luminance[] =
{ 0x01, 0x02, 0x03, 0x00, 0x04, 0x11, 0x05, 0x12,
2
I don't know if this was available years ago but if you want the source JPEG images unmodified from MJPEG, the answer is here: https://ffmpeg.org/ffmpeg-bitstream-filters.html#mjpeg2jpeg ---- In short:
– juanitogan – 2016-12-24T11:51:24.307-c:v copy -bsf:v mjpeg2jpeg
instead ofq:v 1
.1Does anyone know what default value it uses? – Jay R. Wren – 2017-10-10T16:35:26.927
@JayR.Wren I did some tests and in my case it seems to start out low (good) and after a few seconds rises to 24.8 (bad). I don't know why. ffmpegs shows the current quality as
q
. Here it is 24.8 for exampleframe= 64 fps=5.0 q=24.8 Lsize=N/A time=00:00:16.00 bitrate=N/A dup=10 drop=299 speed=1.25x
– problemofficer – 2019-05-02T16:26:22.440