I tried to read live video stream with OpenCV as following,
cv::VideoCapture capture(video_url);
It can read from live video stream and works well. However, when a fake video_url was sent to it, such as an url of a txt file, for example,
video_url = "http://127.0.0.10:8090/result.txt"
it can also decode data from this fake url. But I want it to return error information when the video_url is fake.
How can I make it to be able to discriminate whether an url is truly of a live video stream, or a txt web file?