First working version - segfaults a lot but does update in real time. Next version will try and do a simple update of frame_count using dimensions and not variables to see if that helps