+ if (is_mjpeg && !format.full_range) {
+ // Limited-range MJPEG is only detected by FFmpeg whenever a special
+ // JPEG comment is set, which means that in practice, the stream is
+ // almost certainly generated by Futatabi. Override FFmpeg's forced
+ // MJPEG defaults (it disregards the values set in the mux) with what
+ // Futatabi sets.
+ format.luma_coefficients = YCBCR_REC_709;
+ format.cb_x_position = 0.0;
+ format.cb_y_position = 0.5;
+ }
+