Opened 7 years ago

Closed 7 weeks ago

#2104 closed enhancement (fixed)

anti-epilepsy bright flash remover video filter

Reported by: compn Owned by:
Priority: wish Component: avfilter
Version: git-master Keywords:
Cc: thecybershadow+ffmpeg@gmail.com, cus Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

any chance a filter to remove bright flashes from video?

it may drop the frame or duplicate a previous non-bright frame, making video stutter a bit.

i'll upload a sample soon.

Attachments (1)

Denno.ogg (865.7 KB) - added by cehoyos 7 years ago.
Sample from http://en.wikipedia.org/wiki/Denn%C5%8D_Senshi_Porygon

Download all attachments as: .zip

Change History (13)

comment:1 Changed 7 years ago by cehoyos

  • Keywords avfilter removed

Could you provide a sample?

comment:3 Changed 7 years ago by cehoyos

  • Status changed from new to open

comment:4 Changed 7 years ago by richardpl

please always put link here

comment:5 Changed 6 years ago by compn

this sample is also good for testing:
https://www.youtube.com/watch?v=qKSu_GdF6wk

comment:6 follow-up: Changed 8 months ago by CyberShadow

  • Cc thecybershadow+ffmpeg@gmail.com added

Hi,

I've been working on a filter to do this. My code so far is here:

https://github.com/FFmpeg/FFmpeg/compare/master...CyberShadow:epilepsy

Feedback from those who would find this useful would be appreciated.
I can also provide Win64 ffmpeg/mpv binaries.

I intend to submit the filter for inclusion once we conclude the results to be satisfactory.

comment:7 Changed 8 months ago by cus

  • Cc cus added

Really nice, some comments at first glace:

  • Use the .activate callback
  • You can probably factorize the blending code in vf_framerate so ASM can be used for blending
  • A separate mode to detect only flashes (and not remove them) would probably be useful

comment:8 Changed 8 months ago by Cigaes

This is bug tracker, patches should be discussed on the mailing list.

Also: https://ffmpeg.org/pipermail/ffmpeg-devel/2019-February/240556.html

comment:9 in reply to: ↑ 6 ; follow-up: Changed 8 months ago by compn

yes if you can provide a win64 binary I can test, although I am no expert.

I am curious on why you chose to write a filter for this. I am happy to see work on this, I hope a filter like this can help people.

I am assuming it is real time ?

comment:10 in reply to: ↑ 9 Changed 8 months ago by CyberShadow

Replying to compn:

yes if you can provide a win64 binary I can test, although I am no expert.

There are binaries available at this very-temporary URL:

http://89.28.117.31:8081/bin/

There are also some samples/comparisons on the same server, but note that they may not be safe to look at.

I am curious on why you chose to write a filter for this.

Someone I know mentioned that they would find such a thing useful, and it seemed like a very interesting project that could help people.

I am assuming it is real time ?

Yes, it works in real time (on recent CPUs) and does not buffer.

comment:11 Changed 8 months ago by compn

I like your comparison videos. Very clear before and after.

Your filter tries pretty hard on this clip from the incredibles 2, but I don't think theres anything that can be done for it.

https://www.youtube.com/watch?v=8L_9hXnUzRk

the only other thing i could think of is that the "next gen" version of this filter would remember which macroblocks are moving/changing colors at too fast of a pace, and then you could just freeze those ones while the (still moving, but not flashing) macroblocks are allowed to continue. Not even sure if its possible to do what I am describing though. It would also cause or look like tearing.

is there a memory leak? seems to eat about 3gb+ ram here when using your filter vs no filters. could be a mingw bug or something else.

but yes, if you have not already, please submit patch to ffmpeg-devel for discussions. that is the proper place for patch discussions. this bug tracker does not get as many eyeballs as the mailing list.

comment:12 Changed 7 weeks ago by richardpl

  • Resolution set to fixed
  • Status changed from open to closed
Note: See TracTickets for help on using tickets.