How to resize video with CUDA and C++

I’m new one with CUDA. Could you help me guys with video resizing problem? How can I resize video frames from 1920x1024 to 860x600? How can I grab frames from video with CUDA API? Also video (mpeg2, mpeg1, h264 formats) will be received from sockets but now video files are good example for me if you can share some code with me. Thanks