Skip to content

Instantly share code, notes, and snippets.

@gvoze32
Last active February 7, 2024 14:07
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save gvoze32/3cf2537af47f40dc20360e5e0d3e9eb4 to your computer and use it in GitHub Desktop.
Save gvoze32/3cf2537af47f40dc20360e5e0d3e9eb4 to your computer and use it in GitHub Desktop.
Convert mp3 audio to MP4 using ffmpeg in terminal.

To convert audio mp3 to MP4 by ffmpeg, use the following command

ffmpeg -f lavfi -i color=c=black:s=1280x720:r=5 -i audio.mp3 -crf 0 -c:a copy -shortest output.mp4

Description

This generates mp4 formatted video with blank black background with the color source filter instead of using an image.

Since it is just black video this is one case with lossless mode (-crf 0) will have a smaller file size than the default lossy mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment