dont fail with audio files
This commit is contained in:
parent
951fcdf837
commit
3257e362cf
1 changed files with 10 additions and 0 deletions
|
@ -289,6 +289,13 @@ class Timelines():
|
||||||
self.file_frame_n.append(int(duration * FPS))
|
self.file_frame_n.append(int(duration * FPS))
|
||||||
self.file_points.append(points)
|
self.file_points.append(points)
|
||||||
offset += duration
|
offset += duration
|
||||||
|
#input did not have any video, dont try to render video timelines
|
||||||
|
if self.render_video and not video.video:
|
||||||
|
self.modes = ['audio']
|
||||||
|
self.render_antialias = \
|
||||||
|
self.render_slitscan = \
|
||||||
|
self.render_keyframes = \
|
||||||
|
self.render_video = False
|
||||||
|
|
||||||
if not self.points:
|
if not self.points:
|
||||||
self.in_frame = 0
|
self.in_frame = 0
|
||||||
|
@ -323,6 +330,7 @@ class Timelines():
|
||||||
|
|
||||||
# remove tiles from previous run
|
# remove tiles from previous run
|
||||||
if not self.points:
|
if not self.points:
|
||||||
|
#for mode in filter(lambda m: m!= 'audio', self.modes):
|
||||||
for mode in self.modes:
|
for mode in self.modes:
|
||||||
type = 'png' if mode == 'data' else 'jpg'
|
type = 'png' if mode == 'data' else 'jpg'
|
||||||
tiles = glob('%s/timeline%s%dp*.%s' % (self.tile_path, mode, self.large_tile_h, type))
|
tiles = glob('%s/timeline%s%dp*.%s' % (self.tile_path, mode, self.large_tile_h, type))
|
||||||
|
@ -510,6 +518,8 @@ class Timelines():
|
||||||
is_last_tile = self.frame_i == self.frame_n - 1
|
is_last_tile = self.frame_i == self.frame_n - 1
|
||||||
if large_tile_x == self.large_tile_w - 1 or is_last_tile:
|
if large_tile_x == self.large_tile_w - 1 or is_last_tile:
|
||||||
self._save_tile('audio', large_tile_i)
|
self._save_tile('audio', large_tile_i)
|
||||||
|
if not self.render_video:
|
||||||
|
self.large_tile_i = large_tile_i
|
||||||
|
|
||||||
def _divide(self, num, by):
|
def _divide(self, num, by):
|
||||||
# divide(100, 3) -> [33, 33, 34]
|
# divide(100, 3) -> [33, 33, 34]
|
||||||
|
|
Loading…
Reference in a new issue