#!/usr/bin/env python3
# encoding: utf-8
# 
# © 2017 Benjamin Mintz
# https://bmintz.mit-license.org/@2017
#

"""
techmeme.py: CLI app to turn videos into dank technical may-mays
"""

from moviepy.video.compositing.CompositeVideoClip import CompositeVideoClip

from config import TechnicalMemeConfig


class TechnicalMeme(CompositeVideoClip):
	def __init__(self, *, source_filename, config):
		self.source_filename = source_filename
		self.config = config

@@ -252,16 +252,116 @@
 ideoClip
+%0Afrom moviepy.video.io.VideoFileClip import VideoFileClip%0Afrom moviepy.video.fx.speedx import speedx
 %0A%0Afrom c
@@ -503,54 +503,541 @@
 rce_
-filename = source_filename%0A%09%09self.config = config
+video = VideoFileClip(source_filename)%0A%09%09self.config = config%0A%09%09self._fix_up_timestamps()%0A%09%0A%09def _fix_up_timestamps(self):%0A%09%09self.config.timestamps = %5B0%5D + self.config.timestamps + %5Bself.source_video.end%5D%0A%09%0A%09def _get_subclip(self, timestamp_number):%0A%09%09%22%22%22get a subclip at the timestamp given by self.config.timestamps%5Btimestamp_number%5D%22%22%22%0A%09%09%0A%09%09if timestamp_number %3C len(self.timestamps):%0A%09%09%09return self.source_video.subclip(*self.timestamps%5Btimestamp_number:timestamp_number+2%5D)%0A%09%09else:%0A%09%09%09raise ValueError(%22timestamp number too large%22)
 %0A

add get subclip and a basic init function