Search code examples
wowzamotion-detection

Motion Detection in Wowza Media System


How to detect motion and movement in Wowza? Is there any module that is present in Wowza? If it is present, then please help to find out that module and give me the url or any documentation for that.

If it is not present, then please help to find out that how to create that module in wowza media system by providing any link, url, documentation for that.


Solution

  • The Wowza Transcoder API offers an onGrabFrame() callback:

    public void onGrabFrame(TranscoderNativeVideoFrame videoFrame) {            
         BufferedImage image = TranscoderStreamUtils.nativeImageToBufferedImage(videoFrame);
    
         if (image != null)
            {
                 // do something with frame data
            }
    }
    

    Once you grab the frame data you can feed it to an algorithm that detects scene changes (eg: using the Sum of absolute differences).

    There's also an open-source computer vision project called OpenCV which supports Java and has many features.