Just added cin_quality=1 to mp4.qt,mjpeg.qt, new profile mjpeg.avi and old flv. Files are much bigger, sure, but at least this doesn't show horrible blocking artefacts by default .... Writing interlaced avi still doesn't work :( even if ffmpeg support making such avi: https://trac.ffmpeg.org/ticket/6383 I also modified my patch to mimic that ffmpeg does more closely: ffmpeg: if (ost->top_field_first == 0) { enc_ctx->field_order = AV_FIELD_BB; } else if (ost->top_field_first == 1) { enc_ctx->field_order = AV_FIELD_TT; } if (frame) { if (enc_ctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT | AV_CODEC_FLAG_INTERLACED_ME) && ost->top_field_first >= 0) frame->top_field_first = !!ost->top_field_first; if (frame->interlaced_frame) { if (enc_ctx->codec->id == AV_CODEC_ID_MJPEG) enc_ctx->field_order = frame->top_field_first ? AV_FIELD_TT:AV_FIELD_BB; else enc_ctx->field_order = frame->top_field_first ? AV_FIELD_TB:AV_FIELD_BT; } else enc_ctx->field_order = AV_FIELD_PROGRESSIVE; } me: switch (asset->interlace_mode) { case ILACE_MODE_TOP_FIRST: if (ctx->codec->id == AV_CODEC_ID_MJPEG) av_dict_set(&sopts, "field_order", "tt", 0); else av_dict_set(&sopts, "field_order", "tb", 0); if (ctx->codec_id == AV_CODEC_ID_MPEG4 || ctx->codec_id == AV_CODEC_ID_MPEG2VIDEO) av_dict_set(&sopts, "flags", "+ilme+ildct", 0); break; case ILACE_MODE_BOTTOM_FIRST: if (ctx->codec->id == AV_CODEC_ID_MJPEG) av_dict_set(&sopts, "field_order", "bb", 0); else av_dict_set(&sopts, "field_order", "bt", 0); if (ctx->codec_id == AV_CODEC_ID_MPEG4 || ctx->codec_id == AV_CODEC_ID_MPEG2VIDEO) av_dict_set(&sopts, "flags", "+ilme+ildct", 0); break; case ILACE_MODE_NOTINTERLACED: av_dict_set(&sopts, "field_order", "progressive", 0); break; } file attached or at https://cloud.mail.ru/public/sVbF/4u6SQjJdn Still not sure about interlaced mpeg2/mpeg4 - field order might be wrong .... I'll try to rework this section of patch one more time :(