コード例 #1
0
ファイル: merge_video.py プロジェクト: amtech/aistreamer
    def run(self):

        tmp_video_file = GCSClient().download(self.gs_path_video)
        tmp_audio_file = GCSClient().download(self.requires()[0].output().path)

        #'ffmpeg -i Late_For_Work.mp4 -i Late_For_Work.mp4.voice.mp3 -c:v copy -map 0:v:0 -map 1:a:0 result.mp4'
        cmd = [
            'ffmpeg', '-y', '-i', tmp_video_file.name, '-i',
            tmp_audio_file.name, '-c:v', 'copy', '-map', '0:v:0', '-map',
            '1:a:0', self.temp_result_file
        ]
        print(cmd)
        subprocess.check_call(cmd)

        tmp_video_file.close()
        tmp_audio_file.close()

        GCSClient().put(self.temp_result_file, self.output().path)
コード例 #2
0
 def run(self):
     tmp_txt_file = GCSClient().download(self.input()[0].path)
     
     text_arr = split_into_sentences(open(tmp_txt_file.name, "r").read())
     
     print(text_arr)
     
     tmp_db = atomic_file(self.temp_result_file_path)
     tmp_db.generate_tmp_path(tmp_db.path)
     db = Db(sqlite3.connect(tmp_db.tmp_path), Sql())
     db.setup(2)
     
     SENTENCE_SEPARATOR = '\n'
     WORD_SEPARATOR = ' '
     
     Parser("notused", db, SENTENCE_SEPARATOR, WORD_SEPARATOR).parse_array(text_arr)
     tmp_db.close()
     
     GCSClient().put(self.temp_result_file_path, self.output().path)  
     
     tmp_txt_file.close()