Posting Audio to Twitter


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.

Waves

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.


Share this post on…

  • Mastodon
  • Facebook
  • LinkedIn
  • BlueSky
  • Threads
  • Reddit
  • HackerNews
  • Lobsters
  • WhatsApp
  • Telegram

What are your reckons?

All comments are moderated and may not be published immediately. Your email address will not be published.

Allowed HTML: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <p> <pre> <br> <img src="" alt="" title="" srcset="">