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

[Feature Request]: video Embeddings : chromaDB also for videos #3533

Open
Keerthivardhan1 opened this issue Jan 22, 2025 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@Keerthivardhan1
Copy link

Describe the problem

For up until now chromaDB is only for text, from this feature it will be the solution for videos as well

like "Chat With Video" / "Talk To Video"

Describe the proposed solution

function that creates embeddings for videos

steps :

video ==> audio ==> text ==> nltk(sent_tokenize) ==> vector (steps followed in text ) -- (creating collection for sentences in video )

sample code :

from moviepy import VideoFileClip
import speech_recognition as sr

def extract_audio_from_video(video_file_path , audio_file_path):
'''

desc : extracts audio from video_file_path and stores it in audio_file_path

input :
    video_file_path : path to video file
    audio_file_path : path to audio file 

output : 

'''

video = VideoFileClip(video_file_path)
video.audio.write_audiofile(audio_file_path)

def transcribe_audio_to_text(audio_file_path , text_file_path):
'''
desc : transcribes the audio to text

input : 
    audio_file_path : path to audio file 
    text_file_path : path to text file to save the text

output : 
'''
recognizer = sr.Recognizer()
with sr.AudioFile(audio_file_path) as source:
    audio_data = recognizer.record(source)
    text = recognizer.recognize_google(audio_data)
    with open(text_file_path , "w") as file:
        file.writelines(text)
    return text

video_file_path = "samples.mp4"
audio_file_path = "temp_audio.wav"
text_file_path = "text_of_video.txt"

extract_audio_from_video(video_file_path, audio_file_path)
transcription = transcribe_audio_to_text(audio_file_path , text_file_path)
print("Transcription:")
print(transcription)

and I would like to contribute to this feature

Alternatives considered

No response

Importance

nice to have

Additional Information

I would like to work on it!

@Keerthivardhan1 Keerthivardhan1 added the enhancement New feature or request label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant