Skip to content

Instantly share code, notes, and snippets.

@rafalgrasman-nxp
Forked from gvoze32/ffmpeg mp3 to mp4.MD
Created November 7, 2024 08:03
Show Gist options
  • Select an option

  • Save rafalgrasman-nxp/e6386debb81bc11c47c7a5c657ea8202 to your computer and use it in GitHub Desktop.

Select an option

Save rafalgrasman-nxp/e6386debb81bc11c47c7a5c657ea8202 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