jsmepg 畫布 canvas 視訊串流實作





在linux上必要安裝
1.下載 jsmpeg
2.安裝 node
3.安裝 websocket
4.安裝 npm
5.安裝 ffmpeg



運作流程 :















1.安裝npm
yum install npm

2.安裝npm
npm install ws

3.安裝 nodejs
npm install node

4.檢查看看是否真的安裝好
node -v

5.下載jsmpeg
npm install jsmpeg
or
git clone https://github.com/phoboslab/jsmpeg.git


6.記得開通port
iptables -I INPUT -p tcp --dport 8888 -j ACCEPT
iptables -I INPUT -p tcp --dport 8082 -j ACCEPT
iptables -I INPUT -p tcp --dport 8084 -j ACCEPT


7.執行jsmpeg (server)
node /root/jsmpeg/stream-server.js 8888 8082 8084
8888 = 認證代號
8082 = 接收視訊的port
8084 = 傳送視訊的port


8.跑起來後確認是否真的有跑在處理程序裡
ps -aux | grep node

9.安裝 ffmpeg
rpm --import http://li.nux.ro/download/nux/RPM-GPG-KEY-nux.ro
yum -y install epel-release && rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5. el7.nux.noarch.rpm
yum --enablerepo=nux-dextop list smplayer shutter
yum install ffmpeg


10.假設安裝後不知道檔案跑去那了?
find / -name ffmpeg


11.使用ffmpeg轉發視訊至jsmpeg
ffmpeg -r 25 -y -probesize 70 -i "rtmp://63.221.136.66/live/phone01sd" -an -f mpeg1video -q:v 1 -s 1280x720 -r 25 -probesize 70 http://10.20.30.80:8082/8888/1280/720/



參考 :


https://segmentfault.com/a/1190000000392586
http://weheart.digital/build-simple-live-streaming-solution/
http://tonyhack.familyds.net/wordpress/?p=4297


https://www.exratione.com/2013/06/websockets-over-ssl-with-nodejs-and-nginx/


http://www.streaminglearningcenter.com/blogs/dash-or-hls-which-is-the-best-format-today.html
https://support.jwplayer.com/customer/portal/articles/1430349-about-rtmp-streaming
https://support.jwplayer.com/customer/en/portal/articles/2020482-about-dash-streaming
https://support.jwplayer.com/customer/en/portal/articles/1430189-about-hls-streaming
https://developer.mozilla.org/en-US/Apps/Fundamentals/Audio_and_video_delivery/Live_streaming_web_audio_and_video



https://imququ.com/post/html5-live-player-1.html
https://imququ.com/post/html5-live-player-2.html
https://www.v2ex.com/t/226318
http://gka.github.io/canvid/

https://imququ.com/post/html5-live-player-3.html
https://janus.conf.meetecho.com/screensharingtest.html
https://www.zhihu.com/question/25497090

沒有留言:

張貼留言