Vidmerger
A wrapper around ffmpeg which simplifies merging of multiple videos.
π
What is this exactly?
Vidmerger is a command-line-tool which uses ffmpeg to merge multiple video-files with the same file-extension together into one file called output.FORMAT. It also includes a usage help
USAGE:
vidmerger [OPTIONS] <DIR>
ARGS:
<DIR> Sets the directory to use
FLAGS:
-h, --help Prints help information
-p, --preview Prints previews of the merge-orders without merging them
-V, --version Prints version information
OPTIONS:
-f, --format <format> Specifies which formats should be merged individually,
the default is π avchd,avi,flv,mkv,mov,mp4,webm,wmv
-s, --scale <scale> Scales all videos up before merging, a valid value would be "320:240"
β¨
Installing / Getting started
You can install it on all the three major operating systems
Homebrew
brew install ffmpeg # prerequisite
brew tap tgotwig/vidmerger
brew install vidmerger
Homebrew
sudo snap install ffmpeg --edge # prerequisite
brew tap tgotwig/linux-vidmerger
brew install vidmerger
Chocolatey
choco install ffmpeg # prerequisite
choco install vidmerger
βοΈ
Using Vidmerger
βοΈ
First of all lets see what we have:
βͺ exa -lh | awk '{print $2,$7}'
Size
328k 1.mp4
328k 2.mp4
now just run the following line:
βͺ vidmerger .
Order of merging π
file '1.mp4'
file '2.mp4'
Calling: 'ffmpeg -y -f concat -i data/list.txt -c copy data/output.mp4' π
...
Successfully generated 'output.mp4'! ππ
per default it goes through the filename extensions avchd,avi,flv,mkv,mov,mp4,webm,wmv and tries to merge all mp4 files to out.mp4, all webm files to out.webm, and so on
βͺ exa -lh | awk '{print $2,$7}'
Size
328k 1.mp4
328k 2.mp4
664k output.mp4
There it is!
π³
Run it without installing
You can also use Docker to run vidmerger without installing anything except Docker, hosted on Dockerhub.
docker container run -v <ABSOLUTE-PATH-TO-YOUR-VIDEOS>:/data tgotwig/vidmerger
Example with Bash:
docker container run -v `pwd`/data:/data tgotwig/vidmerger
βοΈ
Developing
Built With
Rust and some listed Crates inside of Cargo.toml under dependencies.
Prerequisites
- Rust 2018+
- youtube-dl (for tests
π§ͺ ) - ffmpeg (for tests
π§ͺ ) - If you are on Windows and want to have the
make
command: Windows Subsystem for Linux with Ubuntu
Setting up Dev
Once you are done with installing the prerequisites, you should run make
to see if everything runs smooth:
git clone [email protected]:TGotwig/vidmerger.git
cd vidmerger
make
Also click on fork from the top right corner of this repository and run:
git remote add <your-github-name> [email protected]:<your-github-name>/vidmerger.git
Here is a little tutorial about working with forks along with GitKraken
Building
Run make build
to build for Mac, Linux and Windows. You can find the compressed Mac & Linux .tar.gz-archives for Github under target/tars, the .exe file for Windows under tools.
Deploying / Publishing
The best is to increase all versions by find and replace, then after make build
:
- Homebrew (MacOS): Edit the version and the hash there.
- Homebrew (Linux): Edit the version and the hash there.
- Chocolatey (Windows): Edit the hash inside of tools/VERIFICATION.txt and run
make publish-choco
. - Dockerhub: Run
make publish-dockerhub
.
π¦
Versioning
We use SemVer for versioning.
π§ͺ
Tests
There are some shell- and cargo-tests, which can be run by make test
, requires youtube-dl and ffmpeg installed.
π
Style guide
We are using rust-clippy and rls-vscode.