diff --git a/encode.py b/encode.py index e15f116..10f5734 100755 --- a/encode.py +++ b/encode.py @@ -20,6 +20,17 @@ def get_videoduration(video): duration = float([s for s in data['streams'] if 'width' in s][0]['duration']) - 70/60 return '%0.3f' % duration +def is_new(xml, mp4): + if not os.path.exists(mp4): + return True + xtime = os.path.getmtime(xml) + vtime = max( + os.path.getmtime(mp4), + os.path.getmtime('text.html'), + os.path.getmtime('VOCALS.json') + ) + return vtime < xtime + for xml in sorted(glob('output/*/*.xml')): if xml.endswith('.audio.xml'): continue @@ -30,7 +41,7 @@ for xml in sorted(glob('output/*/*.xml')): pre_480p = mp4_480p + '.pre.mp4' video = mp4 + '.v.mp4' audio = mp4 + '.wav' - if not os.path.exists(mp4) or os.path.getmtime(xml) > os.path.getmtime(mp4): + if is_new(xml, mp4): subprocess.call([ 'qmelt', xml, '-consumer', 'avformat:' + video, 'vcodec=libx264', 'strict=-2' ]) diff --git a/keywords.py b/keywords.py index f3868da..f0dce4b 100644 --- a/keywords.py +++ b/keywords.py @@ -16,11 +16,14 @@ KEYWORDS = { "zomia" ], "B": [ + "buffalo", + "buffalo", + "buffalo", + "buffalo", "agriculture", "barbarian", "bondage", "boundary", - "buffalo", "colonialism", "peasant", "royalty", @@ -39,8 +42,8 @@ KEYWORDS = { "transmission" ], "D": [ - "burial", "decay", + "burial", "dispersal", "disaggregate", "forensics", @@ -98,7 +101,7 @@ KEYWORDS = { "water" ], "I": [ - "aerial shot", + "aerial", "agriculture", "authors", "writing", @@ -141,7 +144,7 @@ KEYWORDS = { "unreadable" ], "M": [ - "aerial shot", + "aerial", "cosmology", "india bce", "magic", @@ -154,7 +157,7 @@ KEYWORDS = { "survey" ], "N": [ - "aerial shot", + "aerial", "narcotics", "narration", "nationalism", diff --git a/render_mlt.py b/render_mlt.py index 1d7c23f..239f70e 100755 --- a/render_mlt.py +++ b/render_mlt.py @@ -94,7 +94,7 @@ for clip in data['text']: add_blank(overlay, frames) else: frames = int(clip['duration'] * fps) - add_text(overlay, clip['text'].upper(), frames) + add_text(overlay, clip['text'], frames) for clip in data['music']: frames = int(clip['duration'] * fps) diff --git a/text.html b/text.html index 13871de..383bd7b 100644 --- a/text.html +++ b/text.html @@ -16,12 +16,16 @@ body { } #text { color: #fff; + //color: rgb(192, 192, 192); text-align: center; font-family: Menlo; - font-variant: small-caps; + //font-variant: small-caps; + //text-shadow: -2px -2px 0 black, 2px -2px 0 black, -2px 2px 0 black, 2px 2px 0 black; + + text-shadow: 2px 4px 3px black; + //text-transform: uppercase; //font-weight: bold; - text-shadow: 2px 4px 3px black; } #text2 { color: #fff; @@ -57,7 +61,10 @@ function onLoad() { } function handleFontSize() { // Set base font-size to 10% of window height - document.body.style.fontSize = (window.innerHeight * 0.05) + "px"; + //document.body.style.fontSize = (window.innerHeight * 0.1) + "px"; + //document.body.style.fontSize = (window.innerHeight * 0.05) + "px"; + document.body.style.fontSize = (window.innerHeight * 0.09) + "px"; + /* var fontSize = window.innerHeight * 0.1;