Whenever the commercials come on while watching TV, I usually switch the channel over until they finish. The problem is, I have no way of knowing when the commercials have finished, and find myself changing back to the original channel either too soon, or too late.
As my TV is Android based, I decided to see what I could do.
Most channels contain a logo on-screen, which is removed during commercials. So basically, I scan that portion of the screen to get the pixels, and can determine if the logo is there.
When the logo disappears, I hide and mute the channel, then start another video instance with a chosen video.
During playback of the backup video, the original channel continues to be scanned, looking for the logo to return.
When the logo returns, the backup video is stopped and the original channel is returned.
It works really well. Work in progress!