DEV Community

Dhravya
Dhravya

Posted on • Updated on

DeepSubtitles - generates subtitles and renders them onto the video. [Build]

Overview of My Submission

It is a python script that takes a Video, and Renders subtitles onto it. Transcriptions are fetched from Deepgram

Submission Category: Accessibility Advocates

Link to Code on GitHub

GitHub logo Dhravya / DeepSubtitles

A Python script that generates subtitles and renders them onto the video.

DeepSubtitles Logo

DeepSubtitles

A Python script that generates subtitles and renders them to the video.

This was made as a submission for the DeepGram x Dev Hackathon


Here's a Demo πŸ‘€

What it does:

  • Takes a video file's path as the input
  • Generates Subtitles from the video's contents
  • Renders them onto the video

Goal of this project was to provide accessibility to the video for people with disabilities.

Features

  • πŸ’― Accurate subtitles, powered by Deepgram
  • ⚑ Customisable
  • πŸ‘€ Heavily commented and documented code

One Caveat is that it's not a fast script and probably not ideal for a production environment.

If you have any questions, please feel free to reach out to me, if you'd like to contribute to this project, feel free to make an issue on Github

Installation and Usage

Clone this repository and download the requirements:

git clone https://github.com/Dhravya/DeepSubtitles
cd DeepSubtitles
pip install -r requirements.txt
Enter fullscreen mode Exit fullscreen mode

Then, go to src/conf.py…

Additional Resources / Info

Here's a small demo.
(You can also check the MP4 version of this with audio here)
Here's a demo

Top comments (14)

Collapse
 
abhinav1217 profile image
Abhinav Kulshreshtha

Are you making it for the deepgram hackthon.. You beat me into it. I was making same thing ( in js ) and I am not even halfway done. Good work.

Looks like I have to switch back to original plan to make a game for the hackthon.

Collapse
 
dhravya profile image
Dhravya

damnn that's actually insane lol

It was kinda random for me too, I completed the rickroll maker and then stayed up at night to finish this

Admittedly, my code is a bit slow, takes 3 minutes to render a 1-minute, 1080p video on my computer, so you still got a shot at it haha
Excited to see the game you'll be making πŸ‘€

Collapse
 
abhinav1217 profile image
Abhinav Kulshreshtha

Naa.. I am bad at writing stories. Writing game was my initial plan, but then decided to make a automated subtitle generating program.

Regarding time, what about the accuracy for it. As long as it is accurate, 3 minutes in not bad.

Thread Thread
 
dhravya profile image
Dhravya

accuracy is really good. almost perfect, i'd say. But, it struggles to find words when the speaker is going too fast, or there's music playing behind. Otherwise, it's as good as it gets (i think
)

Collapse
 
mtwn105 profile image
Amit Wani

That's so cool, infact I have been thinking about similar, maybe have to tweak it a little bit :D. Amazing work πŸš€

Collapse
 
dhravya profile image
Dhravya

Thanks a lot! I'm working on one more submission now πŸ‘€

Collapse
 
mtwn105 profile image
Amit Wani

Are bhai bhai, looks like you are coming for all prizes!

Thread Thread
 
dhravya profile image
Dhravya

I'm not eligible for the prizes though πŸ˜…πŸ˜‚

Thread Thread
 
mtwn105 profile image
Amit Wani

Oh shit! Why 18+ rule I don't understand tbh 😐

Thread Thread
 
dhravya profile image
Dhravya

yeahhh. it's sad but that's fine, I'm not here for the prizes anyway

Thread Thread
 
mtwn105 profile image
Amit Wani

You'll rock in couple of yearsπŸš€πŸš€πŸš€

Collapse
 
dhravya profile image
Dhravya

absolutely, i think I'll write a blog post here

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
dhravya profile image
Dhravya

Thanks a lot!