avfoundation video capture with preview and histogram view