diff --git a/bin/oxtimelines b/bin/oxtimelines index 3ef8f02..69c1701 100755 --- a/bin/oxtimelines +++ b/bin/oxtimelines @@ -42,6 +42,7 @@ tiles without having to decode the video again. parser.add_option('-s', '--sizes', dest='sizes', help='timeline size(s) (64 or 64,16)') parser.add_option('-w', '--wide', dest='wide', default=False, action='store_true', help='keep wide frames tiles') parser.add_option('-l', '--log', dest='log', default=False, action='store_true', help='log performance') + parser.add_option('-x', '--slit-position', dest='slit_position', default=None, action='store_true', help='slit scan position (default center frame)') (opts, args) = parser.parse_args() if None in (opts.modes, opts.sizes, opts.tiles) or not args: @@ -54,4 +55,4 @@ tiles without having to decode the video again. opts.modes = [m.strip() for m in opts.modes.split(',')] opts.sizes = list(map(int, opts.sizes.split(','))) - oxtimelines.Timelines(opts.videos, opts.tiles, opts.cuts, opts.points, opts.modes, opts.sizes, opts.wide, opts.log).render() + oxtimelines.Timelines(opts.videos, opts.tiles, opts.cuts, opts.points, opts.modes, opts.sizes, opts.wide, opts.log, slit_positoin=opts.slit_position).render() diff --git a/oxtimelines/timeline.py b/oxtimelines/timeline.py index 0d347fe..39129cf 100644 --- a/oxtimelines/timeline.py +++ b/oxtimelines/timeline.py @@ -23,7 +23,8 @@ class Timelines(): def __init__( self, video_files, tile_path, cuts_path, - points, modes, sizes, render_wide_tiles, log + points, modes, sizes, render_wide_tiles, log, + slit_position=None ): self.video_files = video_files @@ -46,6 +47,11 @@ class Timelines(): self.render_data = 'data' in modes self.render_video = len(modes) > 1 if self.render_audio else True + if slit_position: + self.frame_center = int(slit_position) + else: + self.frame_center = None + if self.detect_cuts or self.render_cuts or self.render_keyframes: self.detect_cuts = True self.cuts = [0] @@ -132,7 +138,8 @@ class Timelines(): frame_size = self.videos[0].get_size() self.frame_w = frame_size[0] self.frame_ratio = frame_size[0] / frame_size[1] - self.frame_center = int(frame_size[0] / 2) + if self.frame_center is None: + self.frame_center = int(frame_size[0] / 2) self.large_tile_n = int(math.ceil(self.frame_n / self.large_tile_w)) self.large_tile_last_w = self.frame_n % self.large_tile_w or self.large_tile_w