Source: https://vokal.co/blog/ffmpeg-mp3-to-mp4
Description: Turn an MP3 and a cover image into an MP4 video with FFmpeg. Tested commands for YouTube, Instagram and TikTok, plus a fix for videos that run too long.
Published: 2026-10-27T00:00:00.000Z
Modified: 2026-10-27T12:00:00.000Z

[ffmpeg](https://vokal.co/blog/tags/ffmpeg) [dev](https://vokal.co/blog/tags/dev) [podcast](https://vokal.co/blog/tags/podcast)

# How to Convert MP3 to MP4 with FFmpeg

By [Frizky](https://twitter.com/frizurd)

· October 27, 2026 ·

6 min read

![Video editing timeline with video and audio tracks on a dark screen](https://vokal.co/images/blog/ffmpeg-mp3-mp4/hero-timeline-d9d9d0b8f153-1200.webp)

You have an MP3. Maybe a podcast episode, maybe a song. And you want it on YouTube or Instagram.

Problem is, those sites want video. Not audio.

The fix is simple. Put a still image on top of your audio and save it as an MP4. FFmpeg can do this in one line. I'll show you how, and I tested every command in this post myself.

## 1\. Install FFmpeg

FFmpeg is free. Pick the one for your computer:

-   **Mac:** `brew install ffmpeg` (you need [Homebrew](https://brew.sh/) for this)
-   **Windows:** `winget install Gyan.FFmpeg`
-   **Linux:** `sudo apt install ffmpeg`

No package manager? Download it from the [official website](https://ffmpeg.org/download.html).

To check, run `ffmpeg -version`. If you see a version number, you're set.

## 2\. The basic command

Put your MP3 and your image in one folder. I'll call them `audio.mp3` and `cover.jpg`. Open your terminal in that folder and run this:

```text
ffmpeg -loop 1 -i cover.jpg -i audio.mp3 -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest -fflags +shortest -max_interleave_delta 100M output.mp4
```

![Terminal showing the FFmpeg command and the new output.mp4 file](https://vokal.co/images/blog/ffmpeg-mp3-mp4/terminal-191b35d111da-980.webp)

Done. You now have `output.mp4`.

Looks long, right? Don't worry, it's not as scary as it looks:

-   **`-loop 1 -i cover.jpg`** shows your image over and over, once for every frame.
-   **`-i audio.mp3`** is your sound.
-   **`-c:v libx264`** makes H.264 video. YouTube, Instagram and TikTok all take it.
-   **`-tune stillimage`** lets FFmpeg know nothing moves, so the file stays small.
-   **`-c:a aac -b:a 192k`** saves the audio as AAC. 192 kbps sounds great for voice and music.
-   **`-pix_fmt yuv420p`** is the boring one you still need. Leave it out and QuickTime shows a black screen.
-   **`-shortest -fflags +shortest -max_interleave_delta 100M`** stops the video when the audio ends. More on this one below.
-   **`output.mp4`** is the name of your new video.

## 3\. Why is my video longer than my audio?

This one got me.

Most guides online only use `-shortest`. So I tried that first. My audio was 8.5 seconds long. The video? 25 seconds. The last part was just the image with no sound.

The looped image runs ahead of the audio, and `-shortest` alone doesn't catch it in time. Adding `-fflags +shortest -max_interleave_delta 100M` fixed it for me. The video came out at 8.56 seconds.

So if your video has a long silent tail, that's the reason. Use the full command from step 2.

## 4\. Pick the right size

The basic command keeps the size of your image. A square cover gives you a square video. That's fine for some places. But each platform has its own favorite size.

### YouTube (16:9)

```text
ffmpeg -loop 1 -i cover.jpg -i audio.mp3 -vf "scale=1920:1080:force_original_aspect_ratio=decrease,pad=1920:1080:(ow-iw)/2:(oh-ih)/2" -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest -fflags +shortest -max_interleave_delta 100M youtube.mp4
```

This puts your image in the middle of a 1920x1080 frame, with black bars on the sides. Like this:

![Square podcast cover centered in a 16:9 video with black bars](https://vokal.co/images/blog/ffmpeg-mp3-mp4/youtube-frame-694bd89896ba-1200.webp)

Want to upload it as a podcast? Here's my guide on [how to upload your podcast to YouTube](https://vokal.co/blog/upload-podcast-to-youtube).

### Instagram Reels and TikTok (9:16)

Same trick, just a tall frame:

```text
ffmpeg -loop 1 -i cover.jpg -i audio.mp3 -vf "scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2" -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest -fflags +shortest -max_interleave_delta 100M reel.mp4
```

### Instagram feed (1:1)

Got a square cover? Just scale it to 1080x1080:

```text
ffmpeg -loop 1 -i cover.jpg -i audio.mp3 -vf "scale=1080:1080" -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest -fflags +shortest -max_interleave_delta 100M square.mp4
```

Not sure which size to use? I wrote a whole post on [how to post audio on Instagram](https://vokal.co/blog/post-audio-on-instagram).

## 5\. Add a waveform

A still image is a bit boring. People scroll right past it. A moving waveform shows that something is playing.

FFmpeg has a filter for that called `showwaves`:

```text
ffmpeg -loop 1 -i cover.jpg -i audio.mp3 -filter_complex "[1:a]showwaves=s=1200x240:mode=cline:colors=white[wave];[0:v][wave]overlay=(W-w)/2:H-h-80:shortest=1[v]" -map "[v]" -map 1:a -c:v libx264 -c:a aac -b:a 192k -pix_fmt yuv420p -shortest waveform.mp4
```

Here's a frame from my test video:

![Podcast cover with a white audio waveform at the bottom](https://vokal.co/images/blog/ffmpeg-mp3-mp4/waveform-frame-9f73b157a478-1200.webp)

A few things you can change:

-   **`s=1200x240`** is the size of the waveform.
-   **`mode=cline`** is the style. Try `line`, `p2p` or `point` too.
-   **`colors=white`** is the color. Any color name or hex code works, like `0x1b00ff`.
-   **`H-h-80`** places it 80 pixels from the bottom.

Note the `shortest=1` at the end of the overlay. It does the same job as the flags in step 3, so the video stops when the audio does.

Want more control over the look? My post on [audio waveform animations](https://vokal.co/blog/audio-waveform) goes deeper.

## 6\. Convert a whole folder at once

Got a bunch of episodes? Run this and grab a coffee. Every MP3 in the folder gets its own MP4, all with the same cover:

```text
for f in *.mp3; do ffmpeg -loop 1 -i cover.jpg -i "$f" -c:v libx264 -tune stillimage -c:a aac -b:a 192k -pix_fmt yuv420p -shortest -fflags +shortest -max_interleave_delta 100M "${f%.mp3}.mp4"; done
```

So `episode-1.mp3` turns into `episode-1.mp4`. Spaces in file names are fine too. This one is for Mac and Linux. On Windows, run it in Git Bash or WSL.

## Don't like the command line?

I get it. FFmpeg is great, but it's a lot of typing for one video. And it can't easily do subtitles, progress bars or nice templates.

That's why I built [Vokal](https://vokal.co/features/audio-to-video). You upload your MP3, pick a template and add a [waveform](https://vokal.co/features/music-visualizer), [subtitles](https://vokal.co/features/add-subtitle-to-video) and your logo. Then export. No commands needed.

[Try it for free](https://app.vokal.co/register). No credit card needed.

More FFmpeg guides from me:

-   [Add audio to a video with FFmpeg](https://vokal.co/blog/ffmpeg-add-audio-to-video)
-   [Convert TS to MP4 with FFmpeg](https://vokal.co/blog/ts-to-mp4-ffmpeg)
-   [Add color noise to a video with FFmpeg](https://vokal.co/blog/color-noise-ffmpeg)

## Frequently asked questions

### Can FFmpeg convert MP3 to MP4 without an image?

Sort of. A video needs pictures, but they can be plain black. Swap `-loop 1 -i cover.jpg` for `-f lavfi -i color=c=black:s=1920x1080` and you're done.

### Why is my FFmpeg video longer than the audio?

The looped image keeps going after the audio ends. Add `-fflags +shortest -max_interleave_delta 100M` next to `-shortest`. That fixed it in my test.

### Why does my video show a black screen?

You probably left out `-pix_fmt yuv420p`. Some players, like QuickTime, can't play other pixel formats.

### Does converting MP3 to MP4 lower the audio quality?

A little, because FFmpeg turns the audio into AAC. At 192 kbps most people won't hear a difference. Want to play it safe? Use `-b:a 320k`.

### What image size should I use?

Bigger is better here. Match your video size or go above it. A 3000x3000 podcast cover is plenty for YouTube, Reels and square posts.

## Wrapping up

That's really all there is to it. One command, one image, one MP3. Pick your size, maybe add a waveform, and you're ready to post.

Happy converting!

![Picture of Frizky](https://vokal.co/profile.jpg)

Frizky [@frizurd](https://twitter.com/frizurd)

Creator of Vokal. Designer and developer for 15+ years, on a mission to make great design accessible to everyone.

[PreviousHow to Post Audio on Instagram (Reels & Stories)](https://vokal.co/blog/post-audio-on-instagram)

## Ready to make  
your first video?

[Get started — it's free](https://app.vokal.co/register)

![Vokal video templates](https://vokal.co/images/examples-min-2f8db0875081-1200.webp)
