Parallelize video frame interpolation with FFmpeg.
- Table of Contents
- Prerequisites
- Installation
- Description
- Options
- Examples
- Usage
- Contributing
- License
- Windows only
- FFmpeg
- Python version 3.6+
- Installed
opencv-python
dependency:pip3 install opencv-python
- Only works with MP4 videos
Retrieve the Python script:
- by cloning the repository:
git clone https://github.com/Bryght7/parallel-minterpolate.git
- or directly retrieving the
parallel-minterpolate.py
source file.
parallel-minterpolate is a command-line program to help the user speed up the process of applying frame interpolation to longer videos, using the minterpolate filter from FFmpeg.
As that filter is only single threaded, a common practice is to split the videos into smaller chunks, process those in parallel, and join them back together. This tool generates and runs all the needed commands to do this, all at once.
py parallel-minterpolate.py inputVideo --split N [OPTIONS]
positional arguments:
inputVideo an input video file
options:
-h, --help show this help message and exit
--split N number of tasks to generate equally
-o, --outputDir NAME name of the output directory, default='output'
--fps N target FPS, default=60
--shutdown shutdown computer after tasks are completed
py parallel-minterpolate.py input.mp4 --split 5
👆 Split the video input.mp4
into 5
roughly equal chunks, apply the minterpolate filter to them, and join them back together.
py parallel-minterpolate.py input.mp4 --split 5 --shutdown
👆 Same but the computer shuts down when it is done. Useful for overnight tasks.
After executing the Python script, with option --split 5
for example, you should see 5
different command-line windows open, those are the parallel frame interpolation tasks. Do not close any of them and let them work.
When it is finished, everything should auto close, and you should see the result as a final.mp4
file inside an newly created output
directory (this can be changed using the -o
option).
This script was originally developed hastily and without any serious testing. Therefore it probably contains bugs, may not work under all circumstances, or lack many options/features. Any contributions you make to improve this script are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m '✨ Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the MIT License. See LICENSE.md
for more information.