![]() ![]() I suggest you do it if you don’t want to be full of files. Note: before running the for iteration, I created a folder “chunks” that contain all the slices of the video and a folder “converted” with all the slices of video converted into wav format. In the for loop, I am going to convert each slice of video into text format. Moreover, I created an empty dictionary, diz, where the key will be the string “chunk#” and the value will be the text extracted from that chunk. More details about this concept will be explained later. After I created a list that will be used to cut the video file into a specific number of chunks, it’s needed for the start and end times in the slices of video. The variable num_seconds_video contains my video’s number of seconds. In my case, the video was in format .mp4 and was 52 minutes long. Step 3: Cut video file into chunks of 1 minute and convert each chunk into text format Once we installed the libraries, we can import them: Moreover, moviepy supports various file format. SpeechRecognition is a Python library for performing speech recognition with support for Google’s API, while moviepy allows to cut, read, and write all the most common audio and video formats. Let’s install the libraries that we’ll use in this program. Figure 5: Video DownloadHelper Step 2: Import libraries into Jupiter Notebook Note: Without the Premium status, the video’s download can only be performed 120 minutes after the previous one. In order to make the extension work, I also installed an external app called Companion Application. Some operations required by Video DownloadHelper cannot be performed from within the browser. I downloaded a video from my university’s website with a Chrome extension called Video DownloadHelper. Step 1: Download video from the website Figure 4: Credit: Video DownloadHelper ![]() Isn’t it amazing to have so many hours to convert audio into text per day? Especially when it’s free! It’s not so obvious if you try other API or standard methods without python. The table shows that there is a limit of 480 hours of audio per day, while the maximum number of “ StreamingRecognize” requests per 60 seconds is 900. The current API usage limits you need to know for Speech-to-Text are: Figure 3: Credit: Google Speech-to-text’s limits This type of request is apt for chatbots.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |