use filenames inline with timeline urls

This commit is contained in:
j 2011-10-14 16:42:01 +02:00
parent 5d38ccb796
commit bc9cc2df3b
4 changed files with 8 additions and 8 deletions

View File

@ -41,7 +41,7 @@ if __name__ == '__main__':
else:
video.Timeline(opts.input, opts.prefix, opts.width, opts.height)
oxtimeline.createTimelineMultiline(opts.prefix)
#oxtimeline.createTimelineMultiline(opts.prefix)
oxtimeline.makeTiles(opts.prefix, 16, 3600)
oxtimeline.makeTimelineOverview(opts.prefix, 1920, height=16)
oxtimeline.makeTimelineOverview(opts.prefix, 1920, height=64)

View File

@ -19,7 +19,7 @@ import video
import audio
def loadTimeline(timeline_prefix, height=64):
files = sorted(glob('%s.%s.*.png' % (timeline_prefix, height)))
files = sorted(glob('%s%sp*.png' % (timeline_prefix, height)))
f = Image.open(files[0])
width = f.size[0]
f = Image.open(files[-1])
@ -107,9 +107,9 @@ def makeTimelineByFramesPerPixel(timeline_prefix, frames_per_pixel, inpoint=0, o
def makeTimelineOverview(timeline_prefix, width, inpoint=0, outpoint=0, duration=-1, height=16):
input_scale = 25
timeline_file = '%s.%s.png' % (timeline_prefix, height)
timeline_file = '%s%sp.png' % (timeline_prefix, height)
if outpoint > 0:
timeline_file = '%s.overview.%s.%d-%d.png' % (timeline_prefix, height, inpoint, outpoint)
timeline_file = '%s%sp%d-%d.png' % (timeline_prefix, height, inpoint, outpoint)
timeline = loadTimeline(timeline_prefix)
duration = timeline.size[0]
@ -127,7 +127,7 @@ def makeTimelineOverview(timeline_prefix, width, inpoint=0, outpoint=0, duration
timeline.save(timeline_file)
def makeTiles(timeline_prefix, height=16, width=3600):
files = glob('%s.64.*.png' % timeline_prefix)
files = glob('%s64p*.png' % timeline_prefix)
fps = 25
part_step = 60
output_width = width
@ -148,7 +148,7 @@ def makeTiles(timeline_prefix, height=16, width=3600):
i = 0
while pos < 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%sp%04d.png' % (timeline_prefix, timeline.size[1], i))
pos += output_width
i += 1

View File

@ -162,7 +162,7 @@ class Timeline(Audio):
if -2 < self.tile_width - tile_width < 2:
tile_width = self.tile_width
tile = tile.crop((0, 0, tile_width, self.tile_height))
filename = "%s.%s.%04d.png" % (self.prefix, self.tile_height, i)
filename = "%s%sp%04d.png" % (self.prefix, self.tile_height, i)
tile.save(filename)
def done(self):

View File

@ -115,7 +115,7 @@ class Timeline(Video):
if -2 < self.tile_width - tile_width < 2:
tile_width = self.tile_width
tile = tile.crop((0, 0, tile_width, self.tile_height))
filename = "%s.%s.%04d.png" % (self.prefix, self.tile_height, i)
filename = "%s%sp%04d.png" % (self.prefix, self.tile_height, i)
tile.save(filename)
def done(self):