πŸ“Ό Wrapper around ffmpeg which simplifies merging of multiple videos

Overview

fusion gif

Vidmerger

A wrapper around ffmpeg which simplifies merging of multiple videos.


fusion gif

πŸ™‰ 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 🍺 on MacOS 🍏

brew install ffmpeg # prerequisite
brew tap tgotwig/vidmerger
brew install vidmerger

Homebrew 🍺 on Linux 🐧

sudo snap install ffmpeg --edge # prerequisite
brew tap tgotwig/linux-vidmerger
brew install vidmerger

Chocolatey 🍫 on Windows πŸ³οΈβ€πŸŒˆ

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 😊 When everything went smooth, it should look like this:

β†ͺ 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

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.

πŸ“œ Licensing

MIT License with β€œCommons Clause”.

Comments
  • Make Build fails on Ubuntu

    Make Build fails on Ubuntu

    Im pretty clueless with things if they don't come in an exe format or sudo apt get so please bear with me. I have ffmpeg installed, I downloaded the zip and extracted it to my desktop. Next the readme says "Run make build to build for Mac, Linux and Windows."

    When I run make build it automatically tries to build it for MacOS and not linux. Which results in a fail. error code 2, Could someone enlighten me on what im doing wrong?

    opened by Jalawoud 4
  • Lack of format docs/logging

    Lack of format docs/logging

    So I tried doing cargo run -- -f foo target just as a "let's see how it copes" test (I know it'll fail, but was hoping for logging info detailing what was wrong) and got the following

    Order of merging πŸ‘‡
    
    
    
    stderr: dyld: Library not loaded: /usr/local/opt/libffi/lib/libffi.6.dylib
      Referenced from: /usr/local/opt/p11-kit/lib/libp11-kit.0.dylib
      Reason: image not found
    
    Something went wrong πŸ˜–
    

    No idea what happened there! Thoughts?

    opened by palfrey 3
  • Docker command line does nothing

    Docker command line does nothing

    I executed the command line like explained in the README:

    docker container run -it --rm -v vidoeos:/data tgotwig/vidmerger
    
    guettli@yoga15:~$ docker container run -it --rm -v  django-con-video:/data tgotwig/vidmerger
    Unable to find image 'tgotwig/vidmerger:latest' locally
    latest: Pulling from tgotwig/vidmerger
    cbdbe7a5bc2a: Already exists 
    8b1398788c7d: Pull complete 
    d10d702f5385: Pull complete 
    Digest: sha256:dce94b631f7d8cae10355c892034f6890cf4c7694ed80d7515d7db8814b763a9
    Status: Downloaded newer image for tgotwig/vidmerger:latest
    

    But after that nothing happend.

    Please explain in the README what additional steps are needed.

    opened by guettli 2
  • FFmpeg - Unsafe file name

    FFmpeg - Unsafe file name

    I get a [concat @ 0x55c6fb1e7600] Unsafe file name

    There seems to need a -safe 0 added :

    https://stackoverflow.com/questions/38996925/ffmpeg-concat-unsafe-file-name/56029574

    enhancement 
    opened by t0ben 1
  • Fix error-code 2 on `cargo run` 🐞

    Fix error-code 2 on `cargo run` 🐞

    relates https://github.com/clap-rs/clap/issues/1264

    With fish-shell:

    β†ͺ cargo run
        Finished dev [unoptimized + debuginfo] target(s) in 0.27s
         Running `target/debug/vid_merger`
    vidmerger 0.1.2
    Thomas Gotwig <[email protected]>
    A wrapper around ffmpeg which simlifies merging multiple videos 🎞
    
    USAGE:
        vid_merger <DIR> --format <format>
    
    ARGS:
        <DIR>    Sets the input file to use
    
    FLAGS:
        -h, --help       Prints help information
        -V, --version    Prints version information
    
    OPTIONS:
        -f, --format <format>    Sets a format
    
    β†ͺ echo $status
    2
    
    bug 
    opened by TGotwig 1
  • Restyle [ImgBot] Optimize images

    Restyle [ImgBot] Optimize images

    Automated style fixes for #19, created by Restyled.

    The following restylers made fixes:

    To incorporate these changes, merge this Pull Request into the original. We recommend using the Squash or Rebase strategies.

    NOTE: As work continues on the original Pull Request, this process will re-run and update (force-push) this Pull Request with updated style fixes as necessary. If the style is fixed manually at any point (i.e. this process finds no fixes to make), this Pull Request will be closed automatically.

    Sorry if this was unexpected. To disable it, see our documentation.

    opened by restyled-io[bot] 0
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    opened by imgbot[bot] 0
  • [ImgBot] Optimize images

    [ImgBot] Optimize images

    opened by imgbot[bot] 0
  • Could not find tag for codec pcm_alaw in stream #1

    Could not find tag for codec pcm_alaw in stream #1

    I get this error:

    [mp4 @ 0x7fe854012400] Could not find tag for codec pcm_alaw in stream #1, codec not currently supported in container Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument Stream mapping: Stream #0:1 -> #0:0 (copy) Stream #0:0 -> #0:1 (copy) Last message repeated 1 times Ok(Output { status: ExitStatus(ExitStatus(256)), stdout: "", stderr: "" })

    opened by helmutcarter 4
  • 🐞 Non-monotonous DTS in output stream 0:1;

    🐞 Non-monotonous DTS in output stream 0:1;

    Many warnings like these:

    [mp4 @ 0x7fca3d008e00] Non-monotonous DTS in output stream 0:1; previous: 68688838, current: 68684616; changing to 68688839. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x7fca3d008e00] Non-monotonous DTS in output stream 0:1; previous: 68688839, current: 68685640; changing to 68688840. This may result in incorrect timestamps in the output file.
    [mp4 @ 0x7fca3d008e00] Non-monotonous DTS in output stream 0:1; previous: 68688840, current: 68686664; changing to 68688841. This may result in incorrect timestamps in the output file.
    

    Only shows up as a warning, but still corrupts the output πŸ’₯

    bug help wanted 
    opened by TGotwig 0
Releases(0.2.0)
Owner
Thomas Gotwig
πŸ§ͺ Bioinformatics Master Student πŸ‘¨β€πŸŽ“
Thomas Gotwig
ffmpeg libraries precompiled for WebAsembly/WASI, as a Rust crate.

FFMPEG crate for WebAssembly/WASI This crate bundles FFMPEG's libraries, precompiled for WebAssembly. No native installation required. Compatible with

Frank Denis 45 Dec 14, 2022
rsmpeg is a thin&safe layer above the FFmpeg's Rust bindings

A Rust crate that exposes FFmpeg's power as much as possible.

Lark Technologies Pte. Ltd. 384 Jan 2, 2023
A ffmpeg/rust based HLS stream generator

hls-streamer Stream your heart's content with HLS. Movtivation I've got a CCTV camera from AliExpress, I know I can use ffmpeg hls demuxer to split up

null 16 Jan 9, 2023
AV1 encoding tool with fast VMAF sampling. Uses svt-av1, ffmpeg & vmaf

ab-av1 AV1 encoding tool with fast VMAF sampling. Uses svt-av1, ffmpeg & vmaf. Command: auto-encode Automatically determine the best crf to deliver th

Alex Butler 92 Jan 1, 2023
Wrap a standalone FFmpeg binary in an intuitive Iterator interface. 🏍

FFmpeg Sidecar ?? Wrap a standalone FFmpeg binary in an intuitive Iterator interface. Motivation The core goal of this project is to provide a method

Nathan Babcock 26 Feb 22, 2023
Plays back videos in your terminal in an insanely slow and inefficient way.

term-video I guess this is usable now... Compilation Since this project is built using Rust, install its toolchain first, for example using rustup. gi

Pascal Puffke 7 Feb 23, 2022
A CLI tool that converts videos to ASCII and displays them to the terminal on the fly

A CLI tool that converts videos to ASCII and displays them to the terminal on the fly

Luke T 19 Nov 15, 2022
A not well-named youtube's videos downloader written in Rust πŸ¦€

ytdl-rs A not well-named youtube's videos downloader written in Rust ?? For information about how to use, legal section, next steps in the project, co

Alejandro Lopez 6 Jun 17, 2022
A fork of the abandoned ffmpeg-next crate which is a fork of the abandoned ffmpeg crate

This is a fork of the abandoned ffmpeg-next crate which is a fork of the abandoned ffmpeg crate. Currently supported FFmpeg versions: 4.x, 5.x. Build

Josh Holmer 4 Jan 26, 2023
This is a lightweight audio-video player built in Rust using FFmpeg libraries. It demonstrates the usage of FFmpeg with Rust to play back video files.

FFmpeg Rust Video Player This is a lightweight audio-video player built in Rust using FFmpeg libraries. It demonstrates the usage of FFmpeg with Rust

Jenin Sutradhar 3 Apr 10, 2024
Vulkan and Rust rendering~game engine which creation is covered with YouTube videos

Vulkan and Rust rendering~game engine which creation is covered with YouTube videos

小ι³₯ 11 Dec 4, 2022
Materialize simplifies application development with streaming data. Incrementally-updated materialized views - in PostgreSQL and in real time. Materialize is powered by Timely Dataflow.

Materialize is a streaming database for real-time applications. Get started Check out our getting started guide. About Materialize lets you ask questi

Materialize, Inc. 4.7k Jan 8, 2023
ffmpeg libraries precompiled for WebAsembly/WASI, as a Rust crate.

FFMPEG crate for WebAssembly/WASI This crate bundles FFMPEG's libraries, precompiled for WebAssembly. No native installation required. Compatible with

Frank Denis 45 Dec 14, 2022
rsmpeg is a thin&safe layer above the FFmpeg's Rust bindings

A Rust crate that exposes FFmpeg's power as much as possible.

Lark Technologies Pte. Ltd. 384 Jan 2, 2023
A ffmpeg/rust based HLS stream generator

hls-streamer Stream your heart's content with HLS. Movtivation I've got a CCTV camera from AliExpress, I know I can use ffmpeg hls demuxer to split up

null 16 Jan 9, 2023
AV1 encoding tool with fast VMAF sampling. Uses svt-av1, ffmpeg & vmaf

ab-av1 AV1 encoding tool with fast VMAF sampling. Uses svt-av1, ffmpeg & vmaf. Command: auto-encode Automatically determine the best crf to deliver th

Alex Butler 92 Jan 1, 2023
A micro crate that simplifies a bit the use of the std macro thread_local!.

with-thread-local A micro crate that simplifies a bit the use of the std macro thread_local!. extern crate regex; use with_thread_local::with_thread_

Cecile Tonglet 3 Jan 11, 2023
Simple Rust derive-macro that simplifies integral enum creation

Integral enum A simple way to define integer-like enums. This macro implements bunch of traits that are usually implemented via looooong derive(..) at

null 3 Jan 6, 2023
Wrap a standalone FFmpeg binary in an intuitive Iterator interface. 🏍

FFmpeg Sidecar ?? Wrap a standalone FFmpeg binary in an intuitive Iterator interface. Motivation The core goal of this project is to provide a method

Nathan Babcock 26 Feb 22, 2023
locdev is a handy CLI tool that simplifies the process of adding, removing, and listing entries in the hosts file.

locdev ??️ locdev is a handy CLI tool that simplifies the process of adding, removing, and listing entries in the hosts file. You no longer need to de

Nick Rempel 20 Jun 5, 2023