#πŸ”’ moviepy help

11 messages Β· Page 1 of 1 (latest)

craggy vortex
#

tryna make subtitles. so basically im using fast-whisper https://github.com/SYSTRAN/faster-whisper basically takes an audio file and uses AI to break it up into segments and has like the start time and end time for a sentence.

i want to have a video, and then use TextClips for that show for every sentence so it matches along with the audio. i can share my code i just dont really understand it. I've been doing good building most of this project but this movie py and subtitle stuff i really dont get, any help would be appreciated!

from moviepy import VideoFileClip, TextClip, CompositeVideoClip
from subtitles import segment


clip = VideoFileClip('test.mp4')


segments = segment('output/test.wav')


subtitle_clips = []

for seg in segments:
    txt_clip = TextClip(
    seg.text,
    fontsize=80,
    color="white",
    font="Arial-Bold"
    ).set_start(seg.start).set_end(seg.end)
    subtitle_clips.append(txt_clip)


final_clip = CompositeVideoClip([clip, *subtitle_clips])


final_clip.write_videofile("video_with_subs.mp4")

lmk if u need to see segment.py! a quick overview is just its a func that returns a liss like this

[
(start, end, text),
(start, end, text),
(start, end, text),
]
GitHub

Faster Whisper transcription with CTranslate2. Contribute to SYSTRAN/faster-whisper development by creating an account on GitHub.

opaque frigateBOT
#

@craggy vortex

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

craggy vortex
#

pls help

hollow mesa
craggy vortex
#

yea i used it

#

it was just getting moviepy to edit in the subtitles

#

at the right times

#

but i got in now

#

it

opaque frigateBOT
#
Python help channel closed for inactivity

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.