Ask Your Question

While playing a video in browser, how to extract an image with 10 seconds delay

asked 2017-12-16 18:46:03 -0600

Guna gravatar image

I need to validate a closed captioning in the video. Part of this work, first I need to extract an image from videos. Please let me how to proceed with this.

edit retag flag offensive close merge delete


you probably won't have much luck, doing this from within a webbrowser.

try to extract the video url from the html, and use opencv's VideoCapture.

berak gravatar imageberak ( 2017-12-17 12:20:10 -0600 )edit

I can able to extract the video URL from the browser. could please let me know how to proceed with opencv's VideoCapture??

Guna gravatar imageGuna ( 2017-12-17 16:02:11 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2017-12-18 02:14:35 -0600

berak gravatar image

so, using java, try something like this:

String video_url = "???";
VideoCapture cap = new VideoCapture(video_url);
long t0 = Core.getTickCount();

while (cap.isOpened()) {
    Mat im = new Mat();
    // read continuously, else you get stale images
    if (! 
         break;  // end of video reached

    long t1 = Core.getTickCount();
    double seconds = (double)(t1-t0) / Core.getTickFrequency();
    if (seconds >= 10) {
        t0 = t1; // reset timer
        // process your frame for OCR
edit flag offensive delete link more


Thanks! Let me try with this.

Guna gravatar imageGuna ( 2017-12-19 10:17:13 -0600 )edit

I have tried with above example, but facing an issue in cap.isOpened - It always returns false. Is their anything else i have to do on this?? - Its related web camera ?? @berak

Guna gravatar imageGuna ( 2017-12-19 14:47:02 -0600 )edit

Question Tools

1 follower


Asked: 2017-12-16 18:46:03 -0600

Seen: 150 times

Last updated: Dec 18 '17