All Projects → leandromoreira → Live Stream From Desktop

leandromoreira / Live Stream From Desktop

Provide guidance to test live streaming (mpeg-dash or hls) or vod from your desktop

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Live Stream From Desktop

nott
The New OTT Platform - an excuse to discuss and design a simple edge computing platform
Stars: ✭ 46 (-62.9%)
Mutual labels:  ffmpeg, hls, live-streaming
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+1551.61%)
Mutual labels:  ffmpeg, hls, live-streaming
Docker Nginx Rtmp
🐋 A Dockerfile for nginx-rtmp-module + FFmpeg from source with basic settings for streaming HLS. Built on Alpine Linux.
Stars: ✭ 608 (+390.32%)
Mutual labels:  ffmpeg, hls, live-streaming
Abr Broadcaster
A real time encoder for Adaptive Bitrate Broadcast
Stars: ✭ 80 (-35.48%)
Mutual labels:  ffmpeg, hls, live-streaming
Iptv
一键安装管理 FFmpeg / nginx / openresty / xray / v2ray / armbian / proxmox / cloudflare partner,workers / ibm cloud foundry 脚本
Stars: ✭ 481 (+287.9%)
Mutual labels:  ffmpeg, hls
Gohls
A server that exposes a directory for video streaming via web interface
Stars: ✭ 409 (+229.84%)
Mutual labels:  ffmpeg, hls
Streamline
A reference system for end to end live streaming video. Capture, encode, package, uplink, origin, CDN, and player.
Stars: ✭ 581 (+368.55%)
Mutual labels:  hls, live-streaming
Go Oryx
The go-oryx is SRS++, focus on real-time live streaming load-balancer.
Stars: ✭ 608 (+390.32%)
Mutual labels:  hls, live-streaming
Awesome Live Stream
Webrtc && Nginx && DASH && Quic 学习资料收集,持续更新中
Stars: ✭ 290 (+133.87%)
Mutual labels:  ffmpeg, hls
Janus Webrtc Gateway Docker
Perfect Docker Image for Media Streaming Expert User ( https://github.com/meetecho/janus-gateway )
Stars: ✭ 582 (+369.35%)
Mutual labels:  ffmpeg, hls
Ffmpeg
Mirror of https://git.ffmpeg.org/ffmpeg.git
Stars: ✭ 27,382 (+21982.26%)
Mutual labels:  ffmpeg, hls
Awesome Video
A curated list of awesome streaming video tools, frameworks, libraries, and learning resources.
Stars: ✭ 397 (+220.16%)
Mutual labels:  ffmpeg, hls
Rtsp Stream
Out of box solution for RTSP - HLS live stream transcoding. Makes RTSP easy to play in browsers.
Stars: ✭ 349 (+181.45%)
Mutual labels:  hls, live-streaming
Shaka Player
JavaScript player library / DASH & HLS client / MSE-EME player
Stars: ✭ 5,386 (+4243.55%)
Mutual labels:  hls, live-streaming
Php Practice
🌹 一天一点点,积少成多...
Stars: ✭ 351 (+183.06%)
Mutual labels:  ffmpeg, hls
Go Transcode
Live on-demand transcoding in go using ffmpeg. Also with NVIDIA GPU hardware acceleration.
Stars: ✭ 39 (-68.55%)
Mutual labels:  ffmpeg, live-streaming
Laravel Ffmpeg
This package provides an integration with FFmpeg for Laravel. Laravel's Filesystem handles the storage of the files.
Stars: ✭ 807 (+550.81%)
Mutual labels:  ffmpeg, hls
Hls Trimming Frame Accuracy
JS Code that given a group of HLS chunks, a start timestamp, and end timestamp it creates one MP4 that contains the original V/A frame accuracy trimmed and perfectly aligned
Stars: ✭ 46 (-62.9%)
Mutual labels:  ffmpeg, hls
Python Ffmpeg Video Streaming
📼 Package media content for online streaming(DASH and HLS) using FFmpeg
Stars: ✭ 269 (+116.94%)
Mutual labels:  ffmpeg, hls
Ffdynamic
Library with dynamic audio/video composition and runtime control
Stars: ✭ 274 (+120.97%)
Mutual labels:  ffmpeg, live-streaming

Live stream from your desktop

It provides guidance to test live streaming (mostly RTMP, mpeg-dash or hls) or vod from your own desktop using FFmpeg, it's pretty useful for testing and learning purposes.

MacOS

Tested with:

  • MacOS High Siera 10.13, 10.15.2, Ubuntu 18.04
  • Warning: The video asset used for looping streaming is more than hundreds of MBs.

Requirements

docker
wget
curl

Simulating HLS / DASH with multiple renditions/resolutions and DVR

HLS

Run this server in one of your tabs:

curl -s https://raw.githubusercontent.com/leandromoreira/live-stream-from-desktop/master/start_http_server.sh | sh

Run this encoder in another of your tabs:

curl -s https://raw.githubusercontent.com/leandromoreira/live-stream-from-desktop/master/start_hls_abr_live_stream.sh | sh

Access the stream at http://localhost:8080/master.m3u8 or at clappr's demo page

DASH

Run this server in one of your tabs:

curl -s https://raw.githubusercontent.com/leandromoreira/live-stream-from-desktop/master/start_http_server.sh | sh

Run this encoder in another of your tabs:

curl -s https://raw.githubusercontent.com/leandromoreira/live-stream-from-desktop/master/start_dash_abr_live_stream.sh | sh

Access the stream at http://localhost:8080/out.mpd or go to dashjs's demo page

Simulating an HLS and MPEG-DASH live streaming for latency comparison

HLS

Run this server in one of your tabs:

curl -s https://raw.githubusercontent.com/leandromoreira/live-stream-from-desktop/master/start_http_server.sh | sh

Run this encoder in another of your tabs:

curl -s https://raw.githubusercontent.com/leandromoreira/live-stream-from-desktop/master/start_hls_low_latency_live_stream.sh | sh

Access the stream at http://localhost:8080/stream.m3u8 or at clappr's demo page

MPEG-DASH

Run this server in one of your tabs:

curl -s https://raw.githubusercontent.com/leandromoreira/live-stream-from-desktop/master/start_http_server.sh | sh

Run this encoder in another of your tabs:

curl -s https://raw.githubusercontent.com/leandromoreira/live-stream-from-desktop/master/start_mpeg_dash_low_latency_live_stream.sh | sh

Access the stream at http://localhost:8080/stream.mpd

Requirements

# I assume you have brew already

# or you could use curl
brew install wget
brew install ffmpeg
brew install node

# the http server
npm install http-server -g

#  WARNING IT IS A HUGE download file (263M)
wget -O bunny_1080p_30fps.mp4 http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_30fps_normal.mp4

Sending live RTMP from your local machine

Single Bitrate

From a pseudo FFmpeg video source color bar and generated audio signal made of a sine wave with amplitude 1/8.

ffmpeg -hide_banner \
-re -f lavfi -i "testsrc2=size=1280x720:rate=30,format=yuv420p" \
-f lavfi -i "sine=frequency=1000:sample_rate=4800" \
-c:v libx264 -preset ultrafast -tune zerolatency -profile:v high \
-b:v 1400k -bufsize 2800k -x264opts keyint=30:min-keyint=30:scenecut=-1 \
-c:a aac -b:a 128k -f flv rtmp://<HOST>:1935/live/<STREAM>

From a file.

ffmpeg -stream_loop -1 \
-re -i <YOUR_VIDEO>.mp4  -c:v libx264 \
-x264opts keyint=30:min-keyint=30:scenecut=-1 -tune zerolatency \
-s 1280x720 -b:v 1400k -bufsize 2800k \
-f flv rtmp://<HOST>:1935/live/<STREAM>

Multiple Bitrates

From a pseudo FFmpeg video source color bar and generated audio signal made of a sine wave with amplitude 1/8.

ffmpeg -hide_banner \
-re -f lavfi -i "testsrc2=size=1280x720:rate=30,format=yuv420p" \
-f lavfi -i "sine=frequency=1000:sample_rate=4800" \
-c:v libx264 -preset ultrafast -tune zerolatency -profile:v high \
-b:v 1400k -bufsize 2800k -x264opts keyint=30:min-keyint=30:scenecut=-1 \
-c:a aac -b:a 128k -f flv rtmp://<HOST>:1935/live/<STREAM> \
-c:v libx264 -preset ultrafast -tune zerolatency -profile:v high \
-b:v 750k -bufsize 1500k -s 640x360 -x264opts keyint=30:min-keyint=30:scenecut=-1 \
-c:a aac -b:a 128k -f flv rtmp://<HOST>:1935/live/<STREAM> 

From a file.

ffmpeg -stream_loop -1 \
-re -i <YOUR_VIDEO>.mp4  -c:v libx264 \
-x264opts keyint=30:min-keyint=30:scenecut=-1 -tune zerolatency \
-s 1280x720 -b:v 1400k -bufsize 2800k \
-f flv rtmp://<HOST>:1935/live/<STREAM> \
-x264opts keyint=30:min-keyint=30:scenecut=-1 -tune zerolatency \
-s 640x360 -b:v 750k -bufsize 1500k \
-f flv rtmp://<HOST>:1935/live/<STREAM>

Simulating a MPEG-DASH live streaming from a file

Open a terminal and run the ffmpeg command:

ffmpeg -stream_loop -1 -re -i bunny_1080p_30fps.mp4 \
       -c:v libx264 -x264opts keyint=30:min-keyint=30:scenecut=-1 \
       -preset superfast -profile:v baseline -level 3.0 \
       -tune zerolatency -s 1280x720 -b:v 1400k \
       -bufsize 1400k -use_timeline 1 -use_template 1 \
       -init_seg_name init-\$RepresentationID\$.mp4 \
       -min_seg_duration 2000000 -media_seg_name test-\$RepresentationID\$-\$Number\$.mp4 \
       -f dash stream.mpd

In another tab, run the following command to fire up the server:

http-server -a :: -p 8081 --cors -c-1

Now you can test this with your player (using the URL http://localhost:8081/stream.mpd).

Simulating an HLS live streaming from a file

Open a terminal and run the ffmpeg command:

ffmpeg -stream_loop -1 -re -i bunny_1080p_30fps.mp4 -c:v libx264 \
          -x264opts keyint=30:min-keyint=30:scenecut=-1 \
          -tune zerolatency -s 1280x720 \
          -b:v 1400k -bufsize 1400k \
          -hls_start_number_source epoch -f hls stream.m3u8

In another tab, run the following command to fire up the server:

http-server -a :: -p 8081 --cors -c-1

Now you can test this with your player (using the URL http://localhost:8081/stream.m3u8).

Simulating a MPEG-DASH live streaming from MacOS camera

Open a terminal and run the ffmpeg command:

ffmpeg -re -pix_fmt uyvy422 -f avfoundation -i "0" -pix_fmt yuv420p \
       -c:v libx264 -x264opts keyint=30:min-keyint=30:scenecut=-1 \
       -preset superfast -profile:v baseline -level 3.0 \
       -tune zerolatency -s 1280x720 -b:v 1400k \
       -bufsize 1400k -use_timeline 1 -use_template 1 \
       -init_seg_name init-\$RepresentationID\$.mp4 \
       -min_seg_duration 2000000 -media_seg_name test-\$RepresentationID\$-\$Number\$.mp4 \
       -f dash stream.mpd

In another tab, run the following command to fire up the server:

http-server -a :: -p 8081 --cors -c-1

Now you can test this with your player (using the URL http://localhost:8081/stream.mpd).

Simulating a HLS live streaming from MacOS camera

Playing Camera/Mic in FFplay

ffplay  -f avfoundation -video_device_index 0 -audio_device_index 0 \
        -pixel_format uyvy422 -framerate 30 -video_size 1280x720 -i "default"

MacOS Camera/Mic to HLS

Open a terminal and run the ffmpeg command:

ffmpeg  -f avfoundation -video_device_index 0 -audio_device_index 0 \
        -pixel_format uyvy422 -framerate 30 -video_size 640x480 -i "default" \
        -c:v libx264 -x264opts keyint=30:min-keyint=30:scenecut=-1 \
        -tune zerolatency -b:v 1000k -bufsize 2000k \
        -c:a aac -b:a 128k \
        -hls_time 5 -hls_start_number_source epoch \
        -f hls stream.m3u8

In another tab, run the following command to fire up the server:

http-server -a :: -p 8081 --cors -c-1

Now you can test this with your player (using the URL http://localhost:8081/stream.m3u8).

MacOS Camera/Mic to Twitch/Youtube/RTMP

Open a terminal and run the ffmpeg command:

ffmpeg  -f avfoundation -video_device_index 0 -audio_device_index 0 \
        -pixel_format uyvy422 -framerate 30 -video_size 640x480 -i "default" \
        -c:v libx264 -x264opts keyint=30:min-keyint=30:scenecut=-1 \
        -tune zerolatency -b:v 600k -bufsize 1200k -preset superfast \
        -c:a aac -b:a 128k \
        -f flv rtmp://yourserver:1935/live/yourstream_key

Bonus Round:

FFmpeg generating noise from /dev/random

It generates video and audio from /dev/urandom device, it produces a stream that looks A LOT like an old analog TV noise.

In analog video and television, is a random dot pixel pattern of static displayed when no transmission signal is obtained by the antenna receiver

# if you mess with the -video_size you can have bigger/smaller noise patterns than this. :D
ffmpeg -f rawvideo -pixel_format rgb8 -video_size 640x360 \
       -framerate 60 -i /dev/urandom \
       -f u8 -ar 48100 -ac 1 -i /dev/urandom \
       -sws_flags neighbor -s 640x360 urandom.mp4       

old tv noise

FFmpeg generating video from FFmpeg binary program

# you can replace the binary by any large binary chunk of data (library...)
ffmpeg -f rawvideo -pixel_format rgb8 -video_size 32x23 \
       -framerate 60 -i /usr/local/Cellar/ffmpeg/4.3_2/bin/ffmpeg \
       -f u8 -ar 48100 -ac 1 -i /usr/local/Cellar/ffmpeg/4.3_2/bin/ffmpeg \
       -sws_flags neighbor -s 640x360 -t 5s -pix_fmt yuv420p ffmpeg.mp4

FFmpeg generating video from Mandelbrot set

ffplay -f lavfi -i mandelbrot=size=640x320:rate=60 \
       -vf "drawtext = text = 'UTC %{gmtime}':fontsize=24:fontcolor=white:[email protected]:x=(w-text_w)/2:y=4:box=1:boxborderw=5"
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].