16x timelines are one hour each

This commit is contained in:
j 2010-09-08 13:23:07 +02:00
parent 3c73ffe9e0
commit 73f897aa58
2 changed files with 6 additions and 5 deletions

View File

@ -32,7 +32,7 @@ if __name__ == '__main__':
timeline = oxgst.Timeline(opts.input) timeline = oxgst.Timeline(opts.input)
timeline.extract(opts.prefix, opts.width, opts.height) timeline.extract(opts.prefix, opts.width, opts.height)
oxgst.timeline.createTimelineMultiline(opts.prefix) oxgst.timeline.createTimelineMultiline(opts.prefix)
oxgst.timeline.makeTiles(opts.prefix, 16) oxgst.timeline.makeTiles(opts.prefix, 16, 3600)
oxgst.timeline.makeTimelineOverview(opts.prefix, 1920) oxgst.timeline.makeTimelineOverview(opts.prefix, 1920)

View File

@ -195,17 +195,18 @@ def makeTimelineOverview(timeline_prefix, width, inpoint=0, outpoint=0, duration
timeline = timeline.crop((inpoint, 0, outpoint, timeline.size[1])).resize((width, height), Image.ANTIALIAS) timeline = timeline.crop((inpoint, 0, outpoint, timeline.size[1])).resize((width, height), Image.ANTIALIAS)
timeline.save(timeline_file) timeline.save(timeline_file)
def makeTiles(timeline_prefix, height=16): def makeTiles(timeline_prefix, height=16, width=3600):
files = glob('%s.64.*.png' % timeline_prefix) files = glob('%s.64.*.png' % timeline_prefix)
fps = 25
part_step = 60 part_step = 60
output_width = 300 output_width = width
width = len(files) * part_step width = len(files) * part_step
timeline = Image.new("RGB", (width, height)) timeline = Image.new("RGB", (width, height))
pos = 0 pos = 0
for f in sorted(files): for f in sorted(files):
part = Image.open(f) part = Image.open(f)
part_width = int(part.size[0] / 25) part_width = int(part.size[0] / fps)
part = part.resize((part_width, height), Image.ANTIALIAS) part = part.resize((part_width, height), Image.ANTIALIAS)
timeline.paste(part, (pos, 0, pos+part_width, height)) timeline.paste(part, (pos, 0, pos+part_width, height))
pos += part_width pos += part_width
@ -218,5 +219,5 @@ def makeTiles(timeline_prefix, height=16):
end = min(pos+output_width, timeline.size[0]) end = min(pos+output_width, timeline.size[0])
timeline.crop((pos, 0, end, timeline.size[1])).save('%s.%s.%04d.png' % (timeline_prefix, timeline.size[1], i)) timeline.crop((pos, 0, end, timeline.size[1])).save('%s.%s.%04d.png' % (timeline_prefix, timeline.size[1], i))
pos += output_width pos += output_width
i += 5 i += 1