This Python program is a comprehensive script that automates with AI the creation of short videos (e.g., for TikTok, YouTube Shorts, Instagram) with synchronized subtitles and auto-generated audio speech. Example shorts here: https://www.youtube.com/@24hvideo650/shorts
Features
This Python program is a comprehensive script that automates the creation of short videos (e.g., for TikTok, YouTube Shorts, Instagram) with synchronized subtitles and auto-generated audio speech. Below is a detailed description of its functionality:
User Input
Content Generation Option:
If the user selects "yes," the program uses the OpenAI API to generate a text script based on a specific theme provided by the user.
The generated content is tailored to meet specific requirements (e.g., written in your language, includes a captivating hook at the beginning, excludes emojis or hashtags).
The user can further refine the generated content if necessary.
Manual Option:
The user can directly input the desired video content.
Audio Generation
The program converts the text content into audio using text to speech in any language.
The audio is saved as an MP3 file.
Video Creation
Video Background:
A random background clip (e.g., Minecraft) is selected.
The clip is trimmed and synchronized to match the duration of the generated audio.
Background music is added to enhance the video.
Resizing:
The clip is adjusted to a 9:16 format (ideal for TikTok and Shorts), with cropping applied if necessary.
Audio Transcription
Using the Faster Whisper model, the program transcribes the audio into time-stamped segments, generating precise word-level timing data.
The data, including start and end timestamps for each word, is saved as a JSON file.
Subtitle Creation
Text Segmentation:
The text is divided into subtitle lines based on duration, character count, and detected pauses in the audio.
Dynamic Subtitles:
For each synchronized word, the program creates visual subtitles using MoviePy.
Words are dynamically highlighted as they are spoken, with an effect that changes the text color.
A semi-transparent background is added behind the text to improve readability.
Final Composition and Export
The animated subtitles are overlaid onto the gameplay video, centered on the clip.
The final video is exported as an MP4 file using the H.264 codec, including synchronized audio.
Final Output
The result is a vertical video suitable for social media platforms, featuring engaging gameplay, automatically generated audio, and synchronized subtitles with word-by-word highlighting.
Tested with Python 3.11
You have to login to leave a review!
All Reviews
No Review!
What type of support is included? Verified source code Free support included Download code immediately Quality guarantee for your satisfaction Support: info@sellanycode.com
You have to login to ask a question!
All Questions
No Question!
$60
Verified source code
Join 35189+ buyers which trust us!
Download code immediately
100% Guarantee For Item! Satisfaction guarantee policy.