• Stars
    star
    154
  • Rank 241,352 (Top 5 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created almost 10 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Calculate visual performance metrics from a video (Speed Index, Visual Complete, Incremental progress, etc)

visualmetrics

Calculate visual performance metrics from a video (Speed Index, Perceptual Speed Index, Visual Complete, Incremental progress, etc). This is a command-line port of the WebPagetest mobile video processing and metrics code.

Requirements

visualmetrics requires several image processing tools be installed and available in the path:

The dependencies can be verified by running:

$python visualmetrics.py --check
ffmpeg:   OK
convert:  OK
compare:  OK
Pillow:   OK
SSIM:     OK

Command Line

Help

$ python visualmetrics.py -h

Options

  • -i, --video: Input video file. Required if existing frames or histograms are not available.
  • -d, --dir: Directory of video frames (as input if exists or as output if a video file is specified). If a directory is not specified and video needs to be processed a temporary directory will be used for processing and deleted automatically.
  • -g, --histogram: Histogram file (as input if exists or as output if histograms need to be calculated). If a histogram file is not specified and histograms need to be calculated a temporary histograms file will be created for processing and deleted automatically.
  • -m, --timeline: Timeline capture from Chrome dev tools. Used to synchronize the video start time and only applies when orange frames are removed (see --orange). The timeline file can be gzipped if it ends in .gz. It can also be a trace file captured with the devtools.timeline events.
  • -q, --quality: JPEG quality to use when exporting the video frames (if video is being processed). If not specified the video frames will be saved as PNGs.
  • -l, --full: Keep full-resolution images instead of resizing to 400x400 pixels.
  • -f, --force: Force re-processing of the provided video. By default if a directory or histogram file already exists then those will be used and the video will not be extracted, even if provided. With force enabled it will overwrite any images in the video frame directory and overwrite any existing histograms.
  • -o, --orange: Remove any orange frames at the beginning of the video. These are usually used for synchronizing video capture with other data sources.
  • -p, --viewport: Find the viewport from the virst video frame and use only the viewport for frame de-duplication and metrics calculation.
  • -s, --start: Specify a starting time (in milliseconds) for calculating the various metrics. All of the metrics except for Speed Index will still report an absolute time but will process the video frames in the requested interval. Speed Index will be calculated relative to the starting point.
  • -e, --end: Specify an ending time (in milliseconds) for calculating the various metrics.
  • -v, --verbose: Display debug messages while processing. Specify multiple times (up to 4) to increase detail.
  • -k, --perceptual: Calculates perceptual speed Index for a given input video.
  • -j, --json: Sets output format to JSON.

Examples

$ python visualmetrics.py --video video.mp4 --dir frames -q 75 --histogram histograms.json.gz --orange --viewport
First Visual Change: 1806
Last Visual Change: 1955
Visually Complete: 1955
Speed Index: 1835
Visual Progress: 0=0%, 1806=45%, 1827=48%, 1844=53%, 1861=99%, 1879=99%, 1901=98%, 1922=99%, 1938=99%, 1955=100%
$ python visualmetrics.py --video tests/data/lemons/video.mp4 --dir frames --histogram histograms.json.gz --orange --viewport
First Visual Change: 768
Last Visual Change: 2884
Speed Index: 1840
Visual Progress: 0=0%, 768=23%, 785=24%, 1510=61%, 1545=61%, 1981=61%, 2015=61%, 2033=61%, 2069=61%, 2086=61%, 2105=61%, 2140=61%, 2175=61%, 2572=61%, 2589=61%, 2606=62%, 2623=62%, 2641=63%, 2658=57%, 2676=58%, 2694=58%, 2713=57%, 2731=58%, 2749=58%, 2770=89%, 2789=87%, 2809=87%, 2828=87%, 2884=100%
$ python visualmetrics.py --video tests/data/lemons/video.mp4 --dir frames --histogram histograms.json.gz --orange --viewport --perceptual
First Visual Change: 768
Last Visual Change: 2884
Speed Index: 1840
Perceptual Speed Index: 892
Visual Progress: 0=0%, 768=23%, 785=24%, 1510=61%, 1545=61%, 1981=61%, 2015=61%, 2033=61%, 2069=61%, 2086=61%, 2105=61%, 2140=61%, 2175=61%, 2572=61%, 2589=61%, 2606=62%, 2623=62%, 2641=63%, 2658=57%, 2676=58%, 2694=58%, 2713=57%, 2731=58%, 2749=58%, 2770=89%, 2789=87%, 2809=87%, 2828=87%, 2884=100%

More Repositories

1

WebPageTest

Official repository for WebPageTest
PHP
3,047
star
2

WebPageTest.api-nodejs

WebPageTest API wrapper for NodeJS
JavaScript
1,644
star
3

workflow-telemetry-action

Github action to collect metrics (CPU, memory, I/O, etc ...) from your workflows to help you debug and optimize your CI/CD pipeline
TypeScript
264
star
4

WebPageTest.bulk-tester

Google App Script for spreadsheet that uses the WPT API to bulk test URLs
JavaScript
259
star
5

WebPageTest.agent

Cross-platform WebPageTest agent
Python
210
star
6

WebPageTest.RUM-SpeedIndex

Calculate SpeedIndex measurements from the field
JavaScript
200
star
7

WebPageTest.github-action

Automatically test code changes in WebPageTest and enforce performance budgets
JavaScript
198
star
8

WebPageTest.docs

Documentation for WebPageTest
JavaScript
192
star
9

WebPageTest.win-shaper

Windows traffic-shaping packet filter
C++
126
star
10

WebPageTest.xrecord

Console app for capturing video on OS X (particularly from iOS devices)
Swift
122
star
11

WebPageTest.beacon-ml

Evaluate web beacon metrics for impact on business metrics
Python
75
star
12

WebPageTest.tsproxy

Traffic-shaping SOCKS5 proxy
Python
73
star
13

Pietrasanta-traceroute

C
39
star
14

Tracing.examples-kubernetes-java

Catchpoint Tracing examples for Java applications deploying to Kubernetes
Java
23
star
15

WebPageTest.slack

WebPageTest and Slack Integration
JavaScript
21
star
16

WebPageTest.api-recipes

A collection of useful recipes for the WebPageTest API
JavaScript
13
star
17

WebPageTest.agent-install

Automated scripts for installing dedicated wptagent instances
Shell
10
star
18

WebPageTest.iTether

Reverse-tether app for iOS
Python
9
star
19

WebPageTest.iWptBrowser

wkWebView browser shell for iOS WebPagetest agent (integrates with wptagent)
Swift
9
star
20

WebPageTest.server-install

Installation scripts for the WebPageTest server
Shell
9
star
21

WebPageTest.vscode-extension

JavaScript
7
star
22

foresight-test-kit-action

Action for optimizing your tests by listing test runs and with history
TypeScript
7
star
23

WebPageTest.recorder-chrome-extension

A Chrome extension for outputting user recording sessions as WebPageTest Custom Scripts
JavaScript
6
star
24

WebPageTest.pcap-parser

Parser to extract information from tcpdump pcap files for WebPageTest
Python
6
star
25

WebPageTest.recorder-to-script

Script to convert Chrome user flow recordings to WPT Custom Scripts
TypeScript
6
star
26

WebPageTest.trace-parser

Parser to extract information from Chrome Traces for WebPageTest
Python
6
star
27

foresight-issues

This is the place where the Foresight issues are put in the table
5
star
28

Integrations.SIP

Shell
5
star
29

foresight-workflow-kit-action

TypeScript
5
star
30

WebPageTest.extension-chrome

Chrome helper extension to launch WebPageTest for current URL
JavaScript
5
star
31

WebPageTest.adbwatch

Python app that monitors and kills the Android Debug Bridge when it stops working.
C++
4
star
32

WebPageTest.devtools-parser

Parse a remote dev tools event log and produce page-level and request information json files
Python
3
star
33

WebPageTest.healthcheck

HTTP Healthcheck responder for WebPageTest agents (wptagent)
Python
3
star
34

WebPageTest.etw

Windows ETW watcher for wptagent
C#
3
star
35

WebPageTest.browser-install

Automatically install and keep browsers up to date with the latest releases (on Windows)
Python
2
star
36

Community-Scripts

Repository for custom scripts.
Python
2
star
37

WebPageTest.chromehooks

Windows command-line utility to find the function offsets for SSL/TLS functions in Chrome using the public symbols
Python
2
star
38

WebPageTest.microsoft-teams-bot

JavaScript
2
star
39

Integrations.GoogleCloudMonitoring

JavaScript
2
star
40

WebPageTest.extension-firefox

Extension for Firefox to launch WebPageTest for current URL
JavaScript
2
star
41

Integrations.splunk

Python
1
star
42

Integrations.SumoLogic

1
star
43

WebPageTest.crawler

JavaScript
1
star
44

WebPageTest.battery-time

Browser-based battery life test suite. Used for measuring how long a device can run on a single charge.
1
star
45

terraform-provider-catchpoint

Go
1
star
46

foresight-client-sdk

Foresight API client SDK
Java
1
star
47

Integrations.NewRelic

New Relic Integrations uses catchpoint Test Data Webhook to send data to New Relic Platform, this is accomplished by using New Relic’s Metrics API. To complete this integration, we will rely on third party cloud function to accept the data from Catchpoint API, process it in the desired format and then push it to New Relic. With this integration we are enabling DevOps team to visualise Catchpoints digital experience data with New Relic’s Application Performance Monitoring (APM) data together.
JavaScript
1
star
48

WebPageTest.winres

Set the Windows desktop to the maximum supported by the monitor/video card. This is primarily used in a headless environment like EC2 to maximize the desktop for visual testing.
C++
1
star
49

WebPageTest.tcpdump

Windows tcpdump console app for wptagent (requires WinPCap)
C
1
star
50

Tracing.examples-kubernetes-go

Catchpoint Tracing examples for Go applications deploying to Kubernetes
Go
1
star
51

webpage-visually-complete

Visually Complete is calculated by reporting the time until roughly 80% of elements in the viewport have loaded. It references img, iframe, css, script, and subdocument elements in the Resource Timing API to determine the time from navigation to the page appearing loaded to an end user.
1
star