Ask Your Question
0

Grab frames from online video file

asked 2016-11-08 15:35:11 -0600

vidark gravatar image

Hi!

Let's assume I have link "xyz". If opened in my browser, that link leads to a video file being played back: Basically, an existing video file is being streamed. I can, of course, also jump around in the video without having to download it completely.

I now need to "emulate" such behaviour in a Java program of mine. What I want to do:

  • Open the stream from link "xyz".
  • Be able to get metadata such as video length and resolution and FPS
  • Grab and decode frame x.

I thought that OpenCV looked nice, but haven't managed to do so yet. Simply typing opening a VideoCapture class with the link does not seem to work.

Help appreciated, thank you very much!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2016-11-10 00:23:38 -0600

berak gravatar image

using opencv for this might not work at all

usually, embedded videos on web pages do not point to a stream directly, but load some player software, which does the job under the hood. if you want to jump around there, it has to preload the resp. parts (and some in front of it) for decoding (you cannot just grab a single frame).

as long as ffmpeg can't do it, VideoCapture can't do it either.

opencv, being a computer-vision library, will also strip any audio.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-11-08 15:35:11 -0600

Seen: 242 times

Last updated: Nov 10 '16