Created
January 20, 2016 20:18
-
-
Save Laurian/32c39ae896ee8b22fab7 to your computer and use it in GitHub Desktop.
Revisions
-
Laurian created this gist
Jan 20, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ from moviepy.editor import * from moviepy.video.tools.subtitles import SubtitlesClip generator = lambda txt: TextClip(txt, font='Arial', fontsize=16, color='white') subtitles = SubtitlesClip("somet.srt", generator) video = VideoFileClip("some.mp4") result = CompositeVideoClip([video, subtitles.set_pos(('center','bottom'))]) result.write_videofile("out.mp4", fps=video.fps, temp_audiofile="temp-audio.m4a", remove_temp=True, codec="libx264", audio_codec="aac")