making progress. No longer do we get a crash but the resulting mkv is invalid. Suspect its the encoding stage from the image buffer