

The possibilities with this tool are endless, and you can even take it a step further by converting the SRT file into an ASS file, allowing for even more customization options like custom fonts and designs.Closed captions refer to the visual display of the audio in a program. Remember, all the subtitles and timing were generated by Whisper alone. I have to admit, I was pleasantly surprised by how well the timing of the subtitles turned out. Take a moment to enjoy the fruits of your labor and check out the results in the video below. output( subbed_video, loglevel="error" ) ) out.overwrite_output().run()Ĭongratulations! You’ve now successfully subtitled your video using Whisper and FFmpeg. input_video = ffmpeg.input(video).video input_audio = ffmpeg.input(video).audio out = ( ncat( input_video.filter("subtitles", srt_file), input_audio, v=1, a=1 ). # save SRT locally and convert into ass and store in drive with open(srt_file, "w", encoding="utf-8") as srt: write_srt(result, file=srt) Mux the subtitles back to your original videoįinally, you can use ffmpeg to generate your final subbed video. In this example, the results are written into an SRT file without any post-processing, to show the raw performance of the model. With the generated subtitles, you can now save them as an SRT file. This function generates a list of dictionaries that include the text output and timestamps, which can be conveniently used for the timing of the subtitles! # decode the audio result = anscribe(audio, **kwargs) Save the subtitles as an SRT file You can now use the transcribe function to generate the subtitles.

the video’s id which will be used to name your clipsĭef get_youtube_url(source_url, content): youtube_dl_opts = kwargs = 'transcribe' kwargs = 'english' Generate the subtitles.That’s why, in this tutorial, we will extract the URL of the best format from the video. The best video format may not always have the best audio quality, and vice versa. Videos is done by Insider Business Get the best video and audio quality using YoutubeDLįun fact: Youtube videos are parsed into several different video and audio formats.
