Method for playing videos in real time through multiple cameras
By configuring and generating streaming media playback parameter tables, creating streaming media playback instances, real-time video playback of multiple cameras, and dynamically switch playback methods in complex network environments, solving the problems of unstable video playback, poor compatibility and high resource consumption in the existing technology, and achieving efficient and stable multi-channel video playback.
Patent Information
- Application Number
- CN202411735407.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-14
AI Technical Summary
The prior art faces the problems of system stability, flexibility of playback methods and high resource consumption in intelligent video surveillance and multi-channel video playback applications, resulting in unstable video playback and difficulty in compatible with multiple cameras. The large resource consumption affects the smoothness of playback.
By configuring the streaming media information table and the camera information table, generating the streaming media playback parameter table, creating streaming media playback instances, real-time video playback of multiple cameras, and automatically detecting and recovering when network fluctuations or insufficient resources, dynamically switch playback methods to adapt to different environments.
It realizes compatibility support for multi-brand cameras, has a stable playback control mechanism, and can flexibly switch playback methods in complex network environments, ensuring efficient resource utilization and playback quality, and significantly improving the stability and user experience of video streams.
Smart Images

Figure CN119629309A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of charging pile communication technology, and in particular to a charging pile communication method and system based on 104 protocol. Background Art
[0002] Intelligent video surveillance is greatly affected by various environmental factors such as the network during actual use. According to the on-site technical conditions, flexible configuration of suitable playback solutions can provide a large amount of reliable video data for life and production. At present, the above functions are usually implemented by using a single playback solution, which has strong technical limitations, is not comprehensive in functions, does not support flexible configuration, and is not stable enough. Therefore, conventional video playback solutions cannot support stable video streaming playback in various extreme situations.
[0003] In modern intelligent video surveillance and multi-channel video playback applications, it is of great significance to achieve efficient and stable real-time video playback of multiple cameras. However, the existing technology faces the following major challenges in actual use: System stability: Multi-channel cameras run in a complex network environment and are easily affected by factors such as network fluctuations and insufficient bandwidth, resulting in unstable video playback. Traditional video playback solutions lack automatic detection and recovery mechanisms when the network jitters or the signal is lost, which often leads to playback interruptions or freezes, affecting user experience and monitoring effects. Flexibility of playback methods: The protocols and streaming formats of cameras of different brands vary greatly, resulting in poor compatibility of playback methods. Most existing systems only support a single playback solution, which is difficult to cope with the real-time playback requirements of multiple cameras. Achieving cross-platform and cross-protocol compatibility and flexible playback configuration has become a bottleneck of existing systems. High resource consumption and playback fluency: On the front-end playback end, the parallel playback of multiple videos consumes a lot of system resources, especially when playing high-definition videos, which may lead to insufficient CPU and memory resources, thereby affecting playback fluency. Therefore, optimizing front-end resource management and reducing the system resources required for playback to ensure smooth video playback are the main technical difficulties at present. Summary of the invention
[0004] Purpose of the invention: The purpose of the present invention is to provide a method for real-time video playback through multiple cameras to improve the stability of the video stream and enhance the adaptability of playback.
[0005] Technical solution: The method for real-time video playback through multiple cameras described in the present invention comprises the following steps:
[0006] S1. Streaming media service configuration: configure the streaming media information table to support multiple streaming media services through the streaming media type field;
[0007] S2, camera information configuration: configure a camera information table, the camera information table includes a camera name and a streaming media type field, bind a corresponding streaming media service, and generate streaming media playback parameters corresponding to the camera;
[0008] S3, streaming media playback parameter generation: generating a streaming media playback parameter table according to the streaming media information table and the camera information table;
[0009] S4, creation of playback instance and playback scheme: creating a corresponding streaming media playback instance according to the streaming media type bound to the camera and the streaming media playback parameter table, calling the streaming media service interface to obtain the playback address, and initializing the playback instance;
[0010] According to the streaming media type bound to the camera, the parameters of the streaming media information table are set for the corresponding playback instance, and the video playback action is matched to form a playback plan;
[0011] S5, real-time video stream playback: according to the camera name for real-time video playback, the camera information table is circulated to obtain camera information, and the playback instance and playback scheme of step S4 are called according to the streaming media type corresponding to the camera information to play the real-time stream;
[0012] S6. Dynamic switching of playback mode: When the camera is switched, the name of the camera that needs to play the real-time video is updated, and step S5 is re-executed.
[0013] The technical solution is further limited to that the streaming media information table described in step S1 includes the following fields: streaming media name nvrName, IP address nvrIp, port nvrPort, account nvrAccount, password nvrPassword, streaming media type nvrType; the streaming media service is initialized according to the streaming media information table, and the service connection status is verified. If the configuration fails, the user is prompted to reconfigure.
[0014] Furthermore, the streaming media types include BoRun server, Qingshi streaming media, WebRTC, Hai; device, BoRun box, which are added or deleted in a dynamic form.
[0015] Furthermore, the camera information configuration table described in step S2 includes the following fields: camera name cameraName, IP address cameraIp, account userName, password password, channel number channelNumber, manufacturer cameraManufacturer, streaming media type nvrId, device national standard number serial, and channel national standard number code.
[0016] Furthermore, in step S5, the real-time stream being played is monitored in real time to detect the playing status of the video stream. If a playback abnormality occurs, reconnection, parameter adjustment or prompting the user to supplement the missing parameters is performed.
[0017] Furthermore, the dynamic switching of the playback mode in step S6 also includes switching the streaming media type, modifying the streaming media type field in the camera information table, and re-executing steps S3, S4 and S5.
[0018] Beneficial effects: Compared with the prior art, the advantages of the present invention are: the present invention can achieve compatibility support for cameras of multiple brands, has a stable playback control mechanism, can flexibly switch playback modes in complex network environments, and ensure efficient resource utilization and playback quality. The present invention is not only applicable to monitoring scenarios, but can also be applied to a variety of complex business scenarios, such as intelligent security, traffic monitoring, and industrial automation. Its versatility and scalability significantly reduce the technical cost of switching between different scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 It is a flow chart of a method for real-time video playback through multiple cameras provided by the present invention;
[0020] Figure 2 This is a diagram of the real-time video streaming playback in Example 1 of the present invention. DETAILED DESCRIPTION
[0021] The technical solution of the present invention is described in detail below with reference to the accompanying drawings, but the protection scope of the present invention is not limited to the embodiments.
[0022] Example 1
[0023] This embodiment provides a method for real-time video playback through multiple cameras, which can achieve compatibility support for cameras of multiple brands, has a stable playback control mechanism, can flexibly switch playback modes in a complex network environment, and ensure efficient resource utilization and playback quality. The workflow diagram is as follows: Figure 1 As shown, introduce a third-party js library for calling the interface and bind the streaming media and camera information. The specific steps are as follows.
[0024] S1. Streaming service configuration.
[0025] Configure the streaming media information table to support multiple streaming media services through the streaming media type field.
[0026] The streaming media information table includes the following fields: streaming media name nvrName, IP address nvrIp, port nvrPort, account nvrAccount, password nvrPassword, streaming media type nvrType, and the table structure is shown in Table 1:
[0027]
[0028]
[0029] Subsequently, the corresponding streaming media service is called through the "streaming media type nvrType" in the table, where the streaming media type nvrType includes BoRun server, Qingshi streaming media, webrtc, Hikvision, and BoRun box, and can be added or deleted dynamically as needed.
[0030] The streaming media service is initialized according to the streaming media information table, and the service connection status is verified. If the configuration fails, the user is prompted to reconfigure.
[0031] S2. Camera information configuration.
[0032] A camera information table is configured, wherein the camera information table includes a camera name and a streaming media type field, a corresponding streaming media service is bound, and streaming media playback parameters corresponding to the camera are generated.
[0033] The camera information configuration table includes the following fields: camera name cameraName, IP address cameraIp, account userName, password password, channel number channelNumber, manufacturer cameraManufacturer, streaming media type nvrId, device national standard number serial, channel national standard number code, and the table structure is shown in Table 2:
[0034]
[0035]
[0036] By configuring the streaming media information table and the camera information table, flexible support for multiple streaming media services (such as Borun streaming, Qingshi streaming, WebRTC, Hikvision devices, etc.) is achieved, and it can adapt to cameras of different brands and types. This compatibility significantly enhances the versatility of the system and avoids compatibility issues caused by device diversity. At the same time, the parameter configuration process is standardized and supports direct modification and dynamic update through the interface. This design reduces the user's operational complexity and improves the efficiency of system deployment and debugging.
[0037] S3: Generate streaming media playback parameters.
[0038] Generate a streaming media playback parameter table according to the streaming media information table and the camera information table, including the streaming media type and the parameters corresponding to different streaming media types. Through the parameters camera IP cameraIp, camera account userName, camera password password, camera channel number channelNumber, and streaming media type nvrId in the camera information table, by selecting the streaming media type to associate the streaming media IP nvrIp, account nvrAccount, password nvrPassword, and port nvrPort in the streaming media information table, the streaming media playback parameters are jointly generated according to the fixed custom configuration of each streaming media. The parameter generation method comes with the third-party js library and will not be described in detail here.
[0039] The parameter table includes specific parameters for different streaming media types, such as:
[0040] For BoRun streaming media, parameters such as monitorPointUuid, protocol, deviceNo, channelNo, channelName, channelType, etc. are generated. The table structure is shown in Table 3:
[0041]
[0042]
[0043] For Qingshi streaming media, the device national standard number (serial) and channel national standard number (code) are generated. The table structure is as follows
[0044] As shown in Table 4:
[0045] Fields type illustrate serial String Equipment national standard number code String Channel national standard number
[0046] By generating a streaming media playback parameter table and dynamically creating a playback instance, the present invention effectively solves the problem of unstable video streaming playback in the prior art. At the same time, it provides an automatic reconnection mechanism and friendly prompt function for abnormalities such as network fluctuations and resource loading timeouts, greatly improving the stability and continuity of real-time video streaming playback.
[0047] S4: Creation of playback instance and playback plan.
[0048] Create a corresponding streaming media playback instance according to the streaming media type bound to the camera and the streaming media playback parameter table, call the streaming media service interface to obtain the playback address, and initialize the playback instance.
[0049] For example, BoRun Streaming Media associates the "Streaming Media Information Table" with the "Streaming Media Type" in the "Media Playback Parameter Table" to access the streaming media to obtain information such as monitorPointUuid, protocol, deviceNo, channelNo, channelName, channelType, and then uses the createStream method to initialize the call, and then uses the playStream method to play. If it fails, it will perform automatic reconnection or manual reconnection.
[0050] According to the streaming media type bound to the camera, the parameters of the streaming media information table are set for the corresponding playback instance, including the streaming media name, IP address, port, account password, and the SDK attribute method of the streaming media. Then, the video playback actions are matched to form a playback plan. The video playback actions include real-time playback, pause, close, screenshot, full screen, algorithm stream, playback aspect ratio conversion, reconnection mechanism, etc.
[0051] For example, Borun Streaming Media first obtains the camera playback information protocol, deviceNo, channelNo, channelName, channelType and the token of the S3 to play the video, and then uses this information to play the stream after successfully creating the stream. Qingshi Streaming Media needs to obtain the national standard number of the camera's device and channel for playback.
[0052] S5. Real-time video streaming playback.
[0053] According to the camera name for real-time video playback, the camera information table is circulated to obtain the camera information, including the camera name, camera IP, camera account, camera password, camera channel number, camera manufacturer, streaming media type, equipment national standard number, channel national standard number, and camera status. The playback instance and playback scheme of step S4 are called by the streaming media type corresponding to the camera information to play the real-time stream.
[0054] Specifically: first determine whether the camera is online, and perform playback operations if it is online; otherwise, do not perform operations if it is not online.
[0055] Secondly, determine the camera streaming media type and call the S4 playback instance and S5 solution to obtain the video playback address, real-time playback, pause, close, screenshot, full screen, algorithm stream, playback aspect ratio conversion, reconnection mechanism and other methods according to different streaming media types.
[0056] For example: configure BoRun streaming media information initialization and add test camera No. 1, as shown in Table 5:
[0057]
[0058]
[0059] Get the camera list, send the camera information to Borun streaming media, play or close the stream according to Borun playback plan, close the current camera and re-pull the playback stream of the new camera when switching cameras. The flow chart is as follows Figure 2 shown.
[0060] In step S5, the real-time stream being played is also monitored in real time to detect the playing status of the video stream. If a playback abnormality occurs, reconnection, parameter adjustment or prompting the user to supplement the missing parameters is performed.
[0061] S6. Dynamic switching of playback mode:
[0062] When the camera is switched to play other videos, the name of the camera that needs to play the real-time video is updated and step S5 is executed again.
[0063] The step S6 of dynamically switching the playback mode also includes switching the streaming media type, modifying the streaming media type field in the camera information table, and re-executing steps S3, S4 and S5.
[0064] In actual use, the quality of video streaming is affected by various factors. This solution integrates multiple video streaming playback controls to support switching different playback modes by modifying the camera configuration. Select a solution that suits the on-site environment and economy to switch the configuration. Modify the playback mode of the camera in the camera list and reload the new playback solution to enter the playback process.
[0065] It allows the playback mode to be dynamically switched according to the actual application scenario, and quickly adapts to different business needs by modifying the streaming media type or camera configuration parameters. This flexibility ensures the reliability and economy of the system in various complex environments.
[0066] In addition, the real-time video stream will be monitored during playback. Different playback methods require different conditions. For example, network stability can cause problems such as video stream playback interruption. The real-time stream needs to be monitored when trying to play. If the attempt fails, reconnect a certain number of times and a friendly prompt is given on the page. It is necessary to determine the problem with the real-time stream playback. Network problems, token failure, missing parameters, timeouts waiting for resource loading, video decoding timeouts, etc., and perform certain processing operations based on the conditions to ensure the friendliness of the Web interface. For abnormal situations. For example: there is an error camera in the front, and the normal camera behind does not play; abnormal network fluctuations; server token failure; missing playback parameters; timeouts waiting for resource loading; video decoding timeout page freezes.
[0067] To address these issues, we can set the number of reconnection attempts, manually click on reconnection, reacquire server token, prompt users to add missing parameters, control resource consumption, and other methods.
[0068] The present invention processes a solution for real-time video playback of multiple cameras, realizes real-time playback for robots of different manufacturers and brands, and integrates multiple video playback modes to flexibly configure appropriate playback solutions according to on-site technologies in different scenarios and different business backgrounds to provide technical guarantee for project delivery. The solution for processing real-time video playback of multiple cameras is also applicable to multiple business scenarios, with a streamlined code size and a wide range of applications.
[0069] The present invention does not.
[0070] As described above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes in form and details may be made without departing from the spirit and scope of the present invention as defined in the appended claims.
Claims
1. A method for real-time video playback through multiple cameras, characterized in that: The following steps are involved: S1. Streaming media service configuration: configure the streaming media information table to support multiple streaming media services through the streaming media type field; S2, camera information configuration: configure a camera information table, the camera information table includes a camera name and a streaming media type field, bind a corresponding streaming media service, and generate streaming media playback parameters corresponding to the camera; S3, streaming media playback parameter generation: generating a streaming media playback parameter table according to the streaming media information table and the camera information table; S4, creation of playback instance and playback scheme: creating a corresponding streaming media playback instance according to the streaming media type bound to the camera and the streaming media playback parameter table, calling the streaming media service interface to obtain the playback address, and initializing the playback instance; According to the streaming media type bound to the camera, the parameters of the streaming media information table are set for the corresponding playback instance, and the video playback action is matched to form a playback plan; S5, real-time video stream playback: according to the camera name for real-time video playback, the camera information table is circulated to obtain camera information, and the playback instance and playback scheme of step S4 are called according to the streaming media type corresponding to the camera information to play the real-time stream; S6. Dynamic switching of playback mode: When the camera is switched, the name of the camera that needs to play the real-time video is updated, and step S5 is re-executed.
2. The method for real-time video playback through multiple cameras according to claim 1, characterized in that: The streaming media information table in step S1 includes the following fields: streaming media name nvrName, IP address nvrIp, port nvrPort, account nvrAccount, password nvrPassword, streaming media type nvrType; The streaming media service is initialized according to the streaming media information table, and the service connection status is verified. If the configuration fails, the user is prompted to reconfigure.
3. The method for real-time video playback through multiple cameras according to claim 1, characterized in that: The streaming media types include BoRun server, Qingshi streaming media, WebRTC, Hai; device, BoRun box, which are added or deleted dynamically.
4. The method for real-time video playback through multiple cameras according to claim 1, characterized in that: The camera information configuration table described in step S2 includes the following fields: camera name cameraName, IP address cameraIp, account userName, password password, channel number channelNumber, manufacturer cameraManufacturer, streaming media type nvrId, device national standard number serial, channel national standard number code.
5. The method for real-time video playback through multiple cameras according to claim 1, characterized in that: In step S5, the real-time stream being played is also monitored in real time to detect the playing status of the video stream. If a playback abnormality occurs, reconnection, parameter adjustment or prompting the user to supplement the missing parameters is performed.
6. The method for real-time video playback through multiple cameras according to claim 1, characterized in that: The step S6 of dynamically switching the playback mode also includes switching the streaming media type, modifying the streaming media type field in the camera information table, and re-executing steps S3, S4 and S5.
Citation Information
Cited By
Dynamic video stream playing control method and system
CN120434463A