I’m getting tired of the extremely loud ads on that don’t seem to be subject to the old TV broadcasting laws that prevent them from being blasted 10db louder than the actual content. Wondering if there’s stuff out there that would let me take the hdmi stream from my Apple TV or other streaming source, and do ad detection like the olden days so that it could just mute or do volume leveling at least.

I suppose something very basic might just be an hdmi splitter to a rpi with hdmi that’ll detect ads via the black screens or “this ad will over over in 30s” overlays, then send a mute signal over CEC or something to a receiver or TV….but would be nice if it could modify the hdmi signal directly.

Thoughts on what to search for to do something like this?

  • refalo@programming.dev
    link
    fedilink
    arrow-up
    14
    ·
    7 months ago

    take the hdmi stream from my Apple TV

    I think there’s two big obstacles here: HDCP and processing power. Most legal devices you can buy will not support simply handing over HDCP-unecrypted raw frames for you to mess with as that defeats the whole point of HDCP.

    But even if you get past that, you’re going to need at least a very high speed FPGA or ASIC, optionally also connected to a reasonably high-end PC, in order to be able to modify the stream in real-time and send it back out… certainly no current rpi can do this in even 1080p in real-time, and many devices now are going to 4k and beyond.

    • umami_wasabi
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      7 months ago

      As OP said volume leveling is acceptable, something like this will do.

      Modifying HDMI video signal is simply impossible due to DMCA and bla bla bla. But not all hope is lost though. You can overlay opaque video on top of another encrypted stream via this little box. This is an old project per se and I have no idea if still available, but with some dirty work you might able to detect the increase of volume or match of an algo or something with a total black screen overlay on top.

      • refalo@programming.dev
        link
        fedilink
        arrow-up
        5
        ·
        edit-2
        7 months ago

        Yes those are FPGA/ASIC based solutions like I mentioned. That should work for 1080p at least, but getting to 4k is still prohibitively expensive.

        impossible

        My understanding is the DMCA explicitly allows reverse engineering of encryption for interoperability purposes… the only problem is that would have to specifically be tested in court to know if the government would agree in this instance, and nobody wants to try it.

        • umami_wasabi
          link
          fedilink
          arrow-up
          1
          arrow-down
          1
          ·
          7 months ago

          Overlay isn’t transcoding. All it need is a muxer like MKVToolNix. I doubt it need much processing power.

            • umami_wasabi
              link
              fedilink
              arrow-up
              1
              arrow-down
              1
              ·
              7 months ago

              It doesn’t and I didn’t ever mentioned HDMI in my reply. Just doubt if overlaying another encrypted stream with a muxer ever need that much processing power to the point of “prohibitively expensive”.

              • refalo@programming.dev
                link
                fedilink
                arrow-up
                1
                arrow-down
                1
                ·
                7 months ago

                Encrypted streams also don’t have anything to do with a muxer, I really don’t understand what you’re trying to say. Muxers are for handling file formats, which is not being discussed at all, this is about raw video frame processing in hardware.

    • Decipher0771@lemmy.caOP
      link
      fedilink
      arrow-up
      4
      arrow-down
      1
      ·
      7 months ago

      Yeah I think hdcp and reprocessing would be most difficult. There are hdmi splitter devices like those used for coloured bias lighting that I think could be used….similarly I think the processing actually isn’t unsolvable, it’s not much different than object detection from a live camera stream. I agree re-encoding the stream would be too hardware intensive for anything “cheap” like a pi, hence the secondary device control alternative initially, but analyzing the stream should be possible.

    • ReversalHatchery@beehaw.org
      link
      fedilink
      English
      arrow-up
      1
      arrow-down
      1
      ·
      7 months ago

      in order to be able to modify the stream in real-time and send it back out…

      It doesn’t need to modify. What it needs is detection, and then either blacking it out, or replacing with a simple progesssbar-like screen on a black background.

      • refalo@programming.dev
        link
        fedilink
        arrow-up
        1
        ·
        7 months ago

        I consider “blacking it out” and “replacing” to be equivalent to “modify” in this case as you still need basically the same amount of processing power to do any of it.