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...
Source code for our paper
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

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

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
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
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
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
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
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
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
A simple but production-ready link shortener. Repository belonging to one of my YouTube videos

What is this? This is a simple link shortener, which is the result of a tutorial I did on YouTube. Important technologies used Rust (as our most belov

Oliver Jumpertz 7 Apr 21, 2024
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