+ print '** Transfering in finished.'
+
+ def transcode(self, input_video, video_name, transcode_configs):
+ """
+ Transcodes a video in each requested formats.
+
+ @param input_video input video file name
+ @param video_name a video name which must be a valid file name
+ @param transcode_configs a list of dictionaries with format settings
+ """
+
+ transcoder = config.TRANSCODER_CLASS( \
+ input_file = video_name, \
+ name = video_name, prog_bin = config.TRANSCODER_BIN)
+ transcoder.dest_path = self.transcoded_videos_dir
+
+ # Transcode the raw video in each requested format.
+ # TODO report partial errors
+ for transcode_config in transcode_configs:
+ transcode_config['output_file'] = transcoder.transcode( \
+ container = transcode_config['container'], \
+ a_codec = transcode_config['a_codec'], \
+ a_bitrate = transcode_config['a_bitrate'], \
+ a_samplingrate = transcode_config['a_samplingrate'], \
+ a_channels = transcode_config['a_channels'], \
+ v_codec = transcode_config['v_codec'], \
+ v_bitrate = transcode_config['v_bitrate'], \
+ v_framerate = transcode_config['v_framerate'], \
+ v_resolution = transcode_config['v_resolution'], \
+ v_dar = transcode_config['dar'])
+
+ print '** Transcoding finished.'
+
+ def extract_thumbs(self, input_video, video_name, thumbs):
+ """
+ Extracts thumbnail images from a video.
+
+ @param input_video input video file name
+ @param video_name a video name which must be a valid file name
+ @param thumbs use 'random' to extract a thumbnail image from a random
+ point of the video or use a positive integer n to extract n summary
+ thumbnail
+ """
+
+ # TODO report partial errors
+ thumb_extractor = config.THUMB_EXTRACTOR_CLASS( \
+ input_file = input_video, name = video_name, \
+ prog_bin = config.THUMB_EXTRACTOR_BIN)
+ thumb_extractor.dest_path = self.thumbs_dir
+ if thumbs == 'random':