Converting mp3 to mp4 using FFmpeg to upload audio files to YouTube [macOS Edition]

Tadashi Shigeoka ·  Wed, June 10, 2015

I’ll show you how to combine mp3 audio files with image files on macOS and convert them to mp4 video files for uploading to YouTube.

YouTube

Installing FFmpeg

First, install FFmpeg using HomeBrew.

FFmpeg is free software that can convert video and audio files.

brew install ffmpeg

Audio file mp3 + Image file jpg => Video file mp4

Prepare the following input files:

  • Image file: image.jpg
  • Audio file: audio.mp3

Execute the following command to create a video file called out.mp4.

ffmpeg -loop 1 -i image.jpg -i audio.mp3 \\
-c:v libx264 -tune stillimage \\
-c:a aac -strict experimental -b:a 192k -pix_fmt yuv420p \\
-shortest out.mp4

Initially, I was looking for an app that could convert audio files to video files, but couldn’t find a good one, so I worked on the CLI.

That’s all about converting mp3 to mp4 with FFmpeg from the Gemba.

Reference Information