record: Refactor thread distribution
Have the producer thread only render into an image that we pass to the writer thread that does both the adoption of the correct format, encoding and ultimately write into disk.
It seems to produce better results than doing the encoding on the collection thread.
Draft because it can take a lot of memory space
Edited by Aleix Pol Gonzalez