Compare commits
3 commits
7008fa7e1f
...
ddb70beedd
Author | SHA1 | Date | |
---|---|---|---|
ddb70beedd | |||
5295d1bfc9 | |||
34ef701646 |
3 changed files with 26 additions and 6 deletions
|
@ -24,6 +24,14 @@ FONT_BORDER = 4
|
||||||
SUB_MARGIN = 2 * 36 + 6
|
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):
|
def mpv_log(loglevel, component, message):
|
||||||
logger.info('[{}] {}: {}'.format(loglevel, component, message))
|
logger.info('[{}] {}: {}'.format(loglevel, component, message))
|
||||||
|
|
||||||
|
@ -277,4 +285,8 @@ def main():
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
try:
|
||||||
|
hide_gnome_overview()
|
||||||
|
except:
|
||||||
|
pass
|
||||||
main()
|
main()
|
||||||
|
|
|
@ -139,7 +139,7 @@ def compose(clips, target=150, base=1024, voice_over=None):
|
||||||
elif 'Free' in voc['src']:
|
elif 'Free' in voc['src']:
|
||||||
a, b = '5.2', '-3.8'
|
a, b = '5.2', '-3.8'
|
||||||
elif 'Ashley' in voc['src']:
|
elif 'Ashley' in voc['src']:
|
||||||
a, b = '4.5', '-4.5'
|
a, b = '3.75', '-5.25'
|
||||||
voc['filter'] = {'volume': a}
|
voc['filter'] = {'volume': a}
|
||||||
scene['audio-center']['A1'].append(voc)
|
scene['audio-center']['A1'].append(voc)
|
||||||
vo_low = vo.copy()
|
vo_low = vo.copy()
|
||||||
|
@ -580,11 +580,14 @@ def update_subtitles(options):
|
||||||
for clip in scene['audio-center']['A1']:
|
for clip in scene['audio-center']['A1']:
|
||||||
if not clip.get("blank"):
|
if not clip.get("blank"):
|
||||||
batch, fragment_id = clip['src'].replace('.wav', '').split('/')[-2:]
|
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:
|
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"):
|
for sub in vo.annotations.filter(layer="subtitles").exclude(value="").order_by("start"):
|
||||||
sdata = get_srt(sub, offset)
|
sdata = get_srt(sub, offset)
|
||||||
subs.append(sdata)
|
subs.append(sdata)
|
||||||
|
else:
|
||||||
|
print("could not find vo for %s" % clip['src'])
|
||||||
offset += clip['duration']
|
offset += clip['duration']
|
||||||
path = folder / "front.srt"
|
path = folder / "front.srt"
|
||||||
srt = ox.srt.encode(subs)
|
srt = ox.srt.encode(subs)
|
||||||
|
|
|
@ -13,10 +13,15 @@ def get_propery(element, name):
|
||||||
|
|
||||||
|
|
||||||
def melt_xml(file):
|
def melt_xml(file):
|
||||||
if file in _CACHE:
|
out = None
|
||||||
out = _CACHE[file]
|
real_path = os.path.realpath(path)
|
||||||
else:
|
if file in _CACHE and isinstance(_CACHE[file], list)
|
||||||
out = _CACHE[file] = subprocess.check_output(['melt', file, '-consumer', 'xml']).decode()
|
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
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue