01 logo

FFMPEG - The Swiss Army Knife of Media Files on Mac Mini M1

Manipulate Audio/Video/Image on Mac M1 Command-Line!

By KabirPublished 3 years ago 4 min read
Like

I am a beginning-level YouTuber and an expert-level software engineer with 18+ years of software design, development, and management experience. I have recently launched a few YouTube channels - a first-gen immigrant lifestyle channel, a macOS user group channel, and two more channels on the way. Having to deal with a lot of video files on my shiny Mac Mini M1 system is fun as it is an awesome machine for dealing with H.265 (HEVC) videos that are spet out by the newer camera gears like the Go Pro. However, as a software engineer, I often prefer automation when it comes to repetitive tasks.

Now that I know I am serious about my YouTube efforts, I needed to automate many of my routine video tasks such as inserting intro/outro and many other tasks. I live Final Cut Pro and Screenflow for all my video editing work but I am interested in producing many videos where automation will help.

So I decided to put my skills to work and explore tools that can be handled using shell scripts and other programming languages. FFMPEG - the Swiss Army Knife of media files - became my center of interest. In this article, I will discuss a few common things that you can do with FFMPEG on a Mac Mini M1 without making your computer make a peep!

Before you can play with FFMPEG on a Mac Mini M1, you need to install it via Homebrew - which is the missing package manager for Mac. If you haven't installed Homebrew on your Mac Mini M1 yet, you can follow the process described in my video below:

Once you have Homebrew installed as described in the above video, you can install FFMPEG by following the video below:

Now that you have FFMPEG installed, you are ready to explore many different audio/video/image processing tasks that you can accomplish using FFMPEG. Here are some examples.

How To Trim a Video

Trimming a video using Final Cut Pro or other full-scale video editor is simple. But these tools are not accessible from a command-line or shell scripts that you want to run on your raw video files. For example, I am currently working on a project where I record a certain amount of clips from a remote device as a video file and then I need to trim out the initial 15 seconds to remove personally identifying elements from it. This is a routine task. It would be best done using a shell script that can run through all the videos in a directory and create new clips that are trimmed for the first 15 seconds. In cases like this, you can use FFMPEG. See the video below for a demo.

How To Remove Audio from Video

If you need to remove audio from a number of video files on a regular basis so that they can be played as a background video in the office lobby or hallway, etc, FFMPEG can be a great tool. Check out the simple instructions on how to do this with FFMPEG in the video below.

How to Extract Audio (MP3) from Video

I love listening to lectures and music from YouTube in my car. Grabbing the videos and extracting the music or lectures manually is a painful process. I use youtube-dll to automate all the steps. Youtube-dll uses FFMPEG to do these tasks. So you can do audio extractions easily and directly using FFMPEG. Check out the video below.

How To Extract Images from Video

Creating a YouTube cover image on Canva using a scene from the video is often a good idea. To get the right shot captured as a JPEG, you can use FFMPEG as well. Here in the video below, I show how to do that!

Hot to Extract MP3 from a YouTube Playlist

Sometimes you just want to download a lecture series or bunch of music from a public playlist and play them on your car infotainment system. This is where you can use the FFMPEG powered YouTube-DL package. See how simple it is to use as shown in the video below.

https://www.youtube.com/watch?v=YsPRMsnSBW0

How to Create Video from Images

I know that you can use any decent photo editor like the built-in Photo app or other fancier tools like Adobe Lightroom or Affinity Photos to make your video slideshows. But when you are creating a workflow where you drop your photos in a certain folder and run a script to create a standardized video without needing to manually import them into a third-party tool, FFMPEG is there for you! Here is a video showing how to use one or more images to create videos with or without audio!

There is endless simple to complex usage of FFMPEG. I have simply shown a few basic usages here. Advanced tools often use FFMPEG on the backend to do the actual audio/video/image manipulation behind the scene. This is why I love using this Open Source tool. You can learn more about it at:

https://ffmpeg.org

how to
Like

About the Creator

Kabir

Technologist for life

Reader insights

Be the first to share your insights about this piece.

How does it work?

Add your insights

Comments

There are no comments for this story

Be the first to respond and start the conversation.

Sign in to comment

    Find us on social media

    Miscellaneous links

    • Explore
    • Contact
    • Privacy Policy
    • Terms of Use
    • Support

    © 2024 Creatd, Inc. All Rights Reserved.