fixed seg faults, there's a new limitation that the final resolution of the video must be known when the encoder starts, but at least things work now.