Transcoding is the conversion of one digital data format into another digital format. Most of the time, transcoding is an attempt to convert the source material into a smaller material by means of compression. Transcodology is the science that observes and analyses the different actors involved in transcoding. A sub-discipline of transcodology is compressology. Anyway, lets have a look into the world of transcoding.
For our experiment today, we need a high-quality source material. Therefore, we are now looking for a good cat meow in the freesound library. freesound is a community-run sound library with more than 500k Creative Commons sounds. Because of the licence used in the freesound library, we don't have to worry about copyright infringements in this transcolodgy exercise *wink smiley*
Alright, the cat meowing uploaded by the user nekoninja in very good quality (wav-format, samplerate 44100.0 Hz, bitdepth 16 bit, channels stereo) is our selected source material. The user nekoninja mentions in the description that the cats name is sushi. Thank you sushi and nekoninja!
Lets see what info we can get about the file (called "cat-meowing-original.wav" with the following command:
! ffprobe -hide_banner cat-meowing-original.wav
Input #0, wav, from 'cat-meowing-original.wav': Metadata: encoder : Coderium SoundEngine 5.21 Duration: 00:00:10.18, bitrate: 1411 kb/s Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, 2 channels, s16, 1411 kb/s
And we listen to the sound file with the following command:
from IPython.display import Audio
Audio('cat-meowing-original.wav', autoplay=True)
Now we are going to create a spectogram of the file with the following ffmpeg-command:
! ffmpeg -hide_banner -i cat-meowing-original.wav -lavfi showspectrumpic=s=1000x400:mode=separate meowing-original-spectrogram.png -y
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'cat-meowing-original.wav':
Metadata:
encoder : Coderium SoundEngine 5.21
Duration: 00:00:10.18, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
Stream #0:0 (pcm_s16le) -> showspectrumpic
showspectrumpic -> Stream #0:0 (png)
Press [q] to stop, [?] for help
Output #0, image2, to 'meowing-original-spectrogram.png':
Metadata:
encoder : Lavf58.20.100
Stream #0:0: Video: png, rgb24, 1282x528 [SAR 1:1 DAR 641:264], q=2-31, 200 kb/s, 86.13 fps, 86.13 tbn, 86.13 tbc
Metadata:
encoder : Lavc58.35.100 png
frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.01 bitrate=N/A speed=0.0167x
video:580kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
from IPython.display import Image
Image('meowing-original-spectrogram.png')
In the next to steps we will transcode the original wav-file to a high quality mp3-file and a low quality mp3-file!
First the compression into a high quality mp3-file with 128kbps:
! ffmpeg -hide_banner -i cat-meowing-original.wav -b:a 128k cat-meowing-128k.mp3 -y
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'cat-meowing-original.wav':
Metadata:
encoder : Coderium SoundEngine 5.21
Duration: 00:00:10.18, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'cat-meowing-128k.mp3':
Metadata:
TSSE : Lavf58.20.100
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, s16p, 128 kb/s
Metadata:
encoder : Lavc58.35.100 libmp3lame
size= 160kB time=00:00:10.18 bitrate= 128.7kbits/s speed=19.9x
video:0kB audio:160kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.282704%
from IPython.display import Audio
Audio('cat-meowing-128k.mp3', autoplay=True)
And now the spectogram of it:
! ffmpeg -hide_banner -i cat-meowing-128k.mp3 -lavfi showspectrumpic=s=1000x400:mode=separate:legend=disabled meowing-128k-spectrogram.png -y
Input #0, mp3, from 'cat-meowing-128k.mp3': Metadata: encoder : Lavf58.20.100 Duration: 00:00:10.21, start: 0.025057, bitrate: 128 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 128 kb/s Metadata: encoder : Lavc58.35 Stream mapping: Stream #0:0 (mp3float) -> showspectrumpic showspectrumpic -> Stream #0:0 (png) Press [q] to stop, [?] for help Output #0, image2, to 'meowing-128k-spectrogram.png': Metadata: encoder : Lavf58.20.100 Stream #0:0: Video: png, rgb24, 1000x400 [SAR 1:1 DAR 5:2], q=2-31, 200 kb/s, 86.13 fps, 86.13 tbn, 86.13 tbc Metadata: encoder : Lavc58.35.100 png frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.01 bitrate=N/A speed=0.016x video:544kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
from IPython.display import Image
Image('meowing-128k-spectrogram.png')
Lets make a really low compression of the original file:
! ffmpeg -hide_banner -i cat-meowing-original.wav -b:a 8k cat-meowing-8k.mp3 -y
Guessed Channel Layout for Input Stream #0.0 : stereo
Input #0, wav, from 'cat-meowing-original.wav':
Metadata:
encoder : Coderium SoundEngine 5.21
Duration: 00:00:10.18, bitrate: 1411 kb/s
Stream #0:0: Audio: pcm_s16le ([1][0][0][0] / 0x0001), 44100 Hz, stereo, s16, 1411 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (pcm_s16le (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
Output #0, mp3, to 'cat-meowing-8k.mp3':
Metadata:
TSSE : Lavf58.20.100
Stream #0:0: Audio: mp3 (libmp3lame), 44100 Hz, stereo, s16p, 8 kb/s
Metadata:
encoder : Lavc58.35.100 libmp3lame
size= 40kB time=00:00:10.18 bitrate= 32.3kbits/s speed=22.2x
video:0kB audio:40kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.619248%
! ffmpeg -hide_banner -i cat-meowing-8k.mp3 -lavfi showspectrumpic=s=1000x400:mode=separate:legend=disabled meowing-8k-spectrogram.png -y
Input #0, mp3, from 'cat-meowing-8k.mp3': Metadata: encoder : Lavf58.20.100 Duration: 00:00:10.21, start: 0.025057, bitrate: 32 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 32 kb/s Metadata: encoder : Lavc58.35 Stream mapping: Stream #0:0 (mp3float) -> showspectrumpic showspectrumpic -> Stream #0:0 (png) Press [q] to stop, [?] for help Output #0, image2, to 'meowing-8k-spectrogram.png': Metadata: encoder : Lavf58.20.100 Stream #0:0: Video: png, rgb24, 1000x400 [SAR 1:1 DAR 5:2], q=2-31, 200 kb/s, 86.13 fps, 86.13 tbn, 86.13 tbc Metadata: encoder : Lavc58.35.100 png frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.01 bitrate=N/A speed=0.0313x video:113kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
from IPython.display import Image
Image('meowing-8k-spectrogram.png')
from IPython.display import Audio
Audio('cat-meowing-8k.mp3', autoplay=True)
What we can see from the image and hear from the audio is that the mp3 compression cuts already a lot of the high frequenies! Lets compare the file sizes of the three different files:
! ls -al *.wav *.mp3
-rw-rw-r--+ 1 joak joak 163675 Apr 19 07:45 cat-meowing-128k.mp3 -rw-rw-r--+ 1 joak joak 41109 Apr 19 08:06 cat-meowing-8k.mp3 -rw-rw-r--+ 1 joak joak 1796250 Apr 18 23:00 cat-meowing-original.wav
In the next step we will transcode the 'cat-meowing-128k.mp3'-file 100 times and listen what kind of glitches will appear :D
import os
os.system("cp -f cat-meowing-128k.mp3 test/0.mp3") #copy the mp3 to the test folder
for i in range(0,100):
os.system("ffmpeg -loglevel quiet -hide_banner -i test/"+str(i)+".mp3 test/"+str(i)+".wav -y") #convert from mp3 to wav
os.system("ffmpeg -loglevel quiet -hide_banner -i test/"+str(i)+".wav -b:a 32k -filter:a 'volume=1.05' test/"+str(i+1)+".mp3 -y") #convert from wav to mp3
print("Now the script is at step "+str(i)+" of 99")
print("Finished")
Now the script is at step 0 of 99 Now the script is at step 1 of 99 Now the script is at step 2 of 99 Now the script is at step 3 of 99 Now the script is at step 4 of 99 Now the script is at step 5 of 99 Now the script is at step 6 of 99 Now the script is at step 7 of 99 Now the script is at step 8 of 99 Now the script is at step 9 of 99 Now the script is at step 10 of 99 Now the script is at step 11 of 99 Now the script is at step 12 of 99 Now the script is at step 13 of 99 Now the script is at step 14 of 99 Now the script is at step 15 of 99 Now the script is at step 16 of 99 Now the script is at step 17 of 99 Now the script is at step 18 of 99 Now the script is at step 19 of 99 Now the script is at step 20 of 99 Now the script is at step 21 of 99 Now the script is at step 22 of 99 Now the script is at step 23 of 99 Now the script is at step 24 of 99 Now the script is at step 25 of 99 Now the script is at step 26 of 99 Now the script is at step 27 of 99 Now the script is at step 28 of 99 Now the script is at step 29 of 99 Now the script is at step 30 of 99 Now the script is at step 31 of 99 Now the script is at step 32 of 99 Now the script is at step 33 of 99 Now the script is at step 34 of 99 Now the script is at step 35 of 99 Now the script is at step 36 of 99 Now the script is at step 37 of 99 Now the script is at step 38 of 99 Now the script is at step 39 of 99 Now the script is at step 40 of 99 Now the script is at step 41 of 99 Now the script is at step 42 of 99 Now the script is at step 43 of 99 Now the script is at step 44 of 99 Now the script is at step 45 of 99 Now the script is at step 46 of 99 Now the script is at step 47 of 99 Now the script is at step 48 of 99 Now the script is at step 49 of 99 Now the script is at step 50 of 99 Now the script is at step 51 of 99 Now the script is at step 52 of 99 Now the script is at step 53 of 99 Now the script is at step 54 of 99 Now the script is at step 55 of 99 Now the script is at step 56 of 99 Now the script is at step 57 of 99 Now the script is at step 58 of 99 Now the script is at step 59 of 99 Now the script is at step 60 of 99 Now the script is at step 61 of 99 Now the script is at step 62 of 99 Now the script is at step 63 of 99 Now the script is at step 64 of 99 Now the script is at step 65 of 99 Now the script is at step 66 of 99 Now the script is at step 67 of 99 Now the script is at step 68 of 99 Now the script is at step 69 of 99 Now the script is at step 70 of 99 Now the script is at step 71 of 99 Now the script is at step 72 of 99 Now the script is at step 73 of 99 Now the script is at step 74 of 99 Now the script is at step 75 of 99 Now the script is at step 76 of 99 Now the script is at step 77 of 99 Now the script is at step 78 of 99 Now the script is at step 79 of 99 Now the script is at step 80 of 99 Now the script is at step 81 of 99 Now the script is at step 82 of 99 Now the script is at step 83 of 99 Now the script is at step 84 of 99 Now the script is at step 85 of 99 Now the script is at step 86 of 99 Now the script is at step 87 of 99 Now the script is at step 88 of 99 Now the script is at step 89 of 99 Now the script is at step 90 of 99 Now the script is at step 91 of 99 Now the script is at step 92 of 99 Now the script is at step 93 of 99 Now the script is at step 94 of 99 Now the script is at step 95 of 99 Now the script is at step 96 of 99 Now the script is at step 97 of 99 Now the script is at step 98 of 99 Now the script is at step 99 of 99 Finished
from IPython.display import Audio
Audio('test/100.mp3', autoplay=True)
! ffmpeg -hide_banner -i test/100.mp3 -lavfi showspectrumpic=s=1000x400:mode=separate:legend=disabled test/meowing-100times-spectrogram.png -y
Input #0, mp3, from 'test/100.mp3': Metadata: encoder : Lavf58.20.100 Duration: 00:00:10.21, start: 0.025057, bitrate: 32 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 32 kb/s Metadata: encoder : Lavc58.35 Stream mapping: Stream #0:0 (mp3float) -> showspectrumpic showspectrumpic -> Stream #0:0 (png) Press [q] to stop, [?] for help Output #0, image2, to 'test/meowing-100times-spectrogram.png': Metadata: encoder : Lavf58.20.100 Stream #0:0: Video: png, rgb24, 1000x400 [SAR 1:1 DAR 5:2], q=2-31, 200 kb/s, 86.13 fps, 86.13 tbn, 86.13 tbc Metadata: encoder : Lavc58.35.100 png frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.01 bitrate=N/A speed=0.0272x video:186kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
from IPython.display import Image
Image('test/meowing-100times-spectrogram.png')
Alright that goes into a good direction and even the spectogram looks good. Lets trey it now with 400 times :D
import os
os.system("cp -f cat-meowing-128k.mp3 test/0.mp3") #copy the mp3 to the test folder
for i in range(0,400):
os.system("ffmpeg -loglevel quiet -hide_banner -i test/"+str(i)+".mp3 test/"+str(i)+".wav -y") #convert from mp3 to wav
os.system("ffmpeg -loglevel quiet -hide_banner -i test/"+str(i)+".wav -b:a 32k -filter:a 'volume=1.05' test/"+str(i+1)+".mp3 -y") #convert from wav to mp3
print("Now the script is at step "+str(i)+" of 399")
print("Finished")
Now the script is at step 0 of 399 Now the script is at step 1 of 399 Now the script is at step 2 of 399 Now the script is at step 3 of 399 Now the script is at step 4 of 399 Now the script is at step 5 of 399 Now the script is at step 6 of 399 Now the script is at step 7 of 399 Now the script is at step 8 of 399 Now the script is at step 9 of 399 Now the script is at step 10 of 399 Now the script is at step 11 of 399 Now the script is at step 12 of 399 Now the script is at step 13 of 399 Now the script is at step 14 of 399 Now the script is at step 15 of 399 Now the script is at step 16 of 399 Now the script is at step 17 of 399 Now the script is at step 18 of 399 Now the script is at step 19 of 399 Now the script is at step 20 of 399 Now the script is at step 21 of 399 Now the script is at step 22 of 399 Now the script is at step 23 of 399 Now the script is at step 24 of 399 Now the script is at step 25 of 399 Now the script is at step 26 of 399 Now the script is at step 27 of 399 Now the script is at step 28 of 399 Now the script is at step 29 of 399 Now the script is at step 30 of 399 Now the script is at step 31 of 399 Now the script is at step 32 of 399 Now the script is at step 33 of 399 Now the script is at step 34 of 399 Now the script is at step 35 of 399 Now the script is at step 36 of 399 Now the script is at step 37 of 399 Now the script is at step 38 of 399 Now the script is at step 39 of 399 Now the script is at step 40 of 399 Now the script is at step 41 of 399 Now the script is at step 42 of 399 Now the script is at step 43 of 399 Now the script is at step 44 of 399 Now the script is at step 45 of 399 Now the script is at step 46 of 399 Now the script is at step 47 of 399 Now the script is at step 48 of 399 Now the script is at step 49 of 399 Now the script is at step 50 of 399 Now the script is at step 51 of 399 Now the script is at step 52 of 399 Now the script is at step 53 of 399 Now the script is at step 54 of 399 Now the script is at step 55 of 399 Now the script is at step 56 of 399 Now the script is at step 57 of 399 Now the script is at step 58 of 399 Now the script is at step 59 of 399 Now the script is at step 60 of 399 Now the script is at step 61 of 399 Now the script is at step 62 of 399 Now the script is at step 63 of 399 Now the script is at step 64 of 399 Now the script is at step 65 of 399 Now the script is at step 66 of 399 Now the script is at step 67 of 399 Now the script is at step 68 of 399 Now the script is at step 69 of 399 Now the script is at step 70 of 399 Now the script is at step 71 of 399 Now the script is at step 72 of 399 Now the script is at step 73 of 399 Now the script is at step 74 of 399 Now the script is at step 75 of 399 Now the script is at step 76 of 399 Now the script is at step 77 of 399 Now the script is at step 78 of 399 Now the script is at step 79 of 399 Now the script is at step 80 of 399 Now the script is at step 81 of 399 Now the script is at step 82 of 399 Now the script is at step 83 of 399 Now the script is at step 84 of 399 Now the script is at step 85 of 399 Now the script is at step 86 of 399 Now the script is at step 87 of 399 Now the script is at step 88 of 399 Now the script is at step 89 of 399 Now the script is at step 90 of 399 Now the script is at step 91 of 399 Now the script is at step 92 of 399 Now the script is at step 93 of 399 Now the script is at step 94 of 399 Now the script is at step 95 of 399 Now the script is at step 96 of 399 Now the script is at step 97 of 399 Now the script is at step 98 of 399 Now the script is at step 99 of 399 Now the script is at step 100 of 399 Now the script is at step 101 of 399 Now the script is at step 102 of 399 Now the script is at step 103 of 399 Now the script is at step 104 of 399 Now the script is at step 105 of 399 Now the script is at step 106 of 399 Now the script is at step 107 of 399 Now the script is at step 108 of 399 Now the script is at step 109 of 399 Now the script is at step 110 of 399 Now the script is at step 111 of 399 Now the script is at step 112 of 399 Now the script is at step 113 of 399 Now the script is at step 114 of 399 Now the script is at step 115 of 399 Now the script is at step 116 of 399 Now the script is at step 117 of 399 Now the script is at step 118 of 399 Now the script is at step 119 of 399 Now the script is at step 120 of 399 Now the script is at step 121 of 399 Now the script is at step 122 of 399 Now the script is at step 123 of 399 Now the script is at step 124 of 399 Now the script is at step 125 of 399 Now the script is at step 126 of 399 Now the script is at step 127 of 399 Now the script is at step 128 of 399 Now the script is at step 129 of 399 Now the script is at step 130 of 399 Now the script is at step 131 of 399 Now the script is at step 132 of 399 Now the script is at step 133 of 399 Now the script is at step 134 of 399 Now the script is at step 135 of 399 Now the script is at step 136 of 399 Now the script is at step 137 of 399 Now the script is at step 138 of 399 Now the script is at step 139 of 399 Now the script is at step 140 of 399 Now the script is at step 141 of 399 Now the script is at step 142 of 399 Now the script is at step 143 of 399 Now the script is at step 144 of 399 Now the script is at step 145 of 399 Now the script is at step 146 of 399 Now the script is at step 147 of 399 Now the script is at step 148 of 399 Now the script is at step 149 of 399 Now the script is at step 150 of 399 Now the script is at step 151 of 399 Now the script is at step 152 of 399 Now the script is at step 153 of 399 Now the script is at step 154 of 399 Now the script is at step 155 of 399 Now the script is at step 156 of 399 Now the script is at step 157 of 399 Now the script is at step 158 of 399 Now the script is at step 159 of 399 Now the script is at step 160 of 399 Now the script is at step 161 of 399 Now the script is at step 162 of 399 Now the script is at step 163 of 399 Now the script is at step 164 of 399 Now the script is at step 165 of 399 Now the script is at step 166 of 399 Now the script is at step 167 of 399 Now the script is at step 168 of 399 Now the script is at step 169 of 399 Now the script is at step 170 of 399 Now the script is at step 171 of 399 Now the script is at step 172 of 399 Now the script is at step 173 of 399 Now the script is at step 174 of 399 Now the script is at step 175 of 399 Now the script is at step 176 of 399 Now the script is at step 177 of 399 Now the script is at step 178 of 399 Now the script is at step 179 of 399 Now the script is at step 180 of 399 Now the script is at step 181 of 399 Now the script is at step 182 of 399 Now the script is at step 183 of 399 Now the script is at step 184 of 399 Now the script is at step 185 of 399 Now the script is at step 186 of 399 Now the script is at step 187 of 399 Now the script is at step 188 of 399 Now the script is at step 189 of 399 Now the script is at step 190 of 399 Now the script is at step 191 of 399 Now the script is at step 192 of 399 Now the script is at step 193 of 399 Now the script is at step 194 of 399 Now the script is at step 195 of 399 Now the script is at step 196 of 399 Now the script is at step 197 of 399 Now the script is at step 198 of 399 Now the script is at step 199 of 399 Now the script is at step 200 of 399 Now the script is at step 201 of 399 Now the script is at step 202 of 399 Now the script is at step 203 of 399 Now the script is at step 204 of 399 Now the script is at step 205 of 399 Now the script is at step 206 of 399 Now the script is at step 207 of 399 Now the script is at step 208 of 399 Now the script is at step 209 of 399 Now the script is at step 210 of 399 Now the script is at step 211 of 399 Now the script is at step 212 of 399 Now the script is at step 213 of 399 Now the script is at step 214 of 399 Now the script is at step 215 of 399 Now the script is at step 216 of 399 Now the script is at step 217 of 399 Now the script is at step 218 of 399 Now the script is at step 219 of 399 Now the script is at step 220 of 399 Now the script is at step 221 of 399 Now the script is at step 222 of 399 Now the script is at step 223 of 399 Now the script is at step 224 of 399 Now the script is at step 225 of 399 Now the script is at step 226 of 399 Now the script is at step 227 of 399 Now the script is at step 228 of 399 Now the script is at step 229 of 399 Now the script is at step 230 of 399 Now the script is at step 231 of 399 Now the script is at step 232 of 399 Now the script is at step 233 of 399 Now the script is at step 234 of 399 Now the script is at step 235 of 399 Now the script is at step 236 of 399 Now the script is at step 237 of 399 Now the script is at step 238 of 399 Now the script is at step 239 of 399 Now the script is at step 240 of 399 Now the script is at step 241 of 399 Now the script is at step 242 of 399 Now the script is at step 243 of 399 Now the script is at step 244 of 399 Now the script is at step 245 of 399 Now the script is at step 246 of 399 Now the script is at step 247 of 399 Now the script is at step 248 of 399 Now the script is at step 249 of 399 Now the script is at step 250 of 399 Now the script is at step 251 of 399 Now the script is at step 252 of 399 Now the script is at step 253 of 399 Now the script is at step 254 of 399 Now the script is at step 255 of 399 Now the script is at step 256 of 399 Now the script is at step 257 of 399 Now the script is at step 258 of 399 Now the script is at step 259 of 399 Now the script is at step 260 of 399 Now the script is at step 261 of 399 Now the script is at step 262 of 399 Now the script is at step 263 of 399 Now the script is at step 264 of 399 Now the script is at step 265 of 399 Now the script is at step 266 of 399 Now the script is at step 267 of 399 Now the script is at step 268 of 399 Now the script is at step 269 of 399 Now the script is at step 270 of 399 Now the script is at step 271 of 399 Now the script is at step 272 of 399 Now the script is at step 273 of 399 Now the script is at step 274 of 399 Now the script is at step 275 of 399 Now the script is at step 276 of 399 Now the script is at step 277 of 399 Now the script is at step 278 of 399 Now the script is at step 279 of 399 Now the script is at step 280 of 399 Now the script is at step 281 of 399 Now the script is at step 282 of 399 Now the script is at step 283 of 399 Now the script is at step 284 of 399 Now the script is at step 285 of 399 Now the script is at step 286 of 399 Now the script is at step 287 of 399 Now the script is at step 288 of 399 Now the script is at step 289 of 399 Now the script is at step 290 of 399 Now the script is at step 291 of 399 Now the script is at step 292 of 399 Now the script is at step 293 of 399 Now the script is at step 294 of 399 Now the script is at step 295 of 399 Now the script is at step 296 of 399 Now the script is at step 297 of 399 Now the script is at step 298 of 399 Now the script is at step 299 of 399 Now the script is at step 300 of 399 Now the script is at step 301 of 399 Now the script is at step 302 of 399 Now the script is at step 303 of 399 Now the script is at step 304 of 399 Now the script is at step 305 of 399 Now the script is at step 306 of 399 Now the script is at step 307 of 399 Now the script is at step 308 of 399 Now the script is at step 309 of 399 Now the script is at step 310 of 399 Now the script is at step 311 of 399 Now the script is at step 312 of 399 Now the script is at step 313 of 399 Now the script is at step 314 of 399 Now the script is at step 315 of 399 Now the script is at step 316 of 399 Now the script is at step 317 of 399 Now the script is at step 318 of 399 Now the script is at step 319 of 399 Now the script is at step 320 of 399 Now the script is at step 321 of 399 Now the script is at step 322 of 399 Now the script is at step 323 of 399 Now the script is at step 324 of 399 Now the script is at step 325 of 399 Now the script is at step 326 of 399 Now the script is at step 327 of 399 Now the script is at step 328 of 399 Now the script is at step 329 of 399 Now the script is at step 330 of 399 Now the script is at step 331 of 399 Now the script is at step 332 of 399 Now the script is at step 333 of 399 Now the script is at step 334 of 399 Now the script is at step 335 of 399 Now the script is at step 336 of 399 Now the script is at step 337 of 399 Now the script is at step 338 of 399 Now the script is at step 339 of 399 Now the script is at step 340 of 399 Now the script is at step 341 of 399 Now the script is at step 342 of 399 Now the script is at step 343 of 399 Now the script is at step 344 of 399 Now the script is at step 345 of 399 Now the script is at step 346 of 399 Now the script is at step 347 of 399 Now the script is at step 348 of 399 Now the script is at step 349 of 399 Now the script is at step 350 of 399 Now the script is at step 351 of 399 Now the script is at step 352 of 399 Now the script is at step 353 of 399 Now the script is at step 354 of 399 Now the script is at step 355 of 399 Now the script is at step 356 of 399 Now the script is at step 357 of 399 Now the script is at step 358 of 399 Now the script is at step 359 of 399 Now the script is at step 360 of 399 Now the script is at step 361 of 399 Now the script is at step 362 of 399 Now the script is at step 363 of 399 Now the script is at step 364 of 399 Now the script is at step 365 of 399 Now the script is at step 366 of 399 Now the script is at step 367 of 399 Now the script is at step 368 of 399 Now the script is at step 369 of 399 Now the script is at step 370 of 399 Now the script is at step 371 of 399 Now the script is at step 372 of 399 Now the script is at step 373 of 399 Now the script is at step 374 of 399 Now the script is at step 375 of 399 Now the script is at step 376 of 399 Now the script is at step 377 of 399 Now the script is at step 378 of 399 Now the script is at step 379 of 399 Now the script is at step 380 of 399 Now the script is at step 381 of 399 Now the script is at step 382 of 399 Now the script is at step 383 of 399 Now the script is at step 384 of 399 Now the script is at step 385 of 399 Now the script is at step 386 of 399 Now the script is at step 387 of 399 Now the script is at step 388 of 399 Now the script is at step 389 of 399 Now the script is at step 390 of 399 Now the script is at step 391 of 399 Now the script is at step 392 of 399 Now the script is at step 393 of 399 Now the script is at step 394 of 399 Now the script is at step 395 of 399 Now the script is at step 396 of 399 Now the script is at step 397 of 399 Now the script is at step 398 of 399 Now the script is at step 399 of 399 Finished
! ffmpeg -hide_banner -i test/400.mp3 -lavfi showspectrumpic=s=1000x400:mode=separate:legend=disabled test/meowing-400times-spectrogram.png -y
Input #0, mp3, from 'test/400.mp3': Metadata: encoder : Lavf58.20.100 Duration: 00:00:10.21, start: 0.025057, bitrate: 32 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, fltp, 32 kb/s Metadata: encoder : Lavc58.35 Stream mapping: Stream #0:0 (mp3float) -> showspectrumpic showspectrumpic -> Stream #0:0 (png) Press [q] to stop, [?] for help Output #0, image2, to 'test/meowing-400times-spectrogram.png': Metadata: encoder : Lavf58.20.100 Stream #0:0: Video: png, rgb24, 1282x528 [SAR 1:1 DAR 641:264], q=2-31, 200 kb/s, 86.13 fps, 86.13 tbn, 86.13 tbc Metadata: encoder : Lavc58.35.100 png frame= 1 fps=0.0 q=-0.0 Lsize=N/A time=00:00:00.01 bitrate=N/A speed=0.026x video:196kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
from IPython.display import Image
Image('test/meowing-400times-spectrogram.png')
from IPython.display import Audio
Audio('test/400.mp3', autoplay=True)
From nowadays perspective mp3 could be considered as old and outdated. A current state of the art compression is called opus!