PuriPuri Live

Home of the Puri Stream and PSXplosion
PuriPuri Live

OBS FPS Estimator Plugin v1.0

Framerate Estimation Filter for OBS
by Eric ‘Puri_Puri’
Twitter: @3fg_inc
Site: https://puripuri.live

DOWNLOAD: https://puripuri.live/puri_utilities/2022/obs-fps-estimator-v1.0.zip

What this is:
A video filter that estimates the frame rate of captured video, to show on-screen how well a game renderer is performing.

REQUIRES 64-BIT WINDOWS OBS
Tested with Windows 64-bit OBS versions 27.2.4 and 28.0.2

HOW TO INSTALL:
Extract the three files to your OBS install’s plugin\64bit directory. Overwrite the files if they are already present (like if you installed my Lightgun Flash Filter.)
Typically: C:\Program Files\obs-studio\obs-plugins\64bit

obs-fps-estimator.dll (OBS filter plugin)
opencv_core454.dll (OpenCV version 4.54 core library)
opencv_imgproc454.dll (OpenCV version 4.54 image processing library)

How to use:

– Put the filter on your capture device. (Filters -> Effect Filters -> FPS Estimator)
– In the filter properties, check the “Analog Source” option if you are capturing from an analog system (even if it is through a nice scaler or RGB setup, there is STILL noise in the image even if you can’t see it).
– By default the FPS reading is drawn on top of the video capture. You can move it and resize it using the sliders in the filter properties.
– There is also an option to output the FPS reading to a .txt file, which can then be used in an OBS text source and placed/styled how you wish. Select a folder for where that file will be written to, and inside that folder will be a “FPS.txt” file that contains the current FPS number.

Known Issues:
– Works best on clean digital (HDMI) signals from systems mid-2000s and newer. Older analog systems usually have noise in the image that throws off the algorithm, but it does its best 😭
– FPS readings between 30 to 60 can be inaccurate due to how frequently capture cards get frames, not much can be done there. I use a rolling average of 15 frames to calculate the approximate FPS.

OBS Lightgun Flash Filter (v1.0)

Lightgun Flash Filter for OBS
by Eric ‘Puri_Puri’
Twitter: @3fg_inc
Site: https://puripuri.live

DOWNLOAD: https://puripuri.live/puri_utilities/2022/obs-flash-filter-v1.0.zip

What this is:
A video filter that detects and removes full-screen flashes in captured video, intended for lightgun games that flash the screen whenever the player shoots.

REQUIRES 64-BIT WINDOWS OBS
Tested with Windows 64-bit OBS versions 27.2.4 and 28.0.2

HOW TO INSTALL:
Extract the three files to your OBS install’s plugin\64bit directory
Typically: C:\Program Files\obs-studio\obs-plugins\64bit

obs-flash-filter.dll (OBS filter plugin)
opencv_core454.dll (OpenCV version 4.54 core library)
opencv_imgproc454.dll (OpenCV version 4.54 image processing library)

Known Issues:
– If you are playing on MiSTer FPGA (or any system that draws a crosshair) make sure to disable the crosshair, otherwise it will mess up the algorithm.
– Time Crisis 3 [PS2] has very odd flashes that fade in and out, which is very hard to filter. Will take another looks at it in the future.
– Sometimes crashes when closing OBS. I am not sure why 😅
– Might be a memory leak or two, maybe. Not actually sure.

Modes:
1) Generic 1 4:3 Full screen (Default)
– This is the main operating mode for the filter, and should work with nearly everything. Mainly tested on PSX games that flash the entire screen.

2) Generic 2 Cropped 64px x 64px Center Screen
– Same as Generic 1, but samples a smaller area in the center of the screen. Some games draw the UI over the screen flash, so this accounts for that. Also is faster than the Generic 1 preset, so use if you are having frame drops.
– Intended for: Project Horned Owl [PSX]

3) NES Type 1
– NES Zapper blanks the screen except for a white rectangle for a few frames, then goes back to the game. This detects the flash, then waits for 3 frames before drawing again.
– Intended for: Duck Hunt [NES]

4) NES Type 2
– This variation of the Zapper flashes the entire screen white, then blanks the screen except for a white rectangle. This detects the flash, then waits for 4 frames before drawing again.

5) CUSTOM 1
– This is mainly for playing with the filter. Set the “mean” slider as high as it will go without letting flashes through.

6) CUSTOM 2
– This is mainly for playing with the filter. Set the “stdDev” slider as low as it will go without letting flashes through.

How it works:
New frame
Frame converted to OpenCV Mat in BGR colorspace
Mat converted to HSV colorspace
HSV Mat split into Hue, Saturation, and Value Mats
Value is run through the meanStdDev function to get the average and standard deviation for the entire Value image
Generic:
If the standard deviation is below 5.0 (out of 255.0), then it is probably a flash frame, so discard the frame
NES:
Standard Deviation below 1 OR above 120 is the start of the flash animation, so discard the next 3 to 4 frames.
If it found a flash frame, then just destroy the frame and return NULL (result is showing the last non-flash frame)
Otherwise, draw the frame as-is.

Low Delay option now available for the stream!

Sorry about the long delay since my last stream — between having to build a new capture PC and some RL business I haven’t had much time to stream lately. I have been making good use of my spare time though, and one of the things I worked on is a new low delay option for the stream. This feed will be available in 720p/480p/240p just like the other feeds and also has an automatic setting that adjusts to your internet speed.  
Just about 2 seconds of stream delay *total*. Quite a lot better than the usual 10+ seconds minimum

The new low delay option will be available alongside the HLS and YouTube options that I’ve had before. I really only recommend the low delay setting for desktops, since I got a bit of choppiness on my mobile testing devices.

If you are interested in how this feature works, it uses the SLDP protocol, which is based on WebRTC apparently. In theory this should be able to get less than 1 second of delay, but I’m not sure what the weak link in the chain is for my setup. Oh well, we’ll have to deal with 2 whole seconds of latency 🙁