C++
//Loading video
cv::VideoCapture video("filename");
//width
int W = video.get(CV_CAP_PROP_FRAME_WIDTH);
//height
int H = video.get(CV_CAP_PROP_FRAME_HEIGHT);
//Total number of frames
int count = video.get(CV_CAP_PROP_FRAME_COUNT);
// fps
double fps = video.get(CV_CAP_PROP_FPS);
Python
#Loading video
video = cv2.VideoCapture("filename")
#width
W = video.get(cv2.CAP_PROP_FRAME_WIDTH)
#height
H = video.get(cv2.CAP_PROP_FRAME_HEIGHT)
#Total number of frames
count = video.get(cv2.CAP_PROP_FRAME_COUNT)
# fps
fps = video.get(cv2.CAP_PROP_FPS)