hidden tags, 480p, rename

This commit is contained in:
j 2017-03-06 09:36:39 +01:00
parent 1f4e1edc6e
commit 1da2ac0475
3 changed files with 79 additions and 62 deletions

View file

@ -25,32 +25,15 @@ for xml in sorted(glob('output/*/*.xml')):
continue continue
audio_xml = xml.replace('.xml', '.audio.xml') audio_xml = xml.replace('.xml', '.audio.xml')
mp4 = xml.replace('.xml', '.mp4') mp4 = xml.replace('.xml', '.mp4')
mp4_480p = mp4.replace('.mp4', '.480p.mp4')
pre = mp4 + '.pre.mp4' pre = mp4 + '.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 not os.path.exists(mp4) or os.path.getmtime(xml) > os.path.getmtime(mp4):
subprocess.call([ subprocess.call([
'qmelt', xml, '-consumer', 'avformat:' + video, 'vcodec=libx264', 'strict=-2' 'qmelt', xml, '-consumer', 'avformat:' + video, 'vcodec=libx264', 'strict=-2'
]) ])
'''
subprocess.call([
'qmelt', audio_xml, '-consumer', 'avformat:' + audio,
])
cmd = [
'ffmpeg', '-y',
'-i', video,
'-i', audio,
'-map', '0:v',
'-map', '1:a',
'-c:v', 'copy',
'-strict', '-2',
pre
]
subprocess.call(cmd)
os.unlink(video)
os.unlink(audio)
shutil.move(pre, mp4)
'''
duration = get_videoduration(video) duration = get_videoduration(video)
cmd = [ cmd = [
'ffmpeg', '-y', 'ffmpeg', '-y',
@ -58,8 +41,23 @@ for xml in sorted(glob('output/*/*.xml')):
'-c:a', 'copy', '-c:a', 'copy',
'-c:v', 'copy', '-c:v', 'copy',
'-t', duration, '-t', duration,
'-movflags', '+faststart',
pre pre
] ]
subprocess.call(cmd) subprocess.call(cmd)
os.unlink(video) os.unlink(video)
shutil.move(pre, mp4) shutil.move(pre, mp4)
cmd = [
'ffmpeg', '-y',
'-i', mp4,
'-c:a', 'copy',
'-vf', 'scale=854:480',
'-c:v', 'libx264',
'-preset', 'medium',
'-b:v', '750k',
'-profile:v', 'high',
'-movflags', '+faststart',
pre_480p
]
subprocess.call(cmd)
shutil.move(pre_480p, mp4_480p)

View file

@ -6,11 +6,11 @@ KEYWORDS = {
"anarchism", "anarchism",
"animism", "animism",
"aporia", "aporia",
"archipelago", "archipelagoes",
"ascending/descending", "ascend",
"assimilation", "assimilation",
"diagram", "descend",
"mountain", "highlands",
"piracy", "piracy",
"water", "water",
"zomia" "zomia"
@ -22,10 +22,9 @@ KEYWORDS = {
"boundary", "boundary",
"buffalo", "buffalo",
"colonialism", "colonialism",
"forest", "peasant",
"peasants",
"royalty", "royalty",
"shadow puppet", "shadow puppets",
"tiger" "tiger"
], ],
"C": [ "C": [
@ -34,21 +33,23 @@ KEYWORDS = {
"contagion", "contagion",
"corruption", "corruption",
"cosmology", "cosmology",
"modern leader", "leaders",
"money", "money",
"royalty", "royalty",
"transmission" "transmission"
], ],
"D": [ "D": [
"burial/grave", "burial",
"decay", "decay",
"dispersal/disaggregation", "dispersal",
"disaggregate",
"forensics", "forensics",
"human remains", "human remains",
"humidity", "humidity",
"rain", "rain",
"river", "river",
"soil" "soil",
"tombs"
], ],
"E": [ "E": [
"evasion", "evasion",
@ -56,30 +57,32 @@ KEYWORDS = {
"contagion", "contagion",
"ecology", "ecology",
"efficacy", "efficacy",
"transmission of ideology" "transmission"
], ],
"F": [ "F": [
"fauna",
"fiction", "fiction",
"flight", "flight",
"flora/fauna", "flora",
"fluidity", "fluidity",
"forest", "forest",
"friction", "friction",
"frontier", "frontier",
"magic/shamans", "shamans",
"outlaw" "outlaw"
], ],
"G": [ "G": [
"authors/writing", "authors",
"cpm/mcp/mpaja", "writing",
"cpm/mcp",
"espionage", "espionage",
"geography", "geography",
"ghost/spirit", "ghost", "spirit",
"guerilla", "guerillas",
"transmission" "transmission"
], ],
"H": [ "H": [
"air conditioner", "air-conditioner",
"diagram", "diagram",
"heat", "heat",
"humidity", "humidity",
@ -89,14 +92,16 @@ KEYWORDS = {
"oppression", "oppression",
"rain", "rain",
"river", "river",
"sweat/labor", "sweat",
"labor",
"trade", "trade",
"water" "water"
], ],
"I": [ "I": [
"aerial shot", "aerial shot",
"agriculture", "agriculture",
"authors/writing", "authors",
"writing",
"construction", "construction",
"identity", "identity",
"imitation", "imitation",
@ -104,7 +109,8 @@ KEYWORDS = {
"invulnerability", "invulnerability",
"irrigation", "irrigation",
"tattoo", "tattoo",
"unreadable sign" "illegible",
"unreadable"
], ],
"J": [ "J": [
"jellyfish", "jellyfish",
@ -114,29 +120,32 @@ KEYWORDS = {
], ],
"K": [ "K": [
"family", "family",
"kinship/kingship", "kinship",
"kingship",
"modern nepotism", "modern nepotism",
"royalty" "royalty"
], ],
"L": [ "L": [
"1900-1947", "1900-1947",
"authors/writing", "authors",
"body in water", "writing",
"water bodies",
"colonialism", "colonialism",
"cpm/mcp/mpaja", "cpm/mcp",
"espionage", "espionage",
"guerilla", "guerillas",
"japanese occupation", "japanese occupation",
"legibility", "legibility",
"river", "river",
"shape-shifter", "shape-shifter",
"unreadable sign" "unreadable"
], ],
"M": [ "M": [
"aerial shot", "aerial shot",
"cosmology", "cosmology",
"india bce", "india bce",
"magic/shamans", "magic",
"shamans",
"mandala", "mandala",
"manpower", "manpower",
"map", "map",
@ -152,7 +161,8 @@ KEYWORDS = {
"survey" "survey"
], ],
"O": [ "O": [
"india/china", "india",
"china",
"ocean", "ocean",
"opium", "opium",
"opium war", "opium war",
@ -164,12 +174,11 @@ KEYWORDS = {
"bateson", "bateson",
"buffalo", "buffalo",
"colonialism", "colonialism",
"deleuze/guattari", "deleuze & guattari",
"deleuzian diagram",
"highland tribe", "highland tribe",
"irrigation", "irrigation",
"padi", "padi",
"peasants", "peasant",
"periphery", "periphery",
"plateau", "plateau",
"politics", "politics",
@ -200,7 +209,7 @@ KEYWORDS = {
"cosmology", "cosmology",
"emanation of power", "emanation of power",
"fanaticism", "fanaticism",
"ghost/spirit", "ghost", "spirit",
"mandala", "mandala",
"map", "map",
"network", "network",
@ -208,7 +217,7 @@ KEYWORDS = {
"royalty", "royalty",
"sea", "sea",
"slavery", "slavery",
"society/state", "society against state",
"soul" "soul"
], ],
"T": [ "T": [
@ -222,13 +231,13 @@ KEYWORDS = {
"tiger", "tiger",
"tiger", "tiger",
"colonialism", "colonialism",
"cpm/mcp/mpaja", "cpm/mcp",
"espionage", "espionage",
"forest", "forest",
"indian prisoners", "indian convicts",
"japanese occupation", "japanese occupation",
"map", "map",
"singapore before 1900", "singapore",
"slavery", "slavery",
"survey", "survey",
"theodolite", "theodolite",
@ -257,8 +266,8 @@ KEYWORDS = {
"weretiger", "weretiger",
"water", "water",
"water", "water",
"body in water", "water bodies",
"magic/shamans", "magic", "shamans",
"ritual", "ritual",
"tamil tigers", "tamil tigers",
"tiger", "tiger",
@ -273,19 +282,20 @@ KEYWORDS = {
"Y": [ "Y": [
"first contact", "first contact",
"foreigner", "foreigner",
"magic/shamans", "magic",
"shamans",
"obedience", "obedience",
"youth", "youth",
"yielding" "yielding"
], ],
"Z": [ "Z": [
"animal", "animal",
"archipelago", "archipelagoes",
"evasion", "evasion",
"forest", "forest",
"jellyfish", "jellyfish",
"modern nepotism", "modern nepotism",
"mountain", "highlands",
"oppression", "oppression",
"royalty", "royalty",
"shape-shifter", "shape-shifter",

View file

@ -17,6 +17,10 @@ base_url = 'http://127.0.0.1:2620'
FRAME_DURATION = 1/60 FRAME_DURATION = 1/60
HIDDEN_TAGS = [
"women with white males"
]
api = None api = None
def get_api(): def get_api():
@ -58,6 +62,9 @@ if not os.path.exists('VOCALS.json'):
'path': path, 'path': path,
'duration': ox.avinfo(path)['duration'] 'duration': ox.avinfo(path)['duration']
}) })
while len(VOCALS[letter]) < 10:
VOCALS[letter] += VOCALS[letter]
VOCALS[letter] = VOCALS[letter][:10]
with open('VOCALS.json', 'w') as fd: with open('VOCALS.json', 'w') as fd:
json.dump(VOCALS, fd, indent=2, sort_keys=True) json.dump(VOCALS, fd, indent=2, sort_keys=True)
else: else:
@ -234,6 +241,8 @@ def sequence(seq, letter):
n = min(n, duration-position) n = min(n, duration-position)
if not tags_text: if not tags_text:
tags_text = list(sorted(set(tags))) tags_text = list(sorted(set(tags)))
tags_text = [t for t in tags_text if t not in HIDDEN_TAGS]
ttag = random_choice(seq, tags_text) ttag = random_choice(seq, tags_text)
tags_text.remove(ttag) tags_text.remove(ttag)
text = { text = {