Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support transcription of videos (mp4, webm, etc.) #5

Open
fedirz opened this issue May 23, 2024 · 1 comment
Open

Support transcription of videos (mp4, webm, etc.) #5

fedirz opened this issue May 23, 2024 · 1 comment

Comments

@fedirz
Copy link
Owner

fedirz commented May 23, 2024

https://platform.openai.com/docs/api-reference/audio/createTranscription#audio-createtranscription-file

@fedirz fedirz changed the title Support transcription of multiple audio formats Support transcription of videos (mp4, webm, etc.) May 27, 2024
@thiswillbeyourgithub
Copy link
Contributor

Just stumbled upon this issue by chance. I just happen to have implemented code for this.

I made wdoc which is my tool for RAG (query and summary) that fit my precise needs. It includes various parsers, including some relevants to this issue:

  • youtube links to playlists -> youtube links
  • youtube links to videos (either using youtube transcripts, or translation, or downloading the audio then sending to whisper)
  • url to a website where playwright is used to find a video -> download it -> whisper
  • video -> audio -> whisper

Here's the link to the function to turn a video into text: https://github.com/thiswillbeyourgithub/wdoc/blob/d5a36ae02040420a698b361b7cb137a02d563af7/wdoc/utils/loaders.py#L1776

If you don't want to modify your code and just want to use wdoc directly you can do : wdoc parse --path my_video.mp3 --filetype local_video --only_text --audio_backend="whisper". Although now that I think about it I haven't set a way to overload the openai url for whisper. I'll add a env variable someday. Sooner if anyone's interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants