GB28181 Country Check Push flow

Source: Internet
Author: User

GB28181 has always been the content of real-time video camera streaming, after some efforts to solve this function, now share the experience:

First of all, we need to understand the process, said the simple point is where the video stream from where to go to describe the video stream streaming, forwarding

Basic process: After the signaling interaction succeeds, the camera (media stream sender) pushes the stream to the media server, and the media server specifies

After the port receives the video stream, it forwards it to the streaming media receiver (for example, an idle port on a PC).

Speaking of the basic process, let's take a look at the 28181 required video stream formats. GB28181 the video stream format required for transmission is PS stream, or

H264 bare Stream, or MP4 format, wherein PS flow and H264 bare stream is more common. How the PS stream is encapsulated here is not detailed and can be queried

Related documents. How to distinguish between PS flow or H264 bare flow has a simple method: with Wireshark grab packet, packet type is RTP is the PS stream

The data type is UDP is H264 bare stream.

Get ready to work and start talking about pushing the stream. The premise of push flow is that the signaling interaction has been successful. The following is a basic step based on Jpmedia push flow.

Figure 1

1) staticboolinitialize ()
Input: No output: No return value: True indicates success of initialization, false indicates failure.
After the interface library is initialized, the media server receives the SIP server invite request and executes the Operation 1 2nd.
2) Boolcreaterecvtransport (Unsignedshortrecvport)
Input: Port number output: No return value: True indicates that the receive port was created successfully, false indicates failure.
Note: When the media server receives the invite request, it sends its own SDP information, and Recvport needs to specify the port as the SDP. After the media server receives the SIP server invite request
That is the 2nd step in the 1 operation. 3) Boolattachmediasender (conststring&mediasenderaddress,unsignedshortport) input: Media stream sender IP, port output: No return value: True Indicates that the associated media stream sender succeeded, and false indicates failure.
Note: Associated Media stream sender IP address and port, figure 1 The 6th step to do this, the SDP information contains the media stream sender IP address and port number.
4) Boolcreateforwardtransport (unsignedshortsendport) const input: Local forwarding port output: No return value: True
Indicates that the creation of the forwarding port succeeded, false indicates failure. Note: You can specify the unused port, and the 8th step in Figure 1 is done.
5) Boolattachmediareceiver (conststring&mediareceiveraddress,unsignedshortport) const
Input: Streaming receiver IP address, port output: No return value: True indicates that the associated media stream recipient succeeded, false indicates failure.
Note: Figure 1 is the 12th step to perform the operation. 6) Voiddestroysendtransport () const input: No output: No return value: No note: Release the port resource, Figure 1 step 15th to do the operation.
7) Voiddestroyrecvtransport () const input: No output: No return value: No note: Release the port resource, Figure 1 step 17th to do the operation.

If you have any questions, you can join streaming media/ffmpeg/audio/video 127903734 AC.

GB28181 Country Check push flow

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.