-
Turning the volume down
01/04/2023 at 03:27 • 0 commentsI haven't resumed work on this project, but I found 2 other related projects which try to lower the volume when ads are playing :
This one requires an expensive Sonos speaker system and seems to rely on meta data to detect ads.
This one is much more DIY and relies on the ads being louder than the TV show you're watching. Not sure how reliable this is or if it is still working as the project is 10 years old!
Video ad blocking may become a topic a gain as Netflix seems to offer a plan with ads : https://help.netflix.com/en/node/126831
Not sure if it reached Europe yet.
-
Projects for 2019 - Smartzap
01/10/2019 at 22:40 • 0 commentsHello Followers and project members!
As a bright new year is starting, I thought I would write a log for each of my project.
I don't watch much "live" TV nowadays so I lack some motivation to develop further this project but I will probably improve/add a feature this year to leave this project in a more finished state.
Meanwhile, if you are interested in adblocking you should definitively check what this fellow french guy has done for radio : https://www.adblockradio.com/blog/2018/11/15/designing-audio-ad-block-radio-podcast/All the ideas I was only considering(and even more!), he has actually implemented them. I think that the method he uses for radio could easily be used for TV, the audio of TV ads can be fingerprinted the same way it is done for audio only radio ads, so I will probably test his project with TV streams.
I'll keep you updated, meanwhile I wish you a happy new year and a happy hacking!
-
HDMI PIP switch needs some reverse engineering
05/30/2016 at 08:57 • 0 commentsI have a HDMI switch with a PIP feature that would be very interesting for my project. Unfortunately it seems a bit more complicated to get it working with a single button. I could use an IR blaster to control the switch (it will probably end this way), but as there is a big nice unused 4 pin connector on the PCB, I would like to find out what protocol it is and see if I can control the switch this way.
My guess is either SPI or I²C. I will investigate with my BusPirate as soon as I have some time
-
Modular code
03/26/2016 at 19:21 • 0 commentsI just pushed a more modular version of the code on GitHub.
This paves the way for support of different HDMI switches and video players.
I don't know if anybody else has tried to reproduce this project but it should be easier now.
-
Kodi support
02/28/2016 at 09:23 • 0 commentsI just managed to get Tecedi-Smartzap working with Kodi.
As a proper integration with Kodi will take some time, for now, I'm just giving basic information in this work log, I will provide the full working code and instructions later.
Linux distribution
I first tried OpenElec because I already knew this distribution, but it is not very hacker friendly, the maintainers chose to remove apt-get from it!
So I switched to OSMC instead. It is based on Raspbian but on Jessie, not on wheezy.
I couldn't find the python-rpi.gpio package so I had to install several packages to be able to install python-rpi.gpio with pip.
This should be enough to install it :
apt-get install gcc make python-dev python-pip pip install RPi.GPIO
Kodi
I added the following script in /usr/local/bin/kodi-play-clip
#! /bin/sh # we play the video clip with a JSON request CMD="/usr/bin/curl --header 'Content-Type: application/json' --data-binary '{ \"id\": 1, \"jsonrpc\": \"2.0\", \"method\": \"Player.Open\", \"params\": {\"item\": { \"file\": \""$1"\" } } }' 'http://127.0.0.1/jsonrpc'" sh -c "$CMD" echo # we make a request to get the video clip length LENGTH=$(/usr/bin/curl --header 'Content-Type: application/json' --data-binary '{"jsonrpc":"2.0","method":"Player.GetProperties","id":1,"params":{"playerid":1,"properties":["playlistid","totaltime"]}}' 'http://127.0.0.1/jsonrpc') HOURS=$(echo $LENGTH | sed -r 's/.*hours..([0-9]*).*/\1/g') MINUTES=$(echo $LENGTH | sed -r 's/.*minutes..([0-9]*).*/\1/g') SECONDS=$(echo $LENGTH | sed -r 's/.*seconds..([0-9]*).*/\1/g') # and we sleep for this amount of time so the script will exit only when the video is finished TOTAL_SEC=$(( HOURS*3600 + MINUTES*60 + SECONDS )) echo "sleeping for $TOTAL_SEC seconds" sleep $TOTAL_SEC
So in switchdemo.py you just have to replace :VIDEO_PLAYER = '/usr/bin/omxplayer'
with :VIDEO_PLAYER = '/usr/local/bin/kodi-play-clip'
This is still very much a hack, there is no error checking. The final implementation will use Kodi Python API or the JSON one with PyCurl.
-
Using the Pi power
02/25/2016 at 16:12 • 0 commentsThis not on my short term TODO list, but I think it could be interesting to use the Rapberry Pi power to identify the ads with audio fingerprinting using this lib
Audio fingerprinting
The concept behind audio fingerprinting is that the lib analyze a sound/song and extract some unique characteristics about it. Later it can quickly recognize it. The most famous example is Shazam.
So by fingerprinting the TV jingle announcing ads, you could detect ads automatically and switch to your video clip instead. And since each channel has its own TV jingle you can know which channel the user is watching and the probable length of the ads.
Audio source
And how would I get the TV audio you ask? Well, luckily some TV have a TV audio out plug in case you want to get your TV audio on an amp instead of the TV speakers. If you are lucky, your TV has this audio out and it's analogic. In this case you just have to get a 5€ USB audio card and you can capture audio with your Pi.
If your TV doesn't have such an output, you may try a HDMI splitter with audio like this one.
Well, don't expect to find the code for this feature in the repo this week, but it's definitively something I'll try.
-
Working python demo script
02/21/2016 at 07:36 • 0 commentsHere is a proof of concept python script
First, you need to have the python-rpi.gpio and omxplayer packages installed
sudo apt-get install python-rpi.gpio omxplayer
- check that your configuration match the script settings and edit accordingly,
select a short video clip (like this one) and edit the lineVIDEO_FILE = '/home/pi/video/better-than-tv-ads.mp4'
- start the script :
sudo ./switchdemo.py
- this should select the STB output
- press button 1 on your switch remote
- your video clip should start playing
- at the end of your video clip, the script will switch back to your STB input
The next step should be to integrate this script with Kodi to have a nicer user experience.
- check that your configuration match the script settings and edit accordingly,
-
IRBlaster control attempt
02/17/2016 at 07:51 • 0 commentsAnother way to control the HDMI switch would be to have an IR transmitter LED sending the same signals as the TV remote and switching the to channel 1 or 2.
IR blaster won't work on my Raspbian...
I followed several tutorials like this one and that other one but it failed every time.
The I found this post explaining there is a bug on some Raspbian kernels. My Raspberry run a 3.18.7 kernel and it is affected. I tried to boot on an OpenElec with a 3.17.16 kernel, and then my test code was working.
So I'm postponing the IR blaster part since apparently there is also a performance problem when using this method