video2x icon indicating copy to clipboard operation
video2x copied to clipboard

Flickering problem on the video screen after using RIFE frame interpolation

Open qingchunyy opened this issue 9 months ago • 12 comments

When using RIFE frame interpolation (with 3x interpolation factor), every 3rd frame appears brighter, causing noticeable flickering during playback. It seems these brighter frames might be the original video frames. What's causing this phenomenon?

qingchunyy avatar Feb 15 '25 03:02 qingchunyy

Is your video HDR by chance?

k4yt3x avatar Feb 15 '25 05:02 k4yt3x

No, my video is BDMV

ID : 4113 (0x1011) Menu ID : 1 (0x1) Format : AVC Format/Info : Advanced Video Codec Format profile : [email protected] Format settings : CABAC / 4 Ref Frames Format settings, CABAC : Yes Format settings, Reference frames : 4 frames Format settings, Slice count : 4 slices per frame Codec ID : 27 Duration : 1 min 32 s Bit rate mode : Variable Bit rate : 36.4 Mb/s Maximum bit rate : 40.0 Mb/s Width : 1 920 pixels Height : 1 080 pixels Display aspect ratio : 16:9 Frame rate : 23.976 (24000/1001) FPS Color space : YUV Chroma subsampling : 4:2:0 Bit depth : 8 bits Scan type : Progressive Bits/(Pixel*Frame) : 0.732 Time code of first frame : 00:59:59:00 Stream size : 399 MiB (90%)

qingchunyy avatar Feb 15 '25 16:02 qingchunyy

Image

Image

qingchunyy avatar Feb 15 '25 16:02 qingchunyy

@wondent please add your information here.

k4yt3x avatar Feb 21 '25 17:02 k4yt3x

I also get the same kind of flickering on one video (not HDR) when using 2x interpolation, model 4.26

cosmito-lab avatar Feb 26 '25 19:02 cosmito-lab

Reasons/ideas how to fix? e.g. First part of video is well, second part has flickering (fully black frame, well frame, ...). Edit: 4.25 Lite has no flickering on same video, but 4.6, 4.25, 4.26 have. Edit 2: 4.25 Lite has flickering too, but rarely. 4.26 has less flickering than 4.25 or 4.6 Edit 3: parameter "--rife-uhd" reduces flickering, but not eliminate it PS: I suspect that the 'Scene Detection Threshold' parameter somehow affects the flickering.

pettiness avatar Mar 03 '25 21:03 pettiness

I saw a similar issue in the ECCV2022-RIFE project. The author of the RIFE model believes that the algorithm itself does not have a strong tendency for color shifts. It might be related to video frame reading and writing. I'm not sure if this brighter frames issue is caused by the same reason. You may also refer to it for further insights.

https://github.com/hzwer/ECCV2022-RIFE/issues/350 https://github.com/hzwer/Practical-RIFE/issues/120

avan06 avatar Mar 04 '25 09:03 avan06

After I processed several videos, I found that the flickering is present in all of them, just not apparent in normal playback when there is enough motion in the frame. But on frame-by-frame analysis, it is always there. So the issue is systemic.

stderr-to-devnull avatar Mar 10 '25 21:03 stderr-to-devnull

add parameter:--pix-fmt bgra the chromaticity difference is caused by the conversion from RGB to YUV

wondent avatar Apr 06 '25 04:04 wondent

What is the codec that supports --pix-fmt bgra ? Also what should the values be for the other settings to fix the flickering?

It seems that outputting the video to a png sequence solves the issue as well

nathandickson365 avatar Apr 11 '25 19:04 nathandickson365

av1, h264_nvenc, h265_nvenc, ffv1, huffyuv

pettiness avatar Apr 12 '25 00:04 pettiness

or use RGB or 10bit color

pettiness avatar Apr 16 '25 13:04 pettiness

How to change that in the UI? I also found no config file to do so.

BaseMe2 avatar Aug 23 '25 21:08 BaseMe2

How to change that in the UI? I also found no config file to do so.

in codec section, can you add a screenshot?

pettiness avatar Aug 25 '25 22:08 pettiness

Dude, you added zero description where to find it. I can't even show you a screenshot as I don't know where to look for it. It can only be in Encoded-Optionen, under Standard-Optionen but there's no field for RGB or 10bit. Only suffix, codec, pix_fmt etc. I'm no video expert. I don't know what these options do. There's no drop down to pick a different one either. The videos are mp4 output by comfyui.

BaseMe2 avatar Aug 26 '25 17:08 BaseMe2

Dude, you added zero description where to find it. I can't even show you a screenshot as I don't know where to look for it. It can only be in Encoded-Optionen, under Standard-Optionen but there's no field for RGB or 10bit. Only suffix, codec, pix_fmt etc. I'm no video expert. I don't know what these options do. There's no drop down to pick a different one either. The videos are mp4 output by comfyui.

Dude, i completely forgot how UI looks, just use program, click everywhere and do as many screenshots as possible, i will pick right screenshot and round right place by red pensil

pettiness avatar Aug 26 '25 18:08 pettiness

Dude, i completely forgot how UI looks, just use program, click everywhere and do as many screenshots as possible, i will pick right screenshot and round right place by red pensil

No. I'd rather never find out, then be your servant. Child!

BaseMe2 avatar Aug 27 '25 16:08 BaseMe2

Dude, i completely forgot how UI looks, just use program, click everywhere and do as many screenshots as possible, i will pick right screenshot and round right place by red pensil

No. I'd rather never find out, then be your servant. Child!

btw you can type "video2x" in command line and see all options

pettiness avatar Aug 27 '25 16:08 pettiness

I do not have a command window. I use the UI, which I downloaded from this repo.

Solution: Under the duty options > Encoder-Options then change the following:

suffix: .mp4, codec: h264_nvenc pix_fmt: bgra

h265_nvenc doesn't seam to work, as well as av1 even though I have av1 support installed via microsoft store

BaseMe2 avatar Sep 15 '25 18:09 BaseMe2