Let’s break down this command and its constituent arguments. $ ffmpeg -i benji.gif -f mp4 -pix_fmt yuv420p benji.mp4 Say you have a gif of my ancient, computer illiterate pug, Benji, and you want to convert it to a video format. The easiest way to do that is to go here and find a static build for whatever platform you’re working on. To follow along you’ll need FFmpeg installed. In that light, I wrote this post to share and explain some of its functionality, especially as it relates to GIF transcoding. Maybe you can read the documentation and make some sense of it, or maybe you feel the same way about reading words as me. It’s packed with an enormous amount of functionality. It supports the most obscure ancient formats up to the cutting edge.” “FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. For those of you who are unfamiliar, in their words: If you’ve worked with media encoding in the past decade it’s likely that you’ve come across FFmpeg. If you want a smaller file with just a blank video you can use something like this:įfmpeg -f lavfi -i color=c=0x0a84ff:s=320x240 -i your_input_audio.wav -c:v libx264 -tune stillimage -pix_fmt yuv420p -shortest -c:a aac -b:a 128k output_video_file.To follow along, download media files here: So that it works on Twitter the output audio needs to be transcoded to AAC, that happens by default but to have some control over the quality you can make adjustments to the 128k parameter below ( I haven’t yet figured out if Twitter keeps the audio or resamples it after upload)įfmpeg -i your_input_audio.wav -filter_complex "showspectrum=s=320x240:color=magma,format=yuv420p" -map "" -map 0:a -c:a aac -b:a 128k output_video_file.mp4 This technique uses the audio to create the spectrogram which it merges with the audio. There are a whole load of ways to create the video “image” part besides using a spectrogram (it’s probably best to Google it if you want to explore other things like using a static image etc I’m not an FFmpeg guru!) Just thought I’d share a trick for turning TTS audio ( or any audio) into a nice little spectrogram video using FFmpeg - this means it’s then easy to share on Twitter (which doesn’t take straight audio uploads otherwise) or for other similar uses. Slightly “off topic”, but hope that won’t be a concern as there is a ( tenuous) connection
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |