0

I've programmed server side and client side to receive a video stream from a webcam in java .

This is What I'm using in the client side :

 public void update (ReceiveStreamEvent event) {

              if (event instanceof NewReceiveStreamEvent) {
                  ecritureAffichage("Reception d'un flux");
                //new flux received 
                  ReceiveStream rs = event.getReceiveStream();

                  try {
                      Player p = Manager.createRealizedPlayer(rs.getDataSource());

                      //if the payer has a visual component , then create new jframe 

I'm getting the stream from the server perfectly , what I need now is to do some motion detection on the client side , I'm thinking to use OpenCv but I don't know how to make it work ! all I know is that OpenCv can open a video file or use the webcam directly , what I don't know is can it take a video stream as an input ?

could it be done ? or I'm just going in the wrong way. Please give me some ideas , Thanks

1 Answers1

0

OpenCV does allow you to open a video stream. You can do it following the advice on this link

Essentially, all the functionalities required for video manipulation is integrated in the VideoCapture C++ class. This on itself builds on the FFmpeg open source library. This is a basic dependency of OpenCV so you shouldn’t need to worry about this. A video is composed of a succession of images, we refer to these in the literature as frames. In case of a video file there is a frame rate specifying just how long is between two frames. While for the video cameras usually there is a limit of just how many frames they can digitalize per second, this property is less important as at any time the camera sees the current snapshot of the world.

GPPK
  • 6,546
  • 4
  • 32
  • 57
  • What they mean by this is using the camera directly or opening a video file but what I have is a stream coming from a server to a client , wich means that the camera is on the server side. I hope you got my meaning , Thanks :) – abed benamar Mar 25 '15 at 21:10
  • Please , is there anyone who could help me ?? – abed benamar Mar 26 '15 at 09:05