[solved] detect dead video source

ethaniel

Member
I have a USB HDMI Capture card which gets it's stream from a GoPro camera.
Sometimes the GoPro overheats and turns itself off. That's when I get some static garbage on the video feed.

I need a script that would detect that the video source image is static (hasn't changed within the last 30 seconds or so) and run a specific .bat file.

That's it :) Anyone up for this?
$100 bounty.
 
Last edited:

ethaniel

Member
I managed to do this with the obs websockets plugin. I enabled replay buffer in the obs interface and wrote my own script which runs every 10 seconds:

a. Uses the websockets API to trigger the replay buffer save to file.
b. Extracts the B-frames from the saved file with ffmpeg.
c. Compares the frames to each other with imagemagick.

If the frames are almost identical, then my script restarts the GoPro through a USB relay.

Replay buffer is awesome, because it's very lightweight and allows me to extract the last 5-10 seconds of the video stream only. It's perfect for analyzing the health of the stream.
 
Top