宣传了好久的mui12.5,终于在我的手机上推送了(RedmiK20Pro),体验一下这个多屏协作功能。
这里用的台式机外接usb无线网卡的方式体验了一波。
。。。哎,关于其流畅度。。。也就是能跑起来的样子,后台放个音乐,鼠标滑动一下桌面音乐后台播放的网易云立刻就顿一顿,电脑端的画面也总是慢半拍,当然,这和我的硬件性能有一定关系,所以下面写了这篇水文,顺便给它wireshark抓了个包,瞅瞅看能不能窥探点技术。
设备硬件情况:
小米的这个wind上的客户端可以直接在不同的设备上安装使用,对电脑没啥限制,是windows系统,有wifi,就可以用了。(所以,硬件性能也是没有过滤限制的,体验效果也就参差不齐了,官方说明:推荐使用小米笔记本 Pro 15、小米笔记本 Pro 14、RedmiBook Pro 15、RedmiBook Pro 14、Redmi G 游戏本、RedmiBook 16、RedmiBook 14 Ⅱ、RedmiBook Air 13。 由于驱动及硬件限制,您在其他笔记本上的体验将无法得到保障。)
我的硬件情况:
手机:
电脑:我这里用的台式机 (自组装的跑分30w+的游戏主机,3.6G 6核12线程+16G内存,当然,这里多屏协作流畅度相关的和显卡啥的都没有关系,主要是看wifi无线网卡的性能了,然而主机没有wifi,所以连夜买了个简单的无线WiFi,看起来很简单的普通的一个无线WiFi接收器,腾达-realtek芯片)
然后下载Mui+ wind程序:https://plus.miui.com/
掏出手机打开系统自带相机扫描二维码,就可以连接上去了。
wireshark抓个包
(企图窥探一下技术实现,奈何)
下载个最新的wireshark:https://www.wireshark.org/download.html
抓包:哦,整个就是一个 rtsp-rtp-tcp-mpegts流
全程基于单个的tcp传输,rtsp协商,rtp负载mpegts流来实现音视频传输,(基本将android手机投屏的一套照搬了过来,也就是Miracast Android WifiDisplay 记一下这是Mui12.5.4+ Mui2.3.0.951 wind客户端,不知道后面会不会做一下私有的优化)
详细看一下这个rtsp信息:(标准的rtps wifidisplay)
直接贴上数据吧
OPTIONS * RTSP/1.0
Date: Sat, 12 Jun 2021 02:52:56 +0000
Server:
CSeq: 1
Require: org.wfa.wfd1.0
RTSP/1.0 200 OK
Date: Sat, 12 Jun 2021 02:52:36 +0800
User-Agent: stagefright/1.1 (Linux;Android 4.1)
CSeq: 1
Public: org.wfa.wfd1.0, GET_PARAMETER, SET_PARAMETER
OPTIONS * RTSP/1.0
Date: Sat, 12 Jun 2021 02:52:36 +0800
User-Agent: stagefright/1.1 (Linux;Android 4.1)
CSeq: 1
Require: org.wfa.wfd1.0
RTSP/1.0 200 OK
Date: Sat, 12 Jun 2021 02:52:56 +0000
Server:
CSeq: 1
Public: org.wfa.wfd1.0, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER
GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Date: Sat, 12 Jun 2021 02:52:56 +0000
Server:
CSeq: 2
Content-Type: text/parameters
Content-Length: 99
wfd_content_protection
wfd_video_formats
wfd_audio_codecs
wfd_client_rtp_ports
wfd_tcp_enable
RTSP/1.0 200 OK
Date: Sat, 12 Jun 2021 02:52:36 +0800
User-Agent: stagefright/1.1 (Linux;Android 4.1)
CSeq: 2
Content-Type: text/parameters
Content-Length: 207
wfd_audio_codecs: AAC 00000001 00
wfd_video_formats: 00 00 02 0F 000FFFFF 05157FFF 00000FFF 00 0001 0000 11 none none
wfd_client_rtp_ports: RTP/AVP/TCP;interleaved mode=play
wfd_content_protection: none
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Date: Sat, 12 Jun 2021 02:52:56 +0000
Server:
CSeq: 3
Content-Type: text/parameters
Content-Length: 246
wfd_video_formats: 98 00 02 02 00080000 00000000 00000000 00 0000 0000 00 none none
wfd_audio_codecs: AAC 00000001 00
wfd_presentation_URL: rtsp://192.168.137.108/wfd1.0/streamid=0 none
wfd_client_rtp_ports: RTP/AVP/TCP;interleaved mode=play
RTSP/1.0 200 OK
Date: Sat, 12 Jun 2021 02:52:36 +0800
User-Agent: stagefright/1.1 (Linux;Android 4.1)
CSeq: 3
Content-Type: text/parameters
Content-Length: 0
SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
Date: Sat, 12 Jun 2021 02:52:56 +0000
Server:
CSeq: 4
Content-Type: text/parameters
Content-Length: 27
wfd_trigger_method: SETUP
RTSP/1.0 200 OK
Date: Sat, 12 Jun 2021 02:52:36 +0800
User-Agent: stagefright/1.1 (Linux;Android 4.1)
CSeq: 4
Content-Type: text/parameters
Content-Length: 0
SETUP rtsp://192.168.137.108/wfd1.0/streamid=0 RTSP/1.0
Date: Sat, 12 Jun 2021 02:52:36 +0800
User-Agent: stagefright/1.1 (Linux;Android 4.1)
CSeq: 2
Transport: RTP/AVP/TCP;interleaved=0-1
RTSP/1.0 200 OK
Date: Sat, 12 Jun 2021 02:52:56 +0000
Server:
CSeq: 2
Session: 1638754794;timeout=30
Transport: RTP/AVP/TCP;interleaved=0-1;
PLAY rtsp://192.168.137.108/wfd1.0/streamid=0 RTSP/1.0
Date: Sat, 12 Jun 2021 02:52:36 +0800
User-Agent: stagefright/1.1 (Linux;Android 4.1)
CSeq: 3
Session: 1638754794
RTSP/1.0 200 OK
Date: Sat, 12 Jun 2021 02:52:56 +0000
Server:
CSeq: 3
Session: 1638754794;timeout=30
Range: npt=now-
干脆把抓的包里面的mpeg-ts提取出来看看:
wireshark过来rtp,电话->Rtp->流分析->save->不同步的正向音频->raw格式
保存提取的数据,直接是mpeg-ts的流,用视频播放器比如 potplayer 直接可以播放,包含视频和音频。:
也可以用streamEye软件直接查看其中的编码信息:
h264编码,High:5.1
分辨率1080x2340
实际播放的帧率60
gop 1s