Code Monkey home page Code Monkey logo

yokeap / packet-video Goto Github PK

View Code? Open in Web Editor NEW

This project forked from openrov-atoms/packet-video

0.0 1.0 0.0 55 KB

This is a webcomponent that allows streaming live real-time .mp4 video files packet by packet using Media Source Extensions which injects the video packets directly in to the browsers graphic video decoding subsystem for optimal playback. Great for streaming video over socket.io or websockets.

License: MIT License

HTML 100.00%

packet-video's Introduction

packet-video

This is a webcomponent that allows streaming live real-time .mp4 video files packet by packet using Media Source Extensions which injects the video packets directly in to the browsers graphic video decoding subsystem for optimal playback. Great for streaming video over socket.io or websockets.

Build Status

This component has been tuned for low-latency video delivery (no buffering).

The component works and has passing unit tests.

The incoming video has to be a segmented mp4 file.

The current system only supports a single video stream at the moment. If you want to send audio, you will need to send it separately.

To install:

bower install https://github.com/OpenROV-atoms/packet-video.git

Example usage:

<!doctype html>
<html>
  <head>
    <script src="../bower_components/webcomponentsjs/webcomponents-lite.js"></script>
    <link rel="import" href="../bower_components/packet-video.html">
  </head>
  <body>
    <packet-video id='video'>
      <h2>Text to overlay the video</h2>
    </packet-video>
...
  <script>
    var v = document.getElementById("video");
    var initialFrame = //some means to get the initial frame of the segmented mp4
    v.init(initialFrame);
    socket.on('data',function(data){
        v.append(data);  //both the data and the initFrame need to be UInt8Array
    });

Running the unit tests: The tests have a dependency on Google's web component tester (https://github.com/Polymer/web-component-tester) which should be installed via npm in to your local environment.

To run the tests:

wct

The included wct.conf.json file has a list of local browsers it attempts to test with, adjust it as needed.

Issues affecting live H264 streaming (Updated 2016 Mar 29)

currentTime as reported by HTML5 <video> is not frame-accurate https://code.google.com/p/chromium/issues/detail?id=555376

MSE - remove() to escape QuotaExceededError is leading to decode error later https://code.google.com/p/chromium/issues/detail?id=529990

videoTag.currentTime should not exceed videoTag.buffered.end(N) for the currently playing range https://code.google.com/p/chromium/issues/detail?id=414828

Chrome requires a user touch event to play video http://chromium-bugs.chromium.narkive.com/cW5IXVgj/issue-178297-in-chromium-android-chrome-does-not-allow-applications-to-play-html5-audio-without-an https://bugs.chromium.org/p/chromium/issues/detail?id=178297

packet-video's People

Contributors

brianadams avatar

Watchers

 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.