initial commit for emf18

This commit is contained in:
v0tti 2018-08-23 15:10:24 +02:00
parent de8bd55ba0
commit 4591d78f58
6 changed files with 255 additions and 0 deletions

171
emf2018/__init__.py Normal file
View file

@ -0,0 +1,171 @@
#!/usr/bin/python3
from renderlib import *
from easing import *
# URL to Schedule-XML
scheduleUrl = 'https://frab.das-sendezentrum.de/de/subscribe9/public/schedule.xml'
titlemap = {
}
def introFrames(p):
givenFrame = 0
nr = p['$id'];
# 1 Sekunde nix
frames = 1*fps
for i in range(0, frames):
givenFrame += 1
yield (
('bg', 'attr', '{http://www.w3.org/1999/xlink}href', "given-frames/frame%04d.png" % (givenFrame)),
('layer1', 'style', 'opacity', "%.4f" % 0), # nix
# ('text', 'attr', 'transform', 'translate(%.4f, 0)' % easeOutQuad(i, move, -move, frames)),
)
# 1 Sekunde Text Fadein
frames = 1*fps
for i in range(0, frames):
givenFrame += 1
yield (
('bg', 'attr', '{http://www.w3.org/1999/xlink}href', "given-frames/frame%04d.png" % (givenFrame)),
('layer1', 'style', 'opacity', "%.4f" % easeInQuad(i, 0, 1, frames)),
# ('text', 'attr', 'transform', 'translate(%.4f, 0)' % easeOutQuad(i, move, -move, frames)),
)
# 3 Sekunden Text
frames = 3*fps
for i in range(0, frames):
givenFrame += 1
yield (
('bg', 'attr', '{http://www.w3.org/1999/xlink}href', "given-frames/frame%04d.png" % (givenFrame)),
('layer1', 'style', 'opacity', "%.4f" %1),
# ('text', 'attr', 'transform', 'translate(%.4f, 0)' % easeOutQuad(i, move, -move, frames)),
)
# 1 Sekunde Text Fadeout
frames = 1*fps
for i in range(0, frames):
givenFrame += 1
yield (
('bg', 'attr', '{http://www.w3.org/1999/xlink}href', "given-frames/frame%04d.png" % (givenFrame)),
('layer1', 'style', 'opacity', "%.4f" % easeInQuad(i, 1, -1, frames)),
# ('text', 'attr', 'transform', 'translate(%.4f, 0)' % easeOutQuad(i, move, -move, frames)),
)
# Sponsors
frames = 187
for i in range(0, frames):
givenFrame += 1
yield (
('bg', 'attr', '{http://www.w3.org/1999/xlink}href', "given-frames/frame%04d.png" % (givenFrame)),
('layer1', 'style', 'opacity', "0"),
# ('text', 'attr', 'transform', 'translate(%.4f, 0)' % easeOutQuad(i, move, -move, frames)),
)
def outroFrames(p):
# 3 Sekunden animation bleiben
frames = 5*fps
# five initial frames
for i in range(0, 5):
yield (
('g1', 'style', 'opacity', "%.4f" % 0),
('g2', 'style', 'opacity', "%.4f" % 0),
('g3', 'style', 'opacity', "%.4f" % 0),
)
# 3 Sekunden
frames = 6*fps
for i in range(0, frames):
yield (
('g1', 'style', 'opacity', "%.4f" % easeDelay(easeLinear, 0*fps, i, 0, 1, 4*fps)),
('g2', 'style', 'opacity', "%.4f" % easeDelay(easeLinear, 1*fps, i, 0, 1, 4*fps)),
('g3', 'style', 'opacity', "%.4f" % easeDelay(easeLinear, 2*fps, i, 0, 1, 4*fps)),
)
# five final frames
for i in range(0, 5):
yield (
('g1', 'style', 'opacity', "%.4f" % 1),
('g2', 'style', 'opacity', "%.4f" % 1),
('g3', 'style', 'opacity', "%.4f" % 1),
)
def pauseFrames(p):
# 3 Sekunden animation bleiben
for nr in range(0, 3):
# 10 sekunden sehen
frames = 3*fps
for i in range(0, frames):
yield (
('image%u' % ((nr+0)%3), 'style', 'opacity', "%.4f" % 1),
('image%u' % ((nr+1)%3), 'style', 'opacity', "%.4f" % 0),
('image%u' % ((nr+2)%3), 'style', 'opacity', "%.4f" % 0),
)
# 1 sekunde faden
frames = 2*fps
for i in range(0, frames):
yield (
('image%u' % ((nr+0)%3), 'style', 'opacity', "%.4f" % easeLinear(i, 1, -1, frames)),
('image%u' % ((nr+1)%3), 'style', 'opacity', "%.4f" % easeLinear(i, 0, +1, frames)),
('image%u' % ((nr+2)%3), 'style', 'opacity', "%.4f" % 0),
)
def debug():
render(
'intro.svg',
'../intro.mov',
introFrames,
{
'$id': 42,
'$title': 'Pan-Galactic Gargle Blaster',
'$subtitle': 'the alcoholic equivalent of a mugging expensive and bad for the head',
'$personnames': 'Zaphod Beeblebrox',
#'only_render_frame': 50
#'only_rerender_frames_after': 120
}
)
# render(
# 'outro.svg',
# '../outro.ts',
# outroFrames
# )
# render(
# 'pause.svg',
# '../pause.ts',
# pauseFrames
# )
def tasks(queue, args, id_list, skip_list):
# iterate over all events extracted from the schedule xml-export
for event in events(scheduleUrl, titlemap):
# skip events which will not be recorded
if event['room'] not in ('Großer Sitzungssaal', 'Kleiner Sitzungssaal') or event['track'] == 'Nomnom':
print("skipping room %s (%s [%s])" % (event['room'], event['title'], event['id']))
continue
# when id_list is not empty, only render events which are in id_list
if id_list and int(event['id']) not in id_list:
print("skipping id (%s [%s])" % (event['title'], event['id']))
continue
# generate a task description and put them into the queue
queue.put(Rendertask(
infile = ['intro.svg'],
outfile = str(event['id']) + ".ts",
sequence = introFrames,
parameters = {
'$id': event['id'],
'$title': event['title'].upper(),
'$subtitle': event['subtitle'],
'$personnames': event['personnames'].upper(),
}
))

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 393 KiB

Binary file not shown.

Binary file not shown.

84
emf2018/artwork/intro.svg Normal file
View file

@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Generator: Adobe Illustrator 16.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
x="0px"
y="0px"
width="1920px"
height="1080px"
viewBox="0 0 1920 1080"
enable-background="new 0 0 1920 1080"
xml:space="preserve"
id="svg2"
inkscape:version="0.92.2 5c3e80d, 2017-08-06"
sodipodi:docname="intro.svg"><metadata
id="metadata29"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs27" /><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="1280"
inkscape:window-height="756"
id="namedview25"
showgrid="false"
inkscape:zoom="0.4625"
inkscape:cx="835.67568"
inkscape:cy="540"
inkscape:window-x="49"
inkscape:window-y="5"
inkscape:window-maximized="0"
inkscape:current-layer="layer-bg" /><g
inkscape:label="Hintergrund"
inkscape:groupmode="layer"
id="layer-bg"
style="display:inline"><image
sodipodi:absref="/Users/v0tti/Documents/intro-outro-generator/emf2018_test/artwork/given-frames/frame0353.png"
xlink:href="given-frames/frame0353.png"
y="0"
width="1920"
height="1080"
id="bg"
x="0" /></g><g
id="layer1"
inkscape:groupmode="layer"
style="display:inline;opacity:1"><flowRoot
transform="translate(-271.27832,519.46774)"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:0.01%;font-family:Overpass;-inkscape-font-specification:Overpass;text-align:start;writing-mode:lr-tb;text-anchor:start;display:inline;fill:#ffffff"
id="flowRoot3344-4"
xml:space="preserve"><flowRegion
style="text-align:start;text-anchor:start"
id="flowRegion3346-8"><rect
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:46px;line-height:125%;font-family:Overpass;-inkscape-font-specification:Overpass;text-align:start;writing-mode:lr-tb;text-anchor:start"
y="151.82379"
x="301.07437"
height="319.49005"
width="1860.4078"
id="rect3348-3" /></flowRegion><flowPara
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:90px;line-height:110.00000238%;font-family:Overpass;-inkscape-font-specification:'Overpass, Bold';text-align:start;text-transform:uppercase;writing-mode:lr-tb;text-anchor:start;fill:#ffffff"
id="flowPara3354-9" /><flowPara
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:50px;line-height:110.00000238%;font-family:Overpass;-inkscape-font-specification:'Overpass, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start"
id="subtitle-0" /><flowPara
id="flowPara4147-5"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:17px;line-height:110.00000238%;font-family:Overpass;-inkscape-font-specification:'Overpass, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;opacity:0">.</flowPara><flowPara
id="flowPara3863"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:66.66666412px;line-height:139.99999762%;font-family:Raleway-v4020;-inkscape-font-specification:'Raleway-v4020 Bold';text-align:start;writing-mode:lr-tb;text-anchor:start">$personnames</flowPara><flowPara
id="flowPara3881"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:60px;line-height:139.99999762%;font-family:Raleway-v4020;-inkscape-font-specification:Raleway-v4020;text-align:start;writing-mode:lr-tb;text-anchor:start">$title</flowPara><flowPara
id="flowPara3871"
style="font-style:normal;font-variant:normal;font-weight:300;font-stretch:normal;font-size:50px;line-height:139.99999762%;font-family:Overpass;-inkscape-font-specification:'Overpass, Light';text-align:start;writing-mode:lr-tb;text-anchor:start" /></flowRoot></g></svg>

After

Width:  |  Height:  |  Size: 4.8 KiB