On Monday 24 September 2012 21:35:04 Dan Dennedy wrote:
> On Mon, Sep 24, 2012 at 9:02 AM, j-b-m <j-...@users.sourceforge.net> wrote:
> > Hi again.
> > 
> > The affine transition is also having problems with aspect ratio.
> > When using an "Affine" transition to display a full HD 1920x1080 video in
> > a
> > HDV (1440x1080) project, the result is a small picture, not using full
> > screen. Using a Composite transition it works fine.
> > 
> > Problem can be seen using melt:
> > 
> > melt -profile hdv_1080_50i color:white out=200 -track fullhdclip.mov -
> > transition affine geometry="0/0:100%x100%"
> 
> I am not surprised to hear of it, but I did not reproduce it with that
> or on kdenlive timeline transitioning with the hidden black track,
> checking in monitor only. I would like to confirm the problem and fix.

Ok, after some more tests, here is a way to reproduce with color producer:

Create an 1920x1080 clip:

melt -profile atsc_1080i_50 color:red out=100 -consumer avformat:red.mp4 

Try to make a transition with color clip with HDV profile:

melt -profile hdv_1080_50i color:blue out=100 -track red.mp4 -transition 
affine geometry="0/0:100%x100%:50%"

You will see that the red.mp4 clip does not take the full screen. The bug also 
happens when using avformat producers.

> > --- a/src/modules/plus/transition_affine.c
> > +++ b/src/modules/plus/transition_affine.c
> > @@ -487,18 +487,22 @@ static int transition_get_image( mlt_frame a_frame,
> > uint8_t **image, mlt_image_f
> > 
> >                         double consumer_dar = consumer_ar *
> >                         normalised_width /
> > 
> > normalised_height;
> > 
> >                         double b_ar = mlt_properties_get_double( b_props,
> > 
> > "aspect_ratio" );
> > 
> >                         double b_dar = b_ar * b_width / b_height;
> > 
> > -
> > +                       if ( abs( ( consumer_dar - b_dar ) * 1000 ) < 1 )
> > +                       {
> > +                           // We consider aspect ratio is equal, no
> > scaling +                       }
> 
> That code does not actually do anything, because there is no else in
> front of this "if?" If you change this to make it do something, then
> also check if you meant to use fabs() instead of abs().

Yes, sorry. I sent a wrong version of the patch. Here is a slightly updated 
one.

regards

jb

---------------------------------------------------------------------------

diff --git a/src/modules/plus/transition_affine.c 
b/src/modules/plus/transition_affine.c
index dae81b5..f86a122 100644
--- a/src/modules/plus/transition_affine.c
+++ b/src/modules/plus/transition_affine.c
@@ -488,17 +488,22 @@ static int transition_get_image( mlt_frame a_frame, 
uint8_t **image, mlt_image_f
                        double b_ar = mlt_properties_get_double( b_props, 
"aspect_ratio" );
                        double b_dar = b_ar * b_width / b_height;
                        
-                       if ( b_dar > consumer_dar )
+                       if ( (int) ( ( consumer_dar - b_dar ) * 1000 ) == 0 )
+                       {
+                           // We consider aspect ratio is equal, no scaling
+                       }
+                       else if ( b_dar > consumer_dar )
                        {
                                scale_x = geom_scale_x * ( scale_x == 0 ? 1 : 
scale_x );
                                scale_y = geom_scale_x * ( scale_y == 0 ? 1 : 
scale_y );
+                               scale_y /= consumer_ar / b_ar;
                        }
                        else
                        {
                                scale_x = geom_scale_y * ( scale_x == 0 ? 1 : 
scale_x );
                                scale_y = geom_scale_y * ( scale_y == 0 ? 1 : 
scale_y );
+                               scale_x *= consumer_ar / b_ar;
                        }
-                       scale_x *= consumer_ar / b_ar;
                }
                if ( scale )
                {




------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to