[Cin] Tweaked few profiles for better quality by default
Andrew Randrianasulu
randrianasulu at gmail.com
Wed Nov 18 15:20:30 CET 2020
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 :(
-------------- next part --------------
A non-text attachment was scrubbed...
Name: interlace_aspect_autodetect-11.patch
Type: text/x-diff
Size: 11529 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20201118/e1106a7d/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mjpeg.avi
Type: application/octet-stream
Size: 24 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20201118/e1106a7d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mjpg.qt
Type: application/octet-stream
Size: 24 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20201118/e1106a7d/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mp4.qt
Type: application/octet-stream
Size: 24 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20201118/e1106a7d/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: flv.flv
Type: application/octet-stream
Size: 21 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20201118/e1106a7d/attachment-0003.obj>
More information about the Cin
mailing list