Created by: inrustwetrust
This enables two-pass encoding with codecs other than libx264. The existing "stats" option only works specifically for libx264, which writes/reads stats from an external file itself. For all other codecs, the "stats_in"/"stats_out" properties must be used.
The ffmpeg binary contains custom logic for non-libx264 encodes to write/read the contents of these properties to/from local file. When using PyAV though, one can simply read the "stats_out" field into memory after the first pass and then use it to set the "stats_in" property before starting the second pass, so no external file is needed.
(I believe this should also fix issue #277 (closed).)