I want to use this number so that my slider can work for videos of any length.
Note: this question is basically a duplicate of: http://lovelace.augustana.edu/q2a/index.php/126/how-to-use-the-slider-to-change-frames (although your question title is more accurate).
You can use vidCap.get(Videoio.CV_CAP_PROP_FRAME_COUNT);