為了模擬客戶端對視頻流的推流和拉流,決定下一個流媒體服務器,據說EasyDarwin很一個開源又簡單,就選它了。
下載從它的官網http://www.easydarwin.org/來到git倉庫,選則easydarwin項目后進入releases,選安裝包:

問題是git下載網速被限制了,下了一丟丟就沒了,除非自己下載源碼、編譯和打包。為求方便,先將就下個老版本用用https://download.csdn.net/download/wuxun1997/12239168
下完后解壓,按readme.txt操作一番即可安裝成功:
1、運行EasyDarwin/start.bat啟動EasyDarwin
D:\EasyDarwin\EasyDarwin-Windows-x86_64-v7.3.17.0325\EasyDarwin>cd ./ D:\EasyDarwin\EasyDarwin-Windows-x86_64-v7.3.17.0325\EasyDarwin>EasyDarwin -c ./easydarwin.xml -d EasyDarwin/7.3 ( Build/17.0325; Platform/Win32; Compile_Flags/_RELEASE;Release/EasyDarwin; State/Development; ) Built on: Mar 25 2017, 17:14:41
2、運行nginx-1.11.12/nginx.exe,雙擊exe圖標后nginx是以后台進程運行的

3、在瀏覽器輸入localhost:10080后進入easydarwin的登陸頁面

4、敲入賬號密碼(默認都是admin)后進入后台管理頁面

5、作為流媒體服務器,自然是用來接收流媒體的,我們通過ffmpeg推流給它,敲入命令:
C:\Users\wulf>ffmpeg -re -i d:\vedio\VID_20200223_153448.mp4 -rtsp_transport tcp -f rtsp rtsp://127.0.0.1/test ffmpeg version git-2020-03-06-cfd9a65 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 9.2.1 (GCC) 20200122 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 42.100 / 56. 42.100 libavcodec 58. 73.102 / 58. 73.102 libavformat 58. 39.101 / 58. 39.101 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 77.100 / 7. 77.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'd:\vedio\VID_20200223_153448.mp4': Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 creation_time : 2020-02-23T07:34:48.000000Z com.android.version: 9 Duration: 00:08:30.66, start: 0.000000, bitrate: 9987 kb/s Stream #0:0(eng): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p(tv, bt709), 1280x720, 9783 kb/s, SAR 1:1 DAR 16:9, 30.18 fps, 30 tbr, 90k tbn, 60 tbc (default) Metadata: rotate : 90 creation_time : 2020-02-23T07:34:48.000000Z handler_name : VideoHandle Side data: displaymatrix: rotation of -90.00 degrees Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 192 kb/s (default) Metadata: creation_time : 2020-02-23T07:34:48.000000Z handler_name : SoundHandle Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> mpeg4 (native)) Stream #0:1 -> #0:1 (aac (native) -> aac (native)) Press [q] to stop, [?] for help Output #0, rtsp, to 'rtsp://127.0.0.1/test':014:32:22.77 bitrate=N/A speed=N/A Metadata: major_brand : mp42 minor_version : 0 compatible_brands: isommp42 com.android.version: 9 encoder : Lavf58.39.101 Stream #0:0(eng): Video: mpeg4, yuv420p, 720x1280 [SAR 1:1 DAR 9:16], q=2-31, 200 kb/s, 30 fps, 90k tbn, 30 tbc (default) Metadata: encoder : Lavc58.73.102 mpeg4 creation_time : 2020-02-23T07:34:48.000000Z handler_name : VideoHandle Side data: cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: N/A displaymatrix: rotation of -0.00 degrees Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp, 128 kb/s (default) Metadata: creation_time : 2020-02-23T07:34:48.000000Z handler_name : SoundHandle encoder : Lavc58.73.102 aac frame=10877 fps= 30 q=31.0 size=N/A time=00:06:02.53 bitrate=N/A dup=6 drop=68 speed= 1x
6、然后我們刷新下界面,可以看到直播流列表來了一條數據:

7、通過ffmpeg播放器來拉流,接收從EasyDarwin流媒體服務器過來的流:
C:\Users\wulf>ffplay -i -rtsp_transport tcp rtsp://127.0.0.1:10554/test ffplay version git-2020-03-06-cfd9a65 Copyright (c) 2003-2020 the FFmpeg developers built with gcc 9.2.1 (GCC) 20200122 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf libavutil 56. 42.100 / 56. 42.100 libavcodec 58. 73.102 / 58. 73.102 libavformat 58. 39.101 / 58. 39.101 libavdevice 58. 9.103 / 58. 9.103 libavfilter 7. 77.100 / 7. 77.100 libswscale 5. 6.100 / 5. 6.100 libswresample 3. 6.100 / 3. 6.100 libpostproc 55. 6.100 / 55. 6.100 Input #0, rtsp, from 'rtsp://127.0.0.1:10554/test':q= 0B f=0/0 Metadata: title : No Name Duration: N/A, start: 0.000000, bitrate: N/A Stream #0:0: Video: mpeg4 (Simple Profile), yuv420p, 720x1280 [SAR 1:1 DAR 9:16], 30 tbr, 90k tbn, 30 tbc Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp [mpeg4 @ 00000211fc56d940] warning: first frame is no keyframe 169.27 A-V: -0.000 fd= 154 aq= 2KB vq= 7KB sq= 0B f=0/0
看起來播放的畫面並不是很清晰:

