Sharing Podcasts to YouTube with FFMPEG
Sharing a podcast on social media, specifically YouTube, has turned out to be one of the methods to help with growing listenership. Turning audio clips from your podcast into shareable video highlights for social media encourage new listeners to download your show.
The tool of choice for this conversion is FFMPEG which is available for macOS, Linux and Windows. On macOS, FFMPEG can be installed using the following command:
FFMPEG deals with inputs and outputs where videos are produced using filters. FFMPEG is a rich and powerful tool with a myriad of options, but can be difficult to understand at first. To produce the YouTube ready video with a podcast audio, artwork and waveforms (generated based on the audio data) we will need the following inputs for FFMPEG:
- waveform filter
The following command will input the items listed above except the waveform filter (which is handled below):
The option, -lavfi, indicates the libavfilter is used for the black background of 1280x720 listed above.
Moving on to the more complicated options and filter processing, we will initially look at the waveform filter to generate a spectrum from the input.mp3 file. In our example, we will make use of the showwaves filter which is operating on the [0:a] input - 0 indicates the first input and the 'a' is for the audio input. Entering the command above with the inputs will display all the inputs FFMPEG receives and their index. The filter_complex option will allow for sequential filters applied on the output video. As shown below, the first filter applied is the showwaves:
The output of this filter is called, spectrum, to indicate the waveform spectrum generated by from the podcast audio. This 'spectrum' output then becomes the input to the next filter in the chain.
The next sequence of filters will be the following:
- background color
- overlay the spectrum on the background
- overlay the podcast artwork on the background
- overlay the text on the background
Note: video inputs are indexed and denoted by 'v', for example: [1:v] is the first video input in our example.
Putting it all together for a H.264 encoded video of 1280x720 dimensions and with AAC audio encoding, we have the following FFMPEG command:
The output.mp4 file is now ready to be shared on YouTube and other social media platforms.