Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using Rust to Process ILDA (Laser Video) Files

Lukas
July 03, 2019

Using Rust to Process ILDA (Laser Video) Files

Lukas

July 03, 2019
Tweet

More Decks by Lukas

Other Decks in Technology

Transcript

  1. Using Rust with ILDA (Laser
    Video) Files
    Lukas Prasuhn
    2019/07/03 @ Rust LT #6

    View full-size slide

  2. About me
    - Software Engineer @ Ubie
    - Kotlin / Spring Boot
    - Typescript / React
    - Ruby / Rails
    - 14y in Japan from Germany
    lukasjapan
    @cvguy84

    View full-size slide

  3. ILDA files
    - Video for Laser Projectors
    - Fairly low level
    - Move
    - Color
    - Blanking (Laser On/Off)

    View full-size slide

  4. Making command line tools for ILDA files
    - No satisfactory OSS solution
    - Mostly players & libraries
    - Windows tools that you need to download from forums
    - Streaming
    - Unix command feeling
    - Do one thing but do it good
    - Connect via pipes
    - …
    - Controlling home brew projector
    lukasjapan/ilda-tools

    View full-size slide

  5. Why in Rust?
    - Controlling a homebrew projector from Raspberry Pi
    - Statically compiled
    - Performance
    - Library ecosystem
    - Cargo
    - Crates.io
    - Ruling out other choices
    - Go → less performant
    - C++ → the build system is …
    - Kotlin Native → origin is JVM, production ready?

    View full-size slide

  6. - All purpose command line argument library
    - Supports
    - Flags (-v)
    - Short names (-x yy)
    - Long names (--foo=bar)
    - Automatic help generation
    Used crate for command line argument processing
    clap

    View full-size slide

  7. Used crate to display ILDA data with OpenGL
    - OpenGL wrapper for Rust
    - Window creation (through winit)
    - Event processing
    - Vertex mapping via macro
    glium

    View full-size slide

  8. Used crate(s) to help converting from SVG to ILDA
    - usvg
    - Simplify svg files
    - Reader: svgdom
    - lyon_geom
    - Part of a bigger project (lyon)
    - Svg calculation tools (bezier curves, etc)
    usvg, lyon_geom

    View full-size slide

  9. Used crate to create wav files
    - Projector takes analog signal
    - DAC
    - Digital Analog Converter
    - Sound card is a DAC
    - Convert ILDA files to WAV
    - Get properly timed analog signal from sound card
    - hound
    - read/write wav headers and content
    hound
    Sound Card
    .wav

    View full-size slide

  10. Cargo and crates.io
    - Rusts dependency manager
    - Files
    - Dependency definition file (cargo.toml)
    - Lock file (cargo.lock)
    - In other languages
    - Ruby: bundler + rubygems
    - JS: npm/yarn + npm packages
    - PHP: composer + packagist
    - …
    - Thoughts
    - As easy to use as in other languages
    - Crates are sufficiently mature
    - Finally this kind of solution arrived for a statically compiled language

    View full-size slide

  11. Lets use Rust!

    View full-size slide