Compare commits

..

3 commits

Author SHA1 Message Date
j
ddb70beedd invalidate cache if file changed 2023-11-24 13:13:56 +00:00
j
5295d1bfc9 bring down Ashley vocals slightly (-0.75 db) 2023-11-24 13:06:35 +00:00
j
34ef701646 hide gnome overview on startup 2023-11-20 23:27:49 +00:00
3 changed files with 26 additions and 6 deletions

View file

@ -24,6 +24,14 @@ FONT_BORDER = 4
SUB_MARGIN = 2 * 36 + 6
def hide_gnome_overview():
import dbus
bus = dbus.SessionBus()
shell = bus.get_object('org.gnome.Shell', '/org/gnome/Shell')
props = dbus.Interface(shell, 'org.freedesktop.DBus.Properties')
props.Set('org.gnome.Shell', 'OverviewActive', False)
def mpv_log(loglevel, component, message):
logger.info('[{}] {}: {}'.format(loglevel, component, message))
@ -277,4 +285,8 @@ def main():
if __name__ == "__main__":
try:
hide_gnome_overview()
except:
pass
main()

View file

@ -139,7 +139,7 @@ def compose(clips, target=150, base=1024, voice_over=None):
elif 'Free' in voc['src']:
a, b = '5.2', '-3.8'
elif 'Ashley' in voc['src']:
a, b = '4.5', '-4.5'
a, b = '3.75', '-5.25'
voc['filter'] = {'volume': a}
scene['audio-center']['A1'].append(voc)
vo_low = vo.copy()
@ -580,11 +580,14 @@ def update_subtitles(options):
for clip in scene['audio-center']['A1']:
if not clip.get("blank"):
batch, fragment_id = clip['src'].replace('.wav', '').split('/')[-2:]
vo = item.models.Item.objects.filter(data__icontains='2-Whispered', data__title__startswith=fragment_id + '_').first()
vo = item.models.Item.objects.filter(data__batch__icontains=batch, data__title__startswith=fragment_id + '_').first()
if vo:
#print("%s => %s %s" % (clip['src'], vo, vo.get('batch')))
for sub in vo.annotations.filter(layer="subtitles").exclude(value="").order_by("start"):
sdata = get_srt(sub, offset)
subs.append(sdata)
else:
print("could not find vo for %s" % clip['src'])
offset += clip['duration']
path = folder / "front.srt"
srt = ox.srt.encode(subs)

View file

@ -13,10 +13,15 @@ def get_propery(element, name):
def melt_xml(file):
if file in _CACHE:
out = _CACHE[file]
else:
out = _CACHE[file] = subprocess.check_output(['melt', file, '-consumer', 'xml']).decode()
out = None
real_path = os.path.realpath(path)
if file in _CACHE and isinstance(_CACHE[file], list)
ts, out = _CACHE[file]
if os.stat(real_path).st_mtime != ts:
out = None
if not out:
out = subprocess.check_output(['melt', file, '-consumer', 'xml']).decode()
_CACHE[file] = [os.stat(real_path).st_mtime, out]
return out