AI Personal Learning
and practical guidance

AI YouTube Shorts Generator: long videos automatically converted to multiple short videos

General Introduction

AI YouTube Shorts Generator is a powerful tool designed to help users quickly generate high-quality short YouTube videos. By utilizing artificial intelligence technology, the tool is able to extract key clips from long videos and automatically generate short videos suitable for social media posting. This not only greatly saves time and effort, but also ensures high quality and attractive video content.

AI YouTube Shorts Generator: long videos automatically converted into multiple short videos-1


 

Function List

  • Automatically extract key clips from long videos
  • Generate short videos suitable for social media distribution
  • Provides a variety of video editing options
  • Supports multiple video formats
  • User-friendly interface design

 

Using Help

Installation and use

precondition

  • Python 3.7 or higher Python 3.7 or higher
  • FFmpeg
  • OpenCV

move

  1. Clone the repository. Cloning Warehouse:

    git clone https://github.com/SamurAIGPT/AI-Youtube-Shorts-Generator.git
    cd AI-Youtube-Shorts-Generator
  2. Install the required Python packages.
    安装所需的 Python 包:

    pip install -r requirements.txt
  3. Set up the environment variables. .env file in the project root directory and add your OpenAI API key.
    设置环境变量。在项目根目录下创建一个 .env 文件并添加您的 OpenAI API 密钥:

    OPENAI_API=your_openai_api_key_here

utilization

  1. Ensure your .env file is correctly set up with your OpenAI API key.
    确保您的 .env 文件已正确设置您的 OpenAI API 密钥。
  2. Run the main script and enter the desired YouTube URL when prompted.
    运行主脚本并在提示时输入所需的 YouTube 网址:

    python main.py

 

Detailed Operation Procedure

  1. Upload VideoClick "Upload Video" button in the main interface and select the long video file you want to edit.
  2. automatic generationOnce the upload is complete, click the "Auto Generate Video" button and the tool will start analyzing the video content and extracting key clips.
  3. Edit Video: The generated short video will be displayed in the editing interface, and you can use the toolbar on the left side to edit it, such as editing, adding subtitles, adjusting the volume, etc.
  4. Preview and Export: When the editing is finished, click "Preview" button to see the final effect. If you are satisfied, click "Export" button to choose the video format and save it locally.

Steps to Generate AI Video

Converting long video to short video content involves three main steps:

  1. Generate transcription: First, we need to download a YouTube video as input. We will use the Pytube library to download the video. Once downloaded, we need to generate a transcription of the video. We will use a locally installed Whisper model for this task. If your system is underpowered, you can use the Whisper API.
  2. Identify highlights: Once the transcription is complete, we need to identify the highlights from the video. We will use the OpenAI API to find the hot clips in the video with specific cues. By setting Temperature > 0, we can get different highlights each time we run the script. Once we get the start and end times of the selected highlights, we can use the Moviepy library to edit the video accordingly.
  3. Automatic Video Cropping: Next, we convert the highlight video to a short video format (9:16) by cropping the video to keep the speaker in the center of the frame. Since there may be more than one person in the video, recognizing the speaker requires solving the active speaker detection problem. We can use several methods such as TalkNet, Fast-ASD, etc., but in this paper we will focus on simple heuristics using multiple cues.

common problems

  • How do I ensure the quality of the generated video? The tool uses advanced AI algorithms that intelligently recognize high-quality clips in videos to ensure that the generated video content is clear and coherent.
  • Does it support multiple video formats? Yes, the tool supports many common video formats such as MP4, AVI, MOV, and so on.
  • Can the generated videos be uploaded directly to social media? Yes, the generated videos are optimized for direct uploading to social media platforms such as YouTube, Instagram, and more.
AI Easy Learning

The layman's guide to getting started with AI

Help you learn how to utilize AI tools at a low cost and from a zero base.AI, like office software, is an essential skill for everyone. Mastering AI will give you an edge in your job search and half the effort in your future work and studies.

View Details>
May not be reproduced without permission:Chief AI Sharing Circle " AI YouTube Shorts Generator: long videos automatically converted to multiple short videos

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish