An editing method and device of a video stream, an electronic device, and a storage medium
By receiving and decoding the timestamps of the video stream at the system front end, and searching for editing information for online rendering, the problem of high hardware performance requirements for online video stream rendering is solved, and efficient real-time rendering effects are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANG FEI ZHI NENG JI SHU YOU XIAN GONG SI
- Filing Date
- 2022-10-14
- Publication Date
- 2026-04-17
AI Technical Summary
Existing online video streaming rendering technologies have high requirements for terminal hardware processing and storage performance, and the rendering effect is poor and the real-time performance is insufficient.
The system front end receives information from the Redis module and the streaming media service module, uses timestamp decoding and editing information lookup to directly perform online real-time editing and rendering of the video stream, avoiding high hardware requirements.
It achieves efficient rendering of video streams without relying on system hardware performance and can realize real-time data synchronous rendering.
Smart Images

Figure CN115665479B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video editing and rendering technology, and in particular to a method, apparatus, electronic device and storage medium for editing video streams. Background Technology
[0002] Video editing and rendering are very common on both computers and mobile devices. Users typically adjust the color of offline videos, add small objects, and add text, all of which involve rendering offline videos. However, there are very few products that can render online videos.
[0003] Currently, online video stream rendering is commonly found in Client-Server (CS) architecture products and Browser-Server (BS) architecture products. CS architecture products implement online video stream rendering by decoding the video stream to obtain frame images, then analyzing these frames using intelligent or traditional algorithms to obtain corresponding results, and finally rendering these results onto the current video stream. However, this technology places high demands on the terminal hardware's processing and storage performance. BS architecture products implement online video stream rendering by decoding the video stream into single-frame images on a cloud computing server or edge computing server, then analyzing these single-frame images using intelligent or traditional algorithms to obtain corresponding results, superimposing these results onto the image, and finally encoding the image into a video stream for the system front-end. However, this technology not only produces poor special effects rendering, but also increases hardware overhead and reduces the real-time performance of video stream rendering. Therefore, designing a video stream editing method to address these shortcomings has become an urgent problem to be solved. Summary of the Invention
[0004] This application provides a video stream editing method, apparatus, electronic device, and storage medium, which not only ensures the video stream editing and rendering effect but also has no requirements on system hardware performance. It enables the system front-end to decode the timestamp of the current frame image quickly, achieving the goal of real-time data synchronous rendering.
[0005] Firstly, this application provides a video stream editing method applied to a system front-end, wherein the system front-end is connected to a remote dictionary service Redis module and a streaming media service module, the method comprising:
[0006] Receive video stream editing information sent by the Redis module, and receive real-time video streams sent by the streaming media service module;
[0007] Determine the current timestamp corresponding to the current frame image in the real-time video stream;
[0008] Based on the current timestamp, retrieve the editing information of the current frame image from the video stream editing information;
[0009] The current frame image is rendered based on the editing information of the current frame image to obtain the editing result of the current frame image. All frame images in the real-time video stream are traversed in turn to obtain the editing result of the real-time video stream.
[0010] Secondly, this application provides a video stream editing device integrated into a system front-end, wherein the system front-end is connected to a remote dictionary service Redis module and a streaming media service module, and the device includes:
[0011] The information receiving module is used to receive video stream editing information sent by the Redis module and to receive real-time video streams sent by the streaming media service module.
[0012] The time determination module is used to determine the current timestamp corresponding to the current frame image in the real-time video stream;
[0013] The information search module is used to search for the editing information of the current frame image from the video stream editing information based on the current timestamp;
[0014] The video stream editing module is used to render the current frame image based on the editing information of the current frame image to obtain the editing result of the current frame image, and sequentially traverse all frame images in the real-time video stream to obtain the editing result of the real-time video stream.
[0015] Thirdly, this application provides an electronic device comprising:
[0016] At least one processor; and
[0017] A memory communicatively connected to the at least one processor; wherein,
[0018] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the video stream editing method described in any embodiment of this application.
[0019] Fourthly, this application provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the video stream editing method described in any embodiment of this application.
[0020] This application provides a video stream editing method, including: receiving video stream editing information sent by a Redis module and receiving a real-time video stream sent by a streaming media service module; determining the current timestamp corresponding to the current frame image in the real-time video stream; searching for the editing information of the current frame image from the video stream editing information based on the current timestamp; rendering the current frame image based on the editing information of the current frame image to obtain the editing result of the current frame image; and sequentially traversing all frame images in the real-time video stream to obtain the editing result of the real-time video stream. In this application, when the system front-end receives the video stream editing information and the real-time video stream, it performs timestamp decoding to obtain the current timestamp corresponding to the current frame image in the real-time video stream, searches for the editing information of the current frame image based on the current timestamp and the time information in the video stream editing information, and then directly performs online real-time editing and rendering on the video stream based on the editing information. This application not only ensures the video stream editing and rendering effect but also has no requirements on system hardware performance. It can achieve fast timestamp decoding speed of the current frame image by the system front-end and achieve the purpose of real-time data synchronous rendering.
[0021] It should be noted that the aforementioned computer instructions may be stored, in whole or in part, on a computer-readable storage medium. This computer-readable storage medium may be packaged together with the processor of the video stream editing device, or it may be packaged separately from the processor of the video stream editing device; this application does not impose any limitations on this.
[0022] The descriptions of the second, third, and fourth aspects in this application can be referenced to the detailed description of the first aspect; and the beneficial effects described in the second, third, and fourth aspects can be referenced to the analysis of the beneficial effects of the first aspect, which will not be repeated here.
[0023] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description.
[0024] It is understood that before using the technical solutions disclosed in the various embodiments of this application, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this application in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying 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.
[0026] Figure 1 A first flowchart illustrating a video stream editing method provided in an embodiment of this application;
[0027] Figure 2 A schematic diagram of the timestamp decoding provided in the embodiments of this application;
[0028] Figure 3 A second flowchart illustrating a video stream editing method provided in an embodiment of this application;
[0029] Figure 4 A schematic diagram of the third process of a video stream editing method provided in an embodiment of this application;
[0030] Figure 5 A schematic diagram showing the timestamp encoding provided in the embodiments of this application;
[0031] Figure 6 A schematic diagram of the structure of a video stream editing device provided in an embodiment of this application;
[0032] Figure 7 This is a block diagram of an electronic device used to implement a video stream editing method according to an embodiment of this application. Detailed Implementation
[0033] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, 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 should fall within the scope of protection of this application.
[0034] It should be noted that the terms "first," "second," "target," and "original," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in sequences other than those illustrated or described herein. Furthermore, the terms "comprising," "having," and any variations thereof are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] Figure 1This is a first flowchart illustrating a video stream editing method provided in this application embodiment. This embodiment is applicable to situations involving online real-time editing of video streams. The video stream editing method provided in this embodiment can be executed by the video stream editing device provided in this application embodiment. This device can be implemented through software and / or hardware and integrated into the electronic device executing the method. The method is applied to a system front-end, which is connected to a remote dictionary server (Redis) module and a streaming media service module.
[0036] See Figure 1 The method in this embodiment includes, but is not limited to, the following steps:
[0037] S110: Receive video stream editing information sent by the Redis module, and receive real-time video streams sent by the streaming media service module.
[0038] The Redis module is used to send video stream editing information generated by the system backend (i.e., the algorithm side) to the system frontend. The streaming media service module is used to send the real-time video stream generated by the system backend to the system frontend. The streaming media service module can be an nginx service or an open-source streaming media service (Simple RTMP Server, SRS, etc.). The system frontend starts a Redis client service, continuously receives video stream editing information pushed by the Redis module, and then saves the received video stream editing information to a cache container.
[0039] It should be noted that, in terms of time sequence, the system frontend first receives the video stream editing information sent by the Redis module, and then receives the real-time video stream sent by the streaming media service module. This is because the system frontend must first cache the received video stream editing information in a cache container. Then, upon receiving the real-time video stream, it decodes the timestamp to obtain the timestamp. In step S130 below, it is necessary to ensure that the video stream editing information corresponding to the timestamp can be found in the cache container; otherwise, editing and rendering of the real-time video stream is impossible.
[0040] In this embodiment, the video stream editing information is the result of the system backend editing the original video stream based on the editing algorithm corresponding to the video editing intent. The video stream editing information includes editing information corresponding to each frame and time information for each frame (the unit of time information can be milliseconds). The video editing intent is related to the application scenario of this method, which can be target detection, target classification, or target segmentation, etc. For example, when the application scenario is target detection, the video editing intent is to detect and identify targets in the video, and the editing algorithm corresponding to the video editing intent is any existing target detection and identification algorithm. The editing information can be the target detection and identification result, or it can be the result of special effects rendering after target identification. The real-time video stream is a video stream after adding timestamps to each frame of the original video stream. The timestamp can be the system time corresponding to when the original video is decoded into frame images; adding timestamps to each frame of the original video stream is... Figure 4 In the corresponding embodiment, the original frame images in the original video stream are timestamped, that is... Figure 4 In the corresponding embodiment, steps S310 and S320 are used.
[0041] Optionally, the real-time video stream can be a Real-Time Messaging Protocol (RTMP) video stream.
[0042] S120. Determine the current timestamp corresponding to the current frame image in the real-time video stream.
[0043] In this embodiment of the application, due to Figure 4 In the corresponding embodiment, the real-time video stream is obtained by timestamping the original frame images in the original video stream. Therefore, after the system front-end receives the real-time video stream sent by the streaming media service module, it needs to timestamp decode each frame image of the real-time video stream to obtain the timestamp corresponding to each frame image. The current frame image is the frame image currently being played by the system front-end.
[0044] If in Figure 4 In the corresponding embodiment, binary encoding is used to timestamp the original frame images in the original video stream. Therefore, in this step, binary decoding is required to timestamp the current frame image to obtain the current timestamp. It should be noted that the specific process of timestamp decoding using binary decoding in this step will be explained below.
[0045] pass Figure 4The corresponding embodiment records the timestamp encoding results on the multiple target regions, with each target region corresponding to a time granularity. The number of target regions is consistent with the number of time granularities. The time granularity can include hours, minutes, seconds, and milliseconds, so the number of target regions can be four. For example, target region 1 is used to record the encoding result of "milliseconds" in the timestamp, target region 2 is used to record the encoding result of "seconds" in the timestamp, target region 3 is used to record the encoding result of "minutes" in the timestamp, and target region 4 is used to record the encoding result of "hours" in the timestamp. Therefore, further, determining the current timestamp corresponding to the current frame image in the real-time video stream in this step includes: extracting multiple target regions from the current frame image of the real-time video stream; determining the time information of each target region; and determining the current timestamp based on the time information of each target region and the time granularity represented by each target region.
[0046] Because the numerical ranges differ at different time granularities, therefore... Figure 4 In the corresponding embodiments, the range of the target area occupied when timestamping time information with different time granularities is also different. For example, the value range of "hour" is 0-24, which is encoded using 5 bits, with a range of (0,31); the value range of "minute" and "second" is 0-60, which is encoded using 6 bits, with a range of (0,63); and the value range of "millisecond" is 0-1000, which is encoded using 10 bits, with a range of (0,1023). Therefore, specifically, this step of extracting multiple target regions from the current frame image of the real-time video stream includes: First, determining the range of each target region based on the time granularity it represents. The ranges of different target regions are composed of different numbers of preset data matrices, and the number of preset data matrices in each target region is determined by the time granularity it represents. Each binary value in the binary encoding corresponds to one preset data matrix. Then, since each target region is located in a different orientation within the frame image, and the resolution of each video stream can be different, it is necessary to determine the boundary position of each target region based on its orientation in the current frame image and the resolution information of the current frame image. Finally, based on the boundary position and range of each target region, each target region is extracted from the current frame image. This application does not limit the row format of the preset data matrix; preferably, the preset data matrix can be a 3*3 data matrix.
[0047] For example, target region 1 is used to record the encoding result of "millisecond" in the timestamp, and can be located in the upper left corner of the frame image; target region 2 is used to record the encoding result of "second" in the timestamp, and can be located in the lower left corner of the frame image; target region 3 is used to record the encoding result of "minute" in the timestamp, and can be located in the lower right corner of the frame image; target region 4 is used to record the encoding result of "hour" in the timestamp, and can be located in the upper right corner of the frame image.
[0048] Specifically, determining the time information of each target region in this step includes: taking the coordinate point located in the middle of the preset data matrix as the target coordinate point, then determining the number and position of target coordinate points in each target region based on the preset data matrix, and obtaining the pixel value of the target coordinate point at the position. Each preset data matrix contains one target coordinate point. If the pixel value does not exceed a preset value, the binary code of the target coordinate point is determined as the first encoding value; if the pixel value exceeds the preset value, the binary code of the target coordinate point is determined as the second encoding value; the binary codes of the number of target coordinate points in the target region are converted to obtain the time information of the target region, thereby obtaining the time information of each target region. This application does not limit the preset value; a preferred preset value can be half of the pixel value 255, i.e., 127.5. The first encoding value is 0, and the second encoding value is 1. That is, when the pixel value of a target coordinate point is less than or equal to 127.5, the binary code of that target coordinate point is 0; when the pixel value of a target coordinate point is greater than 127.5, the binary code of that target coordinate point is 1.
[0049] For example, suppose the resolution information of the current frame image is (w, h), that is, the width coordinates are from 0 to w, and the height coordinates are from 0 to h, and the preset data matrix is a 3*3 data matrix. The process of determining the time information of the target region 1 is as follows: the target region 1 in the upper left corner of the current frame image is extracted, and the coordinate positions of the target region 1 are (1,1), (4,1), (7,1), (1,4), (4,4), (7,4), (1,7), (4,7), (7,7), (1,11) as the target coordinate point h. i (i = 0, 1, 2, 3, 4, 5, 6, 7, 8, 9), then obtain h i The pixel value, determine h i If the pixel value is greater than 127.5, the corresponding binary bit is 1; otherwise, the binary bit is 0. This yields a binary code with a time granularity of "milliseconds." This binary code is then converted to a different base to obtain the time information for target region 1. The process for determining the time information for target region 2 is as follows: Target region 2, located at the lower left corner of the current frame image, is extracted. The coordinates (1, h-5), (4, h-5), (7, h-5), (1, h-2), (4, h-2), and (7, h-2) within target region 2 are used as the target coordinate point h. i (i = 0, 1, 2, 3, 4, 5), then obtain h i The pixel value, determine h iIf the pixel value is greater than 127.5, the corresponding binary bit is 1; otherwise, the binary bit is 0. This yields a binary code with a time granularity of "seconds." The time information of target region 2 is then determined by performing a base conversion on this binary code. The process for determining the time information of target region 3 is as follows: Target region 3 is extracted from the lower right corner of the current frame image. The coordinates (w-8, h-5), (w-5, h-5), (w-2, h-5), (w-8, h-2), (w-5, h-2), and (w-2, h-2) within target region 3 are used as the target coordinate point h. i (i = 0, 1, 2, 3, 4, 5), then obtain h i The pixel value, determine h i If the pixel value is greater than 127.5, the corresponding binary bit is 1; otherwise, the binary bit is 0. This yields a binary code with a time granularity of "minutes." The time information of target region 3 is then obtained by performing a base conversion on this binary code. The process for determining the time information of target region 4 is as follows: Target region 4 is extracted from the upper right corner of the current frame image. The coordinates (w-5, 1), (w-2, 1), (w-5, 4), (w-2, 4), and (w-2, 7) within target region 4 are used as target coordinate points h. i (i = 0, 1, 2, 3, 4), then obtain h i The pixel value, determine h i If the pixel value is greater than 127.5, the corresponding binary bit is 1; otherwise, the binary bit is 0. This yields a binary code with a time granularity of "hour". The binary code is then converted to a different base to obtain the time information for the target region 4.
[0050] like Figure 2 The diagram shows the timestamp after decoding, specifically the time information for each target region. The top left corner represents target region 1, which displays milliseconds; the bottom left corner represents target region 2, which displays seconds; the bottom right corner represents target region 3, which displays minutes; and the top right corner represents target region 4, which displays hours. As can be seen, the time information is represented in binary. Converting the time information to decimal values yields the decimal representation of each time granularity. Combining this decimal representation with the time granularity indicated by each target region allows us to determine the current timestamp of the current frame. Figure 2 As shown, the current frame image is timestamped to 5 hours, 37 minutes, 14 seconds, and 412 milliseconds.
[0051] S130. Based on the current timestamp, retrieve the editing information of the current frame image from the video stream editing information.
[0052] In this embodiment, the video stream editing information includes editing information corresponding to each frame and time information for each frame (the unit of time information can be milliseconds). After determining the current timestamp corresponding to the current frame in the real-time video stream through the above step S120, the time information of each frame in the video stream editing information corresponding to the current timestamp is then determined, thereby finding the editing information of the current frame.
[0053] Furthermore, retrieving the editing information of the current frame image from the video stream editing information based on the current timestamp includes: determining the corresponding time information based on the current timestamp; and retrieving the editing information corresponding to the current frame image from the cache container storing the video stream editing information based on the time information. The capacity of the cache container is determined by the delay time between the real-time video stream and the video stream editing information, and the frame rate of the real-time video stream. When the units of the timestamp and the time information are different, the units of the timestamp need to be converted to the units of the time information first. Alternatively, the timestamp and the time information can be stored as time key-value pairs, and the corresponding time information can be retrieved using the time key-value pairs.
[0054] S140. Render the current frame image based on the editing information of the current frame image to obtain the editing result of the current frame image. Then, traverse all frame images in the real-time video stream in sequence to obtain the editing result of the real-time video stream.
[0055] In this embodiment, special effects rendering from the editing information of the current frame image are superimposed onto the current frame image of the real-time video stream. The frame interval time of the real-time video stream can be obtained based on its frame rate. At each frame interval, the editing information of the next frame image is retrieved from the buffer container, and then the special effects rendering from the editing information is superimposed onto the next frame image of the real-time video stream. This process is repeated for all frames in the real-time video stream to obtain the editing result.
[0056] The technical solution provided in this embodiment receives video stream editing information sent by the Redis module and real-time video stream sent by the streaming media service module; determines the current timestamp corresponding to the current frame image in the real-time video stream; searches for the editing information of the current frame image in the video stream editing information based on the current timestamp; renders the current frame image based on the editing information of the current frame image to obtain the editing result of the current frame image; and sequentially traverses all frame images in the real-time video stream to obtain the editing result of the real-time video stream. In this application, when the system front-end receives the video stream editing information and the real-time video stream, it performs timestamp decoding to obtain the current timestamp corresponding to the current frame image in the real-time video stream, searches for the editing information of the current frame image based on the current timestamp and the time information in the video stream editing information, and then directly performs online real-time editing and rendering on the video stream based on the editing information. This application not only ensures the video stream editing and rendering effect but also has no requirements on system hardware performance. It can achieve fast timestamp decoding of the current frame image by the system front-end and achieve the purpose of real-time data synchronous rendering.
[0057] The video stream editing method provided in the embodiments of this application is further described below. Figure 3 This is a second flowchart illustrating a video stream editing method provided in an embodiment of this application. This embodiment optimizes the above-described embodiment, specifically by providing a detailed explanation of the process for generating video stream editing information.
[0058] See Figure 3 The method in this embodiment includes, but is not limited to, the following steps:
[0059] S210. Obtain the original video stream based on the address information of the video stream source.
[0060] In this embodiment, the original video stream can be connected to a cloud computing server or an edge computing server. The original video stream is obtained from the cloud computing server or edge computing server based on the address information of the video stream source. Optionally, the resolution information of the original video stream, i.e., width and height (w, h) and frame rate, can also be obtained.
[0061] The address information of the video stream source is the Internet Protocol Address (IP address), which can be the IP address of a network camera or the IP address of a network video recorder (NVR), etc.
[0062] S220. Decode the original video stream to obtain the original frame image corresponding to the original video stream, and obtain the time information of the original frame image.
[0063] In this embodiment, the original video stream is decoded into image frames using software or hardware decoding technology, and these frames are denoted as the original frame images. The time information of the original frame images is then obtained. This time information can be the system time corresponding to the time when the original video was decoded into frame images, including hour, minute, second, and millisecond information.
[0064] For example, software decoding technology can be the decoding application programming interface (API) of the ffmpeg central processing unit (CPU). Hardware decoding technology can be the API of the ffmpeg graphics processing unit (GPU).
[0065] S230. Based on the editing algorithm corresponding to the video editing intent, the original frame image is processed to obtain editing information.
[0066] In this embodiment, the video editing intent is related to the application scenario of the method. The application scenario of the method can be target detection, target classification, or target segmentation, etc. For example, when the application scenario is target detection, the video editing intent is to detect and identify the target in the video, and the editing algorithm corresponding to the video editing intent is any existing target detection and identification algorithm. The editing information can be the target detection and identification result, or it can be the result of special effects rendering after target identification.
[0067] For example, an object detection and recognition algorithm is applied to the original frame image to obtain the location and category information of the objects in the image, i.e., editing information. Where x1 and y2 are the positions of the top left corner of the target box, x3 and y4 are the positions of the bottom right corner of the target box, c is the category information of the target, and 1 to n are the index numbers of the target.
[0068] S240. Generate video stream editing information by combining editing information and time information according to the preset Redis data format.
[0069] In this embodiment, the Redis module generates video stream editing information by combining editing information and time information according to a preset Redis data format. For example, the video stream editing information may be... Among them, T t Time information is in milliseconds.
[0070] Optionally, the time information can be converted to milliseconds in this step. The default Redis data format can be modified according to the actual application scenario.
[0071] The technical solution provided in this embodiment obtains the original video stream based on the address information of the video stream source; performs video decoding on the original video stream to obtain the original frame image corresponding to the original video stream, and obtains the time information of the original frame image; processes the original frame image based on the editing algorithm corresponding to the video editing intention to obtain editing information; and generates video stream editing information by combining the editing information and time information according to a preset Redis data format. This application not only ensures the video stream editing and rendering effect but also has no requirements on system hardware performance. It enables the system front-end to decode the timestamp of the current frame image quickly, achieving the goal of real-time data synchronous rendering.
[0072] The video stream editing method provided in the embodiments of this application is further described below. Figure 4 This is a third flowchart illustrating a video stream editing method provided in this application embodiment. This application embodiment is an optimization based on the above embodiments, specifically optimizing the process of generating a real-time video stream by providing a detailed explanation.
[0073] refer to Figure 4 The method in this embodiment includes, but is not limited to, the following steps:
[0074] S310. Determine the target region for timestamp encoding on the original frame image at each time granularity.
[0075] In this embodiment, the original frame image is timestamped based on its time information to obtain the corresponding real-time frame image. This step is the first step of timestamping. The original frame image refers to an image without a timestamp; the real-time frame image refers to an image after a timestamp has been added to the original frame image.
[0076] Each target region corresponds to a time granularity. This application does not limit the time granularity. If there are four time granularities for the time information, including hours, minutes, seconds, and milliseconds, then the number of target regions can be four. The following explains the specific process of timestamp encoding using four time granularities and four target regions in this step.
[0077] Because different time granularities have different numerical ranges, the target area occupied when timestamping time information at different time granularities also differs. Further, determining the target area for timestamping each time granularity on the original frame image includes: First, determining the number of bits for each time granularity; since different time granularities have different numerical ranges, the corresponding number of bits is also different. For example, the numerical range of "hour" is 0-24, encoded using 5 bits, with a range of (0,31); the numerical range of "minute" and "second" is 0-60, each encoded using 6 bits, with a range of (0,63); the numerical range of "millisecond" is 0-1000, encoded using 10 bits, with a range of (0,1023).
[0078] Then, the number of encoding bits and the number of preset data matrices are equal, and the range of each target region is determined based on the number of encoding bits and the preset data matrices. For example, if target region 1 is used to record the encoding result of "milliseconds" in the timestamp, then the number of preset data matrices in target region 1 is 10; target region 2 is used to record the encoding result of "seconds" in the timestamp, then the number of preset data matrices in target region 2 is 6; target region 3 is used to record the encoding result of "minutes" in the timestamp, then the number of preset data matrices in target region 3 is 6; and target region 4 is used to record the encoding result of "hours" in the timestamp, then the number of preset data matrices in target region 4 is 5. This application does not limit the row format of the preset data matrices; preferably, the preset data matrix can be a 3*3 data matrix. Thus, the size of the range of each target region can be determined.
[0079] Secondly, the boundary positions of each target region are determined based on the encoding orientation of each time granularity in the original frame image and the resolution information of the original frame image. For example, target region 1 is used to record the encoding result of "millisecond" in the timestamp and can be located in the upper left corner of the frame image; target region 2 is used to record the encoding result of "second" in the timestamp and can be located in the lower left corner of the frame image; target region 3 is used to record the encoding result of "minute" in the timestamp and can be located in the lower right corner of the frame image; target region 4 is used to record the encoding result of "hour" in the timestamp and can be located in the upper right corner of the frame image. If the resolution information of the current frame image is (w, h), that is, the width coordinate x is from 0 to w, the height coordinate y is from 0 to h, and the preset data matrix is a 3*3 data matrix, then the boundary position of target region 1 is x∈[0, 8], y∈[0, 11], the boundary position of target region 2 is x∈[0, 8], y∈[0, h-6], the boundary position of target region 3 is x∈[w-9, w-1], y∈[h-6, h-1], and the boundary position of target region 4 is x∈[w-6, w-1], y∈[0, 8].
[0080] Finally, based on the range and boundary position of each target region, the target regions for which timestamps are encoded on the original frame image at each time granularity are obtained.
[0081] Specifically, the top-left corner of the original frame image is selected to encode the millisecond bit, where x∈[0,2], y∈[0,2] encodes the first bit (from left to right) of a 10-bit binary representation; x∈[3,5], y∈[0,2] encodes the second bit (from left to right) of a 10-bit binary representation; x∈[6,8], y∈[0,2] encodes the third bit (from left to right) of a 10-bit binary representation; x∈[0,2], y∈[3,5] encodes the fourth bit (from left to right) of a 10-bit binary representation; x∈[3,5], y∈[3,5] encodes the 10-bit binary representation. The 5th bit (from left to right) in the binary representation; x∈[6,8],y∈[3,5] encodes the 6th bit (from left to right) in the 10-bit binary representation; x∈[0,2],y∈[6,8] encodes the 7th bit (from left to right) in the 10-bit binary representation; x∈[3,5],y∈[6,8] encodes the 8th bit (from left to right) in the 10-bit binary representation; x∈[6,8],y∈[6,8] encodes the 9th bit (from left to right) in the 10-bit binary representation; x∈[0,2],y∈[9,11] encodes the 10th bit (from left to right) in the 10-bit binary representation.
[0082] Specifically, the second digit is encoded at the bottom left corner of the original frame image. Specifically, x∈[0,2],y∈[h-6,h-4] encodes the first digit of a 6-bit binary sequence (from left to right); x∈[3,5],y∈[h-6,h-4] encodes the second digit (from left to right); x∈[6,8],y∈[h-6,h-4] encodes the third digit (from left to right); x∈[0,2],y∈[h-3,h-1] encodes the fourth digit (from left to right); x∈[3,5],y∈[h-3,h-1] encodes the fifth digit (from left to right); and x∈[6,8],y∈[h-3,h-1] encodes the sixth digit (from left to right).
[0083] Specifically, the bottom right corner of the original frame image is selected for encoding. Specifically, x∈[w-9,w-7],y∈[h-6,h-4] encodes the first bit (from left to right) of a 6-bit binary representation; x∈[w-6,w-4],y∈[h-6,h-4] encodes the second bit (from left to right); x∈[w-3,w-1],y∈[h-6,h-4] encodes the third bit (from left to right); x∈[w-9,w-7],y∈[h-3,h-1] encodes the fourth bit (from left to right); x∈[w-6,w-4],y∈[h-3,h-1] encodes the fifth bit (from left to right); and x∈[w-3,w-1],y∈[h-3,h-1] encodes the sixth bit (from left to right).
[0084] Specifically, the top right corner of the original frame image is selected to encode the hour bit, where x∈[w-6,w-4],y∈[0,2] encodes the first bit of the 5-bit binary representation (from left to right); x∈[w-3,w-1],y∈[0,2] encodes the second bit of the 5-bit binary representation (from left to right); x∈[w-6,w-4],y∈[3,5] encodes the third bit of the 5-bit binary representation (from left to right); x∈[w-3,w-1],y∈[3,5] encodes the fourth bit of the 5-bit binary representation (from left to right); and x∈[w-3,w-1],y∈[6,8] encodes the fifth bit of the 5-bit binary representation (from left to right).
[0085] S320: Convert the time information at each time granularity into its corresponding binary code.
[0086] In this embodiment, this step is the second step of timestamp encoding. Each target region corresponds to a binary code. The time information at the time granularity is converted into a binary code with the corresponding number of bits for that time granularity.
[0087] S330: Pixel filling is performed on each target region based on the corresponding binary code to obtain a real-time frame image.
[0088] In this embodiment, this step is the third step of timestamp encoding. Each binary value in the binary encoding corresponds to a preset data matrix. After determining the encoding positions for milliseconds, seconds, minutes, and hours through the above step S310, (0, 0, 0) or (255, 255, 255) is selected to fill the corresponding RGB pixel values in the image. When the binary bit is 0, the RGB pixel value of the image at the corresponding encoding position is (0, 0, 0); when the binary bit is 1, the RGB pixel value of the image at the corresponding encoding position is (255, 255, 255).
[0089] Furthermore, pixel filling is performed on each target region based on the corresponding binary code to obtain a real-time frame image. This includes: if the binary value is the first encoded value (i.e., 0), then the image of the corresponding preset data matrix is filled with the first pixel value (i.e., pixel value (0, 0, 0)); if the binary value is the second encoded value (i.e., 1), then the image of the corresponding preset data matrix is filled with the second pixel value (pixel value (255, 255, 255)). This process is repeated for all binary values in the binary code to obtain the binary code of the target region. Figure 5 The image shown is a schematic diagram after timestamp encoding.
[0090] S340. Perform video encoding on the real-time frame image to obtain a real-time video stream.
[0091] In the embodiments of this application, after the timestamp encoding is performed by the above steps, a real-time frame image is obtained, and then the real-time frame image is software encoded or hard encoded into a real-time video stream.
[0092] For example, software encoding techniques could be the encoding API of the ffmpeg CPU version. Hardware encoding techniques could be the encoding API of the ffmpeg GPU version. Real-time video streaming could be an RTMP video stream.
[0093] It should be noted that this application uses binary encoding instead of decimal encoding for the timestamping of image pixels in the original frame image because the real-time frame image after timestamping is compressed during video stream encoding. Compression algorithms vary depending on the video stream encoding protocol used and the encoding parameter settings. Furthermore, the image pixel values obtained by the system front-end from the target area can change uncontrollably due to screen brightness settings. Therefore, it cannot be guaranteed that the pixel values of the target area captured by the system front-end from the frame image are the same as, similar to, or similar to the decimal values used during encoding. Therefore, this application chooses multi-bit binary encoding, and decodes by comparing the pixel value at each specific position with the value of 127.5, which can solve the above decimal deviation problem. Each binary bit is represented by a 3*3 data matrix because during image compression, the correlation between pixels within the image block is used to transform the image onto a new basis (usually the frequency domain), so that the energy is concentrated on a few transformation coefficients. By storing these coefficients, the purpose of data compression is achieved. Our choice to use a small data matrix can solve the compression problem to a certain extent without causing a major impact on the image.
[0094] The technical solution provided in this embodiment determines the target areas for timestamp encoding on the original frame image at each time granularity; converts the time information at each time granularity into corresponding binary codes; fills pixels in each target area based on the corresponding binary codes to obtain a real-time frame image; and performs video encoding on the real-time frame image to obtain a real-time video stream. This application not only ensures the editing and rendering effect of the video stream but also has no requirements on system hardware performance. It enables the system front-end to perform fast timestamp decoding of the current frame image, achieving the goal of real-time data synchronous rendering.
[0095] Figure 6 This is a schematic diagram of a video stream editing device provided in an embodiment of this application. The method is integrated into the system front-end, which is connected to a remote dictionary service Redis module and a streaming media service module, such as... Figure 6 As shown, the device 600 may include:
[0096] The information receiving module 610 is used to receive video stream editing information sent by the Redis module and to receive real-time video streams sent by the streaming media service module;
[0097] Time determination module 620 is used to determine the current timestamp corresponding to the current frame image in the real-time video stream;
[0098] The information search module 630 is used to search for the editing information of the current frame image from the video stream editing information based on the current timestamp;
[0099] The video stream editing module 640 is used to render the current frame image based on the editing information of the current frame image to obtain the editing result of the current frame image, and sequentially traverse all frame images in the real-time video stream to obtain the editing result of the real-time video stream.
[0100] Furthermore, the aforementioned time determination module 620 can be specifically used to: extract multiple target regions from the current frame image of the real-time video stream; determine the time information of each target region; and determine the current timestamp based on the time information of each target region and the time granularity represented by each target region.
[0101] Furthermore, the aforementioned time determination module 620 may include a target area determination unit and a time information determination unit;
[0102] The target region determination unit is used to determine the range of each target region based on the time granularity indicated by each target region. The range of different target regions is composed of different numbers of preset data matrices, and the number of preset data matrices in each target region is determined by the time granularity indicated by each target region. The unit also determines the boundary position of each target region based on the orientation of each target region in the current frame image and the resolution information of the current frame image. Finally, the unit extracts each target region from the current frame image based on the boundary position and the range of each target region.
[0103] The time information determination unit is used to determine the number and position of target coordinate points in each target region based on a preset data matrix, and to obtain the pixel value of the target coordinate point at the position. Each preset data matrix contains one target coordinate point. If the pixel value does not exceed a preset value, the binary code of the target coordinate point is determined to be a first code value. If the pixel value exceeds the preset value, the binary code of the target coordinate point is determined to be a second code value. The binary codes of the number of target coordinate points are converted to obtain the time information of the corresponding target region, thereby obtaining the time information of each target region.
[0104] Optionally, the video stream editing information includes editing information corresponding to each frame and time information for each frame;
[0105] Furthermore, the aforementioned information lookup module 630 can be specifically used to: determine the corresponding time information based on the current timestamp; and look up the corresponding editing information from the cache container storing the video stream editing information based on the time information, wherein the capacity of the cache container is determined by the delay time between the real-time video stream and the video stream editing information and the frame rate of the real-time video stream.
[0106] Furthermore, the aforementioned video stream editing device may also include: an editing information generation module;
[0107] The editing information generation module is used to obtain the original video stream based on the address information of the video stream source; perform video decoding on the original video stream to obtain the original frame image corresponding to the original video stream, and obtain the time information of the original frame image; process the original frame image based on the editing algorithm corresponding to the video editing intention to obtain editing information; and generate the video stream editing information by combining the editing information and the time information according to a preset Redis data format.
[0108] Furthermore, the aforementioned video stream editing device may also include: a real-time video stream generation module;
[0109] The real-time video stream generation module is used to timestamp the original frame image based on the time information of the original frame image to obtain the corresponding real-time frame image; and to perform video encoding on the real-time frame image to obtain the real-time video stream.
[0110] Optionally, the time granularity of the time information includes hours, minutes, seconds, and milliseconds;
[0111] Furthermore, the aforementioned real-time video stream generation module can be specifically used to: determine the target regions for timestamp encoding of each time granularity on the original frame image; convert the time information of each time granularity into a binary code; and fill pixels in each target region based on the corresponding binary code to obtain the real-time frame image; wherein each target region corresponds to a time granularity and each target region corresponds to a binary code.
[0112] Furthermore, the aforementioned real-time video stream generation module can be specifically used to: determine the number of encoding bits for each time granularity, wherein the number of encoding bits is equal to the number of preset data matrices; determine the range of each target region based on the number of encoding bits and the preset data matrix; determine the boundary position of each target region based on the encoding orientation of each time granularity in the original frame image and the resolution information of the original frame image; and obtain the target region for timestamping each time granularity on the original frame image based on the range of each target region and the boundary position of each target region.
[0113] Optionally, each binary value in the binary encoding corresponds to a preset data matrix;
[0114] Furthermore, the aforementioned real-time video stream generation module can be specifically used to: if the binary value is a first encoded value, then fill the image of the corresponding preset data matrix with the first pixel value; if the binary value is a second encoded value, then fill the image of the corresponding preset data matrix with the second pixel value, and sequentially traverse all binary values in the binary encoding to obtain the binary encoding of the target area.
[0115] The video stream editing device provided in this embodiment can be applied to the video stream editing method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0116] Figure 7This is a block diagram of an electronic device used to implement a video stream editing method according to embodiments of this application. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0117] like Figure 7 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0118] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0119] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as video stream editing methods.
[0120] In some embodiments, the video stream editing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the video stream editing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the video stream editing method by any other suitable means (e.g., by means of firmware).
[0121] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0122] Computer programs used to implement the methods of this application may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0123] In the context of this application, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0124] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0125] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0126] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0127] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this application can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this application can be achieved, and this is not limited herein.
[0128] The specific embodiments described above do not constitute a limitation on the scope of protection of this application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A method of editing a video stream, characterized by, Applied to the system front-end, which is connected to a remote dictionary service Redis module and a streaming media service module, the method includes: Receive video stream editing information sent by the Redis module, and receive real-time video streams sent by the streaming media service module; Determine the current timestamp corresponding to the current frame image in the real-time video stream; wherein, determining the current timestamp corresponding to the current frame image in the real-time video stream includes: extracting multiple target regions from the current frame image of the real-time video stream; determining the time information of each target region; and determining the current timestamp based on the time information of each target region and the time granularity represented by each target region; Based on the current timestamp, retrieve the editing information of the current frame image from the video stream editing information; The current frame image is rendered based on the editing information of the current frame image to obtain the editing result of the current frame image. All frame images in the real-time video stream are traversed in turn to obtain the editing result of the real-time video stream.
2. The video stream editing method according to claim 1, characterized in that, The process of extracting multiple target regions from the current frame image of the real-time video stream includes: The range of each target region is determined based on the time granularity it represents. The range of different target regions is composed of different numbers of preset data matrices. The number of preset data matrices in each target region is determined by the time granularity it represents. The boundary positions of each target region are determined based on the orientation of each target region in the current frame image and the resolution information of the current frame image; Based on the boundary position and range of each target region, each target region is extracted from the current frame image.
3. The video stream editing method according to claim 1, characterized in that, The determination of time information for each target area includes: The number and location of target coordinate points in each target region are determined based on a preset data matrix, and the pixel value of the target coordinate point at the location is obtained. Each preset data matrix contains one target coordinate point. If the pixel value does not exceed the preset value, then the binary code of the target coordinate point is determined to be the first code value; If the pixel value exceeds the preset value, then the binary code of the target coordinate point is determined to be the second code value; The time information of each target region is obtained by performing a binary conversion on the binary code of the number of target coordinate points.
4. The video stream editing method according to claim 1, characterized in that, The video stream editing information includes editing information corresponding to each frame and time information for each frame. The step of retrieving the editing information of the current frame image from the video stream editing information based on the current timestamp includes: Determine the corresponding time information based on the current timestamp; Based on the time information, the corresponding editing information is retrieved from the cache container storing the video stream editing information. The capacity of the cache container is determined by the delay time between the real-time video stream and the video stream editing information, and the frame rate of the real-time video stream.
5. The video stream editing method according to claim 1, characterized in that, The video stream editing information is generated in the following manner: Obtain the original video stream based on the address information of the video stream source; The original video stream is decoded to obtain the original frame image corresponding to the original video stream, and the time information of the original frame image is obtained. The original frame image is processed based on the editing algorithm corresponding to the video editing intent to obtain editing information; The video stream editing information is generated by combining the editing information and the time information according to a preset Redis data format.
6. The video stream editing method according to claim 5, characterized in that, The real-time video stream is generated in the following manner: The original frame image is timestamped based on its time information to obtain the corresponding real-time frame image. The real-time video stream is obtained by video encoding the real-time frame image.
7. The video stream editing method according to claim 6, characterized in that, The time granularity of the time information includes hours, minutes, seconds, and milliseconds. The step of timestamping the original frame image based on its time information to obtain the corresponding real-time frame image includes: Determine the target regions for timestamp encoding of each time granularity on the original frame image; The time information at each time granularity is converted into its corresponding binary code by a base conversion. Pixels are filled in each target region based on the corresponding binary code to obtain the real-time frame image; Each target region corresponds to a time granularity, and each target region corresponds to a binary code.
8. The video stream editing method according to claim 7, characterized in that, Determining the target regions for timestamping each time granularity on the original frame image includes: The number of encoding bits for each time granularity is determined, and the number of encoding bits is equal to the number of preset data matrices; The range of each target region is determined based on the number of bits in the encoding and the preset data matrix. The boundary positions of each target region are determined based on the encoded orientation of each time granularity in the original frame image and the resolution information of the original frame image; Based on the range of each target region and the boundary position of each target region, the target regions for which the time granularity is timestamped on the original frame image are obtained.
9. The video stream editing method according to claim 7, characterized in that, In the binary encoding, each binary value corresponds to a preset data matrix. The step of filling pixels in each target region based on the corresponding binary encoding to obtain the real-time frame image includes: If the binary value is the first encoded value, then the image of the corresponding preset data matrix is filled with the first pixel value; If the binary value is the second encoded value, then the image of the corresponding preset data matrix is filled with the second pixel value, and all binary values in the binary encoding are traversed in turn to obtain the binary encoding of the target area.
10. A video stream editing device, characterized in that, Integrated into the system front-end, which is connected to the remote dictionary service Redis module and the streaming media service module, the device includes: The information receiving module is used to receive video stream editing information sent by the Redis module and to receive real-time video streams sent by the streaming media service module. A time determination module is used to determine the current timestamp corresponding to the current frame image in the real-time video stream; wherein, determining the current timestamp corresponding to the current frame image in the real-time video stream includes: extracting multiple target regions from the current frame image of the real-time video stream; determining the time information of each target region; and determining the current timestamp based on the time information of each target region and the time granularity represented by each target region. The information search module is used to search for the editing information of the current frame image from the video stream editing information based on the current timestamp; The video stream editing module is used to render the current frame image based on the editing information of the current frame image to obtain the editing result of the current frame image, and sequentially traverse all frame images in the real-time video stream to obtain the editing result of the real-time video stream.
11. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor to enable the at least one processor to perform the video stream editing method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the video stream editing method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Video OSD display method and device based on HTML5
CN109889907A