Converting numpy array to video frames using ffmpeg-python
writing_process = ffmpeg \
.input('pipe:', format='rawvideo', pix_fmt='rgb24', s='{}x{}'.format(WIDTH, HEIGHT)) \
.output(OUT_FILENAME, pix_fmt='yuv420p') \
.overwrite_output() \
.run_async(pipe_stdin=True)
writing_process.stdin.write(frame.tobytes())