![]() ![]() Here are two commands to set higher and lower gain levels. ![]() Setting a gain of less than 1 decreases the sound level, whereas setting it higher increases it. The gain scale has a default value of 1 and can range from 0 to 128 with floating point values. The last filter option I would like to cover is gain. Some higher or lower frequencies become easier to see. Try different color scales to see how your sound information changes in the spectrogram. Some of the details become clearer when color scales are changed. ffmpeg -i audio-in.wav -lavfi showspectrumpic=s=960x540:color=6 image-out.png Here is the command to change it to the “fiery” color setting. So far we have used the default “intensity” color setting. There are 9 possible options available, which I won’t demonstrate all here. Now let’s change the color of our spectrogram that reflects sound levels at different frequencies. It appears to top out at 12Khz on the default orientation, something to note. You can also see a much higher range of 20Khz in the frequency scale when we change the orientation. The start of the sound begins at the top of the image, while the bottom is the end of the file. ffmpeg -i audio-in.wav -lavfi showspectrumpic=s=960x540:orientation=1 image-out.png Use this command to change the orientation. The only time you would use this filter is when you want the frequency scale to run horizontal. Change the scale around, try different options. Now I can read the time and frequency scales easier. ffmpeg -i audio-in.wav -lavfi showspectrumpic=s=960x540 image-out.png I use this command with my options to get my intended results. For my purposes, I prefer to lower it down so I can read the scale information. If you reference the filter help file, it states this, (default “4096×2048”). The actual spcetrogram is 4096 x 2048 if we remove the scale padding that boarders the spectrogram. This should create an image file fairly quickly with the default dimensions of 4328 x 2176. ffmpeg -i audio-in.wav -lavfi showspectrumpic image-out.png ![]() Use this command, replace the input and output file names to suit your needs. Lets create a spectrogram with the default options. This will be worth noting when I demonstrate some advanced uses of this topic. It follows a consistant pattern of 116 pixels on each side and 64 pixels above and below the spectrogram. One thing to keep in mind is that spectrogram function creates a padded boarder around the actual spectrogram. The Size filter option lets you choose the dimensions of the spectrogram image. There are other options as well, but these are advanced concepts beyond the scope of this post, maybe in another post. These are Size, Gain, Color, and Orientation. There are a few options for the filter I would like to point out. You can also get information about the filter by typing in this command. Details about this filter can be found here. This can be useful for a number of reasons.įFMpeg has a feature that lets us create spectrograms with the showspectrumpic filter. They provide a way to visually locate moments in time. #Ffmpeg filter how to#In this post I’ll be covering how to create image files that represent the sound levels and frequencies of a media file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |