All Projects → kmoskwiak → Node Tcp Streaming Server

kmoskwiak / Node Tcp Streaming Server

Experimental TCP video streaming server written in node.js. Streaming over TCP and redistributing using WebSockets.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Tcp Streaming Server

dji-ryze-tello
Pythonic DJI Ryze Tello Workbench
Stars: ✭ 17 (-83%)
Mutual labels:  streaming, h264, ffmpeg
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+1948%)
Mutual labels:  ffmpeg, streaming, video-streaming
Ott Packager
OTT/ABR streaming encoder (H264/HEVC) and packager for DASH and HLS
Stars: ✭ 148 (+48%)
Mutual labels:  video-streaming, h264, streaming
Awesome Video
A curated list of awesome streaming video tools, frameworks, libraries, and learning resources.
Stars: ✭ 397 (+297%)
Mutual labels:  ffmpeg, video-streaming, streaming
Analysisavp
音视频学习,相关文件格式/协议分析。h264 nalu aac adts flv
Stars: ✭ 38 (-62%)
Mutual labels:  ffmpeg, h264
Video Stream.js
🔜 📼 Video stream middleware for express.js
Stars: ✭ 37 (-63%)
Mutual labels:  h264, streaming
Live Stream Face Detection
Live Streaming and Face Detection with Flask in Browser
Stars: ✭ 47 (-53%)
Mutual labels:  video-streaming, streaming
Conv2mp4 Ps
This Powershell script will recursively search through a user-defined file path and convert all videos of user-specified file types to MP4 with H264 video and AAC audio using ffmpeg. The purpose of this script is to reduce transcoding CPU load on a media server like Plex or Emby and increase video compatibility across platforms.
Stars: ✭ 97 (-3%)
Mutual labels:  ffmpeg, h264
Beetlex
high performance dotnet core socket tcp communication components, support TLS, HTTP, HTTPS, WebSocket, RPC, Redis protocols, custom protocols and 1M connections problem solution
Stars: ✭ 802 (+702%)
Mutual labels:  websocket, tcp
Gochat
goim server write by golang !🚀
Stars: ✭ 1,144 (+1044%)
Mutual labels:  websocket, tcp
Hls.js
HLS.js is a JavaScript library that plays HLS in browsers with support for MSE.
Stars: ✭ 10,791 (+10691%)
Mutual labels:  video-streaming, streaming
Ksylive ios
金山云直播SDK [ iOS推流+播放 ]融合版 支持美颜滤镜(Beauty Filter)、美声(Beauty Voice)、软硬编(Software/Hardware Encoder) 、网络自适应(Network Auto Adapt)、混音(Audio Mixer)、混响(Reverb)、画中画(PIP)
Stars: ✭ 861 (+761%)
Mutual labels:  video-streaming, h264
Bigq
Messaging platform in C# for TCP and Websockets, with or without SSL
Stars: ✭ 18 (-82%)
Mutual labels:  websocket, tcp
Gotalk
Async peer communication protocol & library
Stars: ✭ 1,036 (+936%)
Mutual labels:  websocket, streaming
Rtsp Simple Server
ready-to-use RTSP / RTMP server and proxy that allows to read, publish and proxy video and audio streams
Stars: ✭ 882 (+782%)
Mutual labels:  h264, streaming
Akka Http
The Streaming-first HTTP server/module of Akka
Stars: ✭ 1,163 (+1063%)
Mutual labels:  websocket, streaming
Streama
Self hosted streaming media server. https://docs.streama-project.com/
Stars: ✭ 8,948 (+8848%)
Mutual labels:  video-streaming, streaming
Bilibili Live Ws
Bilibili live WebSocket/tcp API
Stars: ✭ 79 (-21%)
Mutual labels:  websocket, tcp
Screen Recorder Ffmpeg Cpp
*Multimedia project* A screen recording application to capture your desktop and store in a video format. Click here to watch the demo
Stars: ✭ 98 (-2%)
Mutual labels:  ffmpeg, video-streaming
T Io
解决其它网络框架没有解决的用户痛点,让天下没有难开发的网络程序
Stars: ✭ 1,331 (+1231%)
Mutual labels:  websocket, tcp

Streaming Video over TCP and WebSockets with node.js

This is experimental streaming server in node.js. Ingest stream is sent over TCP to server then it is redistributed to all clients over WebSockets.

Ingest stream

FFMPEG can be used to ingest stream. In this example I use v4l2 to caputre camera on linux.

-f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0

VP8 (using libvpx)

ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0  -vcodec libvpx -b:v 3500k -r 25 -crf 10 -quality realtime -speed 16 -threads 8 -an -g 25 -f webm tcp://localhost:9090

H.264 (using libx264)

To stream MP4 it needs to be ISO BMFF compatible, so -movflags is set to empty_moov+default_base_moof.

ffmpeg -f v4l2 -framerate 25 -video_size 640x480 -i /dev/video0  -vcodec libx264 -profile:v main -g 25 -r 25 -b:v 500k -keyint_min 250 -strict experimental -pix_fmt yuv420p -movflags empty_moov+default_base_moof -an -preset ultrafast -f mp4 tcp://localhost:9090

Stream flow

FFMPEG ---TCP---> NODE.JS Server -- WebSockets --> [client 0] MediaSource Video
                                |-- WebSockets --> [client 1] MediaSource Video
                                |-- WebSockets --> [client 2] MediaSource Video

Ingest stream is sent over TCP to node.js server. Every packet of stream is sent to clients using WebSockets.

MediaSource is used to retrive video stream.

How to use

Install

npm install

Start application

gulp 

In browser go to localhost:8080

Stream video to tcp://localhost:9090

ffmpeg (...) tcp://localhost:9090

According to video codec set codecString in client/js/app.js line 9 to right value.

You can customize ports in server\app.js lines 12 and 13.

'First packet' hack :)

There is little hack in lines 41-44 and 68-76. Server stores beginning of stream in array which is sent to every new client. Every client will receive couple of start frames.

Without that hack video won't start for users who start watching in the middle of stream. Perhaps there is solution in better ffmpeg setting.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].