Detect changes in a video
I have a friend whose job is to watch a video and take note of times when something happens on the screen. Most of the time it's just a blue/white screen, so there is very little change. It is an outside video, so the color changes as the day goes by. It's also a snowy area, so there is little differentiation between sky and ground.
I'm wondering if there's a way to easily find when things are happening on the screen without sitting and watching it completely. I have thought of two methods for doing this.
The video is encoded as H.264, which uses delta compression. Is there a tool that graphs the amount of data used at a particular frame? The spikes in bitrate would indicate activity on the video. This would help find every point of activity in a quick scan.
Second, it would be possible to use a script program such as AutoIt to view the frame and 开发者_高级运维get an average color, then sound an alert when a certain number of pixels fall outside a "tolerance level" near the average color. The video would still need to be played beginning to end, but it wouldn't be necessary to pay attention to the thing.
Is there such a tool available for #1? If necessary, I can code something for #2, I just thought I'd see what resources are available.
Check PixelGetColor (for a single pixel) or PixelSearch (for scanning a rectangle) in AutoIt. You could save a pixels color using PixelGetColor and check the same position every second. If the new value is different from the old one something happened. To increase the chances of detecting changes you should of course check multiple pixels.
If you know the color you're searching for use PixelSearch. PixelSearch is able to scan a whole rectangle. It even has a "shade-variation" parameter where you can specify how much tolerance you want to have when searching for a specific color.
You can use autoIt to sample a number of pixels of the screen and return the color. Then track if it changes dramatically. Perhaps in a person sized box. It has full support for capturing from the screen and decoding the screen elements. Email or SMS alerts could then be sent.
精彩评论