Zach Ocean
@
zachwe
TAGS
AUDIO
January 16, 2024

How to convert audio to video for hosting on YouTube and other free video hosting sites

Use ffmpeg to convert voice AI outputs to video for easier hosting and embedding.

If you want to upload audio to the internet so that you can easily share and embed it, you typically want to use a free video hosting site like YouTube. (As a voice AI site, we have to do this all the time!)

Unfortunately, sites like YouTube don't support uploading audio files directly. Here's how you can create a video with your audio and a static background image so that you can upload it and embed it for free.

  1. You need an image to use as the background to your video. You can create an AI image using Dall-E through ChatGPT, or use a tool like Canva.
  2. Download the image to the same directory as your audio.
  3. Combine the audio and image into a video using ffmpeg (run this command from the same directory as your audio and image files):
ffmpeg -loop 1 -i background-image.png -i audio.wav -c:v libx264 -tune stillimage -pix_fmt yuv420p -shortest output.mp4

Now you can upload output.mp4 to YouTube or any other video hosting site.

January 16, 2024