Automate YouTube shorts creation from a main video and bottom video. Tasks include zooming, adding subtitles, and making segments efficient.
-
Requirements
- Python 3.10
- FFMPEG v >= 4.4
- Install:
pip install moviepy
-
Execution
./venv/bin/python3.10 src/script.py
src/script.py
: Main script.video/demo.mp4
: Main video.video/minecraft.mp4
: Bottom video.output/
: Processed videos.
-
process_clip(start, end, main_video, bottom_video, output_path, speed_factor=2)
- Process video clips (speed up).
-
process_audio(start, end, temp_video_path, speed_factor=2)
- Process audio (adjust speed).
-
create_final(temp_video_path, final_audio_path, result_path)
- Combine processed video and audio.
- Ensure proper library installation.
- Adjust parameters as needed.
- Generated files stored in
output/
.
- Zoom in the video to fit the screen (use
vfx.crop()
function). - Add subtitles of the top video to the bottom video.
- Make the segments of the video more efficient
- By analyzing the transcript.
- Cut the video at the pauses.
Personal project; use at your own discretion. Contributions and feedback welcome! 👏