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

convert a video to shorts #1658

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

pritipsingh
Copy link
Contributor

This is a Video-to-Shorts Suggestion Agent.

It suggests compelling, high-energy moments from the video along with their start time, end time, a description of the moment, and a confidence score, like this:

Screen.Recording.2024-12-30.at.1.10.03.PM.mov

I have added an optional feature to extract and cut these moments from the video and download them to a specified folder. However, the best use case for this would be to integrate it into a video editor or a similar tool, allowing users to adjust and crop the suggested moments as needed.

Type of change

Please check the options that are relevant:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Model update
  • Infrastructure change

Checklist

  • My code follows Phidata's style guidelines and best practices
  • I have performed a self-review of my code
  • I have added docstrings and comments for complex logic
  • My changes generate no new warnings or errors
  • I have added cookbook examples for my new addition (if needed)
  • I have updated requirements.txt/pyproject.toml (if needed)
  • I have verified my changes in a clean environment

Additional Notes

Include any deployment notes, performance implications, or other relevant information:

2. Run the script using: `python cookbook/agents/47_video_to_shorts.py`
"""

from phi.agent import Agent
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please reorder imports:

import time
import subprocess
from pathlib import Path

from google.generativeai import upload_file, get_file

from phi.agent import Agent
from phi.model.google import Gemini
from phi.utils.log import logger

- Suggestions on how to enhance the segment for short-form content
- An importance score (1-10) based on engagement potential

Instructions:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instructions should be passed a list to the instructions param on the Agent.

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.

2 participants