Zulko / moviepy

Video editing with Python
https://zulko.github.io/moviepy/
MIT License
12.62k stars 1.58k forks source link

SubtitlesClip don't add last line #922

Open aglpy opened 5 years ago

aglpy commented 5 years ago

Hi, when I add subtitles to a video, the last line don't appear on the video, this is the code I use:

myvideo = VideoFileClip(res_dir + "video.avi")

    generator = lambda txt: TextClip(txt, 
                                    font='Georgia-Regular',
                                    fontsize=52, 
                                    color='white',
                                    stroke_color='black',
                                    stroke_width=3,
                                    size=myvideo.size,
                                    method='caption',
                                    align="South") 
    sub = SubtitlesClip(res_dir + "subs.srt", generator)

    final = CompositeVideoClip([myvideo, sub])
    final.to_videofile(res_dir + "video.mp4", fps=myvideo.fps)

The srt file have a last line of text and the time interval of this line is inside the duration of the video, but it don't appear on the final video.

mrhaoji commented 4 years ago

+1 same issue

solution: you should place two empty line at the end of the srt file, try it. @aglpy

orkenstein commented 3 years ago

Wow. Please fix this!