Measures input lag without dedicated hardware, performing motion detection on recorded or live video

Overview

What is InputLagTimer?

This tool can measure input lag by analyzing a video where both the game controller and the game screen can be seen on a webcam or a video file.

Here's how it looks in action:

Usage demo

Even though the typical usage is game latency, InputLagTimer can measure any latency so long as it's captured on video. For example, if you point a camera at both your car key and its door lock, you can measure how fast that remote unlocks your car.

How does it measure input lag?

You first mark two rectangles in the video you provide:

  • 🟦 Input rectangle (blue): where the input motion happens. Such as a gamepad stick.
  • 🟪 Output rectangle (purple): where the response will be visible. Such as the middle left of your TV screen, where the front wheels can be seen turning in your car simulator.

InputLagTimer will detect motion on the input area, and time how long it takes to detect motion on the output area.

Things should work for latencies of up to 700ms; if you need to measure slower events, the limit can be trivially edited in code.

How to use it:

  1. Download InputLagTimer (some windows binaries are available on github if you prefer that)
  2. Open InputLagTimer:
    • Plug your webcam then run the program.
    • Or drag-and-drop your video file to the program.
    • Or, from command line, type InputLagTimer 2 to open the 3rd webcam, or InputLagTimer file.mp4 to open a file.
  3. Press S then follow screen instructions to select the 🟦 input and 🟪 output rectangles.
  4. Observe the input and output motion bars at the top, and press 1/2 and 3/4 to adjust the motion detection thresholds (white indicator). Latency timing will start when the input motion passes the threshold, and stop when the output motion does.

Note: a .cfg file will be created for each video, allowing to reproduce the same latency analysis.

Tips and gotchas

  • Use a tripod to hold the camera. The InputLagTimer is based on motion detection, therefore hand-held footage is doomed to spam false positives.
  • Disable gamepad vibration and put the gamepad in a table (unless you want to measure vibration-latency!): in other words,reduce unnecessary motion from both the input and output rectangles.
  • Select the 🟦 input and 🟪 output rectangles as accurately as possible. E.g. to measure keyboard key travel time, draw an input rectangle including the entire key height. If you don't want to include key travel latency, draw the input rectangle as close to the key activation point as possible.
  • If using certain artificial lights, enable camera's anti-flicker feature when available (press C in InputLagTimer when using a webcam), or choose a recording framerate different than the powerline frequency used in your country (often 50Hz or 60Hz). This removes video flicker, vastly improving motion detection.
  • Prefer higher recording framerate, this provides finer-grained latency measurements:
    • Some phones and actioncams can reach hundreds of FPS.
    • Recording equipment may not reach its advertised framerate if it's not bright enough. If in doubt, add more lighting.
  • If your camera cannot reach the requested framerate (e.g. it only manages to capture 120FPS out of 240FPS, due to lack of light), consider recording directly at the reachable framerate. This eliminates the useless filler frames your camera was forced to duplicate, making it easier to tune the motion detection thresholds in InputLagTimer.
  • Prefer global shutter over rolling shutter cameras. Rolling shutter can slightly skew latency measurements, as one corner of the image is recorded earlier than the oposite corner.

Rolling Shutter example

(source: Axel1963 - CC BY-SA 3.0)

  • Screens normally refresh pixels from the top earlier than pixels from the bottom (or left before right, etc). The location of 🟦 input/ 🟪 output rectangles in a screen can slightly skew latency measurements.
  • The pixels on a screen can take longer or shorter to update, depending on:
    • Pixel color. E.g. white-to-black response time might be longer than black-to-white.
    • Panel type. E.g. OLED will normally be much quicker than LCD panels.
    • Screen configuration. E.g. enabling 'overdrive', enabling 'game mode', etc.
  • Press A (Advanced mode) to see more keys and additional information.

Advanced Mode screenshot

Dependencies

To run the EXE, you don't need anythig else. So move along, nothing to see in this section :)

To run the python code directly, you'll need opencv for python, numpy, and whichever python interpreter you prefer.

To build the binary (with compile.py), you'll need PyInstaller.

Credits and licenses

InputLagTimer software:

Copyright 2021 Bruno Gonzalez Campo | [email protected] | @stenyak

Distributed under MIT license (see license.txt)

InputLagTimer icon:

Copyright 2021 Bruno Gonzalez Campo | [email protected] | @stenyak

Distributed under CC BY 3.0 license (see license_icon.txt)

Icon derived from:

You might also like...
Python scripts for performing object detection with the 1000 labels of the ImageNet dataset in ONNX.
Python scripts for performing object detection with the 1000 labels of the ImageNet dataset in ONNX.

Python scripts for performing object detection with the 1000 labels of the ImageNet dataset in ONNX. The repository combines a class agnostic object localizer to first detect the objects in the image, and next a ResNet50 model trained on ImageNet is used to label each box.

Python scripts for performing road segemtnation and car detection using the HybridNets multitask model in ONNX.
Python scripts for performing road segemtnation and car detection using the HybridNets multitask model in ONNX.

ONNX-HybridNets-Multitask-Road-Detection Python scripts for performing road segemtnation and car detection using the HybridNets multitask model in ONN

This project uses reinforcement learning on stock market and agent tries to learn trading. The goal is to check if the agent can learn to read tape. The project is dedicated to hero in life great Jesse Livermore.

Reinforcement-trading This project uses Reinforcement learning on stock market and agent tries to learn trading. The goal is to check if the agent can

NeuralCompression is a Python repository dedicated to research of neural networks that compress data

NeuralCompression is a Python repository dedicated to research of neural networks that compress data. The repository includes tools such as JAX-based entropy coders, image compression models, video compression models, and metrics for image and video evaluation.

SCAAML is a deep learning framwork dedicated to side-channel attacks run on top of TensorFlow 2.x.
SCAAML is a deep learning framwork dedicated to side-channel attacks run on top of TensorFlow 2.x.

SCAAML (Side Channel Attacks Assisted with Machine Learning) is a deep learning framwork dedicated to side-channel attacks. It is written in python and run on top of TensorFlow 2.x.

NeoPlay is the project dedicated to ESport events.

NeoPlay is the project dedicated to ESport events. On this platform users can participate in tournaments with prize pools as well as create their own tournaments.

This program was designed to detect whether someone is wearing a facemask through a live video stream.

This program was designed to detect whether someone is wearing a facemask through a live video stream. A custom lightweight CNN trained with TensorFlow on a public dataset provided by Kaggle is used to detect whether each face detected by the cv2 face detection dnn is wearing a mask

Video-Captioning - A machine Learning project to generate captions for video frames indicating the relationship between the objects in the video
Video-Captioning - A machine Learning project to generate captions for video frames indicating the relationship between the objects in the video

Video-Captioning - A machine Learning project to generate captions for video frames indicating the relationship between the objects in the video

Official implementation of the network presented in the paper
Official implementation of the network presented in the paper "M4Depth: A motion-based approach for monocular depth estimation on video sequences"

M4Depth This is the reference TensorFlow implementation for training and testing depth estimation models using the method described in M4Depth: A moti

Releases(v1.2)
  • v1.2(Mar 29, 2022)

    • Display summary of measured latencies: min/avg/max latencies and a histogram
    • Added display with the current framerate
    • Fixed incorrect timing when a webcam dropped below the advertised framerate
    • The 'a' key will now cycle between varying amounts of detail (more detail can lead to lower framerates)
    • Add CC license links on readme
    • Minor cleanups here and there

    Full Changelog: https://github.com/stenyak/inputLagTimer/compare/v1.1...v1.2

    Source code(tar.gz)
    Source code(zip)
    InputLagTimer.exe(50.81 MB)
  • v1.1(Jan 8, 2022)

    • Fix safety timeout kicking in too soon if using a custom maxLatency
    • Fix first webcam being ignored when running the program without arguments
    • Rename compiled file from camelCase to CamelCase

    Full Changelog: https://github.com/stenyak/inputLagTimer/compare/v1.0...v1.1

    Source code(tar.gz)
    Source code(zip)
    InputLagTimer.exe(49.22 MB)
  • v1.0(Jan 8, 2022)

Simple STAC Catalogs discovery tool.

STAC Catalog Discovery Simple STAC discovery tool. Just paste the STAC Catalog link and press Enter. Details STAC Discovery tool enables discovering d

Mykola Kozyr 21 Oct 19, 2022
A demo of how to use JAX to create a simple gravity simulation

JAX Gravity This repo contains a demo of how to use JAX to create a simple gravity simulation. It uses JAX's experimental ode package to solve the dif

Cristian Garcia 16 Sep 22, 2022
Weakly-Supervised Semantic Segmentation Network with Deep Seeded Region Growing (CVPR 2018).

Weakly-Supervised Semantic Segmentation Network with Deep Seeded Region Growing (CVPR2018) By Zilong Huang, Xinggang Wang, Jiasi Wang, Wenyu Liu and J

Zilong Huang 245 Dec 13, 2022
Differentiable Neural Computers, Sparse Access Memory and Sparse Differentiable Neural Computers, for Pytorch

Differentiable Neural Computers and family, for Pytorch Includes: Differentiable Neural Computers (DNC) Sparse Access Memory (SAM) Sparse Differentiab

ixaxaar 302 Dec 14, 2022
LIAO Shuiying 6 Dec 01, 2022
face_recognization (FaceNet) + TFHE (HNP) + hand_face_detection (Mediapipe)

SuperControlSystem Face_Recognization (FaceNet) 面部识别 (FaceNet) Fully Homomorphic Encryption over the Torus (HNP) 环面全同态加密 (TFHE) Hand_Face_Detection (M

liziyu0104 2 Dec 30, 2021
A simple pytorch pipeline for semantic segmentation.

SegmentationPipeline -- Pytorch A simple pytorch pipeline for semantic segmentation. Requirements : torch=1.9.0 tqdm albumentations=1.0.3 opencv-pyt

petite7 4 Feb 22, 2022
A pytorch implementation of the CVPR2021 paper "VSPW: A Large-scale Dataset for Video Scene Parsing in the Wild"

VSPW: A Large-scale Dataset for Video Scene Parsing in the Wild A pytorch implementation of the CVPR2021 paper "VSPW: A Large-scale Dataset for Video

45 Nov 29, 2022
A Python implementation of global optimization with gaussian processes.

Bayesian Optimization Pure Python implementation of bayesian global optimization with gaussian processes. PyPI (pip): $ pip install bayesian-optimizat

fernando 6.5k Jan 02, 2023
A Neural Net Training Interface on TensorFlow, with focus on speed + flexibility

Tensorpack is a neural network training interface based on TensorFlow. Features: It's Yet Another TF high-level API, with speed, and flexibility built

Tensorpack 6.2k Jan 01, 2023
[ICML 2021, Long Talk] Delving into Deep Imbalanced Regression

Delving into Deep Imbalanced Regression This repository contains the implementation code for paper: Delving into Deep Imbalanced Regression Yuzhe Yang

Yuzhe Yang 568 Dec 30, 2022
这是一个yolox-keras的源码,可以用于训练自己的模型。

YOLOX:You Only Look Once目标检测模型在Keras当中的实现 目录 性能情况 Performance 实现的内容 Achievement 所需环境 Environment 小技巧的设置 TricksSet 文件下载 Download 训练步骤 How2train 预测步骤 Ho

Bubbliiiing 64 Nov 10, 2022
SEC'21: Sparse Bitmap Compression for Memory-Efficient Training onthe Edge

Training Deep Learning Models on The Edge Training on the Edge enables continuous learning from new data for deployed neural networks on memory-constr

Brown University Scale Lab 4 Nov 18, 2022
PyTorch implementation of ECCV 2020 paper "Foley Music: Learning to Generate Music from Videos "

Foley Music: Learning to Generate Music from Videos This repo holds the code for the framework presented on ECCV 2020. Foley Music: Learning to Genera

Chuang Gan 30 Nov 03, 2022
Learning to Identify Top Elo Ratings with A Dueling Bandits Approach

Learning to Identify Top Elo Ratings We propose two algorithms MaxIn-Elo and MaxIn-mElo to solve the top players identification on the transitive and

2 Jan 14, 2022
code for "AttentiveNAS Improving Neural Architecture Search via Attentive Sampling"

code for "AttentiveNAS Improving Neural Architecture Search via Attentive Sampling"

Facebook Research 94 Oct 26, 2022
DeOldify - A Deep Learning based project for colorizing and restoring old images (and video!)

DeOldify - A Deep Learning based project for colorizing and restoring old images (and video!)

Jason Antic 15.8k Jan 04, 2023
BaseCls BaseCls 是一个基于 MegEngine 的预训练模型库,帮助大家挑选或训练出更适合自己科研或者业务的模型结构

BaseCls BaseCls 是一个基于 MegEngine 的预训练模型库,帮助大家挑选或训练出更适合自己科研或者业务的模型结构。 文档地址:https://basecls.readthedocs.io 安装 安装环境 BaseCls 需要 Python = 3.6。 BaseCls 依赖 M

MEGVII Research 28 Dec 23, 2022
Modular Probabilistic Programming on MXNet

MXFusion | | | | Tutorials | Documentation | Contribution Guide MXFusion is a modular deep probabilistic programming library. With MXFusion Modules yo

Amazon 100 Dec 10, 2022
One-Shot Neural Ensemble Architecture Search by Diversity-Guided Search Space Shrinking

One-Shot Neural Ensemble Architecture Search by Diversity-Guided Search Space Shrinking This is an official implementation for NEAS presented in CVPR

Multimedia Research 19 Sep 08, 2022