一辫红、源碼運(yùn)行
參考
https://github.com/EasyDarwin/EasyDarwin
運(yùn)行EasyDarwin----技術(shù)棧golang、nodejs環(huán)境搭建+運(yùn)行
http://www.easydarwin.org/doc/EasyDarwin.html
1.git clone
我現(xiàn)在的go版本已經(jīng)是1.16了肄满,新項(xiàng)目推薦使用GoModule脱吱。但是EasyDarwin仍然在使用go Vendor模式智政,區(qū)別參見go modules,所以我們?cè)贕it clone EasyDarwin時(shí)要注意放在Go Path目錄中箱蝠,這里嚴(yán)格按照官方文檔操作即可续捂。
cd $GOPATH/src/github.com
mkdir EasyDarwin && cd EasyDarwin
git clone https://github.com/EasyDarwin/EasyDarwin.git --depth=1 EasyDarwin
cd EasyDarwin
windows下也可以手動(dòng)進(jìn)入GoPath路徑,先創(chuàng)建好文件夾結(jié)構(gòu)宦搬,然后手動(dòng)git clone
src
--github.com
--EasyDarwin
--EasyDarwin
--gitee.com
--easydarwin
2.準(zhǔn)備工具
go get -u -v github.com/kardianos/govendor//包管理工具
go get -u -v github.com/penggy/gobuild//熱編譯工具牙瓢,下載可能會(huì)遇到被翻墻限制的問題
安裝成功會(huì)有對(duì)應(yīng)的可以執(zhí)行文件在bin目錄下
3.以開發(fā)模式運(yùn)行
npm run dev
報(bào)錯(cuò)了
PS C:\Users\admin\go\src\github.com\EasyDarwin\EasyDarwin> npm run dev
> easydarwin@8.1.0 dev C:\Users\admin\go\src\github.com\EasyDarwin\EasyDarwin
> go build -o EasyDarwin.exe
# github.com/EasyDarwin/EasyDarwin/vendor/github.com/mattn/go-sqlite3
cgo: exec gcc: exec: "gcc": executable file not found in %PATH%
參考基于 VS Code + MinGW-w64 的C語言/C++簡單環(huán)境配置,專致小白间校,安裝mingw矾克,執(zhí)行CMDgcc-v
看到版本號(hào)表示安裝成功。再次npm run dev
憔足,編譯成功聂渊。
4.執(zhí)行ServiceInstall-EasyDarwin.exe報(bào)錯(cuò)
這是因?yàn)楸镜芈窂较抡也坏紼asyDarwin.exe文件,這個(gè)文件因?yàn)樘?約32M)四瘫,被Git忽略了汉嗽,沒有提交到源碼項(xiàng)目中。
使用npm run dev
生成EasyDarwin.exe后找蜜,就不會(huì)報(bào)錯(cuò)了饼暑。
5.運(yùn)行服務(wù)
直接運(yùn)行(Windows)
EasyDarwin.exe
以 Ctrl + C 停止服務(wù)
以服務(wù)啟動(dòng)(Windows)
ServiceInstall-EasyDarwin.exe
以 ServiceUninstall-EasyDarwin.exe 卸載 EasyDarwin 服務(wù)
現(xiàn)在打開瀏覽器輸入 http://localhost:10008, 進(jìn)入控制頁面,默認(rèn)用戶名密碼是admin/admin
6.推流拉流
ffmpeg -re -i D:\nginx1.7\vod\jay.flv -rtsp_transport tcp -vcodec h264 -f rtsp rtsp://localhost/test
在VLC中播放以下地址
rtsp://localhost/test
7.使用本地?cái)z像頭來推拉流
參考ffmpeg easydarwin 做流媒體服務(wù)器
ffmpeg -f dshow -i video="HP TrueVision HD Camera":audio="麥克風(fēng)陣列 (英特爾? 智音技術(shù))"
-vcodec libx264 -r 25 -preset:v ultrafast -tune:v zerolatency -f rtsp rtsp://127.0.0.1/test