How to know codec from stream captured by opencv

I am trying to figure that out too.