r/PowerShell 16d ago

Script Sharing Working with FFmpeg in PowerShell

One thing I really love to do is make complicated functionality a few notches easier by exposing it in PowerShell.

I absolutely love ffmpeg. It's a very powerful app for manipulating media. It's also famously dense. It has hundreds of filters, thousands of parameters, and generally obtuse and deeply technical help.

So, a long while back, I started whittling away on this problem. I made this module called RoughDraft to manipulate media, and I figured out a good enough mechanism to slowly build out support for filter after filter after filter.

It lets you play files with Show-Media, convert files with Convert-Media, and do almost any edit under the sun with Edit-Media.

IMO, it's a really fun module. Please check it out and let me know what you think.

26 Upvotes

5 comments sorted by

2

u/BlackV 16d ago

what to the microservieces/container/docker parts do ?

2

u/StartAutomating 16d ago

Slowly but surely building my way to a containerized video editor.

Currently it just loads the module and launches an event-based HTTP Listener as a local server.

It looks for a .Serve method on RoughDraft and calls it if available, and prints "Nothing To Serve" otherwise.

The container image will contain the latest RoughDraft and ffmpeg, and is a Linux container. So the other thing this allows you to do is to get to audio/video editing functionality that will only run on Linux (or that may not be available in an older version of ffmpeg).

Hope this helps you understand.

For a bunch of simple servers, might I recommend checking out another project I've got:

Servers101

3

u/orgdbytes 15d ago

I found this a few months ago and it has been great. I was executing FFmpeg in my script with all of my parameters and it worked well. When I found your module, it amazed me how much more efficient it was and how quickly it processed my files compared to my functions. I've not done a deep dive into why yet. I use this monthly to split audio, add intro and outro, and convert files for three different radio networks across the US. I meant to thank you at the summit last month in person...so thank you virtually.

1

u/StartAutomating 15d ago

💙You're welcome!

I was at summit less than I expected due to some pneumonia. Thanks are acceptable in any format. 🤞we will both make it to summit next year and you'll be able to give your thanks in person.

This module has been a fun labor of love and has helped me learn so much more about what ffmpeg can do (and how to make it easier for everyone).

For an example of what the most recent build can do, check out this post I made to BlueSky yesterday. It reverses audio (backmasking), adjusts rate to fit target time, visualizes the audio, and then does an RGBA Shift to add extra flair.

1

u/unumri 15d ago

Wrapping ffmpeg this way is genuinely satisfying, especially with how much the tool keeps evolving - v8.1 dropped just a couple months, ago and the filter and codec surface keeps expanding, so having a cleaner PowerShell interface on top of it saves real cognitive overhead. The gap between what ffmpeg can do and what most people can actually remember off the, top of their head is enormous, and modules like this are..