Git Product home page Git Product logo

videointerminal.jl's Introduction

VideoInTerminal.jl

Video playback in terminal via. ImageInTerminal.jl and VideoIO.jl

Experimental! Owes a lot to ImageInTerminal!

Usage

Play

julia> using VideoInTerminal

julia> framestack = map(i->rand(Gray{N0f8},60,40), 1:200); # a vector of images of the same type and dims

julia> play(framestack) # play through the framestack

julia> colorcube = rand(Gray{N0f8},60,40,30);

julia> play(colorcube, 2) # play slices along dim 2

julia> play("path/to/video.mp4")

ffmpeg test video example

kwargs:

  • fps::Real: play the framestack back at a target fps (default 30)
  • maxsize::Tuple: specify a max video size in terminal characters. Default is determined from terminal window size

Control keys:

  • p or space-bar: pause
  • left- or up-arrow: step backward (in framestack mode)
  • right- or down-arrow: step forward (in framestack mode)
  • ctrl-c or q: exit

Explore

explore methods mimic play methods except starting paused.

Control keys enable stepping through the selected dimension

julia> using VideoInTerminal, TestImages

julia> img = testimage("mri-stack");

julia> explore(img, 3) # explore img along the 3rd dimension, use arrow keys to move

mri example

Camera Streaming

View the primary system camera

julia> showcam()

streaming webcam example

or choose another capture device:

julia> devs = VideoInTerminal.VideoIO.CAMERA_DEVICES
2-element Vector{String}:
 "FaceTime HD Camera (Built-in)"
 "Capture screen 0"

julia> showcam(device=devs[2])

Test videos

VideoIO's test videos can also be accessed by name, which will be automatically downloaded

julia> testvideo("annie_oakley")

Tips

  1. Exit the video with an interrupt via. ctrl-c

  2. If video playback isn't reaching the desired fps, try stopping the video and reduce the size of your terminal, or specify the maxsize kwarg as a tuple of width and height in terminal characters.

    If it's still slow, the internal downscaling in ImageInTerminal may be the limiting factor

  3. ImageInTerminal is exported, so color depth settings can be controlled as per the manual

videointerminal.jl's People

Contributors

ianbutterworth avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.