Access control video preview method, computer equipment, storage medium and computer program product
By deploying an edge media gateway and a lightweight WebRTC server in the access control terminal, sub-streams can be directly transmitted and resolution switching can be supported, solving the problem of high latency in access control video preview and achieving a low-latency and efficient video preview experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-14
- Publication Date
- 2026-04-14
AI Technical Summary
Existing access control video preview systems suffer from high real-time preview latency, which fails to meet users' needs for real-time monitoring and immediate response in access control scenarios.
By deploying an edge media gateway at the access control terminal and using a lightweight WebRTC media server, the shortest and most direct video stream transmission path is established. Sub-streams are directly pulled and pushed to the client at the edge, supporting low-definition display and switching to the main stream for high-definition display when needed.
It achieves low-latency access control video preview, allowing users to see the image in a very short time, ensuring a real-time viewing experience. At the same time, it reduces network transmission and decoding rendering time, supports dynamic resolution switching, and improves the user experience.
Smart Images

Figure CN121864947A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent security technology, and in particular to an access control video preview method, computer equipment, storage medium, and computer program product. Background Technology
[0002] With the development of smart communities and intelligent security, access control systems have evolved from simple identity verification methods such as card swiping and passwords to comprehensive front-end security nodes that integrate video intercom, facial recognition, and behavior analysis. A key function of these systems is allowing users to view real-time video feeds from the access control point via mobile devices or management terminals.
[0003] Current access control video preview solutions involve access control devices outputting H.264 / H.265 encoded video streams via the RTSP protocol. These streams are then transmitted to a central signaling server at the backend. The central signaling server performs transcoding and encapsulation on the aggregated video streams, converting them into formats suitable for internet distribution, such as HTTP-FLV or HLS, before finally distributing them to clients via the internet. However, this solution suffers from a lengthy video stream transmission path, and the buffers designed for smooth playback in protocols like HTTP-FLV or HLS introduce latency, resulting in high end-to-end latency. This fails to meet users' needs for real-time monitoring and immediate response in access control scenarios.
[0004] Therefore, traditional access control video preview systems suffer from high real-time preview latency. Summary of the Invention
[0005] Based on this, the purpose of this application is to at least solve one of the above-mentioned technical defects, in particular the technical defect of high real-time preview latency in the existing access control video preview system. This application provides an access control video preview method, computer equipment, computer-readable storage medium and computer program product that can achieve low-latency access control video preview.
[0006] In a first aspect, this application provides a method for previewing access control video, applied to an edge media gateway of an access control video preview system. The access control video preview system also includes a client and an access control terminal. The edge media gateway and the access control terminal are deployed in the same local area network. The method includes:
[0007] When a user initiates a video preview request for the access control terminal on the client, a video stream transmission channel is established with the client;
[0008] Pull sub-streams from the video stream of the access control terminal;
[0009] The sub-stream is pushed to the client through the video stream transmission channel, so that the client can generate and display a low-definition image based on the sub-stream within a preset time range; the clarity of the low-definition image is lower than the preset clarity.
[0010] In one embodiment, the access control video preview system further includes a central signaling server, which establishes a video stream transmission channel with the client, including: exchanging connection negotiation signaling with the client through the central signaling server to establish a point-to-point transmission channel based on the web real-time communication protocol, and using the point-to-point transmission channel as the video stream transmission channel.
[0011] In one embodiment, the method further includes:
[0012] In response to the client's request to switch the resolution of the low-definition image, stop pulling the sub-stream from the video stream of the access control terminal and pull the main stream from the video stream of the access control terminal;
[0013] The main stream is pushed to the client through the video streaming channel, so that the client can generate and display high-definition images based on the main stream; the clarity of high-definition images is higher than that of low-definition images.
[0014] In one embodiment, the method further includes:
[0015] In response to the client's request to end viewing of the access control video from the access control terminal, stop pulling the bitstream from the video stream of the access control terminal and close the video stream transmission channel.
[0016] Secondly, this application provides a method for previewing access control video, applied to a client of an access control video preview system, the method comprising:
[0017] In response to the access control video preview trigger operation of the access control terminal of the access control video preview system, a video stream transmission channel is established with the edge media gateway of the access control terminal;
[0018] The sub-stream is received through the video stream transmission channel from the edge media gateway; the sub-stream is obtained by the edge media gateway from the video stream of the access control terminal.
[0019] Within a preset time range, a low-resolution image is generated and displayed based on the sub-stream; the resolution of the low-resolution image is lower than the preset resolution.
[0020] In one embodiment, the method further includes:
[0021] In response to a resolution switching operation for low-resolution images, a video stream switching request is sent to the edge media gateway; upon receiving the video stream switching request, the edge media gateway stops pulling sub-streams from the access control terminal's video stream and pulls the main stream from the access control terminal's video stream.
[0022] The system receives the main stream pushed by the edge media gateway through the video stream transmission channel, and generates and displays high-definition images based on the main stream; the clarity of the high-definition images is higher than that of the low-definition images.
[0023] Thirdly, this application provides a method for previewing access control video, applied to the central signaling server of an access control video preview system, the method comprising:
[0024] Receive access control video preview requests initiated by users from the access control video preview system's client to the access control terminal of the access control video preview system, and perform authentication processing on the client;
[0025] After authentication is successful, the client is provided with the edge media gateway information associated with the access control terminal. This enables the client to establish a video stream transmission channel with the edge media gateway associated with the access control terminal based on the edge media gateway information. The client then obtains the sub-stream pulled from the video stream of the access control terminal by the edge media gateway through the video stream transmission channel, generates a low-definition image based on the sub-stream, and displays it. The clarity of the low-definition image is lower than the preset clarity.
[0026] Fourthly, this application provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the above-described method.
[0027] Fifthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the above-described method.
[0028] Sixthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the above-described method.
[0029] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0030] The access control video preview method, computer equipment, storage medium, and computer program product provided in this application establish a video stream transmission channel with the client when a user initiates an access control video preview request on the client side. A sub-stream is retrieved from the video stream of the access control terminal. The sub-stream is then pushed to the client through the video stream transmission channel, enabling the client to generate and display a low-definition image based on the sub-stream within a preset time range. The clarity of the low-definition image is lower than the preset clarity. Thus, by establishing a video stream transmission channel between two points, actively retrieving the sub-stream at the edge media gateway and directly pushing it to the client through the video stream transmission channel, the video preview path is shortened, and the amount of data to be transmitted is reduced. Because of its small data size, the sub-stream can accelerate network transmission speed and decoding rendering speed, ensuring that the user can see the image within the preset time range. This achieves low-latency access control video preview, providing users with a smoother experience when viewing access control videos in real time. Attached Figure Description
[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is an architecture diagram of an access control video preview system in one embodiment;
[0033] Figure 2 This is a flowchart illustrating a video preview method for access control in one embodiment;
[0034] Figure 3 This is a flowchart illustrating an access control video preview method in another embodiment;
[0035] Figure 4 This is a flowchart illustrating a video preview method for access control in yet another embodiment;
[0036] Figure 5 This is a data interaction diagram of an access control video preview system in one embodiment;
[0037] Figure 6 This is a sequence diagram of the core flow of a video preview method for access control in one embodiment;
[0038] Figure 7 This is a structural block diagram of an access control video preview device in one embodiment;
[0039] Figure 8 This is a structural block diagram of an access control video preview device in another embodiment;
[0040] Figure 9 This is a structural block diagram of an access control video preview device in yet another embodiment;
[0041] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0043] Currently, mainstream access control video preview solutions typically employ the following technical path: the access control device (with a built-in camera) outputs an H.264 / H.265 encoded video stream via the RTSP protocol. This video stream is received by a backend central server (or a network video recorder, NVR). The central server transcodes and encapsulates multiple video streams, converting them into browser-friendly formats such as HTTP-FLV or HLS, before distributing them to user clients via the internet. However, mainstream access control video preview solutions have significant drawbacks. First, they suffer from high latency. The long video stream path (device → central server → client) and the inherent buffering in the HTTP-FLV / HLS protocol result in end-to-end latency typically as high as 2-10 seconds, failing to meet real-time interactive requirements. Second, the central server experiences heavy load. Since all video stream transcoding and distribution are concentrated on the central server, bandwidth and computing power costs are high, making it difficult to support large-scale concurrent previews. Third, they have poor adaptability to mobile networks. Under fluctuating wireless network conditions, the latency of HTTP-based protocols like HLS is further exacerbated, leading to an unstable user experience.
[0044] This application aims to overcome the shortcomings of the prior art and provide an access control video preview system and method with an end-to-end latency of less than 500 milliseconds. Its core ideas are "edgeization" and "direct protocol access," by pushing video processing capabilities down to the network edge of the access control device and employing the WebRTC protocol for real-time communication to construct the shortest and most direct video transmission path.
[0045] The access control video preview method provided in this application embodiment can be applied to, for example... Figure 1 The access control video preview system shown here includes access control terminals, an edge media gateway associated with the access control terminals, the Internet, clients, and a central signaling server.
[0046] In one exemplary embodiment, such as Figure 2As shown, a method for previewing access control video is provided, which is applied to... Figure 1 The edge media gateway of the access control video preview system shown is included. The access control video preview system also includes clients and access control terminals. The edge media gateway and access control terminals are deployed on the same local area network. This method is applied to... Figure 1 Taking the edge media gateway as an example, the explanation includes the following steps S202 to S206. Wherein:
[0047] Step S202: When it is detected that a user initiates an access control video preview request for the access control terminal on the client, a video stream transmission channel is established with the client.
[0048] The edge media gateway is a dedicated media processing device deployed near the network edge of access control terminals (such as cameras). It is responsible for video stream access, transcoding, and distribution, aiming to reduce the traffic and latency of data uploaded to the central signaling server. In this application, the edge media gateway is deployed within the same local area network as the access control terminals. Its core component is a lightweight WebRTC media server, which receives the main / sub-streams from the terminals and converts them into WebRTC media streams, while also providing a signaling exchange interface. The edge media gateway uses a similar lightweight computing device, deployed in the building's electrical shaft, and is equipped with an open-source media server, MediaMTX, that integrates WebRTC functionality.
[0049] In this context, the access control terminal refers to a device deployed at access control points that has video capture capabilities, such as a network camera or an integrated access control machine. In this application, the access control terminal can integrate a camera, a codec chip, and an edge computing module, supporting the simultaneous generation of two streams (a high-resolution main stream and a low-resolution sub-stream), and can be equipped with or connected to an edge media gateway. The access control terminal can be an intelligent access control terminal, employing a Hisilicon series AI chip, running a Linux system, and having built-in software to output two RTSP streams. The main stream (1080P, H.264, 4Mbps) is used for high-definition recording, and the sub-stream (360P, H.264, 256kbps) is used for real-time preview.
[0050] In this context, the client refers to the software application used by the user to initiate previewing and viewing videos, such as a mobile app, computer software, or webpage. In this application, the client is a web browser or mobile application with built-in WebRTC capabilities. It obtains the edge gateway information of the target access control system from the central server and establishes a direct P2P or WebRTC connection with it via a TURN server to receive and render the video stream. The client can use the WebRTC API (RTC Peer Connection) to establish a connection with the edge gateway, and video rendering uses... <video>Label.
[0051] Among them, the access control video preview request refers to the request initiated by the client to view the video stream of the specified access control terminal in real time.
[0052] In this context, the video streaming channel refers to the network connection established between the edge media gateway and the client for transmitting video data. In this application, the video streaming channel may refer to a WebRTC channel.
[0053] Optionally, when a user needs to view the real-time video of a certain access control point, they can click to view it in the APP. In response to the viewing operation, the client initiates an access control video preview request, and the edge media gateway bound to the access control point negotiates with the client to establish a video stream transmission channel.
[0054] Step S204: Extract the sub-stream from the video stream of the access control terminal.
[0055] Among them, the sub-stream is a lower resolution, lower bitrate video stream generated synchronously by the access control terminal when generating the original video. It is often used in scenarios with poor network conditions or where fast preview is required.
[0056] Optionally, the edge media gateway obtains a sub-stream from the real-time video stream of the target access control terminal.
[0057] Step S206: The sub-stream is pushed to the client through the video stream transmission channel so that the client generates and displays a low-definition image based on the sub-stream within a preset time range; the resolution of the low-definition image is lower than the preset resolution.
[0058] The preset time range refers to the extremely short time target that the system requires to be achieved between the client sending a request and the first appearance of the image on the screen.
[0059] Low-resolution video refers to video footage with lower resolution generated by decoding sub-streams.
[0060] Among them, preset resolution refers to the picture quality threshold defined by the system as the "high definition" standard (such as 1080P resolution).
[0061] Optionally, the edge media gateway continuously pushes sub-stream video data to the client through the established video streaming channel. After receiving the data, the client quickly decodes it and presents the low-definition picture to the user within a very short preset time range.
[0062] In practical applications, the client can complete the first frame rendering within 300 milliseconds, achieving "instant preview".
[0063] The lightweight WebRTC service of the edge media gateway in this application differs from that of traditional FMS or Wowza. The edge media gateway in this application adopts Media MTX or a lightweight gateway based on Pion, which is optimized for embedded environments and can run stably with 256MB of memory, achieving "zero" latency superposition of protocol conversion.
[0064] The aforementioned access control video preview method establishes a video stream transmission channel with the client when a user initiates an access control video preview request on the client side. It then retrieves a sub-stream from the access control terminal's video stream and pushes it to the client via the video stream transmission channel. This allows the client to generate and display a low-resolution image based on the sub-stream within a preset time range. The low-resolution image has a lower resolution than a preset resolution. By establishing a video stream transmission channel between the two points, actively retrieving the sub-stream at the edge media gateway and directly pushing it to the client via the video stream transmission channel, the video preview path is shortened, and the amount of data to be transmitted is reduced. The smaller data size of the sub-stream accelerates network transmission and decoding / rendering speeds, ensuring that the user can see the image within the preset time range. This achieves low-latency access control video preview, providing users with a smoother experience when viewing access control videos in real time.
[0065] In one exemplary embodiment, the access control video preview system further includes a central signaling server, which establishes a video stream transmission channel with the client, including: exchanging connection negotiation signaling with the client through the central signaling server to establish a point-to-point transmission channel based on the web real-time communication protocol, and using the point-to-point transmission channel as the video stream transmission channel.
[0066] In this system, the central signaling server is the central node responsible for coordinating communication and processing connection negotiation signaling in the access control video preview system. However, it does not relay video stream data; it only establishes the video stream transmission channel between the edge media gateway and the client. In this application, the central signaling server is deployed in the cloud or data center, responsible for device management, user authentication, and signaling relay (exchanging SDP and ICE candidate information), but it does not participate in the transmission of video streaming media data, resulting in a very light workload. The central signaling server is developed using the Spring Boot framework, providing a RESTful API for device management and utilizing the Socket.IO library to implement WebSocket signaling relay services.
[0067] Among them, connection negotiation signaling is a set of control commands that the edge media gateway and the client exchange before establishing a direct connection, in order to exchange network addresses (IP, port), negotiate encryption keys, and confirm communication capabilities.
[0068] Among them, Web Real-Time Communication Protocol refers to protocol standards such as WebRTC (Web Real-Time Communication) that support real-time point-to-point transmission of audio and video between browsers and devices.
[0069] Optionally, when the edge media gateway needs to establish a connection with the client, it will connect to the central signaling server along with the client. Both parties exchange connection negotiation signaling through the central signaling server to complete network traversal and session description negotiation. Once the negotiation is successful, both parties will establish a direct point-to-point video streaming channel based on the web real-time communication protocol, bypassing the central signaling server, for subsequent video data transmission.
[0070] In this embodiment, the reliable exchange of information such as NAT traversal is ensured by relaying signaling through a central server. Once a connection is established, the video stream is transmitted directly through the optimized path (P2P or nearest TURN), ensuring low latency.
[0071] In this embodiment, by utilizing the central signaling server to assist in negotiation and establishing a point-to-point transmission channel based on the web real-time communication protocol, the video stream data avoids being relayed through the central signaling server, eliminating the latency introduced by server bandwidth bottlenecks, processing delays, and additional network hops. By establishing a direct video stream transmission channel, the sub-stream can reach the client directly from the edge media gateway via the most direct and fastest path, enabling low-latency video preview and solving the problem of high latency in end-to-end video stream transmission.
[0072] In an exemplary embodiment, the method further includes: in response to a client's request to switch the resolution of a low-definition image, stopping the retrieval of a sub-stream from the video stream of the access control terminal and retrieving a main stream from the video stream of the access control terminal; pushing the main stream to the client through a video stream transmission channel so that the client generates and displays a high-definition image based on the main stream; the resolution of the high-definition image is higher than that of the low-definition image.
[0073] Among them, the resolution switching request is a command sent by the client to the edge media gateway to switch the video stream quality when the user wants to watch a clearer picture (such as clicking the "HD" button).
[0074] The main stream is a high-resolution, high-bitrate raw video stream or a high-quality encoded stream generated by the access control terminal to provide clear details.
[0075] High-definition images refer to high-resolution video images generated by decoding the main bitstream.
[0076] Optionally, after viewing a low-resolution image on the client, if a user wants to see clearer details, they can click to switch to a high-resolution image. In response to the resolution switch, the client sends a resolution switch request to the edge media gateway. Upon receiving this request, the edge media gateway immediately stops acquiring the sub-stream and instead retrieves the main stream from the same access control terminal. Subsequently, the edge media gateway seamlessly pushes the main stream data to the client using the previously established video stream transmission channel. The client then switches to decoding the main stream and renders the high-resolution image on the screen.
[0077] In this embodiment, the edge gateway implements hot-switching logic to ensure that the video track is not interrupted or renegotiation is not required when switching bitstreams. The client only perceives the change in video resolution and there is no black screen or stuttering.
[0078] In this embodiment, by supporting dynamic resolution switching, the user's demand for high image quality is met while ensuring initial preview speed (using sub-streams). The switching process reuses existing video stream transmission channels, avoiding the overhead of re-establishing connections and achieving a smooth transition. This "fast preview" and "on-demand HD" video display strategy optimizes the user experience overall. Users do not need to endure initial high latency while waiting for HD images, and can obtain clear HD images when needed. It is an effective solution that balances low latency and high image quality.
[0079] In one exemplary embodiment, the method further includes: in response to a client's request to end viewing of the access control video on the access control terminal, stopping the extraction of the bitstream from the video stream of the access control terminal and closing the video stream transmission channel.
[0080] Among them, the access control video end viewing request is an instruction initiated by the client to the edge media gateway to end the current video preview session or end the current video HD viewing session when the user initiates the operation to end the access control video viewing.
[0081] Optionally, when the user closes the preview window, closes the HD viewing window, or exits the application, the client sends a request to the edge media gateway to end the access control video viewing. Upon receiving this request, the edge media gateway immediately stops pulling any bitstream (sub-stream or main stream) from the access control terminal and proactively closes the video stream transmission channel with the client, releasing related network and computing resources.
[0082] In this embodiment, by responding promptly to the end request and releasing resources, the effective utilization of system resources is ensured, the long-term suspension of connections and streaming media tasks is avoided, and resources and network bandwidth on the edge side are freed up for other new preview requests. This ensures the overall performance and response speed of the system when processing concurrent preview requests and maintains the stability of the system with a low-latency experience.
[0083] In one exemplary embodiment, a method for previewing access control video is provided, applied to a client of an access control video preview system, so that the method is applied to... Figure 1 Taking the client as an example, the explanation includes the following steps S302 to S306. Wherein:
[0084] Step S302: In response to the access control video preview trigger operation of the access control terminal for the access control video preview system, a video stream transmission channel is established with the edge media gateway of the access control terminal.
[0085] Among them, the access control video preview trigger operation is an interactive behavior performed by the user on the client interface to initiate a video preview, such as clicking the access control point icon.
[0086] Among them, edge media gateway information refers to the network address (such as IP address and port) and connection credentials of the edge media gateway responsible for the target access control terminal, which is returned by the central signaling server.
[0087] Optionally, after the user selects the access control point to view via the access control video preview trigger operation on the client, the client immediately sends an access control video preview request carrying the target device identifier to the central signaling server. The central signaling server returns the corresponding edge media gateway information, which the client uses to perform signaling interaction with the specified edge media gateway and establish a video stream transmission channel.
[0088] Step S304: Receive the sub-stream pushed by the edge media gateway through the video stream transmission channel; the sub-stream is obtained by the edge media gateway from the video stream of the access control terminal.
[0089] Optionally, once the channel is established, the client begins receiving sub-stream data pushed by the edge media gateway.
[0090] Step S306: Within a preset time range, generate and display a low-resolution image based on the sub-stream; the resolution of the low-resolution image is lower than the preset resolution.
[0091] Optionally, the client can quickly decode and render based on the sub-stream to ensure that the low-definition image is displayed to the user within a preset time range, thus achieving low-latency low-definition preview.
[0092] In the aforementioned access control video preview method, in response to an access control video preview trigger operation on the access control terminal of the access control video preview system, an access control video preview request is sent to the central signaling server of the access control video preview system. The central signaling server determines the edge media gateway information associated with the access control terminal based on the access control video preview request. Based on the edge media gateway information obtained from the central signaling server, a video stream transmission channel is established with the edge media gateway of the access control terminal. The sub-stream pushed by the edge media gateway is received through the video stream transmission channel. The sub-stream is pulled by the edge media gateway from the video stream of the access control terminal. Within a preset time range, a low-definition image is generated and displayed based on the sub-stream. The clarity of the low-definition image is lower than the preset clarity. In this way, the client can actively obtain connection information from the central signaling server and connect directly to the edge media gateway, avoiding the detour of the video stream passing through the central signaling server. As the terminal for user experience, the client can quickly initiate requests, efficiently establish connections, and render low-definition images in real time, reducing the end-to-end latency perceptible to the user.
[0093] In an exemplary embodiment, the method further includes: in response to a resolution switching operation for a low-resolution image, sending a video stream switching request to an edge media gateway; the edge media gateway, upon receiving the video stream switching request, stopping the extraction of sub-streams from the video stream of the access control terminal and extracting a main stream from the video stream of the access control terminal; receiving the main stream pushed by the edge media gateway through a video stream transmission channel, and generating and displaying a high-resolution image based on the main stream; the resolution of the high-resolution image is higher than that of the low-resolution image.
[0094] The resolution switching operation is an interaction performed by the user on the client to request switching to a higher image quality, such as clicking the "HD" icon on the screen.
[0095] Among them, the video stream switching request is an instruction generated by the client based on the resolution switching operation, which requests the edge media gateway to switch the bitstream type.
[0096] Optionally, when a user is watching low-definition content and performs a resolution switching operation (such as clicking the high-definition button), the client will immediately send a video stream switching request to the edge media gateway. Subsequently, the client continues to receive data through the original video stream transmission channel, but the data source has changed from the sub-stream to the main stream. The client's video decoder seamlessly switches to decoding the main stream and replaces the original low-definition content with the rendered high-definition image for display.
[0097] In this embodiment, the client responds to the user's resolution switching operation and actively initiates a video stream switching request, giving the user the right to control the image quality. The entire switching process is completed within the established video stream transmission channel, without requiring the user to wait for a new connection to be established, thus achieving a smooth transition in image quality improvement. While ensuring low initial latency, it meets the user's high requirements for the final viewing quality, thereby comprehensively improving the quality of the video preview service.
[0098] In one exemplary embodiment, a method for previewing access control video is provided, applied to the central signaling server of an access control video preview system, so that the method is applied to... Figure 1 Taking the central signaling server as an example, the explanation includes the following steps S402 to S404. Wherein:
[0099] Step S402: Receive the access control video preview request initiated by the user's client on the access control video preview system for the access control terminal of the access control video preview system, and perform authentication processing on the client.
[0100] In this application, the central signaling server specifically refers to the central signaling server, which is the control center of the system and is responsible for authentication, resource scheduling, and signaling forwarding.
[0101] The authentication process is a security verification procedure that checks whether the client and user have permission to access the video stream of the specified access control terminal.
[0102] Optionally, the user initiates an access control video preview request for the access control terminal of the access control video preview system on the client side of the access control video preview system. After receiving the access control video preview request, the central signaling server first extracts the user / device credentials in the request, compares them with the authorization database, and completes the authentication process.
[0103] Step S404: After authentication is successful, the client is provided with edge media gateway information associated with the access control terminal, so that the client can establish a video stream transmission channel with the edge media gateway associated with the access control terminal based on the edge media gateway information, and obtain the sub-stream pulled by the edge media gateway from the video stream of the access control terminal through the video stream transmission channel, generate a low-definition picture based on the sub-stream and display it; the clarity of the low-definition picture is lower than the preset clarity.
[0104] Optionally, if authentication is successful, the central signaling server queries the edge media gateway responsible for the access control terminal based on the access control terminal identifier in the request, and returns the connection information of that gateway (edge media gateway information) to the client. The client establishes a video transmission channel with the access control terminal's edge media gateway based on this connection information, and obtains the sub-stream pulled from the access control terminal's video stream by the edge media gateway through this channel. Based on this sub-stream, a low-definition image is generated and displayed. After this, the central signaling server no longer participates in video data transmission, and may only continue to be responsible for signaling maintenance or state synchronization.
[0105] In the aforementioned access control video preview method, the central signaling server ensures system security and prevents unauthorized access through centralized authentication processing. At the same time, as an information exchange node, the central signaling server efficiently completes the pairing of the client and the edge media gateway, providing the necessary connection information for establishing a direct video stream transmission channel between the two parties. By separating signaling control from media stream transmission and allowing the media stream to take a point-to-point direct connection path, the central signaling server successfully avoids becoming a bottleneck for video data transmission, creating conditions for reducing end-to-end latency from the system architecture level.
[0106] For the convenience of those skilled in the art, Figure 5 This document provides an exemplary data interaction diagram for an access control video preview system. Initially, the access control terminal powers on and registers with the central signaling server, announcing the network access information of its associated edge media gateway. The client initiates a request to the central signaling server to preview a specific access control unit. After authentication, the client obtains the signaling address and sub-stream session description of the associated edge media gateway. The client and edge media gateway exchange WebRTC signaling (SDP Offer / Answer and ICE candidate) through the central signaling server, prioritizing the establishment of a WebRTC transmission channel based on the sub-stream. The edge media gateway pushes the low-bitrate sub-stream from the access control terminal to the client in real time through the established WebRTC data channel. The client completes the first frame rendering within 300 milliseconds, achieving "instant preview." Based on the sub-stream preview, if the user triggers a "high-definition viewing" operation (such as double-clicking the screen), the client initiates a dynamic bitstream switching request to the edge media gateway. The gateway seamlessly stops pushing the sub-stream and switches to pushing the high-resolution main bitstream, improving clarity. At the end of the preview, either the client or the edge media gateway actively closes the WebRTC connection to release resources.
[0107] Figure 6 An exemplary sequence diagram of the core process of an access control video preview system is provided. In this application, the access control video preview implementation of the access control video preview system can be divided into four stages: the first stage is device discovery initialization, the second stage is low-latency preview establishment, the third stage is high-definition screen switching, and the fourth stage is preview end.
[0108] In the first phase, the access control terminal registers itself with the central signaling server, carrying the gateway address, while the client authenticates itself via login on the central signaling server. If a user requests to preview access control terminal X, the central signaling server will return the gateway signaling address associated with access control terminal X to the client, thereby establishing a video stream transmission channel between the client and the edge media gateway of the access control terminal.
[0109] In the second phase, the client requests a sub-stream via WebRTC Offer, the edge media gateway sends a WebRTC Answer to the client, and then the client and the edge media gateway perform an ICE Candidate exchange to establish a WebRTCeer Connection. Then, the edge media gateway pushes the sub-stream video data pulled from the access control terminal to the client through the WebRTC channel. The client renders the first frame within 300ms to achieve low-definition preview.
[0110] In the third stage, when a user requests to view a high-definition image, i.e., when the user requests to switch from the sub-stream to the main stream, the edge media gateway stops pulling the sub-stream and switches to pulling the main stream. The video stream is switched through the same WebRTC channel, and the client can display a high-definition image based on the main stream.
[0111] In the fourth stage, the user ends the viewing of the access control video, and the client sends a signal to the edge media gateway to stop streaming. Upon receiving the signal, the edge media gateway stops streaming and closes the WebRTC channel, thus terminating the WebRTC connection and resources.
[0112] The beneficial effects of this invention are as follows: ultra-low latency, employing WebRTC, a protocol designed for real-time communication, and eliminating the central transcoding stage, resulting in end-to-end latency consistently below 500 milliseconds and first-frame preview time less than 300 milliseconds; lightweight architecture, reduced costs, with video streams processed only within the edge LAN and sent directly point-to-point, while the central server only handles lightweight signaling, significantly reducing bandwidth and computing costs and providing extremely strong system scalability; dynamic experience optimization, with an innovative "sub-stream priority, main stream switched on demand" strategy, ensuring real-time preview while also meeting high-definition viewing needs and saving unnecessary bandwidth consumption; standardization and high compatibility, based on the standard WebRTC protocol, requiring no plugins for the client, and directly supported by mainstream browsers and mobile operating systems, making deployment convenient.
[0113] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0114] The access control video preview device provided in the embodiments of this application is described below. The access control video preview device has the same inventive concept as the access control video preview method described above. The solution to the problem provided by the device is similar to the solution described in the above method. Therefore, the specific limitations of one or more access control video preview device embodiments provided below can be referred to the limitations of the access control video preview method above. The access control video preview device described below and the access control video preview method described above can be referred to each other, and will not be repeated here.
[0115] In one exemplary embodiment, Figure 7 This application provides a schematic diagram of the structure of an access control video preview device, which is applied to an edge media gateway of an access control video preview system. The access control video preview system also includes a client and an access control terminal. The edge media gateway and the access control terminal are deployed in the same local area network. The device includes: an establishment module 702, a pull module 704, and a push module 706, wherein:
[0116] Module 702 is used to establish a video stream transmission channel with the client when a user initiates a video preview request for the access control terminal on the client.
[0117] The pull module 704 is used to pull sub-streams from the video stream of the access control terminal;
[0118] The push module 706 is used to push the sub-stream to the client through the video stream transmission channel, so that the client can generate and display a low-definition picture based on the sub-stream within a preset time range; the clarity of the low-definition picture is lower than the preset clarity.
[0119] In one exemplary embodiment, the access control video preview system further includes a central signaling server and an establishment module 702, which is specifically used to exchange connection negotiation signaling with the client through the central signaling server to establish a point-to-point transmission channel based on the web real-time communication protocol, and use the point-to-point transmission channel as a video stream transmission channel.
[0120] In one exemplary embodiment, the apparatus further includes: a switching module, configured to, in response to a client's request to switch the resolution of a low-resolution image, stop retrieving a sub-stream from the video stream of the access control terminal and retrieve a main stream from the video stream of the access control terminal; push the main stream to the client through a video stream transmission channel, so that the client generates and displays a high-resolution image based on the main stream; the resolution of the high-resolution image is higher than that of the low-resolution image.
[0121] In one exemplary embodiment, the apparatus further includes: a termination module, configured to, in response to a client's request to end viewing of the access control video on the access control terminal, stop pulling the bitstream from the video stream of the access control terminal and close the video stream transmission channel.
[0122] In one exemplary embodiment, such as Figure 8 As shown, an access control video preview device is provided, which is applied to the client of an access control video preview system. This module includes: a sending module 802, a receiving module 804, and a display module 806, wherein:
[0123] The sending module 802 is used to respond to the access control video preview trigger operation of the access control terminal for the access control video preview system and establish a video stream transmission channel with the edge media gateway of the access control terminal.
[0124] The receiving module 804 is used to receive the sub-stream pushed by the edge media gateway through the video stream transmission channel; the sub-stream is obtained by the edge media gateway from the video stream of the access control terminal.
[0125] Display module 806 is used to generate and display a low-definition image based on a sub-bitstream within a preset time range; the resolution of the low-definition image is lower than the preset resolution.
[0126] In an exemplary embodiment, the apparatus further includes: a response module, configured to send a video stream switching request to an edge media gateway in response to a resolution switching operation for a low-definition image; the edge media gateway, upon receiving the video stream switching request, to stop retrieving sub-streams from the video stream of the access control terminal and retrieve the main stream from the video stream of the access control terminal; to receive the main stream pushed by the edge media gateway through a video stream transmission channel, and to generate and display a high-definition image based on the main stream; the resolution of the high-definition image is higher than that of the low-definition image.
[0127] In one exemplary embodiment, such as Figure 9 As shown, an access control video preview device is provided, which is applied to the central signaling server of the access control video preview system. The device includes: an authentication module 902 and an information providing module 904, wherein:
[0128] The authentication module 902 is used to receive access control video preview requests initiated by users from the client of the access control video preview system for the access control terminal of the access control video preview system, and to perform authentication processing on the client.
[0129] The information providing module 904 is used to provide the client with the edge media gateway information associated with the access control terminal after authentication is passed, so that the client can establish a video stream transmission channel with the edge media gateway associated with the access control terminal based on the edge media gateway information, and obtain the sub-stream pulled by the edge media gateway from the video stream of the access control terminal through the video stream transmission channel, generate a low-definition picture based on the sub-stream and display it; the clarity of the low-definition picture is lower than the preset clarity.
[0130] In one exemplary embodiment, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the access control video preview methods described above.
[0131] In one exemplary embodiment, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of any of the access control video preview methods described above.
[0132] In one exemplary embodiment, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the access control video preview methods described in the above embodiments.
[0133] Indicatively, such as Figure 10 As shown, Figure 10 This is a schematic diagram of the internal structure of a computer device 1000 provided in an embodiment of this application. The computer device 1000 can be provided as a server. (Refer to...) Figure 10 The computer device 1000 includes a processing component 1002, which further includes one or more processors, and memory resources represented by memory 1001 for storing instructions, such as application programs, that can be executed by the processing component 1002. The application programs stored in memory 1001 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 1002 is configured to execute instructions to perform the access control video preview method of any of the above embodiments.
[0134] The computer device 1000 may also include a power supply component 1003 configured to perform power management of the computer device 1000, a wired or wireless network interface 1004 configured to connect the computer device 1000 to a network, and an input / output (I / O) interface 1005. The computer device 1000 may operate on an operating system stored in memory 1001, such as Windows Server™, Mac OS X™, Unix™, Linux™, Free BSD™, or similar.
[0135] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0136] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0137] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0138] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.< / video>
Claims
1. A method for previewing access control video, characterized in that, An edge media gateway is used in an access control video preview system, wherein the access control video preview system further includes a client and an access control terminal, and the edge media gateway and the access control terminal are deployed on the same local area network. The method includes: When a user initiates an access control video preview request for the access control terminal on the client, a video stream transmission channel is established with the client; Pull sub-streams from the video stream of the access control terminal; The sub-stream is pushed to the client through the video stream transmission channel, so that the client generates and displays a low-definition image based on the sub-stream within a preset time range; the resolution of the low-definition image is lower than the preset resolution.
2. The method according to claim 1, characterized in that, The access control video preview system also includes a central signaling server, and the establishment of a video stream transmission channel with the client includes: The central signaling server exchanges connection negotiation signaling with the client to establish a point-to-point transmission channel based on the web real-time communication protocol, and uses the point-to-point transmission channel as a video stream transmission channel.
3. The method according to claim 1, characterized in that, The method further includes: In response to the client's request to switch the resolution of the low-definition image, stop pulling the sub-stream from the video stream of the access control terminal and pull the main stream from the video stream of the access control terminal; The main stream is pushed to the client through the video stream transmission channel, so that the client generates and displays a high-definition image based on the main stream; the clarity of the high-definition image is higher than that of the low-definition image.
4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: In response to the client's request to end viewing of the access control video of the access control terminal, the system stops pulling the bitstream from the video stream of the access control terminal and closes the video stream transmission channel.
5. A method for previewing access control video, characterized in that, The method, applied to a client-side access control video preview system, includes: In response to the access control video preview trigger operation of the access control terminal of the access control video preview system, a video stream transmission channel is established with the edge media gateway of the access control terminal; The sub-stream pushed by the edge media gateway is received through the video stream transmission channel; the sub-stream is obtained by the edge media gateway from the video stream of the access control terminal. Within a preset time range, a low-resolution image is generated and displayed based on the sub-stream; the resolution of the low-resolution image is lower than the preset resolution.
6. The method according to claim 5, characterized in that, The method further includes: In response to the resolution switching operation for the low-resolution image, a video stream switching request is sent to the edge media gateway; the edge media gateway is used to stop pulling sub-streams from the video stream of the access control terminal and pull the main stream from the video stream of the access control terminal when it receives the video stream switching request. The system receives the main stream pushed by the edge media gateway through the video stream transmission channel, and generates and displays a high-definition image based on the main stream; the clarity of the high-definition image is higher than that of the low-definition image.
7. A method for previewing access control video, characterized in that, A central signaling server used in an access control video preview system, the method comprising: Receive access control video preview requests initiated by users from the client of the access control video preview system for the access control terminal of the access control video preview system, and perform authentication processing on the client; After authentication is successful, the client is provided with edge media gateway information associated with the access control terminal, so that the client can establish a video stream transmission channel with the edge media gateway associated with the access control terminal based on the edge media gateway information, and obtain the sub-stream pulled by the edge media gateway from the video stream of the access control terminal through the video stream transmission channel, generate a low-definition picture based on the sub-stream and display it; the clarity of the low-definition picture is lower than the preset clarity.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.