diff --git a/fossgis22/__init__.py b/fossgis22/__init__.py new file mode 100644 index 0000000..b5394cf --- /dev/null +++ b/fossgis22/__init__.py @@ -0,0 +1,198 @@ +#!/usr/bin/python3 + +from renderlib import * +from easing import * + +# URL to Schedule-XML +scheduleUrl = 'https://pretalx.com/fossgis2022/schedule/export/schedule.xml' + +def outroFrames(params): + # 8 Sekunden + + # 2 Sekunden Fadein Text + frames = 2*fps + for i in range(0, frames): + yield ( + ('banderole', 'style', 'opacity', "%.4f" % easeOutCubic(i, 0, 1, frames) ), + ('license', 'style', 'opacity', 0) + ) + + # 2 Sekunde Fadein Lizenz-Logo + frames = 2*fps + for i in range(0, frames): + yield ( + ('banderole', 'style', 'opacity', 1), + ('license', 'style', 'opacity', "%.4f" % (float(i)/frames)) + ) + + # 4 Sekunde stehen bleiben + frames = 4*fps + for i in range(0, frames): + yield ( + ('banderole', 'style', 'opacity', 1), + ('license', 'style', 'opacity', 1) + ) + +def introFrames(params): + # 7 Sekunden + + # 2 Sekunden Text 1 + frames = 2*fps + for i in range(0, frames): + yield ( + ('box-und-text1', 'style', 'opacity', "%.4f" % easeOutCubic(i, 0, 1, frames)), + ('url', 'style', 'opacity', "%.4f" % easeOutCubic(i, 0, 1, frames)), + ('text1', 'style', 'opacity', "%.4f" % 1), + ('text2', 'style', 'opacity', 0) + ) + + # 1 Sekunde Fadeout Text 1 + frames = 1*fps + for i in range(0, frames): + yield ( + ('box-und-text1', 'style', 'opacity', 1), + ('url', 'style', 'opacity', 1), + ('text1', 'style', 'opacity', "%.4f" % (1-(float(i)/frames))), + ('text2', 'style', 'opacity', 0) + ) + + # 2 Sekunden Text 2 + frames = 2*fps + for i in range(0, frames): + yield ( + ('box-und-text1', 'style', 'opacity', 1), + ('url', 'style', 'opacity', 1), + ('text1', 'style', 'opacity', 0), + ('text2', 'style', 'opacity', "%.4f" % easeOutCubic(i, 0, 1, frames)) + ) + + # 2 Sekunden stehen bleiben + frames = 2*fps + for i in range(0, frames): + yield ( + ('box-und-text1', 'style', 'opacity', 1), + ('url', 'style', 'opacity', 1), + ('text1', 'style', 'opacity', 0), + ('text2', 'style', 'opacity', 1) + ) + +def pauseFrames(params): + # 12 Sekunden + + # 2 Sekunden Text1 stehen + frames = 2*fps + for i in range(0, frames): + yield ( + ('text1', 'style', 'opacity', 1), + ('text2', 'style', 'opacity', 0) + ) + + # 2 Sekunden Fadeout Text1 + frames = 2*fps + for i in range(0, frames): + yield ( + ('text1', 'style', 'opacity', "%.4f" % (1-easeOutCubic(i, 0, 1, frames))), + ('text2', 'style', 'opacity', 0) + ) + + # 2 Sekunden Fadein Text2 + frames = 2*fps + for i in range(0, frames): + yield ( + ('text1', 'style', 'opacity', 0), + ('text2', 'style', 'opacity', "%.4f" % easeOutCubic(i, 0, 1, frames)) + ) + + # 2 Sekunden Text2 stehen + frames = 2*fps + for i in range(0, frames): + yield ( + ('text1', 'style', 'opacity', 0), + ('text2', 'style', 'opacity', 1) + ) + + # 2 Sekunden Fadeout Text2 + frames = 2*fps + for i in range(0, frames): + yield ( + ('text1', 'style', 'opacity', 0), + ('text2', 'style', 'opacity', "%.4f" % (1-easeOutCubic(i, 0, 1, frames))) + ) + + # 2 Sekunden Fadein Text1 + frames = 2*fps + for i in range(0, frames): + yield ( + ('text1', 'style', 'opacity', "%.4f" % (easeOutCubic(i, 0, 1, frames))), + ('text2', 'style', 'opacity', 0) + ) + +def debug(): + render('intro.svg', + '../intro.ts', + introFrames, + { + '$id': 7776, + '$title': 'StageWar live!', + '$subtitle': 'Metal Konzert', + '$persons': 'www.stagewar.de' + } + ) + + render('outro.svg', + '../outro.ts', + outroFrames + ) + + render('pause.svg', + '../pause.ts', + pauseFrames + ) + + +def tasks(queue, args, idlist, skiplist): + # iterate over all events extracted from the schedule xml-export + for event in events(scheduleUrl): + if event['room'] not in ('Bühne 1', 'Bühne 2','Bühne 3','Bühne 4'): + print("skipping room %s (%s [%s])" % (event['room'], event['title'], event['id'])) + continue + if not (idlist==[]): + if 000000 in idlist: + print("skipping id (%s [%s])" % (event['title'], event['id'])) + continue + if int(event['id']) not in idlist: + print("skipping id (%s [%s])" % (event['title'], event['id'])) + continue + + # generate a task description and put them into the queue + delimiter = ', ' + queue.put(Rendertask( + infile = 'intro.svg', + outfile = str(event['id'])+".ts", + sequence = introFrames, + + parameters = { + '$id': event['id'], + '$title': event['title'], + '$subtitle': event['subtitle'], + '$persons': delimiter.join(event['persons']), + '$url': event['url'] + } + )) + + # place a task for the outro into the queue + if not "out" in skiplist: + queue.put(Rendertask( + infile = 'outro.svg', + outfile = 'outro.ts', + sequence = outroFrames + )) + + # place the pause-sequence into the queue + if not "pause" in skiplist: + queue.put(Rendertask( + infile = 'pause.svg', + outfile = 'pause.ts', + sequence = pauseFrames + )) + diff --git a/fossgis22/artwork/by-sa.svg b/fossgis22/artwork/by-sa.svg new file mode 100755 index 0000000..f850297 --- /dev/null +++ b/fossgis22/artwork/by-sa.svg @@ -0,0 +1,199 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fossgis22/artwork/fossgis22_logo.png b/fossgis22/artwork/fossgis22_logo.png new file mode 100644 index 0000000..5f9cd47 Binary files /dev/null and b/fossgis22/artwork/fossgis22_logo.png differ diff --git a/fossgis22/artwork/intro.svg b/fossgis22/artwork/intro.svg new file mode 100755 index 0000000..f3c4e3e --- /dev/null +++ b/fossgis22/artwork/intro.svg @@ -0,0 +1,242 @@ + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + $url + + + + Marburg09. - 12. März 2022 + FOSSGIS Konferenz2022 + + + $persons$title + Photo: Markus Farnung + + diff --git a/fossgis22/artwork/outro.svg b/fossgis22/artwork/outro.svg new file mode 100755 index 0000000..e1cd7f0 --- /dev/null +++ b/fossgis22/artwork/outro.svg @@ -0,0 +1,339 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + Marburg09. - 12. März 2022 + FOSSGIS Konferenz2022 www.fossgis-konferenz.de/2022 + + + + + + + + + + + + + + + + + + + BY 4.0 DE + https://creativecommons.org/licenses/by/4.0/ + + Photo: Markus Farnung + + diff --git a/fossgis22/artwork/pause.svg b/fossgis22/artwork/pause.svg new file mode 100755 index 0000000..662b7c0 --- /dev/null +++ b/fossgis22/artwork/pause.svg @@ -0,0 +1,239 @@ + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + Photo: Markus Farnung + + + Marburg09. - 12. März 2022 + FOSSGIS Konferenz2022 www.fossgis-konferenz.de/2022 + + + Gleich geht's weiter... + + + + diff --git a/fossgis22/artwork/stadtansicht_marburg_c_markus_farnung_blured.png b/fossgis22/artwork/stadtansicht_marburg_c_markus_farnung_blured.png new file mode 100644 index 0000000..c8461d2 Binary files /dev/null and b/fossgis22/artwork/stadtansicht_marburg_c_markus_farnung_blured.png differ diff --git a/renderlib.py b/renderlib.py index 3f545a3..448c872 100644 --- a/renderlib.py +++ b/renderlib.py @@ -93,7 +93,7 @@ def renderFrame(infile, task, outfile): converted.save(filename=outfile) else: # invoke inkscape to convert the generated svg-file into a png inside the .frames-directory - cmd = 'inkscape --export-background=white --export-background-opacity=0 --export-width={1} --export-height={2} --export-png="{3}" "{4}" 2>&1 >/dev/null'.format(task.workdir, width, height, outfile, infile) + cmd = 'inkscape --export-background=white --export-background-opacity=0 --export-width={1} --export-height={2} --export-filename="{3}" --export-type="png" "{4}"'.format(task.workdir, width, height, outfile, infile) errorReturn = subprocess.check_output(cmd, shell=True, universal_newlines=True, stderr=subprocess.STDOUT, cwd=task.workdir) if errorReturn != '': print("inkscape exitted with error\n" + errorReturn) @@ -322,7 +322,7 @@ def events(scheduleUrl, titlemap={}): 'personnames': ', '.join(personnames), 'room': room.attrib['name'], 'track': event.find('track').text, - #'url': event.find('url').text + 'url': event.find('url').text }