dpinney / omf

The Open Modeling Framework for smart grid cost-benefit analysis.
https://omf.coop
GNU General Public License v2.0
112 stars 60 forks source link

Switch solarEngineering output from PNG to JPEG (nah, MP4) #331

Closed dpinney closed 9 years ago

dpinney commented 9 years ago

This should bring down the output size significantly.

Really we should test all the matplotlib output options.

dpinney commented 9 years ago

If we do JPEGs, it’s 6.2 MB/24 simulation hours.
If we do PNGs it’s 2.8 MB/24 simulation hours. So actually, PNG is better.

dpinney commented 9 years ago

ffmpeg -framerate 10 -i volts%03d.png -s:v 1000x1000 -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p voltsMovie.mp4

mp4 brings it down to 56kB/24 simulation hours. So an 8760 simulation would take 20 MB. Acceptable.

dpinney commented 9 years ago

Going to have to stream the data. See http://stackoverflow.com/questions/13294919/can-you-stream-images-to-ffmpeg-to-construct-a-video-instead-of-saving-them-t

dpinney commented 9 years ago

We can just go directly to a movie in matplotlib see 3dc35637ccaf27264ea4bac70bd4c56963dadab6.

dpinney commented 9 years ago

Done with a movie in ef270635d2c33db78f3146bb602dd41db5e012c5