Easily create YouTube chapters for combined videos. This tool automatically generates chapters for merged video files, enhancing navigation for viewers and content structure for creators.
- Automatically detects video duration and creates chapter marks.
- Supports a variety of file naming conventions.
- Outputs chapter marks in a YouTube-ready format.
-
Clone the repository or download the source code.
-
Install Python dependencies:
Navigate to the project directory and run:
pip install -r requirements.txt
-
Install FFmpeg:
moviepy
requires FFmpeg to process video files. Follow the instructions below based on your operating system:-
Windows:
- Download FFmpeg from https://ffmpeg.org/download.html.
- Extract the downloaded archive.
- Add the path to the
bin
folder inside the extracted folder to your system's PATH environment variable.
-
macOS: Use Homebrew to install FFmpeg:
brew install ffmpeg
-
Linux: Use your distribution's package manager. For example, on Ubuntu/Debian:
sudo apt-get update sudo apt-get install ffmpeg
Ensure FFmpeg is installed correctly by running
ffmpeg -version
in your command line or terminal. -
-
Run the script:
python video.py
-
Follow the script prompts:
- Enter the directory path containing your video files.
The script will generate a result.txt
file with the YouTube chapters based on the video files in the specified directory.
- Python 3.x
- moviepy
- FFmpeg
For any issues related to FFmpeg installation or usage, refer to the official FFmpeg documentation.
- To merge videos free and fast use https://github.com/mifi/lossless-cut
Let's say you have files like the below naming convention.
lesson1.mp4
lesson2.mp4
lesson3.mp4
And you have a text file containing the correct name for each lessons.
For example course-contents.txt
may have the following content.
01 - Intro to JavaScript
02 - Variable declaration
03 - Loop
Now, if you want to rename original file names with correct file names defined in the .txt
file then run the rename.py
file.
-
Run the script:
python rename.py
-
Follow the script prompts:
- Enter the directory path containing your video files.
- Enter the fie directory of the
.txt
file containing correct file names.