Coder Social home page Coder Social logo

shougun's Introduction

shougun

Take command of your media

What?

shougun is a programmable, extensible, embeddable, media management framework. That's a lot of adjectives, but it's intended for a lot of uses.

My primary use is integration with a voice assistant and a Chromecast, which looks like this:

// ShougunBuilder is a convenient, typesafe, fluent interface for building a
// Shougun instance with whatever features you desire.
const shougun = await ShougunBuilder.create()

    // play back on a specific chromecast device
    .playOnNamedChromecast("Family Room TV")

    // call this multiple times to scan multiple local folders
    .scanFolder("~/Movies")

    // adds support for querying configured Babbling apps and considering those
    // results in findMedia
    .includeBabblingMedia()

    // track episode watch progress in a sqlite db
    .trackInSqlite("shougun.db")

    // use a phonetic matcher for queries, suitable for use with voice assistants
    .matchByPhonetics()

    // allow Shougun to keep the Node process alive; since this is for
    // a long-running server, we ought to do this since it enables various
    // internal optimizations
    .allowProcessKeepalive()

    // construct the instance
    .build();

onPlaybackRequest(async (query: string) => {

    // find the best match to the query from all configured sources
    const found = await shougun.findMedia(query);
    if (!found) {
        throw new Error("no match");
    }

    // play the found media on the configured output surface (a Chromecast).
    // if `found` appears to be a TV series, Shougun will automatically resume
    // wherever you left off
    console.log("Playing", found);
    await shougun.play(found);
});

shougun's People

Contributors

dhleong avatar dependabot[bot] avatar

Stargazers

 avatar Vic avatar Thomas Lekanger avatar

Watchers

 avatar James Cloos avatar

shougun's Issues

Consider more sophisticated transcodability checks and transcode auto-config

This project seems to think that the mkv container format is actually supported, so in such a case we would need to check the actual codecs. We ought to be able to query the Chromecast itself for its type, at least, which would let us know which codecs it supports. In some cases, we may be able to passthrough one of the tracks when transcoding (eg -vcodec copy) instead of necessarily having to transcode both tracks, which could speed things along and reduce instances of buffering on files that are particularly high-quality, for example.

Consider typesafe Builder interfaces

This could give users compile-time checks to guarantee they've configured all the necessary things before they can call .build(), hiding optional configuration like .matchWith or .enableRemote() until all the required components (tracker, discovery, player) are configured.

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.