use titletext, title already used
This commit is contained in:
parent
959d1f5408
commit
d271e9ba32
1 changed files with 7 additions and 4 deletions
11
edit.py
11
edit.py
|
@ -105,7 +105,7 @@ def get_pandora_media_path(oshash):
|
||||||
|
|
||||||
def cache_clips(api, videos, use_source=False, use_pandora=False):
|
def cache_clips(api, videos, use_source=False, use_pandora=False):
|
||||||
for clip in videos:
|
for clip in videos:
|
||||||
if clip.get("title"):
|
if clip.get("titletext"):
|
||||||
continue
|
continue
|
||||||
out = '%s/%s.mp4' % (render, clip['oshash'])
|
out = '%s/%s.mp4' % (render, clip['oshash'])
|
||||||
if 'path' in clip:
|
if 'path' in clip:
|
||||||
|
@ -144,18 +144,21 @@ def make_title(title):
|
||||||
image.save(title_png)
|
image.save(title_png)
|
||||||
cmd = [
|
cmd = [
|
||||||
'ffmpeg', '-r', '25',
|
'ffmpeg', '-r', '25',
|
||||||
|
'-hide_banner',
|
||||||
|
'-nostats', '-loglevel', 'error', '-y',
|
||||||
'-i', title_png, '-t', '5',
|
'-i', title_png, '-t', '5',
|
||||||
'-pix_fmt', 'yuv420p',
|
'-pix_fmt', 'yuv420p',
|
||||||
title_mp4
|
title_mp4
|
||||||
]
|
]
|
||||||
subprocess.call(cmd)
|
subprocess.call(cmd)
|
||||||
clip = {
|
clip = {
|
||||||
"title": title,
|
"titletext": title,
|
||||||
"in": 0,
|
"in": 0,
|
||||||
"out": 5,
|
"out": 5,
|
||||||
"duration": 5,
|
"duration": 5,
|
||||||
"volume": 1.0,
|
"volume": 1.0,
|
||||||
"path": title_mp4
|
"path": title_mp4,
|
||||||
|
"oshash": ox.oshash(title_mp4),
|
||||||
}
|
}
|
||||||
return clip
|
return clip
|
||||||
|
|
||||||
|
@ -240,7 +243,7 @@ if __name__ == '__main__':
|
||||||
if opts.title:
|
if opts.title:
|
||||||
clips.insert(0, make_title(opts.title))
|
clips.insert(0, make_title(opts.title))
|
||||||
for clip in clips:
|
for clip in clips:
|
||||||
if clip.get("title"):
|
if clip.get("titletext"):
|
||||||
videos.append(clip)
|
videos.append(clip)
|
||||||
position += clip['duration']
|
position += clip['duration']
|
||||||
position = math.ceil(position / (1/25)) * 1/25
|
position = math.ceil(position / (1/25)) * 1/25
|
||||||
|
|
Loading…
Reference in a new issue