-1

I'm planning to develop a simple solution that would able me to perform a very basic video stream analysis on the fly. I've never done anything like that before, hence the very general and open question. The main focus is on checking if the stream is going without problems like - freeze frames, black screens and if the audio is there. Sync is out of scope. I read about open libraries like OpenCV and Xuggler, but they seem more complex than for my needs. FFmpeg is able to detect black screens, but not on the fly.

Is there any other open lib I could look into? Could you advise me anything? I'm thinking about using Java or Python. Or maybe both. Efficiency of the solution is out of scope, I'm focusing now only on freeze frames and black screens detection.

Any advise is welcome!

Best regards, Peter

jakkolwiek
  • 145
  • 1
  • 3
  • 15
  • with OpenCV you can detect freeze frames and black screens without a problem and in a couple of lines, although for the audio part you will need something different. OpenCV is available in python and java. – api55 Apr 08 '16 at 10:31
  • 1
    What do you mean by "FFmpeg is not able to detect black screens on the fly"? – aergistal Apr 08 '16 at 10:34

1 Answers1

1

You can analyze a live stream on-the-fly with ffmpeg. For example:

ffmpeg -i <input> -filter:v blackdetect=d=9 -filter:a silencedetect=d=9 -t 10 -f null /dev/null

checks if 9s out 10s of video are black or silent. Repeat.

In recent versions of FFmpeg you can use the freezedetect filter to detect frames that don't change.

If you need different metrics you can take two screen-shots at different times and compare them with imagemagick:

compare -metric <metric> <in1> <in2> <diff>
aergistal
  • 29,947
  • 5
  • 70
  • 92