Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
Photosensitivity Filter?
#1
Are there any plugins or filters I can enable to avoid bright flashes from appearing in videos being played by Kodi? My girlfriend is photosensitive / has epilepsy. We're usually pretty mindful of what movies/shows are likely to have flashes in them, but sometimes it can occur suddenly, which can lead to a seizure.

ffmpeg has recently had the wonderful filter, "photosensitivity", added back in 2019 by the programmer CyberShadow. I've been using it with good success to ease movies that have severe flashing. It analyzes the difference in brightness between multiple frames and blends them together if the brightness delta exceeds a set value. It only blends frames in a scene for the duration of the flashing.

The user can adjust how sensitive the filter is to flashes, including these options:
  1. Frames: Set how many frames to use when filtering.
  2. Threshold: Set detection threshold factor. Default is 1. Lower is stricter.
  3. Skip: Set how many pixels to skip when sampling frames. Default is 1. Allowed range is from 1 to 1024.

Here's an example of how to convert this movie using ffmpeg via command line:

cmd:
ffmpeg -i "M:\Movies\Blade II (2002).mp4" -vf photosensitivity=30:0.6:20 "M:\Movies\Filtered\Blade II (2004).mp4"
(this example applies an aggressive flashing filter, since Blade 2 is particularly bad when it comes to bright flashes)

I know that Kodi uses ffmpeg as a video player. Is there any way to leverage Kodi to use ffmpeg with this ffmpeg filter turned on?
Reply
#2
(2021-03-30, 09:26)GoTeamScotch Wrote: Are there any plugins or filters I can enable to avoid bright flashes from appearing in videos being played by Kodi? My girlfriend is photosensitive / has epilepsy. We're usually pretty mindful of what movies/shows are likely to have flashes in them, but sometimes it can occur suddenly, which can lead to a seizure.

ffmpeg has recently had the wonderful filter, "photosensitivity", added back in 2019 by the programmer CyberShadow. I've been using it with good success to ease movies that have severe flashing. It analyzes the difference in brightness between multiple frames and blends them together if the brightness delta exceeds a set value. It only blends frames in a scene for the duration of the flashing.

The user can adjust how sensitive the filter is to flashes, including these options:
  1. Frames: Set how many frames to use when filtering.
  2. Threshold: Set detection threshold factor. Default is 1. Lower is stricter.
  3. Skip: Set how many pixels to skip when sampling frames. Default is 1. Allowed range is from 1 to 1024.

Here's an example of how to convert this movie using ffmpeg via command line:

cmd:
ffmpeg -i "M:\Movies\Blade II (2002).mp4" -vf photosensitivity=30:0.6:20 "M:\Movies\Filtered\Blade II (2004).mp4"
(this example applies an aggressive flashing filter, since Blade 2 is particularly bad when it comes to bright flashes)

I know that Kodi uses ffmpeg as a video player. Is there any way to leverage Kodi to use ffmpeg with this ffmpeg filter turned on?
Not tested, but I found some information that "may" work:

https://kodi.wiki/view/Advancedsettings.xml#video

See section:
----------------------
<ppffmpegpostprocessing>ha:128:7,va,dr</ppffmpegpostprocessing>
Override the post processing options passed to libpostproc when 'Video post-processing' is activated in GUI Videos-Settings-Playback.
-----------------------

And a reddit link that talks a bit more about this setting and how to use it:

https://www.reddit.com/r/ffmpeg/comments...anscoding/

Hope this helps!
Reply

Logout Mark Read Team Forum Stats Members Help
Photosensitivity Filter?0