subins2000 / adblock-tv

An AdBlocker for TV

Repository from Github https://github.comsubins2000/adblock-tvRepository from Github https://github.comsubins2000/adblock-tv

Adblock TV

An AdBlocker (Ad-Muter) for TV. When ads appear in between programs, the TV audio will be muted and when program comes back on, TV is unmuted. Completely offline and runs on a Raspberry Pi.

Video Demo + Pictures.

Description

A simple, cheap, extension to your Raspberry Pi for blocking/muting ads on TV.

When ads start to appear after a program, ADBTV will recognize the advertisement audio and will send an Infrared signal to the TV asking it to mute. When the ads end, TV will be unmuted and audio will continue.

Audio from set-top-box (STB) is routed to the Raspberry Pi and TV is asked to mute. So, audio will be continuously received in the Raspberry Pi. And when ads end, the TV will unmute again

Setup

Hardware

  • Raspberry Pi
  • Infrared Emitter
  • USB Sound Card since Raspberry Pi doesn't support audio input
  • Your set-top-box (STB) probably support AV output, then connect a 3.5mm-RCA-Female cable to it and then connect a AUX-Male-3.5mm cable to the USB sound card
  • Test if audio from STB reaches Raspberry Pi by using pavucontrol or Audacity or other voice recording softwares

Software

  • Clone into your Raspberry Pi
  • pipenv install
  • Setup postgres database, copy .env.example to .env and edit config

Setup Infrared

Running

  • Run the adblocker by running adbtv.py
  • ADBTV web interface runs on port 8100

Scripts :

  • record-ad.py - For recording ads
  • scan.py - Scan for ads, no blocking
  • scan-block.py - Scan for ads, and block (mute) them, but no unmute
  • scan-block-unblock.py - Scan, block ads and unblock when no ad is detected
  • adbtv.py - Run the web interface and blocker. The main script

Tips

  • Keep the audio level coming into rasppi to a standard, peak should reach -3dB only. Use pavucontrol for this
  • From experience, audio recognition has correlation with the volume of the audio

TODO

  • Instead of mute, decrease/increase volume. Helps much in false positives
  • Improve audio recognition. Volume has a significant effect on detection

About

An AdBlocker for TV

License:GNU Affero General Public License v3.0


Languages

Language:Python 48.2%Language:JavaScript 26.5%Language:Svelte 20.7%Language:SCSS 2.3%Language:HTML 1.8%Language:Shell 0.6%