Use ffmpeglib to connect to the stream.
These functions may be useful. But take a look in the docs
av_open_input_stream(...);
av_find_stream_info(...);
avcodec_find_decoder(...);
avcodec_open(...);
avcodec_alloc_frame(...);
You would need a little algo to get a complete frame,
which is available here
http://www.dranger.com/ffmpeg/tutorial01.html
Once you get a frame you could copy the video data (for each plane if needed) into a
IplImage which is an OpenCV image object.
You can create an IplImage using something like...
IplImage *p_gray_image = cvCreateImage(size, IPL_DEPTH_8U, 1);
Once you have an IplImage, you could perform all sorts of image operations available in the OpenCV lib