DEV Community

Cover image for I got tired of Googling FFmpeg flags, so I built a universal CLI converter in Rust
Arshal Aromal
Arshal Aromal

Posted on

I got tired of Googling FFmpeg flags, so I built a universal CLI converter in Rust

Hey everyone! This is my first ever post on dev.to, and I wanted to share a tool I built purely out of frustration with my own terminal workflow.

If you are anything like me, you probably process a lot of media and documents locally. You also probably refuse to use slow, bloated desktop GUIs, and you definitely don't want to upload sensitive files to random cloud converters just to change a format.

So, we turn to the CLI titans: FFmpeg, ImageMagick, and Pandoc. They are incredibly powerful, but they share one massive flaw: a massive cognitive tax. Memorizing hyper-specific, multi-line CLI flags for three separate monolithic tools is a nightmare.

To solve this friction, I built MCVT (Multi-format ConVerTer).


The Problem

Let's say you just want to convert a video into a high-quality, dithered GIF. If you want it to actually look good, you can't just change the extension. You usually end up on StackOverflow, copying and pasting a massive filter graph that looks like this:

ffmpeg -i input.mp4 -filter_complex "[0:v] fps=15,scale=w=640:h=-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" output.gif

Enter fullscreen mode Exit fullscreen mode

Or maybe you want to encode an .avi to an .mp4 that won't crash hardware decoders (requiring even-pixel dimensions):

ffmpeg -i input.avi -c:v libx264 -preset medium -crf 16 -pix_fmt yuv420p -vf "bwdif=deint=interlaced,scale=trunc(iw/2)*2:trunc(ih/2)*2" -movflags +faststart output.mp4

Enter fullscreen mode Exit fullscreen mode

This is exhausting.


The Solution: MCVT

MCVT is a CLI tool written in Rust that acts as a universal abstraction layer over FFmpeg, ImageMagick, and Pandoc.

Instead of dealing with three different syntaxes, MCVT lets you do this:

mcvt input.mp4 output.gif
mcvt input.avi output.mp4
mcvt document.docx document.pdf
Enter fullscreen mode Exit fullscreen mode

You give it an input and an output, and it figures out the rest. The exact same optimization templates (like the complex GIF palette generation) are built right in and executed under the hood.

MCVT Demo showing file conversion in action

Why this isn't "just another wrapper"

I know what you're thinking. "Oh great, another wrapper script that hides the useful flags."

I specifically engineered MCVT to avoid the classic wrapper traps. It doesn't just blindly pipe commands; it’s an actual routing engine with theoretically over 94,600 unique file conversion pathways.

Here is what makes it a standalone utility rather than a dumb script:

  • Magic-Byte Detection: It doesn't just trust the file extension you type. The routing engine inspects raw file headers to determine the correct domain.
  • Cross-Domain Routing: It handles intra-domain swaps (video-to-video) and cross-domain routes (extracting video frames straight into document-ready images) seamlessly.
  • Safe Interrupts: Basic process cleanup is built-in. If you Ctrl+C a batch job, MCVT ensures the leftover backend processes don't keep quietly chewing up your CPU in the background.
  • Recursive Directory Batching: It natively handles converting entire nested folders without needing a messy find ... -exec bash loop.

The Escape Hatches (Retaining Control)

Crucially, MCVT doesn't lock you into its default templates. As power users, we need access to the underlying binaries for edge cases.

You can force paths, bypass the header probing, or inject raw backend flags whenever you need to:

# Don't probe the file, trust the extension
mcvt corrupted.jpg restored.png --no-guess

# Inject raw FFmpeg arguments to limit threads during a batch job
mcvt ./in/ ./out/ --batch-ext mkv --ffmpeg-out -threads 1 -b:v 1M

Enter fullscreen mode Exit fullscreen mode

How to try it out

Note: MCVT does not replace FFmpeg, ImageMagick, or Pandoc. It routes them. You still need them installed and available in your system's PATH.

You can grab the prebuilt binaries (Windows, macOS, Linux) directly from the GitHub Releases, or you can build it from source if you have Rust installed:

git clone https://github.com/arshalaromal/mcvt.git
cd mcvt
cargo build --release

Enter fullscreen mode Exit fullscreen mode

It's 100% local, fully open-source (GPL), and keeps your data entirely private.

If you appreciate local-first dev tools or just want to clean up your terminal workflow, I would love for you to try it out. Let me know what you think in the comments, and if you find it useful, dropping a star on the repo goes a long way!

GitHub Repository: arshalaromal/mcvt

Top comments (0)