A command-line tool to slice videos for social-media stories
There are a few different ways to get story-slicer.
# Clone project to the local workspace
git clone https://github.com/myTerminal/story-slicer.git
# Switch to the project directory
cd story-slicer
# Install with `make`
make install
Simply execute the below command in a terminal; the rest should be automatic.
/bin/bash -c "$(curl https://raw.githubusercontent.com/myTerminal/story-slicer/main/install)"
story-slicer will soon be available to install from your operating system's package manager.
A simple way to use story-slicer is to run it in a command-line terminal passing in the path of the video file to be sliced.
story-slicer ~/Videos/input.mp4
The above command would create slices of the video and place them within the current directory. You can optionally also specify the output directory where you expect the slices to be placed.
story-slicer ~/Videos/input.mp4 ~/Downloads
By default, the video file input.mp4
is split into several videos of 30 seconds in length and placed in the specified output directory. You can also optionally specify the length of the individual slices as the second argument to the command.
story-slicer ~/Videos/input.mp4 ~/Downloads 60
The above command would split the video into several videos of 60 seconds each.
One can also provide a start offset, which is the number of seconds to ignore from the input video. So, the above command would turn into:
story-slicer ~/Videos/input.mp4 ~/Downloads 60 15
and it would ignore the first 15 seconds of the input video.
Just the way you can skip a part of the video from the start, you can also omit a part towards the end.
story-slicer ~/Videos/input.mp4 ~/Downloads 60 15 250
The above command splits the input video input.mp4
into slices that are 60 seconds long, but skips the first 15 seconds of the input video, and ends the splitting process at 250 seconds.
To learn more about usage, refer to manpage
:
man story-slicer
In order to update story-slicer, simply run:
story-slicer-update
In order to uninstall story-slicer, simply run:
story-slicer-uninstall
Being written with Common Lisp, story-slicer depends on SBCL. In most cases, it will be automatically installed while generating the binary, but if it doesn't please install it before running the installation.
The other required programs are as follows:
- Implement installation of ffmpeg automatically
- Implement detection of file extension
- Implement padding of slice numbers