Just sharing this project I found, it's not mine.
Fun project I made in my downtime to sharpen my programming skills and work with new libraries. Using opencv, ffmpeg, and lodepng I created a file to video encoder and video to file decoder. This project was finished within about a week from conceptualization to successfully converting between the two.
This is just your personal issue, doesn't apply to others. Although the process you're doing is too excessive with the sorting and such.