cms icon indicating copy to clipboard operation
cms copied to clipboard

feature: Write a script that constantly polls the DB and adds subtitles to videos

Open hkirat opened this issue 1 year ago • 13 comments

Screenshot 2024-08-11 at 6 56 42 PM

It needs to get a video without subtitles Download the video Transcode it to mp4 convert it to mp3 use Whisper to generate subs Upload the subs to bunny Add an entry to subtitles fields in the VideoMetadata table

hkirat avatar Aug 11 '24 13:08 hkirat

Working on this

Pritam12F avatar Aug 11 '24 15:08 Pritam12F

@hkirat What are the formats of these videos and which one should i download to get good audio quality but also save on the download size?

Pritam12F avatar Aug 11 '24 16:08 Pritam12F

Hi @Pritam12F, Are you planning to download the video when it is added or somewhere else ?? I have gone through the code, metadata is implemented, if it has the bunny url then button will be visible in video For testing I created a .srt file, uploaded in a free cdn, placed the url in the VideoMetadata table still caption did not come on the video Could you please tell me what did I do wrong ??

iSouvikKhan avatar Aug 11 '24 18:08 iSouvikKhan

@hkirat What are the formats of these videos and which one should i download to get good audio quality but also save on the download size?

Actually you dont want to download the .mp4 you can directly get the .mp3 from the url of a video

SujithThirumalaisamy avatar Aug 11 '24 20:08 SujithThirumalaisamy

Hi @Pritam12F, Are you planning to download the video when it is added or somewhere else ?? I have gone through the code, metadata is implemented, if it has the bunny url then button will be visible in video For testing I created a .srt file, uploaded in a free cdn, placed the url in the VideoMetadata table still caption did not come on the video Could you please tell me what did I do wrong ??

I am just going through the codebase now I am gonna let you know soon

Pritam12F avatar Aug 12 '24 14:08 Pritam12F

@hkirat What are the formats of these videos and which one should i download to get good audio quality but also save on the download size?

Actually you dont want to download the .mp4 you can directly get the .mp3 from the url of a video

How so? Where can I find the mp3's link?

Pritam12F avatar Aug 12 '24 14:08 Pritam12F

@Pritam12F

mp3 links are stored in VideoMetadata table the point being,

  • we need to get the subtitles
  • store it in a .srt file,
  • upload the file in the bunny cdn
  • get the cdn link and store that in the subtitle column of VideoMetadata table

rest otherthings are already set up the trickiest part is getting the subtitles which I am unable to figure out

iSouvikKhan avatar Aug 12 '24 14:08 iSouvikKhan

@iSouvikKhan I don't see any field for the mp3 link in the videoMetadata table. Unless I am missing something. Do you mean the mp4 links are already present so we can skip the step of transcoding the video?

Pritam12F avatar Aug 12 '24 15:08 Pritam12F

Let me give a small context here. You will have multiple trancoded video urls there. Get one video. Download it. Get the .mp3 from the file. Submit it to Whisper AI. Get the subtitles. Parse it to SRT format. Then put it into bunny.

SujithThirumalaisamy avatar Aug 12 '24 16:08 SujithThirumalaisamy

Okay yeah that makes sense @SujithThirumalaisamy

Pritam12F avatar Aug 12 '24 16:08 Pritam12F

  • [x] Done Ref: https://github.com/SujithThirumalaisamy/100x-subtitles

SujithThirumalaisamy avatar Aug 13 '24 08:08 SujithThirumalaisamy

@SujithThirumalaisamy

Page not found

iSouvikKhan avatar Aug 13 '24 09:08 iSouvikKhan

@SujithThirumalaisamy

Page not found

Private for now.

SujithThirumalaisamy avatar Aug 13 '24 09:08 SujithThirumalaisamy