Posting Audio to Twitter

by @edent | # # #

You can’t post raw audio to Twitter directly. It sucks.

Sure, you can post links to audio, but it’s not quite the same.

Here’s a couple of Linux one-liners which will turn audio into simple video suitable for uploading to social media.


This converts audio to a waveform:

ffmpeg -i input.mp3 -filter_complex "[0:a]showwaves=s=640x480:mode=line,format=yuv420p[v]" -map "[v]" -map 0:a -c:v libx264 -c:a copy output.mkv

How it looks

Single Image

This takes a single image and adds it to the audio:

ffmpeg -loop 1 -i image.jpg -i audio.mp3 -c:v libx264 -tune stillimage -c:a copy  -pix_fmt yuv420p -shortest out.mp4

How it looks

That’s it! If you know of a more efficient way to do it – shove a comment in the box.

Leave a Reply

Your email address will not be published. Required fields are marked *