Skip to content

Commit

Permalink
update demos to use affine instead of composite
Browse files Browse the repository at this point in the history
  • Loading branch information
ddennedy committed Sep 12, 2024
1 parent e83c0a4 commit c8d9b2b
Show file tree
Hide file tree
Showing 17 changed files with 45 additions and 57 deletions.
10 changes: 5 additions & 5 deletions demo/README
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ Watermark

My name is...

Titles are very easy to composite in realtime. The titler uses Pango
Titles are very easy to overlay in realtime. The titler uses Pango
with the FreeType2 rendering backend. This means it supports high
quality scalable font rendering with anti-aliasing, unicode (UTF-8),
and Pango markup capabilities. The compsiting here respects the aspect
Expand All @@ -53,10 +53,10 @@ My name is...
is doing field-based rendering. So, when displayed non-progressively
with SDL, you can see motion artifacts during animation.

A composite transition
An overlay transition

The compositor also handles video over video as demonstrated in this
usage of the compositor to create a special transition. This demonstration
The affine transition also handles video over video as demonstrated in this
usage of affine to create a special transition. This demonstration
also crossfades the audio during the transition! Progressive rendering
is explicitly enabled on the compositor due to the poor results that
would otherwise occur due to scaling an interleaved video frame and moving
Expand Down Expand Up @@ -214,6 +214,6 @@ Pango Keyframed Markup
separate lines. For .mpl the key is a frame number and the value is
Pango Markup Language. A tilde is interpreted as a new line. This
example also demonstrates using the watermark and the alignment
properties of its encapsulated composite transition where halign
properties of its encapsulated transition where halign
is the horizontal, valign is the vertical, c is for center, and m
is for middle.
2 changes: 1 addition & 1 deletion demo/demo
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

export MLT_PROFILE=dv_pal
export MLT_PROFILE=dv_ntsc
export LC_NUMERIC=C

function show_consumers( )
Expand Down
1 change: 0 additions & 1 deletion demo/demo.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@ mlt_lcut L Cut clip1.dv,clip2.dv
mlt_fade_black Fade from/to black/silence clip3.mpeg
mlt_push Push wipe clip1.mpeg, clip2.mpeg
mlt_ticker Ticker tape clip1.dv
mlt_slideshow_black Composite slideshow photos
mlt_slideshow2 Ken Burns slideshow photos
mlt_pango_keyframes Pango Keyframed Markup pango_keyframes.mpl
3 changes: 1 addition & 2 deletions demo/mlt_bouncy
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ melt \
clip3.dv \
-filter \
watermark:clip1.dv \
composite.geometry="0=10%/10%:20%x20%; 33=30%/70%:25%x25%; 66=70%/30%:15%x15%; -1=70%/70%:20%x20%" \
composite.rect="0=10%/10%:20%x20%; 33=30%/70%:25%x25%; 66=70%/30%:15%x15%; -1=70%/70%:20%x20%" \
composite.out=100 \
composite.sliced_composite=1 \
$*
2 changes: 1 addition & 1 deletion demo/mlt_composite_transition
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ melt \
clip1.dv out=74 \
-track \
-blank 49 clip2.mpeg \
-transition composite:"0=57%/10%:33%x33%; -1=0%/0%:100%x100%" progressive=1 distort=true in=50 out=74 a_track=0 b_track=1 sliced_composite=1 \
-transition affine:"0=57%/10%:33%x33%; -1=0%/0%:100%x100%" progressive=1 fill=0 distort=1 in=50 out=74 a_track=0 b_track=1 \
-transition mix:-1 in=50 out=74 a_track=0 b_track=1 \
$*
6 changes: 3 additions & 3 deletions demo/mlt_my_name_is
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ clip3.dv \
"+My name is Inigo Montoya.txt" out=99 -blank 49 "+Prepare to die!.txt" out=99 \
-track \
-blank 74 "+You killed my father.txt" out=74 \
-transition composite:"0=50%/20%:5%x4%; -1=10%/20%:80%x12%" distort=1 halign=centre valign=centre in=0 out=99 a_track=0 b_track=1 sliced_composite=1 \
-transition composite:"0=0%/70%:100%x10%; -1=100%/70%:100%x10%" in=75 out=149 a_track=0 b_track=2 sliced_composite=1 \
-transition composite:25%/25%:50%x50% in=150 out=249 a_track=0 b_track=1 sliced_composite=1 \
-transition affine:"0=50%/20%:5%x4%; -1=10%/20%:80%x12%" fill=0 distort=1 halign=centre valign=centre in=0 out=99 a_track=0 b_track=1 \
-transition affine:"0=0%/70%:100%x10%; -1=100%/70%:100%x10%" fill=0 in=75 out=149 a_track=0 b_track=2 \
-transition affine:25%/25%:50%x50% fill=0 in=150 out=249 a_track=0 b_track=1 \
$*
18 changes: 9 additions & 9 deletions demo/mlt_news
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ clip1.dv in=0 out=0 -repeat 99 clip1.dv \
-track \
clip2.dv out=199 \
-track \
pango: text=" Breaking News
MLT Rocks India" bgcolour=0xff000080 out=149 \
pango: text=" Breaking News
MLT Rocks the World" bgcolour=0xff000080 out=349 \
pango: text=" Breaking News
MLT Rocks India" bgcolour=#80ff0000 out=149 \
pango: text=" Breaking News
MLT Rocks the World" bgcolour=#80ff0000 out=349 \
-transition mix:0.5 always_active=1 a_track=0 b_track=2 \
-transition composite geometry=50%/15%:37.5%x40% a_track=0 b_track=1 in=0 out=174 sliced_composite=1 \
-transition composite geometry=10%/15%:37.5%x40% a_track=0 b_track=2 in=0 out=199 sliced_composite=1 \
-transition composite geometry="50%/15%:37.5%x40%; -1=0%/0%:100%x100%" a_track=0 b_track=1 in=175 out=199 distort=1 sliced_composite=1 \
-transition composite geometry=10%/65%:90%x20% a_track=0 b_track=3 in=0 out=199 sliced_composite=1 \
-transition composite geometry=10%/65%:90%x20% a_track=1 b_track=3 in=200 out=499 sliced_composite=1 \
-transition affine rect=50%/15%:37.5%x40% fill=0 a_track=0 b_track=1 in=0 out=174 \
-transition affine rect=10%/15%:37.5%x40% fill=0 a_track=0 b_track=2 in=0 out=199 \
-transition affine rect="50%/15%:37.5%x40%; -1=0%/0%:100%x100%" fill=0 a_track=0 b_track=1 in=175 out=199 distort=1 \
-transition affine rect=10%/65%:90%x20% fill=0 a_track=0 b_track=3 in=0 out=199 \
-transition affine rect=10%/65%:90%x20% fill=0 a_track=1 b_track=3 in=200 out=499 \
$*
10 changes: 4 additions & 6 deletions demo/mlt_push
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ clip3.dv in=200 out=275 \
-blank 49 \
clip2.dv in=200 \
-transition \
composite in=50 out=75 a_track=0 b_track=1 \
geometry="0=0/0:100%x100%:100%; -1=100%/0:100%x100%:100%" \
sliced_composite=1 \
affine in=50 out=75 a_track=0 b_track=1 \
rect="0=0/0:100%x100%:100%; -1=100%/0:100%x100%:100%" \
-transition \
composite in=50 out=75 a_track=0 b_track=2 \
geometry="0=-100%/0:100%x100%:100%; -1=0/0:100%x100%:100%" \
sliced_composite=1 \
affine in=50 out=75 a_track=0 b_track=2 \
rect="0=-100%/0:100%x100%:100%; -1=0/0:100%x100%:100%" \
-transition \
mix:-1 in=50 out=75 a_track=1 b_track=2 \
$*
2 changes: 1 addition & 1 deletion demo/mlt_slideshow2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
melt \
photos/.all.jpg ttl=75 \
-attach crop center=1 \
-attach affine transition.cycle=225 transition.geometry="0=0/0:100%x100%;74=-100/-100:120%x120%;75=-60/-60:110%x110%;149=0/0:110%x110%;150=0/-60:110%x110%;224=-60/0:110%x110%" \
-attach affine transition.cycle=225 transition.rect="0=0/0:100%x100%;74=-20%/-20%:120%x120%;75=-10%/-10%:110%x110%;149=0/0:110%x110%;150=0/-10%:110%x110%;224=-10%/0:110%x110%" \
-filter luma cycle=75 duration=25 \
-track music1.ogg \
-transition mix \
Expand Down
3 changes: 0 additions & 3 deletions demo/mlt_slideshow_black

This file was deleted.

6 changes: 3 additions & 3 deletions demo/mlt_squeeze
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ clip1.dv out=124 clip2.dv out=149 clip3.dv in=75 out=224 clip1.dv \
-track \
-blank 99 colour:black out=49 -blank 99 colour:black out=49 -blank 99 colour:black out=49 \
-group progressive=1 distort=1 \
-transition composite geometry="0%/0%:100%x100%;25=50%/0%:5%x100%;-1=0%/0%:100%x100%" a_track=1 b_track=0 in=100 out=149 sliced_composite=1 \
-transition composite geometry="0%/0%:100%x100%;25=0%/50%:100%x5%;-1=0%/0%:100%x100%" a_track=1 b_track=0 in=250 out=299 sliced_composite=1 \
-transition composite geometry="0%/0%:100%x100%;25=100%/0%:5%x100%;-1=0%/0%:100%x100%" a_track=1 b_track=0 in=400 out=449 sliced_composite=1 \
-transition affine rect="0%/0%:100%x100%;25=50%/0%:5%x100%;-1=0%/0%:100%x100%" a_track=1 b_track=0 in=100 out=149 \
-transition affine rect="0%/0%:100%x100%;25=0%/50%:100%x5%;-1=0%/0%:100%x100%" a_track=1 b_track=0 in=250 out=299 \
-transition affine rect="0%/0%:100%x100%;25=100%/0%:5%x100%;-1=0%/0%:100%x100%" a_track=1 b_track=0 in=400 out=449 \
$*
6 changes: 3 additions & 3 deletions demo/mlt_squeeze_box
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ clip1.dv out=124 clip2.dv out=149 clip3.dv in=75 out=224 clip1.dv \
-track \
-blank 99 colour:black out=49 -blank 99 colour:black out=49 -blank 99 colour:black out=49 \
-group progressive=1 \
-transition composite:"0=0%/0%:100%x100%; 25=50%/0%:5%x100%; -1=0%/0%:100%x100%" a_track=1 b_track=0 in=100 out=149 sliced_composite=1 \
-transition composite:"0=0%/0%:100%x100%; 25=0%/50%:100%x5%; -1=0%/0%:100%x100%" a_track=1 b_track=0 in=250 out=299 sliced_composite=1 \
-transition composite:"0=0%/0%:100%x100%; 25=100%/0%:5%x100%; -1=0%/0%:100%x100%" a_track=1 b_track=0 in=400 out=449 sliced_composite=1 \
-transition affine:"0=0%/0%:100%x100%; 25=50%/0%:5%x100%; -1=0%/0%:100%x100%" fill=0 a_track=1 b_track=0 in=100 out=149 \
-transition affine:"0=0%/0%:100%x100%; 25=0%/50%:100%x5%; -1=0%/0%:100%x100%" fill=0 a_track=1 b_track=0 in=250 out=299 \
-transition affine:"0=0%/0%:100%x100%; 25=100%/0%:5%x100%; -1=0%/0%:100%x100%" fill=0 a_track=1 b_track=0 in=400 out=449 \
$*
10 changes: 4 additions & 6 deletions demo/mlt_ticker
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ colour:0 out=299 \
"+The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog..txt" \
out=299 \
-transition \
composite a_track=0 b_track=1 out=299 distort=1 \
geometry=0/70%:100%x11%:100% \
sliced_composite=1 \
affine a_track=0 b_track=1 out=299 distort=1 \
rect=0/70%:100%x11%:100% \
-transition \
composite a_track=0 b_track=2 out=299 titles=1 \
geometry="0=100%/70%:999%x20%; -1=-299%/70%:999%x20%" \
sliced_composite=1 \
affine a_track=0 b_track=2 out=299 fill=0 \
rect="0=100%/70%:999%x20%; -1=-299%/70%:999%x20%" \
$*
6 changes: 2 additions & 4 deletions demo/mlt_title_over_gfx
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,18 @@ melt \
-track \
clip1.dv \
-transition \
composite:30%/20%:40%x60% \
affine:30%/20%:40%x60% \
in=50 \
out=199 \
a_track=0 \
b_track=1 \
distort=1 \
sliced_composite=1 \
-transition \
composite:"0=0%/75%:100%x20%:0; 24=0%/75%:100%x20%:100%; -25=0%/75%:100%x20%:100%; -1=0%/75%:100%x20%:0" \
affine:"0=0%/75%:100%x20%:0; 24=0%/75%:100%x20%:100%; -25=0%/75%:100%x20%:100%; -1=0%/75%:100%x20%:0" \
in=50 \
out=199 \
a_track=2 \
b_track=0 \
luma=luma1.pgm \
distort=1 \
sliced_composite=1 \
$*
8 changes: 4 additions & 4 deletions demo/mlt_titleshadow_watermark
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
melt \
"+hello~world.txt" align=1 out=1000 \
-track "+hello~world.txt" align=1 out=1000 fgcolour=0x000000ff \
-track "+hello~world.txt" align=1 out=1000 fgcolour=#000000 \
-track watermark1.png out=1000 \
-track clip3.dv \
-filter greyscale track=2 \
-transition composite:"0=21%/11%:100%x100%:50; -1=61%/41%:100%x100%" out=99 a_track=3 b_track=1 sliced_composite=1 \
-transition composite:"0=20%/10%:100%x100%; -1=60%/40%:100%x100%" out=99 a_track=3 b_track=0 sliced_composite=1 \
-transition composite:85%/80%:10%x10%:30 out=1000 a_track=3 b_track=2 sliced_composite=1 \
-transition affine:"0=21%/11%:100%x100%:50; -1=61%/41%:100%x100%" fill=0 out=99 a_track=3 b_track=1 \
-transition affine:"0=20%/10%:100%x100%; -1=60%/40%:100%x100%" fill=0 out=99 a_track=3 b_track=0 \
-transition affine:85%/80%:10%x10%:30 fill=0 out=1000 a_track=3 b_track=2 \
$*
7 changes: 3 additions & 4 deletions demo/mlt_voiceover
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ melt \
family="Sans" \
size="72" \
weight="700" \
fgcolour=0x00000000 \
bgcolour=0xff9933aa \
fgcolour=#000000 \
bgcolour=#aaff9933 \
pad=10 \
-track music1.ogg \
-track clip1.dv out=149 clip2.mpeg \
Expand All @@ -29,11 +29,10 @@ melt \
a_track=2 \
b_track=1 \
-transition \
composite:0%/80%:100%x20% \
affine:0%/80%:100%x20% \
distort=1 \
in=100 \
out=299 \
a_track=2 \
b_track=0 \
sliced_composite=1 \
$*
2 changes: 1 addition & 1 deletion demo/mlt_watermark
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ melt \
clip2.dv out=1000 \
-track \
watermark1.png out=1000 \
-transition composite fill=1 in=0 out=1000 a_track=0 b_track=1 geometry=85%/5%:10%x10% sliced_composite=1 \
-transition affine in=0 out=1000 a_track=0 b_track=1 rect=85%/5%:10%x10% \
$*

0 comments on commit c8d9b2b

Please sign in to comment.