is new
This commit is contained in:
parent
6bce711ea3
commit
146c1ee9e7
4 changed files with 31 additions and 10 deletions
13
encode.py
13
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
|
duration = float([s for s in data['streams'] if 'width' in s][0]['duration']) - 70/60
|
||||||
return '%0.3f' % duration
|
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')):
|
for xml in sorted(glob('output/*/*.xml')):
|
||||||
if xml.endswith('.audio.xml'):
|
if xml.endswith('.audio.xml'):
|
||||||
continue
|
continue
|
||||||
|
@ -30,7 +41,7 @@ for xml in sorted(glob('output/*/*.xml')):
|
||||||
pre_480p = mp4_480p + '.pre.mp4'
|
pre_480p = mp4_480p + '.pre.mp4'
|
||||||
video = mp4 + '.v.mp4'
|
video = mp4 + '.v.mp4'
|
||||||
audio = mp4 + '.wav'
|
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([
|
subprocess.call([
|
||||||
'qmelt', xml, '-consumer', 'avformat:' + video, 'vcodec=libx264', 'strict=-2'
|
'qmelt', xml, '-consumer', 'avformat:' + video, 'vcodec=libx264', 'strict=-2'
|
||||||
])
|
])
|
||||||
|
|
13
keywords.py
13
keywords.py
|
@ -16,11 +16,14 @@ KEYWORDS = {
|
||||||
"zomia"
|
"zomia"
|
||||||
],
|
],
|
||||||
"B": [
|
"B": [
|
||||||
|
"buffalo",
|
||||||
|
"buffalo",
|
||||||
|
"buffalo",
|
||||||
|
"buffalo",
|
||||||
"agriculture",
|
"agriculture",
|
||||||
"barbarian",
|
"barbarian",
|
||||||
"bondage",
|
"bondage",
|
||||||
"boundary",
|
"boundary",
|
||||||
"buffalo",
|
|
||||||
"colonialism",
|
"colonialism",
|
||||||
"peasant",
|
"peasant",
|
||||||
"royalty",
|
"royalty",
|
||||||
|
@ -39,8 +42,8 @@ KEYWORDS = {
|
||||||
"transmission"
|
"transmission"
|
||||||
],
|
],
|
||||||
"D": [
|
"D": [
|
||||||
"burial",
|
|
||||||
"decay",
|
"decay",
|
||||||
|
"burial",
|
||||||
"dispersal",
|
"dispersal",
|
||||||
"disaggregate",
|
"disaggregate",
|
||||||
"forensics",
|
"forensics",
|
||||||
|
@ -98,7 +101,7 @@ KEYWORDS = {
|
||||||
"water"
|
"water"
|
||||||
],
|
],
|
||||||
"I": [
|
"I": [
|
||||||
"aerial shot",
|
"aerial",
|
||||||
"agriculture",
|
"agriculture",
|
||||||
"authors",
|
"authors",
|
||||||
"writing",
|
"writing",
|
||||||
|
@ -141,7 +144,7 @@ KEYWORDS = {
|
||||||
"unreadable"
|
"unreadable"
|
||||||
],
|
],
|
||||||
"M": [
|
"M": [
|
||||||
"aerial shot",
|
"aerial",
|
||||||
"cosmology",
|
"cosmology",
|
||||||
"india bce",
|
"india bce",
|
||||||
"magic",
|
"magic",
|
||||||
|
@ -154,7 +157,7 @@ KEYWORDS = {
|
||||||
"survey"
|
"survey"
|
||||||
],
|
],
|
||||||
"N": [
|
"N": [
|
||||||
"aerial shot",
|
"aerial",
|
||||||
"narcotics",
|
"narcotics",
|
||||||
"narration",
|
"narration",
|
||||||
"nationalism",
|
"nationalism",
|
||||||
|
|
|
@ -94,7 +94,7 @@ for clip in data['text']:
|
||||||
add_blank(overlay, frames)
|
add_blank(overlay, frames)
|
||||||
else:
|
else:
|
||||||
frames = int(clip['duration'] * fps)
|
frames = int(clip['duration'] * fps)
|
||||||
add_text(overlay, clip['text'].upper(), frames)
|
add_text(overlay, clip['text'], frames)
|
||||||
|
|
||||||
for clip in data['music']:
|
for clip in data['music']:
|
||||||
frames = int(clip['duration'] * fps)
|
frames = int(clip['duration'] * fps)
|
||||||
|
|
13
text.html
13
text.html
|
@ -16,12 +16,16 @@ body {
|
||||||
}
|
}
|
||||||
#text {
|
#text {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
//color: rgb(192, 192, 192);
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-family: Menlo;
|
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;
|
//text-transform: uppercase;
|
||||||
//font-weight: bold;
|
//font-weight: bold;
|
||||||
text-shadow: 2px 4px 3px black;
|
|
||||||
}
|
}
|
||||||
#text2 {
|
#text2 {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
@ -57,7 +61,10 @@ function onLoad() {
|
||||||
}
|
}
|
||||||
function handleFontSize() {
|
function handleFontSize() {
|
||||||
// Set base font-size to 10% of window height
|
// 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;
|
var fontSize = window.innerHeight * 0.1;
|
||||||
|
|
Loading…
Reference in a new issue