Skip to content

Conversation

@omgate234
Copy link

Pull Request

Description:
Add video.clip() method to generate video clips based on text prompts using AI analysis of video
content (transcript, scenes, or both).

Changes:

  • Add ClipContentType class with spoken, visual, multimodal options in _constants.py
  • Add clip to ApiPath in _constants.py
  • Add clip() method to Video class in video.py
  • Export ClipContentType in __init__.py

Related Issues:

  • Implements SDK support for POST /video/{video_id}/clip endpoint

Testing:

from videodb import connect, ClipContentType                                                            
                                                                                                        
conn = connect()
coll = conn.get_collection()                                                                                        
video = coll.get_video("m-xxxxx")                                                                       
                                                                                                        
# Test spoken content (default)                                                                         
clips = video.clip("find the introduction")                                                             
                                                                                                        
# Test visual content                                                                                   
clips = video.clip("find action scenes", content_type=ClipContentType.visual)                           
                                                                                                        
# Test multimodal                                                                                       
clips = video.clip("find funny moments", content_type=ClipContentType.multimodal)                       
                                                                                                        
# Verify Shot objects are returned with correct attributes                                              
for shot in clips:                                                                                      
    print(shot.start, shot.end, shot.text)                                                              

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

Successfully merging this pull request may close these issues.

1 participant