The above exception was the direct cause of the following exception:
Return self.fl(lambda gf, t: image_func(gf(t)), apply_to)įile "make_demo.py", line 65, in pipelineĬv2.putText(frame, str(next(dfi).word), (0, 50), cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 0), 3, cv2.LINE_AA, True) Newclip = t_make_frame(lambda t: fun(self.get_frame, t))įile "/Users/asi/anaconda3/lib/python3.7/site-packages/moviepy/video/VideoClip.py", line 490, in MoviePy - Writing audio in vidoutTEMP_MPY_wvf_snd.mp3 EDITĪfter using the suggested moviepy solution, I get a subtitled video with no audio and the error below: Moviepy - Building video vidout.mp4. These five speech recognition services automatically create captions that can make the videos you share for. I understand OpenCV does not work with any audio, but are there any other workarounds? This approach works well in my pipeline, so I'd like to be able to write these frames to a new video but keep audio while using as little additional libraries as possible. 5 speech recognition apps that auto-caption videos. This works, but now I don't have any audio. Drag videos to the timeline and click on 'Titles' on the top menu, and choose 'Subtitles' to pick up a template you like. After that, choose 'New Project' and click 'Import Media Files from Here' to load the video clip you wish to add subtitles.
Add subtitles to video app install#
Num_frames = video.get(cv2.CAP_PROP_FRAME_COUNT)Ĭv2.putText(frame, str(df.sentence), (0,50),cv2.FONT_HERSHEY_SIMPLEX, 1, (0, 0, 0), 3, cv2.LINE_AA, True) Directly install the program on your computer, then launch it. The csv is the same length as the number of frames in the video. This way I loop over all frames and put text for the sentence on every frame within that sentence.
Add subtitles to video app full#
To do so, I created a csv where there is a row for every frame, and every row contains the full sentence during that sentence time chunk. The time frame for the display of the added text will become available from the left side of the window. I chunked the words into sentences so that I could display 1 sentence at a time on the screen, like normal subtitles in a movie. Add Subtitles To Video And Audio Files in PowerPoint To add a caption, click the Add a new caption + button and begin typing the content for the subtitles.