Created
January 20, 2016 20:18
-
-
Save Laurian/32c39ae896ee8b22fab7 to your computer and use it in GitHub Desktop.
movie.py subtitles example
This file contains 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 characters
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") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi! First of all, thank you for this nice script!
At first I wasn't able to run it, so I used this solution and now it works! https://askubuntu.com/questions/873112/imagemagick-cannot-be-detected-by-moviepy/873124 https://askubuntu.com/questions/873112/imagemagick-cannot-be-detected-by-moviepy/873124
Thanks!