Speed up audio thumbnail generation by 2.5X in only 5 LOC !!
Sorry, I couldn't resist the clickbait title
I just opened an old project I worked on in the pre-25.04 era. It started regenerating all audio thumbs. Unfortunately the data for this project lies on my NAS accessed via slow Wifi.
The time it took to process a video was suspiciously in the range of what I expect when copying files from my NAS to my local machine. As the new thumbnail generation is using avutil I looked up what ffmpeg -vn
does as that is pretty fast even on my slow network. According to the docs it sets a discard flag on the video streams. So the change here in this MR does the same. Currently we process all data but then skip if its not data from the audio stream we're interested in.
Didn't test it much but doesn't look like a dangerous change to me. Please test if you can reproduce it.
Before:
Audio levels generation took 445.213 s ( 605.827 frames/s)
After:
Audio levels generation took 180.067 s ( 1497.9 frames/s)