Skip to content

GB28181 Protocol Live Streaming Flow ​

1. GB28181 Protocol Live Streaming Flow for Monitoring Devices ​

1.1 Interaction Flow Between the FastBee Platform and Monitoring Devices ​

1. Flow Description ​

a. The FastBee platform calls the ZLMediaKit API /index/api/openRtpServer to create an RTP server, and fills the returned RTP streaming port into the SDP information of the Invite message

b. The FastBee platform (SIP server) sends an Invite message to the device. The message header carries the Subject field, indicating parameters such as the video source ID of the on-demand request, the sender media stream sequence number, the media stream receiver ID, and the receiver media stream sequence number. In the SDP message body, the s field is "Play", which represents real-time on-demand streaming

c. After receiving the Invite request from the FastBee platform (SIP server), the device first replies with a 100 Trying response, then replies with a 200 OK response carrying the SDP message body, which describes the IP, port, media format, SSRC field, and other content of the media stream sent by the device

d. After receiving the 200 OK response returned by the device, the FastBee platform (SIP server) sends an ACK request to the device. The request carries no message body, completing the Invite session establishment process with the device.

e. The device pushes the stream to the RTP server created by ZLMediaKit

f. ZLMediaKit notifies the FastBee platform through the onPublish hook API that the stream has been published, and performs streaming authentication. The FastBee platform responds with information such as the pull protocols to enable and the stream configuration. ZLMediaKit notifies the FastBee platform through the onStreamChanged hook API about the stream registration status of streamers with different protocols

g. The player pulls the FLV live stream according to the configured default playback address

h. ZLMediaKit notifies the FastBee platform through the onPlay hook API that the player has started playing, and performs playback authentication

1.2 Steps Where Major Problems Occur ​

· In steps b, c, and d, the data packets do not follow the standard protocol format, causing problems in establishing the live streaming session
· ZLMediaKit configuration problems: check the API http/https ports (8082, 8443), the RTP receiving ports (udp 30000-30100), the HTTPS certificate, and so on
· Whether connectivity between the device and the server is normal: device SIP packets -> server java 5061; device RTP streaming -> ZLMediaKit 30000-30100. If either is unreachable, the device streaming in step e will fail
· Whether the hook API is configured correctly: if the Java application is deployed in a container, the hook API is java:8080; if the Java application is started in IDEA and the ZLMediaKit server is started in Docker on the local machine, the hook API is host.docker.internal:8080. Incorrect configuration will cause problems with the callback APIs in steps f and h

1.3 Packet Capture Screenshot ​

1.3 Packet capture screenshot

1.4 GB28181 Standard Live Streaming Protocol Flow ​

1.5 Player URL Examples ​

1. HTTP and HTTPS ​

Under the HTTP protocol, the server is: http://ip:port, for example: http://192.168.1.66:8082

Under the HTTPS protocol, the server is: https://domain:port, for example: https://fastbee.cn:8443

2. FLV Protocol ​

Playback URL format: server/rtp/streamID.live.flv
Example: http://192.168.1.66:8082/rtp/gb_play_11010100001320000001_11010100001320000001.live.flv

https://fastbee.cn:8443/rtp/gb_play_11010100001320000001_11010100001320000001.live.flv

3. FMP4 Protocol ​

Playback URL format: server/rtp/streamID.live.mp4
Example: http://192.168.1.66:8082/rtp/gb_play_11010100001320000001_11010100001320000001.live.mp4

https://fastbee.cn:8443/rtp/gb_play_11010100001320000001_11010100001320000001.live.mp4

4. RTMP Protocol ​

Playback URL format: rtmp://ip:port/rtp/streamID

Example: rtmp://192.168.1.66:1935/rtp/gb_play_11010100001320000001_11010100001320000001

5. RTSP Protocol ​

Playback URL format: rtsp://ip:port/rtp/streamID

Example: rtsp://192.168.1.66:554/rtp/gb_play_11010100001320000001_11010100001320000001

FastBee | fastbee.cn