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)

3D Avatar Lip Syncronization from speech (JALI based face-rigging)

visemenet-inference Inference Demo of "VisemeNet-tensorflow" VisemeNet is an audio-driven animator centric speech animation driving a JALI or standard

Junhwan Jang 17 Dec 20, 2022
Code repository for the paper "Doubly-Trained Adversarial Data Augmentation for Neural Machine Translation" with instructions to reproduce the results.

Doubly Trained Neural Machine Translation System for Adversarial Attack and Data Augmentation Languages Experimented: Data Overview: Source Target Tra

Steven Tan 1 Aug 18, 2022
Code for Blind Image Decomposition (BID) and Blind Image Decomposition network (BIDeN).

arXiv, porject page, paper Blind Image Decomposition (BID) Blind Image Decomposition is a novel task. The task requires separating a superimposed imag

64 Dec 20, 2022
A set of simple scripts to process the Imagenet-1K dataset as TFRecords and make index files for NVIDIA DALI.

Overview This is a set of simple scripts to process the Imagenet-1K dataset as TFRecords and make index files for NVIDIA DALI. Make TFRecords To run t

8 Nov 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
PyTorch Implementation of ByteDance's Cross-speaker Emotion Transfer Based on Speaker Condition Layer Normalization and Semi-Supervised Training in Text-To-Speech

Cross-Speaker-Emotion-Transfer - PyTorch Implementation PyTorch Implementation of ByteDance's Cross-speaker Emotion Transfer Based on Speaker Conditio

Keon Lee 114 Jan 08, 2023
A curated list of programmatic weak supervision papers and resources

A curated list of programmatic weak supervision papers and resources

Jieyu Zhang 118 Jan 02, 2023
All public open-source implementations of convnets benchmarks

convnet-benchmarks Easy benchmarking of all public open-source implementations of convnets. A summary is provided in the section below. Machine: 6-cor

Soumith Chintala 2.7k Dec 30, 2022
The code for MM2021 paper "Multi-Level Counterfactual Contrast for Visual Commonsense Reasoning"

The Code for MM2021 paper "Multi-Level Counterfactual Contrast for Visual Commonsense Reasoning" Setting up and using the repo Get the dataset. Follow

4 Apr 20, 2022
Cockpit is a visual and statistical debugger specifically designed for deep learning.

Cockpit: A Practical Debugging Tool for Training Deep Neural Networks

Felix Dangel 421 Dec 29, 2022
Scalable Multi-Agent Reinforcement Learning

Scalable Multi-Agent Reinforcement Learning 1. Featured algorithms: Value Function Factorization with Variable Agent Sub-Teams (VAST) [1] 2. Implement

3 Aug 02, 2022
Manifold-Mixup implementation for fastai V2

Manifold Mixup Unofficial implementation of ManifoldMixup (Proceedings of ICML 19) for fast.ai (V2) based on Shivam Saboo's pytorch implementation of

Nestor Demeure 16 Jul 25, 2022
StyleGAN2 - Official TensorFlow Implementation

StyleGAN2 - Official TensorFlow Implementation

NVIDIA Research Projects 10.1k Dec 28, 2022
It is an open dataset for object detection in remote sensing images.

RSOD-Dataset It is an open dataset for object detection in remote sensing images. The dataset includes aircraft, oiltank, playground and overpass. The

136 Dec 08, 2022
Official PyTorch implementation of Joint Object Detection and Multi-Object Tracking with Graph Neural Networks

This is the official PyTorch implementation of our paper: "Joint Object Detection and Multi-Object Tracking with Graph Neural Networks". Our project website and video demos are here.

Richard Wang 443 Dec 06, 2022
Контрольная работа по математическим методам машинного обучения

ML-MathMethods-Test Контрольная работа по математическим методам машинного обучения. Вычисление основных статистик, диаграмм и графиков, проверка разл

Stas Ivanovskii 1 Jan 06, 2022
Graph Robustness Benchmark: A scalable, unified, modular, and reproducible benchmark for evaluating the adversarial robustness of Graph Machine Learning.

Homepage | Paper | Datasets | Leaderboard | Documentation Graph Robustness Benchmark (GRB) provides scalable, unified, modular, and reproducible evalu

THUDM 66 Dec 22, 2022
CVPR2022 (Oral) - Rethinking Semantic Segmentation: A Prototype View

Rethinking Semantic Segmentation: A Prototype View Rethinking Semantic Segmentation: A Prototype View, Tianfei Zhou, Wenguan Wang, Ender Konukoglu and

Tianfei Zhou 239 Dec 26, 2022
NLG evaluation via Statistical Measures of Similarity: BaryScore, DepthScore, InfoLM

NLG evaluation via Statistical Measures of Similarity: BaryScore, DepthScore, InfoLM Automatic Evaluation Metric described in the papers BaryScore (EM

Pierre Colombo 28 Dec 28, 2022
Official PyTorch implementation of RIO

Image-Level or Object-Level? A Tale of Two Resampling Strategies for Long-Tailed Detection Figure 1: Our proposed Resampling at image-level and obect-

NVIDIA Research Projects 17 May 20, 2022