Play videos on IT8951-controlled e-paper displays

Overview

it8951-video

Play videos on IT8951-controlled e-paper displays via USB. This has been tested with a Waveshare 7.8inch e-Paper HAT display.

Example Video

Design

This runs fairly smooth considering it is a e-Paper display (~5 fps) which has not been optimized for video usage. The following "tricks" have been used:

  • Convert every video frame into an image which only contains black or white pixels (via dithering)
  • Pack pixel information for every frame into 1bit (black = 0, white = 1) and store it in a file so it can be played later (don't do this on-the-fly as the dithering process takes too much time)
  • Activate undocumented 1bpp (1 bit per pixel) and "pitch" mode on IT8951 by flipping the bits in the 0x1800_1138 register before displaying
  • Store frame data via "fast write" (fw) 0xa5 command in memory
  • Since the data is smaller now (322944 bytes) than grayscale images we can store up to 8 frames in the image buffer (which usually only has space for one image)
  • Always write in A2 mode since it is fast and does not cause any flashing with b/w-only data. Use GL16 mode sometimes, just to make sure the ghosting does not minder the quality too much

Requirements

  • ffmpeg
  • Rust

Preparation

In order to make this work you need to create a udev rule that gives users permission to talk to this device. To this end add a file 60-it8951.rules to the /etc/udev/rules.d directory with the following contents:

SUBSYSTEM=="usb", ATTRS{idVendor}=="048d", MODE="0666"

This gives applications access to talk to devices by vendor "048d", which is the IT8951. You can then restart your system, or by write this to trigger without reboot:

udevadm control --reload-rules && udevadm trigger

Usage

Play videos on IT8951-controlled e-paper displays

USAGE:
    it8951-video [OPTIONS] <input>

FLAGS:
        --help       Prints help information
    -V, --version    Prints version information

OPTIONS:
    -v, --vcom <vcom>        VCOM value [default: -1.58]
    -g, --ghost <ghost>      Paint in GL16 mode every nth frame [default: 32]
    -t, --take <take>        Only take every nth frame from video [default: 5]
    -w, --width <width>      Width of video on display [default: 1856]
    -h, --height <height>    Height of video on display [default: 1392]

ARGS:
    <input>    Video file which will be displayed

Credits

You might also like...
A command line application which sets your wall paper with new image generating pollens once they arrive.

pollenwall Table of Contents pollenwall About Installation Binary releases Build from source Usage Command Line Arguments Running as a service MacOS L

An Rust implementation of the Modified Merkle Patricia Tree described by ETH Yellow Paper

Merkle Patricia Tree的Rust实现 博客文章:https://dere.press/2022/01/24/eth-trie/ 本实现参考下列项目: https://ethereum.github.io/yellowpaper/paper.pdf https://github.co

Supporting code for the paper "Optimized Homomorphic Evaluation of Boolean Functions" submitted to Eurocrypt 2024

This repository contains the code related to the paper Optimized Homomorphic Evaluation of Boolean Functions. The folder search_algorithm contains the

 yayagram - Play nonograms/picross in your terminal
yayagram - Play nonograms/picross in your terminal

yayagram is a puzzle game in which you fill out a grid with cells based on logic and number clues.

Lists Steam applications that have specified a Steam Play compatibility tool

proton-usage Lists Steam applications that have specified a Steam Play compatibility tool. Useful for when you want to remove/uninstall unused compati

ADPlay (ASCII-Drip Play): Pics on your terminal
ADPlay (ASCII-Drip Play): Pics on your terminal

ADPlay ADPlay (ASCII-Drip play): Graphic content on your terminal (works better on pixel arts) Build Build bin and install dependencies: cargo build -

A series of crates that I made to compile images/video into asciinema & play them.

Bad Apple A series of crates that I made to compile images/video into asciinema & play them. The end goal is to make a kernel & legacy bootloader that

xyz is a chat platform where people sign up, play a matching game, and say goodbye
xyz is a chat platform where people sign up, play a matching game, and say goodbye

xyz is an asynchronous chat and web service What you need Docker Desktop 🐳 Cargo (Rust package manager) 📦 Clone our project Follow the steps below t

A CLI tool that converts videos to ASCII and displays them to the terminal on the fly
A CLI tool that converts videos to ASCII and displays them to the terminal on the fly

A CLI tool that converts videos to ASCII and displays them to the terminal on the fly

ePaperify: Framebuffer/image pre-processing library for e-Paper displays

ePaperify: Framebuffer/image pre-processing library for e-Paper displays

Procedural engine sound generator controlled via GUI or CLI
Procedural engine sound generator controlled via GUI or CLI

enginesound GUI Application used to generate purely synthetic engine sounds with advanced options written in Rust loosely based on this paper Reading

A LED Christmas Tree controlled by Rust. Contribute your own renderers!
A LED Christmas Tree controlled by Rust. Contribute your own renderers!

Rusty Christmas Tree This is code that draws on the LED Christmas Tree made by @aidancrowther. You can see his 3D design files and Pi Pico setup code

Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres.

SDB - SignatureDB Distributed, version controlled, SQL database with cryptographically verifiable storage, queries and results. Think git for postgres

This contract is to provide vesting account feature for the both cw20 and native tokens, which is controlled by a master address

Token Vesting This contract is to provide vesting account feature for the both cw20 and native tokens, which is controlled by a master address. Instan

MIDI-controlled stereo-preserving granular-synthesizer LV2 plugin

Stereog "Stereog" rhymes with "hairy dog." Stereog is a MIDI-controlled stereo-preserving granular synthesizer LV2 plugin. It is experimental software

Minimal server (with maximal security) for turning off an X10-controlled fan over HTTP

"Fan Remote" A self-contained Rust binary to expose a single X10 command (turn off that fan) as an HTML form button. In its current form, it's highly

Minimalist multi-track audio recorder which may be controlled via OSC or MIDI.
Minimalist multi-track audio recorder which may be controlled via OSC or MIDI.

smrec Minimalist multi-track audio recorder which may be controlled via OSC or MIDI. I did this because I needed a simple multi-track audio recorder w

A bunch of links to blog posts, articles, videos, etc for learning Rust

rust-learning A bunch of links to blog posts, articles, videos, etc for learning Rust. Feel free to submit a pull request if you have some links/resou

 Slideo: This tool uses OpenCV to automatically synchronize slides with videos that show these slides.
Slideo: This tool uses OpenCV to automatically synchronize slides with videos that show these slides.

This tool matches video frames against PDF pages by using computer vision. It also ships a web app in which you can click on a PDF page to play the video from the first frame showing the page. Its primary use-case is to quickly play a recorded lecture from a given slide.

Comments
  • Cool project - any suggestions to get vcom value?

    Cool project - any suggestions to get vcom value?

    Hi! I've been playing with the usb based controlling using https://sr.ht/~martijnbraam/it8951/ C code as the basis. I wasn't able to get the current vcom value using this code. Have you successfully queried the vcom value? The USB programming pdf sheet had an example command:

    unsigned char get_vcom_cmd[16] = {
      0xfe, // Customer command.
      0x00,
      0x00,
      0x00,
      0x00,
      0x00,
      0xa3,  // PMIC (Power Management Integrated Circuits) command.
      0x00,
      0x00,
      0x00,   // Do Set VCom? (0 – no, 1 – yes)
      0x00,
      0x00,
      0x00,
      0x00,
      0x00,
      0x00,
    };
    

    but it didn't describe the return shape or length in bytes.

    As a reference, Waveshare has a GPIO based C code example.

    opened by kimmobrunfeldt 4
Owner
Andreas Dzialocha
Andreas Dzialocha
Nazuna - 🐦 Download Twitter videos using your terminal!

Nazuna ?? Download Twitter videos using your terminal! Installation Binary Download the desired file for your OS (Windows, Mac, Linux) from https://gi

Felipe Garcia 27 Nov 22, 2022
Enhance low quality images and videos using AI technology.

Real ESRGAN GUI Real ESRGAN GUI is a simple and minimal GUI for xinntao's Real-ESRGAN This allows you to enhance low quality images and videos using A

null 20 Dec 21, 2022
A terminal ASCII media player. View images, gifs, videos, webcam, YouTube, etc.. directly in the terminal as ASCII art.

Terminal Media Player View images, videos (files or YouTube links), webcam, etc directly in the terminal as ASCII. All images you see below are just m

Max Curzi 36 May 8, 2023
A Rust-based renderer for Remotion videos.

Rustymotion A Rust-based renderer for Remotion projects. ?? WARNING: This is exploratory work only, use at your own risk. Design Remotion allows you t

Siddharth 12 Oct 6, 2023
Tokei is a program that displays statistics about your code.

Tokei is a program that displays statistics about your code. Tokei will show the number of files, total lines within those files and code, comments, and blanks grouped by language.

null 7.5k Jan 1, 2023
Coinlive is an interactive command line tool that displays live cryptocurrency prices.

Coinlive is an interactive command line tool that displays live cryptocurrency prices. It can also display simple historical price charts.

Mayer Analytics 9 Dec 7, 2022
A cargo subcommand that displays ghidra function output through the use of the rizin rz-ghidra project.

cargo-rz-ghidra A cargo subcommand that displays ghidra function output through the use of the rizin rz-ghidra project. Install cargo install --git ht

wcampbell 4 Nov 5, 2022
Kusa is a simple CLI tool that works on any platform and displays GitHub contribution graphs.

Kusa is a simple CLI tool that works on any platform and displays GitHub contribution graphs. Installation Homebrew (only macOS) $ brew tap Ryu0118/Ku

Ryu 103 Jun 18, 2023
An implementation of Joshua Yanovski's Ghost Cell paper.

A novel safe and zero-cost borrow-checking paradigm from the GhostCell paper. Motivation A number of collections, such as linked-lists, binary-trees,

null 350 Dec 22, 2022
Source code for our paper "Higher-order finite elements for embedded simulation"

Higher-order Finite Elements for Embedded Simulation This repository contains the source code used to produce the results for our paper: Longva, A., L

Interactive Computer Graphics 18 Sep 30, 2022