Plays videos using Prometheus and Grafana, e.g. Bad Apple.

Related tags

prometheus bad-apple
Overview

prometheus_video_renderer

Plays videos using Prometheus and Grafana, e.g. Bad Apple.

grafana

Modes

Currently 3 different modes are supported.

Bitmap

The bitmap mode either creates a sample or does not, depending on the brightness of the source image. It is the only mode compatible with the Prometheus UI.

bitmap-preview

Example: https://www.youtube.com/watch?v=ApJxFprSTqA

Grayscale

The RGB mode creates a metric and sets a brightness label matching an override for each unique brightness.

This is made with 256 unique overrides.

Example coming soon.

RGB

The RGB mode creates offset metrics for red, green, and blue, and sets a brightness label matching an override for each unique color/brightness.

This is 22-bit color, made with 640 unique overrides.

Example: https://www.youtube.com/watch?v=aLvh0oId3Go

Inspiration

A while back I thought this blog post and the corresponding source code were kind of fun. After seeing some of kevinjycui's bad apple videos I thought combining these two ideas could be an interesting (and hilariously terrible) idea.

How to use

  • Download a video e.g. bad_apple.mkv
  • Figure out the output resolution, you should scale 1:1 with height being the number of time series you want.
  • Get a png sequence ffmpeg -i bad_apple.mkv -vf "scale=180:135" -vsync 0 frames\out%06d.png
  • If you would like to make sure that the y axis doesn't change, you can add 1px white bars to each frame. e.g.
    • ffmpeg -i frames\out%06d.png -vf "crop=in_w:in_h-1:0:1,pad=iw+0:ih+1:0:1:#[email protected],format=rgb24" -y frames\out%06d.png
    • ffmpeg -i frames\out%06d.png -vf "crop=in_w:in_h-1:0:-1,pad=iw+0:ih+1:0:-1:#[email protected],format=rgb24" -y frames\out%06d.png
  • go run main.go --project="bad_apple" (use --help to see all arguments)
  • Loop over the files and send them to promtool tsdb create-blocks-from openmetrics
  • docker compose up
  • Wait for Prometheus to compact etc. so it doesn't take 20 years to render.
  • Run a script to record all the frames from the UI. (Mediocre examples are in the scripts directory.)
  • cd to wherever you stored your screenshots.
  • Generate the video file ffmpeg -framerate 30 -i '%06d.png' -c:v libx264 -pix_fmt yuv420p out.mp4
Issues
  • Add grafana + color support

    Add grafana + color support

    opened by MacroPower 0
  • Add Prometheus Jukebox

    Add Prometheus Jukebox

    opened by MacroPower 0
  • Switch to Grafana 8.0

    Switch to Grafana 8.0

    This PR switches to Grafana 8 and Image Renderer 3.

    I've kept the old dashboard, which behaves almost the same as before. It takes about 5-10% less time to render each frame versus Grafana 7.

    I've also added a new dashboard which uses the new Time Series panel (pvr-dash-8), which takes about 50-60% less time to render each frame versus the old Graph panel. The downside is that it looks (in my opinion) slightly worse, as the horizontal gaps between pixels are slightly easier to see.

    For the new dashboard, I just wrote jsonnet for the overrides since I couldn't find anything in the grafana libraries for the Time Series panel. You have to manually paste the output in the grafana-created dashboard json.

    opened by MacroPower 0
  • Any chance to do Nyan Cat?

    Any chance to do Nyan Cat?

    https://www.youtube.com/watch?v=QH2-TGUlwu4 might be a challenge because colors, but would be awesome.

    opened by RichiH 9
Personal video streaming server.

tube This is a Golang project to build a self hosted "tube"-style video player for watching your own video collection over HTTP or hosting your own ch

davy wybiral 194 Jun 11, 2021
Parse and generate m3u8 playlists for Apple HTTP Live Streaming (HLS) in Golang (ported from gem https://github.com/sethdeckard/m3u8)

go-m3u8 Golang package for m3u8 (ported m3u8 gem https://github.com/sethdeckard/m3u8) go-m3u8 provides easy generation and parsing of m3u8 playlists d

Tan Quang Ngo 75 Jun 2, 2021
👾 Annie is a fast, simple and clean video downloader built with Go.

?? Annie is a fast, simple and clean video downloader built with Go. Installation Prerequisites Install via go get Homebrew (macOS only) Arch Linux Vo

Xinzhao Xu 14.9k Jun 12, 2021
Parser and generator of M3U8-playlists for Apple HLS. Library for Go language. :cinema:

M3U8 This is the most complete opensource library for parsing and generating of M3U8 playlists used in HTTP Live Streaming (Apple HLS) for internet vi

Alexander I.Grafov 831 Jun 9, 2021
一个直播录制工具

Bililive-go Bililive-go是一个支持多种直播平台的直播录制工具 支持网站 站点 url 支持情况 Acfun直播 live.acfun.cn 滋瓷 哔哩哔哩直播 live.bilibili.com 滋瓷 战旗直播 www.zhanqi.tv 滋瓷 斗鱼直播 www.douyu.c

Chigusa 576 Jun 12, 2021
Manipulate subtitles in GO (.srt, .ssa/.ass, .stl, .ttml, .vtt (webvtt), teletext, etc.)

This is a Golang library to manipulate subtitles. It allows you to manipulate srt, stl, ttml, ssa/ass, webvtt and teletext files for now. Available op

Quentin Renard 314 Jun 14, 2021
Go bindings for libVLC and high-level media player interface

Go bindings for libVLC 2.X/3.X/4.X and high-level media player interface. The package can be useful for adding multimedia capabilities to applications

Adrian-George Bostan 216 Jun 14, 2021
Parse and demux MPEG Transport Streams (.ts) natively in GO

This is a Golang library to natively parse and demux MPEG Transport Streams (ts) in GO. WARNING: this library is not yet production ready. Use at your

Quentin Renard 367 Jun 9, 2021
Golang bindings for FFmpeg

goav Golang binding for FFmpeg A comprehensive binding to the ffmpeg video/audio manipulation library. Usage import "github.com/giorgisio/goav/avforma

H. Giorgis 1.6k Jun 12, 2021
Live on-demand transcoding in go using ffmpeg. Also with NVIDIA GPU hardware acceleration.

Go live HTTP on-demand transcoding Transcoding is expensive and resource consuming operation on CPU and GPU. For big companies with thousands of custo

Miroslav Šedivý 41 May 24, 2021
A Go implementation of fluent-ffmpeg

A Go implementation of fluent-ffmpeg

Modfy 271 Jun 13, 2021
Go Media Framework

Go FFmpeg Bindings Installation Prerequisites Current master branch supports all major Go versions, starting from 1.6. Build/install FFmpeg build last

alex 691 Jun 12, 2021
golang library to read and write various subtitle formats

libgosubs Golang library to read and write subtitles in the following formats Advanced SubStation Alpha v4 SRT TTML v1.0 - This is based on the spec p

Wargarblgarbl 14 May 20, 2021
Go bindings for GStreamer (retired: currently I don't use/develop this package)

Retired. I don't use/develop this package anymore. Go bindings for GStreamer at a very early stage of maturity. This package is based on GLib bindings

Michał Derkacz 159 Apr 20, 2021