Opened 12 years ago

Closed 5 years ago

Last modified 13 months 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, Marton Balint 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 Carl Eugen Hoyos 12 years ago.
Sample from http://en.wikipedia.org/wiki/Denn%C5%8D_Senshi_Porygon

Download all attachments as: .zip

Change History (14)

comment:1 by Carl Eugen Hoyos, 12 years ago

Keywords: avfilter removed

Could you provide a sample?

comment:2 by compn, 12 years ago

uploaded to incoming as bright-flash-sample-for-filter.mkv
4mb.

Version 0, edited 12 years ago by compn (next)

comment:3 by Carl Eugen Hoyos, 12 years ago

Status: newopen

comment:4 by Elon Musk, 12 years ago

please always put link here

by Carl Eugen Hoyos, 12 years ago

Attachment: Denno.ogg added

comment:5 by compn, 11 years ago

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

comment:6 by Vladimir Panteleev, 6 years ago

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 by Marton Balint, 6 years ago

Cc: Marton Balint 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 by Cigaes, 6 years ago

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

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

in reply to:  6 ; comment:9 by compn, 6 years ago

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 ?

in reply to:  9 comment:10 by Vladimir Panteleev, 6 years ago

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 by compn, 6 years ago

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 by Elon Musk, 5 years ago

Resolution: fixed
Status: openclosed

comment:13 by compn, 4 years ago

I asked netflix about the filter. they said it would need proof that the filter is following the ITU standard before considering using it.

https://www.itu.int/dms_pubrec/itu-r/rec/bt/R-REC-BT.1702-2-201910-I!!PDF-E.pdf

maybe a future feature request. just putting itu link here for now. maybe someone would put a bounty or hire developer to make it conform to specs.

Note: See TracTickets for help on using tickets.