В сообщении от Wednesday 02 December 2020 02:27:43 Phyllis Smith via Cin написал(а):
Andrew, I could not reproduce the crash I got the other day so have finally *checked into GIT interlace_aspect_autodetect-12.patch *(from the ru download site). I tested and saw the correct interlace mode in the Resources window media folder "info" and under Settings->Format. Also looked at the code but I do not know much about C++. But the one thing that I for sure do not comprehend in the patch is the section in fileffmpeg.C about the Fixups (maybe this was explained in a different email though):
Well, if you try to bring up 'format options' for say mkv or qt format CinGG will complain without this patch Just names used for format (container) not always match what libavcodec/libavformat use ... This code tries to fix up difference, so you can set some of container options via GUI now.
Asset *asset = fmt_config->asset; char *format_name = asset->fformat; + char *replace_name0 = "mov"; + char *replace_name1 = "mpegts"; + char *replace_name2 = "matroska"; + if (!strcmp(format_name, "qt")) + format_name = replace_name0; // fixup + if (!strcmp(format_name, "m2ts")) + format_name = replace_name1; // fixup + if (!strcmp(format_name, "mkv")) + format_name = replace_name2; // fixup
And in mwindow.C, why is it needed to specifically add the following?:
well, in theory this must be function, not code duplication .. this just sets session (display) aspect ratio (so if you bring up 'mainwindow menu->Format' you will see correcty-picked up values, not default 4:3) I'm a bit confused between session vs asset, because encoding for example seems to use asset's parameters (or may be they just stored there).
+ float ar = asset->aspect_ratio; + if (ar) { + //printf ("Aspect ratio from asset: %f \n", ar); + if( EQUIV(ar, 1.3333) ) { session->aspect_w = 4; session->aspect_h = 3; } + if( EQUIV(ar, 1.7777) ) { session->aspect_w = 16; session->aspect_h = 9; } + if( EQUIV(ar, 2.1111) ) { session->aspect_w = 19; session->aspect_h = 9; } + if( EQUIV(ar, 2.2222) ) { session->aspect_w = 20; session->aspect_h = 9; } + if( EQUIV(ar, 2.3333) ) { session->aspect_w = 21; session->aspect_h = 9; } + if( EQUIV(ar, 2.370370) ) { session->aspect_w = 64; session->aspect_h = 27; }