VideoExtender is a Python script that extends the duration of a video file to a specified number of hours by repeating its content. It is ideal for creating extended loops of short videos.
- Python 3.x
ffmpeg
andffprobe
installed on your system. You can install these with a package manager likeapt
for Ubuntu:
sudo apt update
sudo apt install ffmpeg
Clone this repository to your local machine:
git clone https://github.com/annaelmoussa/VideoExtender.git
cd VideoExtender
Run the script from the command line by specifying the input video file, the output video file, and the desired duration in hours:
python3 VideoExtender.py <input_video.mp4> <output_video.mp4> <hours>
Example:
python3 VideoExtender.py video_original.mp4 video_extended.mp4 10
The script calculates how many times the original video needs to be repeated to reach approximately the specified duration. It then creates a video that loops the original content until the target duration is met.
Feel free to fork the repository and submit pull requests.
This work is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.