TV Ad blocker using OBS Studio and OpenCV (simple logo detection using template matching)
- Python (3.7-3.10)
- OBS Studio.
- OBS Websocket plugin.
- obs-ndi plugin. Be sure to also download the NDI runtime.
- Install the required packages with:
pip install -r requirements.txt
- Run OBS Studio and create two scenes:
- tv: This is the scene that will be shown when there is no ad
- adbreak: This is the scene that will be shown when an ad is detected. Put anything you want here, a cute video, or a message saying "Ad break".
- Add the NDI filter to the tv scene.
- Install the OBS Websocket plugin and configure it to use the default port (4444), and enable authentication (default script password is "secret"). Restart OBS and start the websocket server.
- Replace
logo.png
with the logo of the channel you want to block ads from. You can use any image format supported by OpenCV. - Set the config file (
config.ini
) to your liking. - Run the script:
python main.py