Method and device for adding user-defined OSD (On Screen Display) to video stream

By adding SEI units to the video stream and adding custom OSD tag data thereon, the problems of complexity and high resource occupation of video surveillance system in the prior art are solved, and the simultaneous display of video images and OSD information is realized, reducing the System complexity and resource consumption.

CN119182948APending Publication Date: 2024-12-24INSPUR COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411223799.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-03
Publication Date
2024-12-24

AI Technical Summary

Technical Problem

When existing video surveillance systems display monitoring-related information, commonly used methods increase system complexity and instability, or lead to video playback delay and resource utilization.

Method used

By adding SEI units to the video stream, using keyframes to determine whether the SEI units are included, and adding custom OSD tag data thereon, the video picture and OSD information are simultaneously displayed without additional transmission channels or codec operations.

Benefits of technology

It realizes automatic filtering and displaying custom OSD information without affecting video stream playback, reducing system complexity and resource consumption, and avoiding time synchronization problems and video playback delay.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182948A_ABST
    Figure CN119182948A_ABST
Patent Text Reader

Abstract

The invention discloses a method and device for adding a user-defined OSD to a video stream, and relates to the technical field of front ends. Comprising the steps of 1, configuring OSD label data needing to be sent to a superior platform by using a current platform, 2, receiving a video stream sent by a subordinate device by using the current platform, judging whether the video stream contains an SEI unit or not according to a key frame, if so, adding the OSD label data to the SEI unit according to the current platform configuration, and if not, adding the OSD label data to the SEI unit; and 3, after the video stream arrives at a playing end, reading the OSD label data of the SEI unit in sequence, and sending the OSD label data to a subtitle module for presentation or presenting the OSD label data and the video in an overlapping manner through a browser layer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention discloses a method and device for adding a custom OSD to a video stream, and relates to the technical field of front-end. Background Art

[0002] With the continuous development of the intelligent industry, video surveillance is widely used in many occasions due to its intuitive, accurate, timely and rich information content, and has become a powerful means of technical security prevention. Usually, in order to intuitively understand the monitoring-related information such as the name of the monitoring area, grouping, platform information, etc., it is displayed on the monitoring screen through OSD (On Screen Display). Except for a few information such as timestamps and camera names that can be achieved by setting the camera, the others are added in the middle. There are currently two main solutions: 1. Send relevant information by defining other interface protocols, forward it step by step to the final presentation end and merge it with the video stream for display. This solution increases the complexity and instability of the system, and will cause time synchronization problems when other interfaces are unstable and cause retransmission; 2. Through transcoding, decode the video stream, superimpose the information on the picture, and then encode it as a video stream for transmission. This solution does not require any modification to the original system, but will greatly increase resource usage and increase video playback delay. Summary of the invention

[0003] In view of the problems of the prior art, the present invention provides a method and device for adding custom OSD to a video stream, which does not require adding additional transmission channels, has no synchronization problems, and does not require encoding and decoding of videos. It only requires adding an extension unit to the original video frame. The unit is supported by the video itself and automatically filters the analysis of the unit when no modification is made on the playback end, which does not affect the video stream playback. After targeted modification, the video screen and OSD information can be displayed at the same time.

[0004] The specific scheme proposed by the present invention is:

[0005] The present invention provides a method for adding a custom OSD to a video stream, comprising:

[0006] Step 1: Use the current platform to configure the OSD tag data that needs to be sent to the upper-level platform.

[0007] Step 2: Use the current platform to receive the video stream sent by the lower-level device, and determine whether the video stream contains the SEI unit based on the key frame. If it does, add the OSD tag data to the SEI unit according to the current platform configuration.

[0008] Step 3: After the video stream reaches the playback end, the OSD tag data of the SEI unit is read in sequence and sent to the subtitle module for presentation or presented through a browser layer overlay with the video.

[0009] Furthermore, when configuring the OSD label in step 1 of the method for adding a custom OSD to a video stream, one label is provided in each line, and a line break is provided as two labels. The fields of the OSD label include the upper left coordinate point of the label, the font size and the display content.

[0010] Furthermore, if step 2 of the method for adding a custom OSD to a video stream does not include adding a SEI unit to the video stream, the OSD tag data configured by the current platform is added to the SEI unit.

[0011] Furthermore, in step 2 of the method for adding a custom OSD to a video stream, the OSD tag data format added to the SEI unit is: tag length + upper left coordinate x + upper left coordinate y + font size + tag content, and all OSD tags are added in a loop.

[0012] The label length refers to the total number of bytes occupied by other fields except the length itself;

[0013] Upper left coordinates: refers to the position of the label in the video. x, y is the coordinates of the upper left corner of the label and the aspect ratio of the video * 10000;

[0014] Font size: refers to the font size of the label, in pt.

[0015] The present invention also provides a device for adding a custom OSD to a video stream, comprising a configuration module, a judgment and addition module, and a display module.

[0016] The configuration module uses the current platform configuration to send OSD tag data to the upper platform.

[0017] The judgment adding module uses the current platform to receive the video stream sent by the lower-level device, and judges whether the video stream contains the SEI unit according to the key frame. If it does, the OSD tag data is added to the SEI unit according to the current platform configuration.

[0018] After the video stream reaches the playback end, the display module reads the OSD tag data of the SEI unit in sequence and sends it to the subtitle module for presentation or presents it through a browser layer and video overlay.

[0019] Furthermore, when the configuration module of the device for adding a custom OSD to a video stream configures the OSD label, one label is set for each line, and a line break is used as two label settings. The fields of the OSD label include the upper left coordinate point of the label, the font size and the display content.

[0020] Furthermore, if the apparatus for adding a custom OSD to a video stream does not include a judgment adding module, a SEI unit is added to the video stream, and the OSD tag data configured by the current platform is added to the SEI unit.

[0021] Furthermore, the OSD tag data format added to the SEI unit by the adding module of the device for adding custom OSD to a video stream is: tag length + upper left coordinate x + upper left coordinate y + font size + tag content, and all OSD tags are added in a loop.

[0022] The label length refers to the total number of bytes occupied by other fields except the length itself;

[0023] Upper left coordinates: refers to the position of the label in the video. x, y is the coordinates of the upper left corner of the label and the aspect ratio of the video * 10000;

[0024] Font size: refers to the font size of the label, in pt.

[0025] The benefits of the present invention are:

[0026] No additional transmission channels are required. In addition to adding the label platform and the player that displays the label, the intermediate platform does not need to be modified and can forward the video stream according to the original rules.

[0027] No need to encode or decode video streams, just add extension units to the encoded video streams without increasing resource consumption;

[0028] Backward compatible, the extension unit is natively supported by the video, and it will not affect the video playback regardless of whether the player is modified to support custom OSD tags. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a schematic flow chart of the method of the present invention. DETAILED DESCRIPTION

[0030] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments so that those skilled in the art can better understand the present invention and implement it, but the embodiments are not intended to limit the present invention.

[0031] Example 1

[0032] The present invention provides a method for adding a custom OSD to a video stream, comprising:

[0033] Step 1: Use the current platform to configure the OSD tag data that needs to be sent to the upper-level platform. Associate the fields video stream ID and upper-level platform ID. The platform side can customize any number of OSD tags, or define specific tags for different upper-level platforms. At the same time, you can choose whether to delete the customized tags sent by the lower-level platform / device.

[0034] When configuring the OSD label in step 1, one label can be set for each line, with line breaks as two label settings. The fields of the OSD label include the upper left coordinate point of the label, font size and display content.

[0035] Step 2: Use the current platform to receive the video stream sent by the lower-level device, and determine whether the video stream contains the SEI (Supplemental Enhancement Information) unit based on the key frame. If not, add the SEI unit to the video stream and add the OSD tag data configured by the current platform to the SEI unit; if included, add the OSD tag data to the SEI unit according to the current platform configuration.

[0036] The OSD tag data format added to the SEI unit in step 2 is: tag length (1 byte) + upper left coordinate x (2 bytes) + upper left coordinate y (2 bytes) + font size (1 byte) + tag content (n bytes). All OSD tags are added in this way.

[0037] The label length refers to the total number of bytes occupied by other fields except the length itself;

[0038] Upper left coordinates: refers to the position of the label in the video. x, y is the coordinates of the upper left corner of the label and the aspect ratio of the video * 10000;

[0039] Font size: refers to the font size of the label, in pt.

[0040] Step 3: After the video stream reaches the playback end, the OSD tag data of the SEI unit is read in sequence and sent to the subtitle module, such as the CS player for presentation, or presented through a browser layer, such as the BS player, overlaid with the video.

[0041] The current mainstream H264, H265 and domestic security SVAC encoding in the present invention all support SEI units and can cover the vast majority of monitoring equipment on the market.

[0042] Example 2

[0043] The present invention also provides a device for adding a custom OSD to a video stream, comprising a configuration module, a judgment and addition module, and a display module.

[0044] The configuration module uses the current platform configuration to send OSD tag data to the upper platform.

[0045] The judgment adding module uses the current platform to receive the video stream sent by the lower-level device, and judges whether the video stream contains the SEI unit according to the key frame. If it does, the OSD tag data is added to the SEI unit according to the current platform configuration.

[0046] After the video stream reaches the playback end, the display module reads the OSD tag data of the SEI unit in sequence and sends it to the subtitle module for presentation or presents it through a browser layer and video overlay.

[0047] As the information interaction and execution process between the modules in the above-mentioned device are based on the same concept as the embodiment of the method of the present invention, the specific contents can be found in the description of the embodiment of the method of the present invention and will not be repeated here.

[0048] Likewise, the benefits of the device of the present invention are:

[0049] No additional transmission channels are required. In addition to adding the label platform and the player that displays the label, the intermediate platform does not need to be modified and can forward the video stream according to the original rules.

[0050] No need to encode or decode video streams, just add extension units to the encoded video streams without increasing resource consumption;

[0051] Backward compatible, the extension unit is natively supported by the video, and it will not affect the video playback regardless of whether the player is modified to support custom OSD tags.

[0052] The above-described embodiments are only preferred embodiments for fully illustrating the present invention, and the protection scope of the present invention is not limited thereto. Equivalent substitutions or changes made by those skilled in the art based on the present invention are within the protection scope of the present invention. The protection scope of the present invention shall be subject to the claims.

Claims

1. A method for adding a custom OSD to a video stream, characterized in that include: Step 1: Use the current platform to configure the OSD tag data that needs to be sent to the upper-level platform. Step 2: Use the current platform to receive the video stream sent by the lower-level device, and determine whether the video stream contains the SEI unit based on the key frame. If it does, add the OSD tag data to the SEI unit according to the current platform configuration. Step 3: After the video stream reaches the playback end, the OSD tag data of the SEI unit is read in sequence and sent to the subtitle module for presentation or presented through a browser layer overlay with the video.

2. The method for adding a custom OSD to a video stream according to claim 1, characterized in that When configuring the OSD label in step 1, one label is set for each line, and line breaks are used as two label settings. The fields of the OSD label include the upper left coordinate point of the label, font size, and display content.

3. The method for adding a custom OSD to a video stream according to claim 1, characterized in that If it is not included in step 2, an SEI unit is added to the video stream, and the OSD tag data configured by the current platform is added to the SEI unit.

4. The method for adding a custom OSD to a video stream according to claim 1, characterized in that The OSD tag data format added to the SEI unit in step 2 is: tag length + upper left coordinate x + upper left coordinate y + font size + tag content. All OSD tags are added in this way. The label length refers to the total number of bytes occupied by other fields except the length itself; Upper left coordinates: refers to the position of the label in the video. x, y is the coordinates of the upper left corner of the label and the aspect ratio of the video * 10000; Font size: refers to the font size of the label, in pt.

5. A device for adding a custom OSD to a video stream, characterized in that Including configuration module, judgment and addition module and display module, The configuration module uses the current platform configuration to send OSD tag data to the upper platform. The judgment adding module uses the current platform to receive the video stream sent by the lower-level device, and judges whether the video stream contains the SEI unit according to the key frame. If it does, the OSD tag data is added to the SEI unit according to the current platform configuration. After the video stream reaches the playback end, the display module reads the OSD tag data of the SEI unit in sequence and sends it to the subtitle module for presentation or presents it through a browser layer and video overlay.

6. The device for adding a custom OSD to a video stream according to claim 5, characterized in that When configuring the OSD label, there is one label per line, with line breaks as two label settings. The fields of the OSD label include the upper left coordinate point of the label, font size, and display content.

7. The device for adding a custom OSD to a video stream according to claim 5, characterized in that If it is not included, the judgment adding module adds a SEI unit to the video stream and adds the OSD tag data configured by the current platform to the SEI unit.

8. The device for adding a custom OSD to a video stream according to claim 5, characterized in that The format of OSD label data added by the add module to the SEI unit is: label length + upper left coordinate x + upper left coordinate y + font size + label content. All OSD labels are added in this way. The label length refers to the total number of bytes occupied by other fields except the length itself; Upper left coordinates: refers to the position of the label in the video. x, y is the coordinates of the upper left corner of the label and the aspect ratio of the video * 10000; Font size: refers to the font size of the label, in pt.