News for hackers. Stuff that matters.
Re:Apple Detection of Flashing Lights by dagmx on Monday March 27, 2023 @05:31PM (#35332944)
This corresponds to new functionality in the OS updates today around dimming flashing lights

https://9to5mac.com/2023/03/27/apple-releases-tvos-16-4-with...

https://developer.apple.com/documentation/mediaaccessibility...

For epileptics like myself, this is a huge deal. It helps me deal with a lot of media that otherwise might cause me to suffer a seizure.

Re:Apple Detection of Flashing Lights by 3r3rni9 on Monday March 27, 2023 @05:55PM (#35333261)
Are there any comparable tools or filters you find useful now? I have an old epileptic cat on my couch, and I’m always worried subjecting her to my horrible old anime. I was just yesterday thinking a filter like this was probably out there, and if not, might be easy to make. Looking for VLC plugins, though, I don’t see anything
Re:Apple Detection of Flashing Lights by dagmx on Monday March 27, 2023 @06:00PM (#35333335)
To the best of my knowledge, there's nothing else that's realtime like this for end users?

There are other offline tests like the Harding test that are run by the content creators (and why you see the epilepsy warnings at the start of shows)

FWIW, I'm not sure if this actually would benefit cats. I'm not up to speed on feline perception, but I know dogs see at a different frame rate than humans so things that won't trigger us might trigger them differently

Re:Apple Detection of Flashing Lights by mgdlbp on Monday March 27, 2023 @09:46PM (#35334783)
VLC: Tools > Effects and Filters > Video Effects > Advanced > Anti-Flickering

VLC: Tools > Preferences > Show settings: All > Search: antiflicker

  mpv --vf=deflicker,scale=960x540,pixscope 'https://github.com/apple/VideoFlashingReduction/blob/main/VideoFlashingReduction_Mathematica/Resources/movie.mp4?raw=true'
(generate test video):

  ffplay -f lavfi -i "color=777777[x],color=cccccc,
    [x]framepack=frameseq,settb=AVTB,
    setpts=N/TB/${flickerrate:-12},framerate=${interpolated:-24},
    deflicker=size=5:mode=am,scale=640x480,pixscope"
antiflicker and deflicker are different implementations
Re:Apple Detection of Flashing Lights by mgdlbp on Wednesday March 29, 2023 @06:28PM (#35364754)
Doh! there's a better filter for this: photosensitivity. It detects local brightness changes that sum to 0, unlike deflicker and the Apple implementation (??).

drawgraph is a useful bodge to convert metadata to frames. This enables silly things like mimicking the Apple demo, including graphs.

  frames=5
  sensitivity=1.5
  dim_range=2
  dim_intercept=-0.4
  smoothing=10
  smoothtype=am
  persistence=0.9
  min_contrast=0.0
  min_brightness=0.0
  min_saturation=0.0
  
  ffplay -vf "split[original],  crop=640:360:0:0,
  split=5[i1][i2][i3][i4][i5];
  [i1]photosensitivity=$frames :$sensitivity,
    drawgraph='bg=black@0 :r=60 :s=1x1 :m1=lavfi.photosensitivity.factor
 :fg1=0x010101*round(0xff*clip(VAL*$dim_range+$dim_intercept,0,1))',
 split[sensedat],  deflicker=$smoothing :$smoothtype,
 negate,  lagfun=$persistence,  negate,  split[mit1][mit2];
      [mit1][i2]scale2ref[mask][i2];  [i2][mask]alphamerge[m];
      [mit2]signalstats[mitdat];
  [i3]eq=$min_contrast :$min_brightness :${min_saturation}[a];
    [a][m]overlay,  split[output1][output2];
  [sensedat]drawgraph=lavfi.photosensitivity.badness :0xffff0000
 :bg=white :r=60 :slide=scroll :size=512x256 :min=0 :max=7[bad];
    [bad][i5]scale2ref[badout][reuse];
      [badout]drawtext=fontcolor=2222dd:text='frame     %{metadata\:lavfi.photosensitivity.frame-badness}'[badout];
      [badout]drawtext=fontcolor=0000ff:y=1.2*lh:text='badness %{metadata\:lavfi.photosensitivity.badness}'[badout];
      [badout]drawtext=fontcolor=777700:y=2.4*lh:text='factor      %{metadata\:lavfi.photosensitivity.factor}'[badout];
    [mitdat]drawgraph=lavfi.signalstats.YAVG :0xff00ccdd
 :bg=00000000 :r=60 :slide=scroll :size=512x256 :min=0 :max=255,  vflip[factor];
    [factor][badout]scale2ref[factorout][badout];
      [factorout]drawtext=fontcolor=999900:y=3.6*lh:text='smoothed %{metadata\:lavfi.signalstats.YAVG}'[factorout];
    [badout][factorout]overlay[rplot];
  [i4]signalstats,  drawgraph=lavfi.signalstats.YAVG :0xffff0000
      :bg=white :r=60 :slide=scroll :size=512x256 :min=0 :max=255[lum];
    [lum][reuse]scale2ref[lumout][reuse];
      [lumout]drawtext=fontcolor=ff0000:text='%{pts\:hms} %{pts} %{eif\:n\:d\:5}'[lumout];
      [lumout]drawtext=fontcolor=0000ff:y=1.2*lh:text='avg luma %{metadata\:lavfi.signalstats.YAVG}'[lumout];
  [output1]signalstats,  drawgraph=lavfi.signalstats.YAVG :0xff00ccdd
      :bg=00000000 :r=60 :slide=scroll :size=512x256 :min=0 :max=255[mlum];
    [mlum][lumout]scale2ref[mlumout][lumout];
      [mlumout]drawtext=fontcolor=999900:y=2.4*lh:text='mitigated %{metadata\:lavfi.signalstats.YAVG}'[mlumout];
    [lumout][mlumout]overlay[lplot];
  [reuse][output2][rplot][lplot]xstack=4 :0_0|w0+30_0|w0+30_h0+20|0_h0+20,  [original]hstack" \
  'https://developer.apple.com/accessibility/downloads/video-flashing-reduction-fig12.mp4'
Re:Apple Detection of Flashing Lights by Kye on Tuesday March 28, 2023 @08:42AM (#35339970)
Re:Apple Detection of Flashing Lights by ar_turnbull on Wednesday March 29, 2023 @01:02AM (#35352844)
There’s this chrome plugin for YouTube videos. It stops the video before trigger scenes so you might find it a bit interruptive depending on your (or your cat’s) sensitivity.

https://chrome.google.com/webstore/detail/seizafe-epilepsy-a...

Re:Apple Detection of Flashing Lights by FriedPickles on Monday March 27, 2023 @07:05PM (#35334065)
Could flashing lights be the new blue light? Even for non epileptics, flashing lights might be associated with eye strain, sleep disruption, migraines, and stress. I may turn this feature on.
Re:Apple Detection of Flashing Lights by r00fus on Monday March 27, 2023 @08:42PM (#35334245)
This. I know I'm page-rage and even navigate away from webpages or videos with too much flash (whether by accident due to loading issues or by design).

I'm not epileptic.

Re:Apple Detection of Flashing Lights by tgsovlerkhgsel on Monday March 27, 2023 @09:18PM (#35334554)
I basically only encounter this when I use a machine without an ad blocker. (And holy ** is the Internet bad without one.)
Re:Apple Detection of Flashing Lights by Edd314159 on Tuesday March 28, 2023 @06:08AM (#35338266)
I’m not epileptic but I find flashing lights extremely unpleasant and will always avoid or look away if I encounter them.

Like most accessibility features, you don’t need to have a condition to find value in this one

Re:Apple Detection of Flashing Lights by lomuse on Monday March 27, 2023 @09:05PM (#35334442)
Some more documentation on this api is here: https://developer.apple.com/accessibility/#whats-new
Re:Apple Detection of Flashing Lights by ar_turnbull on Wednesday March 29, 2023 @01:06AM (#35352871)
I was so happy and pleasantly surprised to see this feature come out today! I just spent the last week telling a client they can’t put their flashy new brand video on their website and still meet AA guidelines.

I told them to do a Harding Test and get the company who made it to do the edits because WCAG doesn’t leave any wiggle room when it comes to potential seizures (rightfully so).

Glad to see Apple leading in this front. These features aren’t sexy but they make a real difference in people’s lives!