sendezentrum basic artwork
This commit is contained in:
parent
175b2de1fc
commit
762bd0307e
7 changed files with 958 additions and 0 deletions
BIN
sendezentrum14/artwork/bkd-sz-484a4f.jpg
Normal file
BIN
sendezentrum14/artwork/bkd-sz-484a4f.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 395 KiB |
BIN
sendezentrum14/artwork/overlay-1024x576.png
Normal file
BIN
sendezentrum14/artwork/overlay-1024x576.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.7 KiB |
BIN
sendezentrum14/artwork/overlay-720x576.png
Normal file
BIN
sendezentrum14/artwork/overlay-720x576.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
246
sendezentrum14/artwork/overlay.svg
Normal file
246
sendezentrum14/artwork/overlay.svg
Normal file
|
@ -0,0 +1,246 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<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"
|
||||
width="1024"
|
||||
height="576"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="overlay.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient3807">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop3809" />
|
||||
<stop
|
||||
id="stop3815"
|
||||
offset="0.2"
|
||||
style="stop-color:#ffffff;stop-opacity:0.78431374;" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0.78431374;"
|
||||
offset="1"
|
||||
id="stop3811" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3807"
|
||||
id="linearGradient3813"
|
||||
x1="650"
|
||||
y1="595.07648"
|
||||
x2="1230"
|
||||
y2="595.07648"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.99744172,-74.949237,-22.857439)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3807"
|
||||
id="linearGradient3819"
|
||||
x1="575.05078"
|
||||
y1="570.69666"
|
||||
x2="1155.0508"
|
||||
y2="570.69666"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
spreadMethod="reflect" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3807-2"
|
||||
id="linearGradient3819-8"
|
||||
x1="575.05078"
|
||||
y1="570.69666"
|
||||
x2="1155.0508"
|
||||
y2="570.69666"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
spreadMethod="reflect" />
|
||||
<linearGradient
|
||||
id="linearGradient3807-2">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop3809-5" />
|
||||
<stop
|
||||
id="stop3815-1"
|
||||
offset="0.2"
|
||||
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3811-1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientTransform="matrix(2.3933139,0,0,1,-1291.5105,359.35582)"
|
||||
y2="570.69666"
|
||||
x2="1155.0508"
|
||||
y1="570.69666"
|
||||
x1="575.05078"
|
||||
spreadMethod="reflect"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient4017-1"
|
||||
xlink:href="#linearGradient3807-2-2"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient3807-2-2">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop3809-5-5" />
|
||||
<stop
|
||||
id="stop3815-1-7"
|
||||
offset="0.2"
|
||||
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3811-1-0" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="570.69666"
|
||||
x2="1155.0508"
|
||||
y1="570.69666"
|
||||
x1="575.05078"
|
||||
spreadMethod="reflect"
|
||||
gradientTransform="matrix(2.3933139,0,0,1,-842.013,2.87365)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient4510"
|
||||
xlink:href="#linearGradient3807-2-2"
|
||||
inkscape:collect="always" />
|
||||
<filter
|
||||
id="filter4858"
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow"
|
||||
width="1.2">
|
||||
<feFlood
|
||||
id="feFlood4860"
|
||||
flood-opacity="0.29666666666666669"
|
||||
flood-color="rgb(255,255,255)"
|
||||
result="flood" />
|
||||
<feComposite
|
||||
id="feComposite4862"
|
||||
in2="SourceGraphic"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur4864"
|
||||
in="composite"
|
||||
stdDeviation="2"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset4866"
|
||||
dx="2"
|
||||
dy="2.2000000000000002"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
id="feComposite4868"
|
||||
in2="offset"
|
||||
in="SourceGraphic"
|
||||
operator="over"
|
||||
result="composite2"
|
||||
dy="0" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="1.4"
|
||||
inkscape:cx="873.34104"
|
||||
inkscape:cy="395.16467"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1-7"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="993"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:snap-global="true"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:bbox-paths="true"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-bbox-edge-midpoints="true"
|
||||
inkscape:snap-bbox-midpoints="true"
|
||||
inkscape:object-paths="false"
|
||||
inkscape:snap-to-guides="true">
|
||||
<sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="0,0"
|
||||
id="guide3017" />
|
||||
<sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="0,576"
|
||||
id="guide3019" />
|
||||
<sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="0,0"
|
||||
id="guide3021" />
|
||||
<sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="1024,0"
|
||||
id="guide3023" />
|
||||
<sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="0,25"
|
||||
id="guide3025" />
|
||||
<sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="0,547"
|
||||
id="guide3027" />
|
||||
<sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="122.22846,648.51793"
|
||||
id="guide3029" />
|
||||
<sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="994,0"
|
||||
id="guide3031" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<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>
|
||||
<g
|
||||
inkscape:label="Ebene 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-476.36218)">
|
||||
<g
|
||||
transform="matrix(0.48267099,0,0,0.48267099,713.88668,139.03891)"
|
||||
id="layer1-7"
|
||||
inkscape:label="Ebene 1">
|
||||
<image
|
||||
sodipodi:absref="/home/peter/AAA-VOC/mazdermind-c3voc-toolz/vor-abspann/sendezentrum14/artwork/sz.png"
|
||||
xlink:href="sz.png"
|
||||
style="opacity:0.75000000000000000;stroke:none;stroke-opacity:1;stroke-width:41.81523319000000072;stroke-miterlimit:4;stroke-dasharray:none"
|
||||
width="319.21854"
|
||||
height="49.578899"
|
||||
id="image3108"
|
||||
x="261.12152"
|
||||
y="758.95026" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 6.9 KiB |
243
sendezentrum14/artwork/pause.svg
Normal file
243
sendezentrum14/artwork/pause.svg
Normal file
|
@ -0,0 +1,243 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<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"
|
||||
width="1024"
|
||||
height="576"
|
||||
id="svg2"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="pause.svg">
|
||||
<defs
|
||||
id="defs4">
|
||||
<linearGradient
|
||||
id="linearGradient3807">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop3809" />
|
||||
<stop
|
||||
id="stop3815"
|
||||
offset="0.2"
|
||||
style="stop-color:#ffffff;stop-opacity:0.78431374;" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0.78431374;"
|
||||
offset="1"
|
||||
id="stop3811" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3807"
|
||||
id="linearGradient3813"
|
||||
x1="650"
|
||||
y1="595.07648"
|
||||
x2="1230"
|
||||
y2="595.07648"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(1,0,0,0.99744172,-74.949237,-22.857439)" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3807"
|
||||
id="linearGradient3819"
|
||||
x1="575.05078"
|
||||
y1="570.69666"
|
||||
x2="1155.0508"
|
||||
y2="570.69666"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
spreadMethod="reflect" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#linearGradient3807-2"
|
||||
id="linearGradient3819-8"
|
||||
x1="575.05078"
|
||||
y1="570.69666"
|
||||
x2="1155.0508"
|
||||
y2="570.69666"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
spreadMethod="reflect" />
|
||||
<linearGradient
|
||||
id="linearGradient3807-2">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop3809-5" />
|
||||
<stop
|
||||
id="stop3815-1"
|
||||
offset="0.2"
|
||||
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3811-1" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
gradientTransform="matrix(2.3933139,0,0,1,-1291.5105,359.35582)"
|
||||
y2="570.69666"
|
||||
x2="1155.0508"
|
||||
y1="570.69666"
|
||||
x1="575.05078"
|
||||
spreadMethod="reflect"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient4017-1"
|
||||
xlink:href="#linearGradient3807-2-2"
|
||||
inkscape:collect="always" />
|
||||
<linearGradient
|
||||
id="linearGradient3807-2-2">
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:0;"
|
||||
offset="0"
|
||||
id="stop3809-5-5" />
|
||||
<stop
|
||||
id="stop3815-1-7"
|
||||
offset="0.2"
|
||||
style="stop-color:#ffffff;stop-opacity:1;" />
|
||||
<stop
|
||||
style="stop-color:#ffffff;stop-opacity:1;"
|
||||
offset="1"
|
||||
id="stop3811-1-0" />
|
||||
</linearGradient>
|
||||
<linearGradient
|
||||
y2="570.69666"
|
||||
x2="1155.0508"
|
||||
y1="570.69666"
|
||||
x1="575.05078"
|
||||
spreadMethod="reflect"
|
||||
gradientTransform="matrix(2.3933139,0,0,1,-842.013,2.87365)"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
id="linearGradient4510"
|
||||
xlink:href="#linearGradient3807-2-2"
|
||||
inkscape:collect="always" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.98994951"
|
||||
inkscape:cx="311.93679"
|
||||
inkscape:cy="216.7472"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="993"
|
||||
inkscape:window-x="0"
|
||||
inkscape:window-y="27"
|
||||
inkscape:window-maximized="1"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:snap-global="true"
|
||||
inkscape:snap-bbox="true"
|
||||
inkscape:bbox-paths="true"
|
||||
inkscape:bbox-nodes="true"
|
||||
inkscape:snap-bbox-edge-midpoints="true"
|
||||
inkscape:snap-bbox-midpoints="true"
|
||||
inkscape:object-paths="false"
|
||||
inkscape:snap-to-guides="true">
|
||||
<sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="0,0"
|
||||
id="guide3017" />
|
||||
<sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="0,576"
|
||||
id="guide3019" />
|
||||
<sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="0,0"
|
||||
id="guide3021" />
|
||||
<sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="1024,0"
|
||||
id="guide3023" />
|
||||
<sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="0,25"
|
||||
id="guide3025" />
|
||||
<sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="0,547"
|
||||
id="guide3027" />
|
||||
<sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="32,0"
|
||||
id="guide3029" />
|
||||
<sodipodi:guide
|
||||
orientation="1,0"
|
||||
position="994,0"
|
||||
id="guide3031" />
|
||||
<sodipodi:guide
|
||||
orientation="0,1"
|
||||
position="510.09586,50.114988"
|
||||
id="guide3868" />
|
||||
</sodipodi:namedview>
|
||||
<metadata
|
||||
id="metadata7">
|
||||
<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>
|
||||
<g
|
||||
inkscape:label="Ebene 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-476.36218)">
|
||||
<image
|
||||
sodipodi:absref="/home/peter/AAA-VOC/mazdermind-c3voc-toolz/vor-abspann/sendezentrum14/artwork/bkd-sz-484a4f.jpg"
|
||||
xlink:href="bkd-sz-484a4f.jpg"
|
||||
id="image2993"
|
||||
x="0"
|
||||
y="475.36218"
|
||||
width="1024"
|
||||
height="640" />
|
||||
<flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot3049"
|
||||
style="fill:black;stroke:none;stroke-opacity:1;stroke-width:1px;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;font-family:Sans;font-style:normal;font-weight:normal;font-size:40px;line-height:125%;letter-spacing:0px;word-spacing:0px"><flowRegion
|
||||
id="flowRegion3051"><rect
|
||||
id="rect3053"
|
||||
width="1032.8572"
|
||||
height="94.285713"
|
||||
x="-7.1428571"
|
||||
y="278.85715" /></flowRegion><flowPara
|
||||
id="flowPara3055"></flowPara></flowRoot> <flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot3065"
|
||||
style="fill:black;stroke:none;stroke-opacity:1;stroke-width:1px;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;font-family:Sans;font-style:normal;font-weight:normal;font-size:40px;line-height:125%;letter-spacing:0px;word-spacing:0px"><flowRegion
|
||||
id="flowRegion3067"><rect
|
||||
id="rect3069"
|
||||
width="960"
|
||||
height="134.28571"
|
||||
x="31.428572"
|
||||
y="310.28571" /></flowRegion><flowPara
|
||||
id="flowPara3071"></flowPara></flowRoot> <flowRoot
|
||||
xml:space="preserve"
|
||||
id="flowRoot3073"
|
||||
style="font-size:40px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
|
||||
transform="translate(-0.375,455.53518)"><flowRegion
|
||||
id="flowRegion3075"><rect
|
||||
id="rect3077"
|
||||
width="962"
|
||||
height="117.27592"
|
||||
x="32"
|
||||
y="319.86731"
|
||||
style="text-align:center;text-anchor:middle" /></flowRegion><flowPara
|
||||
id="flowPara3079"
|
||||
style="-inkscape-font-specification:Nord;font-family:Nord;font-size:72px">$text</flowPara></flowRoot> </g>
|
||||
</svg>
|
After Width: | Height: | Size: 7.7 KiB |
BIN
sendezentrum14/artwork/sz.png
Normal file
BIN
sendezentrum14/artwork/sz.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
469
sendezentrum14/make.py
Executable file
469
sendezentrum14/make.py
Executable file
|
@ -0,0 +1,469 @@
|
|||
#!/usr/bin/python
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
import sys
|
||||
import glob
|
||||
import os
|
||||
import re
|
||||
import math
|
||||
import time
|
||||
import shutil
|
||||
import errno
|
||||
import urllib2
|
||||
from lxml import etree
|
||||
from xml.sax.saxutils import escape as xmlescape
|
||||
import cssutils
|
||||
import logging
|
||||
import tempfile
|
||||
import threading
|
||||
import multiprocessing
|
||||
from threading import Thread, Lock
|
||||
import subprocess
|
||||
from Queue import Queue
|
||||
|
||||
# URL to Schedule-XML
|
||||
scheduleUrl = 'http://www.fossgis.de/konferenz/2014/programm/schedule.de.xml'
|
||||
|
||||
# For (really) too long titles
|
||||
titlemap = {
|
||||
#708: "Neue WEB-Anwendungen des LGRB Baden-Württemberg im Überblick"
|
||||
}
|
||||
|
||||
# Frames per second. Increasing this renders more frames, the avconf-statements would still need modifications
|
||||
fps = 25
|
||||
|
||||
# using --debug skips the threading, the network fetching of the schedule and
|
||||
# just renders one type of video
|
||||
debug = ('--debug' in sys.argv)
|
||||
|
||||
# using --offline only skips the network fetching and use a local schedule.de.xml
|
||||
offline = ('--offline' in sys.argv)
|
||||
|
||||
# set charset of output-terminal
|
||||
reload(sys)
|
||||
sys.setdefaultencoding('utf-8')
|
||||
|
||||
# t: current time, b: begInnIng value, c: change In value, d: duration
|
||||
# copied from jqueryui
|
||||
def easeOutCubic(t, b, c, d):
|
||||
t=float(t)/d-1
|
||||
return c*((t)*t*t + 1) + b
|
||||
|
||||
def easeInCubic(t, b, c, d):
|
||||
t=float(t)/d
|
||||
return c*(t)*t*t + b;
|
||||
|
||||
def easeOutQuad(t, b, c, d):
|
||||
t=float(t)/d
|
||||
return -c *(t)*(t-2) + b;
|
||||
|
||||
# try to create all folders needed and skip, they already exist
|
||||
def ensurePathExists(path):
|
||||
try:
|
||||
os.makedirs(path)
|
||||
except OSError as exception:
|
||||
if exception.errno != errno.EEXIST:
|
||||
raise
|
||||
|
||||
# remove the files matched by the pattern
|
||||
def ensureFilesRemoved(pattern):
|
||||
for f in glob.glob(pattern):
|
||||
os.unlink(f)
|
||||
|
||||
def abspannFrames():
|
||||
# 9 Sekunden
|
||||
|
||||
# 3 Sekunden Fadein Logo
|
||||
frames = int(3*fps)
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('logo', 'style', 'opacity', "%.4f" % easeInCubic(i, 0, 1, frames)),
|
||||
('box', 'style', 'opacity', 0)
|
||||
)
|
||||
|
||||
# 3 Sekunde Fadein Box
|
||||
frames = 3*fps
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('logo', 'style', 'opacity', 1),
|
||||
('box', 'style', 'opacity', "%.4f" % easeOutQuad(i, 0, 1, frames)),
|
||||
('box', 'attr', 'transform', 'translate(0,%.4f)' % easeOutQuad(i, 94, -94, frames) )
|
||||
#('box', 'attr', 'transform', 'translate(%.4f,0)' % easeOutQuad(i, 960, -960, frames) )
|
||||
)
|
||||
|
||||
# 3 Sekunden stehen bleiben
|
||||
frames = 3*fps
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('logo', 'style', 'opacity', 1),
|
||||
('box', 'style', 'opacity', 1)
|
||||
)
|
||||
|
||||
|
||||
def vorspannFrames():
|
||||
# 7 Sekunden
|
||||
|
||||
# 0.5 Sekunden stehen bleiben
|
||||
frames = int(math.ceil(0.5*fps))
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('logo', 'style', 'opacity', 0),
|
||||
('box', 'style', 'opacity', 0)
|
||||
)
|
||||
|
||||
# 1.5 Sekunden Fadein Logo
|
||||
frames = int(math.ceil(1.5*fps))
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('logo', 'style', 'opacity', "%.4f" % easeInCubic(i, 0, 1, frames)),
|
||||
('box', 'style', 'opacity', 0)
|
||||
)
|
||||
|
||||
# 3 Sekunde Fadein Box
|
||||
frames = 3*fps
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('logo', 'style', 'opacity', 1),
|
||||
('box', 'style', 'opacity', "%.4f" % easeOutQuad(i, 0, 1, frames)),
|
||||
('box', 'attr', 'transform', 'translate(0,%.4f)' % easeOutQuad(i, 198, -198, frames) )
|
||||
#('box', 'attr', 'transform', 'translate(%.4f,0)' % easeOutQuad(i, 960, -960, frames) )
|
||||
)
|
||||
|
||||
# 3 Sekunden stehen bleiben
|
||||
frames = 3*fps
|
||||
for i in range(0, frames):
|
||||
yield (
|
||||
('logo', 'style', 'opacity', 1),
|
||||
('box', 'style', 'opacity', 1)
|
||||
)
|
||||
|
||||
def pauseFrames():
|
||||
# 12 Sekunden
|
||||
|
||||
texts = {
|
||||
'text1': "0.0",
|
||||
'text2': "0.0",
|
||||
'text3': "0.0"
|
||||
}
|
||||
|
||||
for name in texts.keys():
|
||||
# 2 Sekunden einfaden
|
||||
frames = 2*fps
|
||||
for i in range(0, frames):
|
||||
texts[name] = "%.4f" % easeOutQuad(i, 0, 1, frames)
|
||||
|
||||
yield (
|
||||
('text1', 'style', 'opacity', texts['text1']),
|
||||
('text2', 'style', 'opacity', texts['text2']),
|
||||
('text3', 'style', 'opacity', texts['text3'])
|
||||
)
|
||||
|
||||
# 2 Sekunden ausfaden
|
||||
frames = 2*fps
|
||||
for i in range(0, frames):
|
||||
texts[name] = "%.4f" % easeOutQuad(i, 1, -1, frames)
|
||||
|
||||
yield (
|
||||
('text1', 'style', 'opacity', texts['text1']),
|
||||
('text2', 'style', 'opacity', texts['text2']),
|
||||
('text3', 'style', 'opacity', texts['text3'])
|
||||
)
|
||||
|
||||
texts[name] = "0.0"
|
||||
|
||||
cssutils.ser.prefs.lineSeparator = ' '
|
||||
cssutils.log.setLevel(logging.ERROR)
|
||||
|
||||
def render(infile, outfile, sequence, parameters={}, workdir='artwork'):
|
||||
# in debug mode we have no thread-worker which prints its progress
|
||||
if debug:
|
||||
print "generating {0} from {1}".format(outfile, infile)
|
||||
|
||||
# make sure a .frames-directory exists in out workdir
|
||||
ensurePathExists(os.path.join(workdir, '.frames'))
|
||||
|
||||
# open and parse the input file
|
||||
with open(os.path.join(workdir, infile), 'r') as fp:
|
||||
svgstr = fp.read()
|
||||
for key in parameters.keys():
|
||||
svgstr = svgstr.replace(key, xmlescape(str(parameters[key])))
|
||||
|
||||
svg = etree.fromstring(svgstr)
|
||||
|
||||
# find all images and force them to absolute file-urls
|
||||
namespaces = {'xlink': 'http://www.w3.org/1999/xlink', 'svg': 'http://www.w3.org/2000/svg'}
|
||||
for el in svg.findall(".//svg:image[@xlink:href]", namespaces=namespaces):
|
||||
el.attrib['{http://www.w3.org/1999/xlink}href'] = 'file:///' + os.path.realpath(workdir) + '/' + el.attrib['{http://www.w3.org/1999/xlink}href']
|
||||
|
||||
# frame-number counter
|
||||
frameNr = 0
|
||||
|
||||
# iterate through the animation seqence frame by frame
|
||||
# frame is a ... tbd
|
||||
for frame in sequence():
|
||||
# print a line for each and every frame generated
|
||||
if debug:
|
||||
print "frameNr {0:2d} => {1}".format(frameNr, frame)
|
||||
|
||||
# open the output-file (named ".gen.svg" in the workdir)
|
||||
with open(os.path.join(workdir, '.gen.svg'), 'w') as fp:
|
||||
# apply the replace-pairs to the input text, by finding the specified xml-elements by thier id and modify thier css-parameter the correct value
|
||||
for replaceinfo in frame:
|
||||
(id, type, key, value) = replaceinfo
|
||||
|
||||
for el in svg.findall(".//*[@id='"+id.replace("'", "\\'")+"']"):
|
||||
if type == 'style':
|
||||
style = cssutils.parseStyle( el.attrib['style'] if 'style' in el.attrib else '' )
|
||||
style[key] = unicode(value)
|
||||
el.attrib['style'] = style.cssText
|
||||
|
||||
elif type == 'attr':
|
||||
el.attrib[key] = value
|
||||
|
||||
# write the generated svg-text into the output-file
|
||||
fp.write( etree.tostring(svg) )
|
||||
|
||||
# invoke inkscape to convert the generated svg-file into a png inside the .frames-directory
|
||||
errorReturn = subprocess.check_output('cd {0} && inkscape --export-png=.frames/{1:04d}.png .gen.svg 2>&1 >/dev/null'.format(workdir, frameNr), shell=True)
|
||||
if errorReturn != '':
|
||||
print "inkscape exitted with error\n"+errorReturn
|
||||
sys.exit(42)
|
||||
|
||||
# increment frame-number
|
||||
frameNr += 1
|
||||
|
||||
|
||||
|
||||
# remove the dv we are about to (re-)generate
|
||||
ensureFilesRemoved(os.path.join(workdir, outfile))
|
||||
|
||||
# invoke avconv aka ffmpeg and renerate a lossles-dv from the frames
|
||||
# if we're not in debug-mode, suppress all output
|
||||
os.system('cd {0} && ffmpeg -ar 48000 -ac 2 -f s16le -i /dev/zero -f image2 -i .frames/%04d.png -target pal-dv -aspect 16:9 -shortest "{1}"'.format(workdir, outfile) + ('' if debug else '>/dev/null 2>&1'))
|
||||
|
||||
# as before, in non-debug-mode the thread-worker does all progress messages
|
||||
if debug:
|
||||
print "cleanup"
|
||||
|
||||
# remove the .frames-dir with all frames in it
|
||||
shutil.rmtree(os.path.join(workdir, '.frames'))
|
||||
|
||||
# remove the generated svg
|
||||
ensureFilesRemoved(os.path.join(workdir, '.gen.svg'))
|
||||
|
||||
|
||||
|
||||
# Download the Events-Schedule and parse all Events out of it. Yield a tupel for each Event
|
||||
def events():
|
||||
print "downloading pentabarf schedule"
|
||||
|
||||
# use --offline to skip networking
|
||||
if offline:
|
||||
# parse the offline-version
|
||||
schedule = etree.parse('schedule.de.xml').getroot()
|
||||
|
||||
else:
|
||||
# download the schedule
|
||||
response = urllib2.urlopen(scheduleUrl)
|
||||
|
||||
# read xml-source
|
||||
xml = response.read()
|
||||
|
||||
# parse into ElementTree
|
||||
schedule = etree.fromstring(xml)
|
||||
|
||||
# iterate all days
|
||||
for day in schedule.iter('day'):
|
||||
# iterate all rooms
|
||||
for room in day.iter('room'):
|
||||
# iterate events on that day in this room
|
||||
for event in room.iter('event'):
|
||||
# aggregate names of the persons holding this talk
|
||||
personnames = []
|
||||
for person in event.find('persons').iter('person'):
|
||||
personnames.append(person.text)
|
||||
|
||||
# yield a tupel with the event-id, event-title and person-names
|
||||
yield ( int(event.get('id')), event.find('title').text, event.find('subtitle').text or '', ', '.join(personnames) )
|
||||
|
||||
|
||||
# debug-mode selected by --debug switch
|
||||
if debug:
|
||||
print "!!! DEBUG MODE !!!"
|
||||
|
||||
render(
|
||||
'vorspann.svg',
|
||||
'../intro.dv',
|
||||
vorspannFrames,
|
||||
{
|
||||
'$id': 667,
|
||||
'$title': 'OpenJUMP - Überblick, Neuigkeiten, Zusammenarbeit/Schnittstellen mit proprietärer Software',
|
||||
'$subtitle': 'Even more news about OpenJUMP',
|
||||
'$personnames': 'Matthias S.'
|
||||
}
|
||||
)
|
||||
|
||||
render(
|
||||
'abspann.svg',
|
||||
'../outro.dv',
|
||||
abspannFrames
|
||||
)
|
||||
|
||||
render('pause.svg',
|
||||
'../pause.dv',
|
||||
pauseFrames
|
||||
)
|
||||
|
||||
sys.exit(0)
|
||||
|
||||
|
||||
|
||||
# threaded task queue
|
||||
tasks = Queue()
|
||||
|
||||
# iterate over all events extracted from the schedule xml-export
|
||||
for (id, title, subtitle, personnames) in events():
|
||||
if id in titlemap:
|
||||
title = titlemap[id]
|
||||
|
||||
# generate a task description and put them into the queue
|
||||
tasks.put((
|
||||
'vorspann.svg',
|
||||
str(id)+".dv",
|
||||
vorspannFrames,
|
||||
{
|
||||
'$id': id,
|
||||
'$title': title,
|
||||
'$subtitle': subtitle,
|
||||
'$personnames': personnames
|
||||
}
|
||||
))
|
||||
|
||||
# place a task for the outro into the queue
|
||||
tasks.put((
|
||||
'abspann.svg',
|
||||
'outro.dv',
|
||||
abspannFrames
|
||||
))
|
||||
|
||||
# place the pause-sequence into the queue
|
||||
tasks.put((
|
||||
'pause.svg',
|
||||
'pause.dv',
|
||||
pauseFrames
|
||||
))
|
||||
|
||||
# one working thread per cpu
|
||||
num_worker_threads = multiprocessing.cpu_count()
|
||||
print "{0} tasks in queue, starting {1} worker threads".format(tasks.qsize(), num_worker_threads)
|
||||
|
||||
# put a sentinel for each thread into the queue to signal the end
|
||||
for _ in range(num_worker_threads):
|
||||
tasks.put(None)
|
||||
|
||||
# this lock ensures, that only one thread at a time is writing to stdout
|
||||
# and avoids output from multiple threads intermixing
|
||||
printLock = Lock()
|
||||
def tprint(str):
|
||||
# aquire lock
|
||||
printLock.acquire()
|
||||
|
||||
# print thread-name and message
|
||||
print threading.current_thread().name+': '+str
|
||||
|
||||
# release lock
|
||||
printLock.release()
|
||||
|
||||
|
||||
# thread worker
|
||||
def worker():
|
||||
# generate a tempdir for this worker-thread and use the artwork-subdir as temporary folder
|
||||
tempdir = tempfile.mkdtemp()
|
||||
workdir = os.path.join(tempdir, 'artwork')
|
||||
|
||||
# save the current working dir as output-dir
|
||||
outdir = os.getcwd()
|
||||
|
||||
# print a message that we're about to initialize our environment
|
||||
tprint("initializing worker in {0}, writing result to {1}".format(tempdir, outdir))
|
||||
|
||||
# copy the artwork-dir into the tempdir
|
||||
shutil.copytree('artwork', workdir)
|
||||
|
||||
# loop until all tasks are done (when the thread fetches a sentinal from the queue)
|
||||
while True:
|
||||
# fetch a task from the queue
|
||||
task = tasks.get()
|
||||
|
||||
# if it is a stop-sentinal break out of the loop
|
||||
if task == None:
|
||||
break
|
||||
|
||||
# print that we're about to render a task
|
||||
tprint('rendering {0}'.format(task[1]))
|
||||
|
||||
# render options
|
||||
opts = (
|
||||
# argument 0 is the input file. prepend the workdir
|
||||
os.path.join(workdir, task[0]),
|
||||
|
||||
# argument 1 is the output file. prepend the outdir
|
||||
os.path.join(outdir, task[1]),
|
||||
|
||||
# argument 2 is the frame generator, nothing to do here
|
||||
task[2],
|
||||
|
||||
# argument 3 are the extra parameters
|
||||
task[3] if len(task) > 3 else {},
|
||||
|
||||
# argument 4 is the workdir path
|
||||
workdir
|
||||
)
|
||||
|
||||
# render with these arguments
|
||||
render(*opts)
|
||||
|
||||
# print that we're finished
|
||||
tprint('finished {0}, {1} tasks left'.format(task[1], max(0, tasks.qsize() - num_worker_threads)))
|
||||
|
||||
# mark the task as finished
|
||||
tasks.task_done()
|
||||
|
||||
# all tasks from the queue done, clean up
|
||||
tprint("cleaning up worker")
|
||||
|
||||
# remove the tempdir
|
||||
shutil.rmtree(tempdir)
|
||||
|
||||
# mark the sentinal as done
|
||||
tasks.task_done()
|
||||
|
||||
# List of running threads
|
||||
threads = []
|
||||
|
||||
# generate and start the threads
|
||||
for i in range(num_worker_threads):
|
||||
t = Thread(target=worker)
|
||||
t.daemon = True
|
||||
t.start()
|
||||
threads.append(t)
|
||||
|
||||
# wait until they finished doing the work
|
||||
# we're doing it the manual way because tasks.join() would wait until all tasks are done,
|
||||
# even if the worker threads crash due to broken svgs, Ctrl-C termination or whatnot
|
||||
while True:
|
||||
if tasks.empty() == True:
|
||||
break
|
||||
|
||||
# sleep while the workers work
|
||||
time.sleep(1)
|
||||
|
||||
# check if all worker-threads are still alive
|
||||
thread_count = len(filter(lambda t: t.is_alive(), threads))
|
||||
|
||||
# exit otherwise
|
||||
if thread_count != num_worker_threads:
|
||||
tprint("{0} of {1} threads have died, ending".format(num_worker_threads - thread_count, num_worker_threads))
|
||||
sys.exit(23)
|
||||
|
||||
print "all worker threads ended"
|
Loading…
Add table
Reference in a new issue