Coder Social home page Coder Social logo

abhishekyelley / hls-vod-too Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kmxz/hls-vod-too

0.0 0.0 0.0 4.89 MB

HTTP Live Streaming with on-the-fly encoding of any video file for Web/Apple TV/iPhone/iPad/iPod

JavaScript 32.82% TypeScript 64.36% CSS 1.57% HTML 1.25%

hls-vod-too's Introduction

hls-vod-too npm version

HTTP Live Streaming with on-the-fly encoding of any video file. Supports modern browsers through the use of hls.js.

Differences from the original hls-vod

This is like a re-write of the original hls-vod. I certainly borrowed the main idea and many code segments from it. But as the differences (listed below) are huge, I decided to name this as a new package instead of sending changes to the original hls-vod.

Improvements compared to the original hls-vod:

  • On-demand transcoding.
    • Original hls-vod transcode the entire video from beginning to the end, as a whole and in the fixed order. hls-vod-too transcode the parts you're actually playing.
    • This allows seeking immediately after loading a video. With original hls-vod, the progress bar only shows the parts of the video that has finished transcoding. You'll have to wait for the transcoding before jumping to a later time in the video. With hls-vod-too, the progress bar immediately shows the full length of the video, so you can jump to any specific time of the video.
  • Supports multiple quality levels (1080p, 720p, etc.).
    • Done by using a master playlist.
    • It allows video players to automatically switch between different qualities according to network conditions. Users can also switch between quality levels on-the-fly.
  • Detects if a video format is likely to be directly playable in the browser. If so, offer the option to play the video file directly, instead of transcoding and serving through HLS.
    • Modern browsers are capable of playing video files directly, with pretty good performance and full seeking functionality. HLS is unnecessary in this case.
    • User can fallback to use HLS on the web UI. The whole feature can also be disabled by --no-short-circuit.
  • Supports multiple players/transcodings at the same time.
    • The max number of concurrent users can be specified by --max-client-number.
    • When multiple users play the same file (at the same quality level), the file will only be transcoded once.
  • Better thumbnailing (a.k.a. preview).
    • Take snapshots evenly throughout the video, instead of just near the beginning of the video.
    • Allow users to select the number of images in the thumbnail tile.
    • Loading frames one by one instead of loading the entire tile at once, so some frames can be rendered earlier.
  • Play audio files through HLS too.
    • Audio files are now served through HLS instead of a single transcoded audio file. With this, you can seek to a later time in a long audio file easily.
    • Same as videos, files that can be played directly in browsers won't have to go through transcoding.

Limitations compared to the original hls-vod

  • Not supporting VLC as backend. Only supports ffmpeg.
  • Legacy browsers won't be supported, as the UI code uses ES6 classes, web components, async generator functions, etc..

Requirements

  • node.js (>= v10.12)
  • ffmpeg (Tested on 4.1, must be built with libx264).
  • Tested on Linux only.

Installation

npm i -g hls-vod-too

Running (with ffmpeg)

  • Make sure you have node.js and ffmpeg in PATH
  • hls-vod-too --root-path /path/to/my/videos
  • Or: hls-vod-too --transcoder-path /usr/bin --root-path /path/to/my/videos
  • Browse to http://localhost:4040/

Arguments

--root-path DIR - Root path allowed to read files in. Defaults to current directory.

--cache-path DIR - Where to write transcoded video cache. Defaults to OS temp dir.

--ffmpeg-binary-dir DIR - The directory to look for ffmpeg and ffprobe binaries. Needed if they are not in $PATH.

--no-short-circuit - Always playback through HLS, even when the file is directly playable in browsers.

For more arguments run it without arguments: hls-vod-too

hls-vod-too's People

Contributors

mifi avatar kmxz avatar thomaspedersen avatar liu58995 avatar itsjw avatar mysoogal 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.