https://github.com/podborski/gstreamerlatencyplotter
A small node.js program that allows you to calculate and display the latency of each element of the GStreamer pipeline
https://github.com/podborski/gstreamerlatencyplotter
gstreamer latency plotting
Last synced: 5 months ago
JSON representation
A small node.js program that allows you to calculate and display the latency of each element of the GStreamer pipeline
- Host: GitHub
- URL: https://github.com/podborski/gstreamerlatencyplotter
- Owner: podborski
- License: mit
- Created: 2020-01-17T19:31:25.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-09-19T18:28:54.000Z (over 2 years ago)
- Last Synced: 2025-04-14T05:08:58.632Z (11 months ago)
- Topics: gstreamer, latency, plotting
- Language: JavaScript
- Size: 3.21 MB
- Stars: 36
- Watchers: 2
- Forks: 5
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GStreamer Latency Plotter
A small node.js program that allows you to calculate and display the latency of each element of the GStreamer pipeline while using the GStreamer [Tracing](https://gstreamer.freedesktop.org/documentation/additional/design/tracing.html?gi-language=c#latency) subsystem.
## How to use
1. Install `npm install`
2. Run your GStreamer pipeline using the latency tracer and store the traces in a file like this:
GST_DEBUG_COLOR_MODE=off GST_TRACERS="latency(flags=pipeline+element)" GST_DEBUG=GST_TRACER:7 GST_DEBUG_FILE=traces.log
3. Run `node main.js traces.log` on that logfile. Check `-h` on more options.
## Examples
Decode and render the HEVC bitstream `file.265`:
GST_DEBUG_COLOR_MODE=off GST_TRACERS="latency(flags=pipeline+element)" GST_DEBUG=GST_TRACER:7 GST_DEBUG_FILE=traces.log gst-launch-1.0 filesrc location=file.265 ! video/x-h265 ! h265parse ! avdec_h265 ! videorate ! video/x-raw,framerate=25/1 ! autovideosink
Plot the results:
node main.js traces.log
Which returns you a table like this:

And creates an interactive plot of the latency over time in your web browser window like this:

In this example we have a file where after 10 seconds we swith the aspect ratio of the video, which shows that the `h265parse` element introduces approx. 600 ms of extra latency.
You can find `file.265` and the corresponding `traces.log` from this example in the `testdata` folder.