This is a script for creating clips from a video file.
You create a spreadsheet that describes the clips you want to create, and then the script calls ffmpeg
to create the clips.
This is an example spreadsheet:
filename | start_time | duration | notes |
---|---|---|---|
intro.mp4 | 00:00 | 00:03 | animated "DLR 30" |
social_media.mp4 | 00:35.5 | 00:11 | social media information |
Combined with a video file, this would create two clips (intro.mp4
and social_media.mp4
).
This is deliberately a simple script. If you need more complex options, you might be better off invoking ffmpeg directly, or looking at script like https://github.com/c0decracker/video-splitter
Original design and idea are from @bessyboo
You need two programs installed and in your PATH:
- ffmpeg; see the ffmpeg installation guide.
- Python; which you can download from python.org. Any recent version of Python should be fine (2.7 or 3.x).
Then download this repository (click "Clone or download" > "Download ZIP"). Unzip the repository.
-
Create a spreadsheet that describes the clips you want to create; one row per clip. This needs to have at least three named columns:
filename
-- the name of the file you want to create for this clipstart_time
-- where in the file the clip startsduration
-- how long the clip lasts
You can add other columns if it's helpful (e.g. a
notes
column describing what's in the clip), but the script will ignore them.Save this spreadsheet as a CSV.
-
Open a terminal window, and navigate to the repository.
$ cd /path/to/repository
-
Run the script, passing (1) the path to the video file you want to clip and (2) the path to the CSV you created in step 1.
The repository includes an example:
$ python clipatron.py --manifest manifest.csv --input dlr_turns_30.mp4 ✨ Clipping done! ✨
So you can see what the script expects, this repository includes an example manifest.csv
and video file.
(This is a video from the Transport for London YouTube channel.)
If you get stuck, you can ask me for help on Twitter.
MIT.