Create Subtitles with Python and Moviepy - Free Tutorial

Find AI Tools
No difficulty
No complicated process
Find ai tools

Create Subtitles with Python and Moviepy - Free Tutorial

Table of Contents:

  1. Introduction
  2. Creating the Script Audiogram
  3. Step 1: Obtaining the Video
  4. Step 2: Extracting Audio from the Video
  5. Step 3: Converting Audio into Word Level Timestamps
  6. Step 4: Editing the Transcription
  7. Step 5: Correcting Mistakes in the Transcription
  8. Step 6: Converting Word Level Timestamps into Line Level Timestamps
  9. Step 7: Creating the Video using Movie Pi Library
  10. Step 8: Visualizing the Final Audiogram
  11. Conclusion

Introduction

Welcome to my YouTube Channel where I share my learnings on building AI SAS apps. In this video, we will learn how to Create a script audiogram, similar to the one You just saw, using completely open-source technology with Python, Movie Pi, and Open as Whisper. We will go through the step-by-step process of converting a video into word level subtitles and creating a captivating audiogram. Let's get started!

Creating the Script Audiogram

To create a script audiogram, we will follow the following steps:

Step 1: Obtaining the Video

The first step is to obtain the video that you want to convert into word level subtitles. You can either download the video directly or upload it to the Collab notebook. For best results, it is recommended to use short videos under two minutes in length.

Step 2: Extracting Audio from the Video

Next, we need to extract the audio from the video in MP3 format. We will use the FFmpeg pipe with Python to accomplish this. By separating the audio from the video, we can then process it separately.

Step 3: Converting Audio into Word Level Timestamps

In this step, we will use Open as Whisper, a free and open-source speech-to-text algorithm, to convert the audio into word level timestamps. This will give us the spoken words and their corresponding timestamps. You can also use other speech-to-text models if desired.

Step 4: Editing the Transcription

After converting the audio, we will have a transcription of the spoken words. However, there may be errors or mispronunciations in the transcription. In this step, we will edit the transcription to correct any mistakes and make it more accurate.

Step 5: Correcting Mistakes in the Transcription

Once the transcription has been edited, we will store the word level timestamps into a JSON file within the collab notebook itself. This will allow us to quickly make any necessary edits before rendering the final audiogram or word level subtitle file.

Step 6: Converting Word Level Timestamps into Line Level Timestamps

To create a visually appealing audiogram, we need to convert the word level timestamps into line level timestamps. This is necessary because we cannot display all the text in a single frame. By dividing the timestamps into line levels, we can create subtitle lines that highlight the words as they are spoken.

Step 7: Creating the Video using Movie Pi Library

In this step, we will use the Movie Pi library to take the line level timestamps JSON and create a video. The library allows us to customize the video's size, fonts, colors, and other visual elements. We can also append the original audio to the final video.

Step 8: Visualizing the Final Audiogram

Finally, we will Visualize the final audiogram, which is the created video. We can append the original audio to the video to enhance the viewer's experience. The audiogram can then be shared on various social media platforms.

Conclusion

In conclusion, creating a script audiogram is an engaging way to present your video content. By following the step-by-step process outlined in this article, you can convert a video into word level subtitles and create an Attention-grabbing audiogram. Remember to make any necessary edits to the transcription and customize the visual elements using the Movie Pi library. Enhance your social media presence with captivating audiograms created using open-source tools.

Most people like

Are you spending too much time looking for ai tools?
App rating
4.9
AI Tools
100k+
Trusted Users
5000+
WHY YOU SHOULD CHOOSE TOOLIFY

TOOLIFY is the best ai tool source.

Browse More Content