14.01.12 00:25, Dan Dennedy написав(ла):
2012/1/13 Maksym Veremeyenko<ve...@m1stereo.tv>:
Hi,

i am trying to play a mlt files with video on /logo/ overlay:

<?xml version="1.0" ?>
<mlt>
    <tractor id="tractor0">
        <multitrack>

            <playlist id="AV">
                <producer id="AV0" in="0.0" out="1499.0">
                    <property
name="resource">/home/studio/Videos/file_titling_test/I0009618_test.avi</property>
                </producer>
            </playlist>

            <playlist id="G0">
                <producer id="p1" in="0.0" out="1499.0">
                    <property
name="resource">/home/studio/Videos/file_titling_test/test_image_13.png</property>

The image producers assume the image has square pixels because that is
most typical. However, if your images are 720x576 or you simply want
to prevent scaling for sample aspect ratio compensation, then you need
to override the force_aspect_ratio property, e.g.
force_aspect_ratio=@16/15

The '@' prefix to the property value tells it to do very simple
expression evaluation when fetching the property as a numeric type.

                </producer>
            </playlist>

        </multitrack>

        <transition in="0.0" out="150.0">
            <property name="mlt_service">composite</property>
            <property name="a_track">0</property>
            <property name="b_track">1</property>
            <property name="progressive">1</property>
            <property name="geometry">0=0%,0%:100%x100%:100;
-1=0%,0%:100%x100%:100;</property>
            <property name="halign">centre</property>
            <property name="valign">centre</property>
            <property name="distort">0</property>
            <property name="fill">1</property>

fill=1 tells it to scale up; otherwise, the default is only to scale
down to fit within the geometry rectangle. Sorry this is not
documented in the service metadata. We ported some docs to metadata
format, but still have not fully updated them.

        </transition>

    </tractor>
</mlt>

but graphics from test_image_13.png been always scaled to dimensions defined
in profile.

remove fill=1
Thanks, that helps!


[...]
for images it would be ease to calculate geometry scaling, but for pango i
have no idea how to do this.

pango generates images with square pixels; however, like pixbuf, you
can force_aspect_ratio (pixel aspect) to the same as the project if
you do not care about a (subtle?) distortion in the display aspect
ratio of the text. I have used this trick in the past on SD PAL, but
it will not work on anamorphic widescreen.


i could be wrong, but i have a suspicious that pango do not support force_aspect_ratio property, so i attached a patch.

PS
where is located a code that perform *composite* of all tracks?

--
________________________________________
Maksym Veremeyenko
>From 36efc230c6d4adf28bb87941aabcf7117813d2a1 Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1stereo.tv>
Date: Sat, 14 Jan 2012 18:01:31 +0200
Subject: [PATCH 1/2] fix pango's producer force_aspect_ratio property
 handling

---
 src/modules/gtk2/producer_pango.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/src/modules/gtk2/producer_pango.c b/src/modules/gtk2/producer_pango.c
index deb8bd2..ef4985c 100644
--- a/src/modules/gtk2/producer_pango.c
+++ b/src/modules/gtk2/producer_pango.c
@@ -536,6 +536,9 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
 {
 	producer_pango this = producer->child;
 
+	// Fetch the producers properties
+	mlt_properties producer_properties = MLT_PRODUCER_PROPERTIES( producer );
+
 	// Generate a frame
 	*frame = mlt_frame_init( MLT_PRODUCER_SERVICE( producer ) );
 
@@ -556,7 +559,11 @@ static int producer_get_frame( mlt_producer producer, mlt_frame_ptr frame, int i
 
 	// Set producer-specific frame properties
 	mlt_properties_set_int( properties, "progressive", 1 );
-	mlt_properties_set_double( properties, "aspect_ratio", 1 );
+	double force_ratio = mlt_properties_get_double( producer_properties, "force_aspect_ratio" );
+	if ( force_ratio > 0.0 )
+		mlt_properties_set_double( properties, "aspect_ratio", force_ratio );
+	else
+		mlt_properties_set_double( properties, "aspect_ratio", 1.0);
 
 	// Stack the get image callback
 	mlt_frame_push_service( *frame, this );
-- 
1.7.4.4

>From 850c326e3e0c1acbb25ddb03b09663b99d084fcb Mon Sep 17 00:00:00 2001
From: Maksym Veremeyenko <ve...@m1stereo.tv>
Date: Sat, 14 Jan 2012 18:04:50 +0200
Subject: [PATCH 2/2] fix tag closing

---
 docs/mlt-xml.txt |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/docs/mlt-xml.txt b/docs/mlt-xml.txt
index 0a6c1ee..41312a7 100644
--- a/docs/mlt-xml.txt
+++ b/docs/mlt-xml.txt
@@ -202,6 +202,7 @@ Tractors:
 	    <entry producer="producer0" in="0" out="2999"/>
 	    <blank length="1000"/>
 	    <entry producer="producer0" in="3000" out="6999"/>
+	  </playlist>
 	  <playlist id="playlist1">
 	    <blank length="3000"/>
 	    <entry producer="producer1" in="0" out="999"/>
@@ -256,6 +257,7 @@ Tractors:
 	    <entry producer="producer0" in="0" out="2999"/>
 	    <blank length="1000"/>
 	    <entry producer="producer0" in="3000" out="6999"/>
+	  </playlist>
 	  <playlist id="playlist1">
 	    <blank length="3000"/>
 	    <entry producer="producer1" in="0" out="999"/>
-- 
1.7.4.4

------------------------------------------------------------------------------
RSA(R) Conference 2012
Mar 27 - Feb 2
Save $400 by Jan. 27
Register now!
http://p.sf.net/sfu/rsa-sfdev2dev2
_______________________________________________
Mlt-devel mailing list
Mlt-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlt-devel

Reply via email to