It provides guidance to test live streaming (mpeg-dash or hls) or vod from your own desktop, it's useful for testing and learning purposes.
- MacOS High Siera 10.13
- WARNING: IT WILL DOWNLOAD MORE THAN HUNDREDS OF MBs
docker
wget
curl
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
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
# 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
Open a terminal and run the ffmpeg command:
ffmpeg -stream_loop 1 -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
).
Open a terminal and run the ffmpeg command:
ffmpeg -stream_loop 1 -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
).
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
).
Open a terminal and run the ffmpeg command:
ffmpeg -re -pix_fmt uyvy422 -f avfoundation -i "0" -pix_fmt yuv420p \
-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.mpd
).