npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

p2ptv

v0.5.2

Published

HTML5 livestreaming

Downloads

3

Readme

p2ptv

An open source P2P livestreaming module for synchronized playback in HTML5.

p2ptv distributes live WebM by sending the WebM Byte Stream Format directly to the browser where the experimental MSE API is used for playback. Livestreams are transcoded from RTMP or from a file before being processed by this module.

The plan is to significantly reduce the cost of livestreaming by forming a P2P distribution network using WebRTC. Currently has only client-server implementation. If you're interested in starting a webservice, it is probably in your best interest to use conventional streaming methods.

Please note that this is alpha software. Meaning it is experimental, unstable, incomplete, and likely to change drastically between versions. Feel free to contribute if you are interested in the project.

Supported browsers

  • Chrome 34+
  • Opera 15+
  • Firefox 43+

Install

npm install p2ptv

or

$ git clone git://github.com/eadle/p2ptv.git
$ cd p2ptv
$ npm install

Usage

Without logging:

$ node example/example.js

With verbose logging:

$ DEBUG=p2ptv,gateway,peer,push-pull-window node example/example.js

Transcoding

There's no FFmpeg flag to force placement of a keyframe at the beginning of each cluster. Until this project switches to DASH, just set -cluster_size_limit and -cluster_time_limit to 999999999 or some value that's greater than your expected media segments. It's ugly, but it works.

From RTMP (with upstream port set to 9001):

ffmpeg -re -i rtmp://localhost:1935/480p/test -c:a libvorbis -c:v libvpx \
-g 150 -crf 23 -lag-in-frames 15 -profile:v 2 -qmax 50 -qmin 1 \
-cpu-used 0 -slices 4 -b:v 2M -cluster_size_limit 999999999 \
-cluster_time_limit 999999999 -deadline realtime \
-f webm tcp://localhost:9001;

From a file:

ffmpeg -i media/test.mp4 -c:a libvorbis -c:v libvpx -g 150 -crf 23 \
-lag-in-frames 15 -profile:v 2 -qmax 50 -qmin 1 -cpu-used 0 -b:v 1M \
-cluster_size_limit 999999999 -cluster_time_limit 999999999 \
-deadline realtime -f webm tcp://127.0.0.1:9001

You may have better results transcoding from RTMP. It really depends on how much processing power you're willing to give your transcoding box.

License

MIT

Contributing

Not really actively working on this anymore. Feel free to create an issue or pull request though.