Video coding method, device, electronic device, and storage medium
Patent Information
- Application Number
- CN202211637725.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-17
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2042-12-17
AI Technical Summary
[0004]本申请实施例提供了一种视频编解码方法、装置、电子装置和存储介质,以至少解决相关技术中大分辨率视频帧编解码效率低的问题
[0035]相比于相关技术,本申请实施例提供的视频编解码方法、装置、电子装置和存储介质,通过对关键视频帧进行分片、并发传输及编解码,以及对关键视频帧和非关键视频帧在不同视频层解码,解决了相关技术中大分辨率视频帧编解码效率低的问题,提高了视频传输、显示的流畅性。
Smart Images

Figure CN116156204B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of video processing, and in particular to video encoding and decoding methods, apparatus, electronic devices, and storage media. Background Technology
[0002] With technological advancements and the ever-evolving demands of new technologies and scenarios, video resolution in the video surveillance field is increasing, leading to an explosive growth in data volume. This presents significant challenges to the data encoding / decoding, data transmission, and playback timeliness of front-end video surveillance equipment. Simultaneously, for back-end storage devices, the limitations of current encoding / decoding and compression technologies mean that encoding and decoding high-resolution video frames is time-consuming, easily causing delays and stuttering during video network transmission and playback, thus reducing the smoothness of video display.
[0003] Currently, no effective solution has been proposed to address the issue of low encoding and decoding efficiency for high-resolution video frames in related technologies. Summary of the Invention
[0004] This application provides a video encoding / decoding method, apparatus, electronic device, and storage medium to at least solve the problem of low encoding / decoding efficiency of high-resolution video frames in related technologies.
[0005] In a first aspect, embodiments of this application provide a video encoding / decoding method.
[0006] In some embodiments, the video encoding / decoding method is applied to a server device, including:
[0007] Concurrently receive N video frames from the encoded key video frames sent by the terminal device, where N is an even number greater than 1;
[0008] Receive encoded non-critical video frames sent by the terminal device;
[0009] The N video segments are decoded in the first video layer to determine the N decoded video segments, and the decoded key video frames are determined based on the N decoded video segments.
[0010] The encoded non-critical video frames are decoded in the second video layer to identify the decoded non-critical video frames.
[0011] In some embodiments, the N segmented video frames in the encoded key video frame sent by the concurrent receiving terminal device include:
[0012] Establish N socket channels to concurrently receive N segmented video frames from the encoded key video frames sent by the terminal device.
[0013] In some embodiments, the encoded non-critical video frames sent by the receiving terminal device include:
[0014] One of the N socket channels is reused to receive encoded non-critical video frames sent by the terminal device.
[0015] In some embodiments, after decoding the encoded non-critical video frames at the second video layer to determine the decoded non-critical video frames, the method further includes:
[0016] The decoded key video frames and the decoded non-key video frames are displayed alternately.
[0017] In some embodiments, the method further includes, before the N segmented video frames in the encoded key video frames sent by the concurrent receiving terminal device:
[0018] Obtain the video resolution and video frame interval duration of the video to be encoded / decoded;
[0019] When the video resolution is higher than a preset resolution threshold and the video frame interval duration is longer than a preset duration, a segmentation encoding instruction is sent to the terminal device.
[0020] Secondly, embodiments of this application provide a video encoding / decoding method.
[0021] In some embodiments, the video encoding / decoding method includes:
[0022] The terminal device acquires an initial key video frame, performs concurrent encoding on the initial key video frame to determine N segmented video frames, where N is an even number greater than 1; determines the encoded key video frame based on the N segmented video frames; acquires an initial non-key video frame, and determines the encoded non-key video frame based on the initial non-key video frame.
[0023] The server device concurrently receives N segmented video frames from the encoded key video frames sent by the terminal device, decodes the N segmented video frames at the first video layer to determine N decoded segmented video frames, and determines the decoded key video frames based on the N decoded segmented video frames; it also receives the encoded non-key video frames sent by the terminal device, decodes the encoded non-key video frames at the second video layer to determine the decoded non-key video frames.
[0024] In some embodiments, before the terminal device acquires the initial key video frame and performs concurrent encoding on the initial key video frame to determine N segmented video frames, the method further includes:
[0025] The server device obtains the video resolution and video frame interval duration of the video to be encoded and decoded. If the video resolution is higher than a preset resolution threshold and the video frame interval duration is greater than a preset duration, it sends a segmentation encoding instruction to the terminal device.
[0026] The terminal device receives the segmentation encoding instruction sent by the server device, and determines the number of video frames N to be segmented according to the segmentation encoding instruction, where N is an even number greater than 1.
[0027] Thirdly, embodiments of this application provide a video encoding / decoding apparatus.
[0028] In some embodiments, the apparatus includes a keyframe receiving module, a non-keyframe receiving module, a keyframe decoding module, and a non-keyframe decoding module:
[0029] The key frame receiving module is used to concurrently receive N video fragments from the encoded key video frames sent by the terminal device, where N is an even number greater than 1.
[0030] The non-critical frame receiving module is used to receive encoded non-critical video frames sent by the terminal device.
[0031] The keyframe decoding module is used to decode the N video segments in the first video layer to determine the N decoded video segments, and to determine the decoded key video frames based on the N decoded video segments.
[0032] The non-key frame decoding module is used to decode the encoded non-key video frames in the second video layer to determine the decoded non-key video frames.
[0033] Fourthly, embodiments of this application provide an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the video encoding / decoding method as described in the first and second aspects above.
[0034] Fifthly, embodiments of this application provide a storage medium storing a computer program thereon, which, when executed by a processor, implements the video encoding / decoding methods as described in the first and second aspects above.
[0035] Compared to related technologies, the video encoding and decoding method, apparatus, electronic device, and storage medium provided in this application solve the problem of low encoding and decoding efficiency of high-resolution video frames in related technologies by segmenting, concurrently transmitting, and encoding and decoding key video frames, as well as decoding key and non-key video frames at different video layers, thereby improving the smoothness of video transmission and display.
[0036] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description
[0037] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0038] Figure 1 This is a hardware structure block diagram of a terminal for a video encoding / decoding method according to an embodiment of this application;
[0039] Figure 2 This is a flowchart of a video encoding / decoding method according to an embodiment of this application;
[0040] Figure 3 This is a flowchart of yet another video encoding / decoding method according to an embodiment of this application;
[0041] Figure 4 This is a flowchart of a video encoding / decoding method according to a preferred embodiment of this application;
[0042] Figure 5 This is a structural block diagram of a video encoding / decoding apparatus according to an embodiment of this application. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application. Furthermore, it is understood that although the efforts made in such a development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, modifications to design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.
[0044] In this application, the reference to "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment that is mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments without conflict.
[0045] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may indicate singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that includes a series of steps or modules (units) is not limited to the listed steps or units, but may also include steps or units not listed, or may include other steps or units inherent to these processes, methods, products, or devices. The terms “connected,” “linked,” “coupled,” and similar words used in this application are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. “Multiple” used in this application means two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. The terms “first,” “second,” “third,” etc., used in this application are merely to distinguish similar objects and do not represent a specific ordering of the objects.
[0046] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. Taking running on a terminal as an example, Figure 1 This is a hardware structure block diagram of the terminal for the video encoding / decoding method according to an embodiment of the present invention. For example... Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. Optionally, the terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.
[0047] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the video encoding / decoding method in this embodiment of the invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thereby implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0048] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.
[0049] This embodiment provides a video encoding and decoding method. Figure 2 This is a flowchart of a video encoding / decoding method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:
[0050] Step S201: Concurrently receive N video frames from the encoded key video frames sent by the terminal device, where N is an even number greater than 1.
[0051] Specifically, the server device initiates a single-channel multi-segment streaming data request and concurrently receives N segmented video frames from the encoded key video frames sent by the terminal device, where N is an even number greater than 1.
[0052] Step S202: Receive encoded non-critical video frames sent by the terminal device.
[0053] The non-critical video frames that have already been encoded are obtained by encoding the initial non-critical video frames acquired by the terminal device into full-area data.
[0054] Step S203: Decode the N video segments in the first video layer to determine the N decoded video segments, and determine the decoded key video frames based on the N decoded video segments.
[0055] After receiving N video fragments, the server device establishes N+1 decoders. The N decoders are configured at the first video layer to decode the N video fragments and identify the N decoded video fragments. During decoding, frame sequence numbers are synchronized across different regions to minimize image distortion caused by multi-region synchronization, ensuring smooth and consistent playback. The region information of the N decoded video fragments is determined, and based on this information, the N decoded video fragments are merged and reassembled to identify the key decoded video frames.
[0056] Step S204: Decode the encoded non-critical video frames in the second video layer to determine the decoded non-critical video frames.
[0057] The second video layer can be a picture-in-picture (PIP) layer. After determining that the key video frame has been decoded, the display data in the video memory is copied to the PIP layer as a decoding reference frame for the non-key video frame. Then, one of the encoders mentioned above (N+1) is used to decode the encoded non-key video frame in the PIP layer to obtain the decoded non-key video frame.
[0058] Through the above steps, since the resolution of a single video frame is much smaller than that of the entire key video frame, multiplexing and concurrent reception of the video frames are performed under the same Maximum Transmission Unit (MTU) condition, reducing the amount of data packets in the overall encoded key video frame, thereby reducing network transmission time. Furthermore, concurrent decoding of encoded key video frames and encoded non-key video frames is performed at different video layers, thereby improving the encoding and decoding efficiency of high-resolution video frames. This solves the problem of low encoding and decoding efficiency of high-resolution video frames in related technologies and improves the smoothness of video transmission and display.
[0059] In some embodiments, step S201 includes:
[0060] Step S2011: Establish N socket channels for concurrently receiving N segmented video frames from the encoded key video frames sent by the terminal device.
[0061] Using N socket channels to concurrently receive N segmented video frames from the encoded key video frames sent by the terminal device is simple, feasible, and highly stable.
[0062] In some embodiments, step S202 includes:
[0063] Step S2021: Reuse one of the N socket channels to receive encoded non-critical video frames sent by the terminal device.
[0064] For encoded non-critical video frames, they can be multiplexed and transmitted through the socket channel of one of the video frame segments, thereby reducing the server-side processing of the socket and further improving efficiency. It's also worth mentioning that channel information, region information, frame sequence number, frame type, and other information can be added to the transmitted video frames at this time for use in subsequent processing steps.
[0065] In some embodiments, the method further includes the following after step S204:
[0066] Step S205: Alternately display the decoded key video frames and the decoded non-key video frames.
[0067] When a decoded key video frame is detected, the PIP layer screen is hidden, and key and non-key video frames are displayed alternately in two video layers. The decoded key and non-key video frames can be displayed by the server device's display module, or the server device can send the decoded key and non-key video frames to a separate display terminal for display. This application does not impose specific limitations on this method.
[0068] By following the steps above, we can achieve fast concurrent decoding and display, accelerate transmission and decoding efficiency, and solve the playback stuttering problem caused by the time consumption of encoding and decoding key video frames and network transmission at high resolutions.
[0069] In some embodiments, the method further includes the following steps prior to step S201:
[0070] Step S2001: Obtain the video resolution and video frame interval duration of the video to be encoded / decoded.
[0071] The server device performs background statistics on the video frame data of the incoming video to be encoded or decoded, and obtains the video resolution and video frame interval duration of the video to be encoded or decoded.
[0072] Step S2002: When the video resolution is higher than a preset resolution threshold and the video frame interval duration is greater than a preset duration, a segmentation encoding instruction is sent to the terminal device.
[0073] The video frame interval duration exceeding a preset duration can be a single instance of the video frame interval exceeding the preset duration, or multiple consecutive instances of the video frame interval exceeding the preset duration; this application does not impose a specific limitation. For example, if the preset resolution threshold is 4K and the preset duration is an average frame interval of 40ms under a 1-second 25-frame bitstream, when a video resolution of 4K or higher is obtained, and the video frame interval duration exceeds 40ms for 5 consecutive instances, a fragmentation encoding command is sent to the terminal device.
[0074] Through the above steps, this embodiment of the application sends a segmentation encoding instruction to the terminal device when a large video resolution is detected and the transmission is slow, thus avoiding wasting resources.
[0075] This application also provides a video encoding / decoding method. Figure 3 This is a flowchart of another video encoding / decoding method according to an embodiment of this application, such as... Figure 3 As shown, the process includes the following steps:
[0076] Step S301: The terminal device acquires an initial key video frame, performs concurrent encoding on the initial key video frame to determine N segmented video frames, where N is an even number greater than 1; determines the encoded key video frame based on the N segmented video frames; acquires an initial non-key video frame, and determines the encoded non-key video frame based on the initial non-key video frame.
[0077] The terminal device acquires the initial key video frame. Upon receiving the segmentation encoding instruction, it segments the data region according to the video frame interval duration deviation in the segmentation encoding instruction, ensuring that the data encoding and data transmission time of each region reaches the average frame transmission interval duration for smooth decoding, thus obtaining segmented video frames. The number of segmented video frames N is calculated as follows: N0 = (maximum transmission interval duration of the current 5 frames / average frame transmission interval duration for smooth decoding) + 1. If N0 is even, then N = N0; if N0 is odd, then N = N0 + 1. Simultaneously, the initial key video frame scene region is divided into an 8192 coordinate system, and the data is equally divided. The equally divided data is concurrently encoded to determine N segmented video frames. The N segmented video frames are combined to form the encoded key video frame. The terminal device also acquires the initial non-key video frames and performs full-domain encoding on them to determine the encoded non-key video frames.
[0078] The data partitioning method in the above steps can ensure that the area allocation is uniform in size, prevent data synchronization time from being too long due to differences in data parsing, and improve coding efficiency by concurrently encoding key video frames to obtain N segmented video frames and performing full-domain encoding on non-key video frames.
[0079] Step S302: The server device concurrently receives N segmented video frames from the encoded key video frames sent by the terminal device, decodes the N segmented video frames at the first video layer to determine N decoded segmented video frames, and determines the decoded key video frames based on the N decoded segmented video frames; it also receives the encoded non-key video frames sent by the terminal device, decodes the encoded non-key video frames at the second video layer to determine the decoded non-key video frames.
[0080] After receiving N video fragments, the server device establishes N+1 decoders. The N decoders are configured in the first video layer to decode the N video fragments and identify the N decoded video fragments. During decoding, frame sequence numbers are synchronized across different regions to minimize image distortion caused by multi-region synchronization, ensuring smooth and consistent playback. The region information of the N decoded video fragments is determined, and they are merged and reassembled based on this information to identify the key decoded video frames. The encoded non-key video frames are then decoded in the second video layer, which can be a picture-in-picture (PIP) layer. After identifying the key decoded video frames, display data from the video memory is copied to the PIP layer as a reference frame for decoding the non-key video frames. Of the N+1 decoders mentioned above, in addition to the N decoders set in the first video layer, another decoder is set in the second video layer. Thus, using this decoder set in the second video layer, the encoded non-critical video frames are decoded in the second video layer (PIP layer) to obtain the decoded non-critical video frames.
[0081] Through the above steps, since the resolution of a single video frame is much smaller than that of the entire key video frame, multiplexing and concurrent reception of the video frames are performed under the same Maximum Transmission Unit (MTU) condition, reducing the amount of data packets in the overall encoded key video frame, thereby reducing network transmission time. Furthermore, concurrent decoding of encoded key video frames and encoded non-key video frames is performed at different video layers, thereby improving the encoding and decoding efficiency of high-resolution video frames. This solves the problem of low encoding and decoding efficiency of high-resolution video frames in related technologies and improves the smoothness of video transmission and display.
[0082] In some embodiments, the method further includes the following steps prior to step S301:
[0083] In step S3001, the server device obtains the video resolution and video frame interval duration of the video to be encoded and decoded. If the video resolution is higher than a preset resolution threshold and the video frame interval duration is greater than a preset duration, the server device sends a segmentation encoding instruction to the terminal device.
[0084] The video frame interval duration exceeding a preset duration can be a single instance of the video frame interval exceeding the preset duration, or multiple consecutive instances of the video frame interval exceeding the preset duration; this application does not impose a specific limitation. For example, if the preset resolution threshold is 4K and the preset duration is an average frame interval of 40ms under a 1-second 25-frame bitstream, when a video resolution of 4K or higher is obtained, and the video frame interval duration exceeds 40ms for 5 consecutive instances, a fragmentation encoding command is sent to the terminal device.
[0085] In step S3002, the terminal device receives the segmentation encoding instruction sent by the server device, and determines the number of video frames N to be segmented according to the segmentation encoding instruction, where N is an even number greater than 1.
[0086] The terminal device acquires the initial key video frame. Upon receiving the fragmentation encoding instruction, it fragments the data region according to the video frame interval duration deviation in the fragmentation encoding instruction, ensuring that the data encoding and data transmission time of each region reaches the average frame transmission interval for smooth decoding, thus obtaining fragmented video frames. The number of fragmented video frames N is calculated as follows: N0 = (maximum transmission interval duration of the current 5 frames / average frame transmission interval duration for smooth decoding) + 1. If N0 is even, then N = N0; if N0 is odd, then N = N0 + 1.
[0087] Through the above steps, this embodiment of the application sends a segmentation encoding instruction to the terminal device when a large video resolution is detected and the transmission is slow, thus avoiding wasting resources. Furthermore, the data partitioning method can ensure that the area allocation size is uniform, preventing data synchronization time from being too long due to differences in data parsing.
[0088] The embodiments of this application will be described and illustrated below through preferred embodiments.
[0089] Figure 4 This is a flowchart of a video encoding / decoding method according to a preferred embodiment of this application. Figure 4 As shown, the video encoding / decoding method includes the following steps:
[0090] Step S401: The server device obtains the video resolution and video frame interval duration of the video to be encoded and decoded. If the video resolution is higher than a preset resolution threshold and the video frame interval duration is greater than a preset duration, the server device sends a segmentation encoding instruction to the terminal device.
[0091] In step S402, the terminal device receives the segmentation encoding instruction sent by the server device, and determines the number of video frames N to be segmented according to the segmentation encoding instruction, where N is an even number greater than 1.
[0092] Step S403: The terminal device acquires the initial key video frame, performs concurrent encoding on the initial key video frame to determine N segmented video frames, and determines the encoded key video frame based on the N segmented video frames.
[0093] Step S404: The terminal device acquires the initial non-critical video frame and determines the encoded non-critical video frame based on the initial non-critical video frame.
[0094] Step S405: The server device concurrently receives N segmented video frames from the encoded key video frames sent by the terminal device, decodes the N segmented video frames at the first video layer to determine N decoded segmented video frames, and determines the decoded key video frames based on the N decoded segmented video frames.
[0095] In step S406, the server device receives the encoded non-critical video frame sent by the terminal device, and decodes the encoded non-critical video frame in the second video layer to determine the decoded non-critical video frame.
[0096] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0097] This application also provides a video encoding / decoding apparatus for implementing the above embodiments and preferred embodiments, which will not be repeated hereafter. As used below, the terms "module," "unit," "subunit," etc., can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0098] Figure 5 This is a structural block diagram of a video encoding / decoding apparatus according to an embodiment of this application, such as... Figure 5 As shown, the device includes a keyframe receiving module 10, a non-keyframe receiving module 20, a keyframe decoding module 30, and a non-keyframe decoding module 40.
[0099] The key frame receiving module 10 is used to concurrently receive N segmented video frames from the encoded key video frames sent by the terminal device, where N is an even number greater than 1.
[0100] The non-critical frame receiving module 20 is used to receive encoded non-critical video frames sent by the terminal device.
[0101] The keyframe decoding module 30 is used to decode the N video segments in the first video layer to determine the N decoded video segments, and to determine the decoded key video frames based on the N decoded video segments.
[0102] The non-key frame decoding module 40 is used to decode the encoded non-key video frames in the second video layer to determine the decoded non-key video frames.
[0103] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.
[0104] This application also provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0105] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0106] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0107] Concurrently receive N video frames from the encoded key video frames sent by the terminal device, where N is an even number greater than 1;
[0108] Receive encoded non-critical video frames sent by the terminal device;
[0109] The N video segments are decoded in the first video layer to determine the N decoded video segments, and the decoded key video frames are determined based on the N decoded video segments.
[0110] The encoded non-critical video frames are decoded in the second video layer to identify the decoded non-critical video frames.
[0111] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0112] Furthermore, in conjunction with the video encoding / decoding methods described in the above embodiments, this application embodiment can provide a storage medium for implementation. This storage medium stores a computer program; when executed by a processor, the computer program implements any of the video encoding / decoding methods described in the above embodiments.
[0113] Those skilled in the art should understand that the technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments have been described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0114] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A video encoding / decoding method, applied to server equipment, characterized in that, Includes the following steps: Concurrently receive N video frames from the encoded key video frames sent by the terminal device, where N is an even number greater than 1; Receive encoded non-critical video frames sent by the terminal device; The N video segments are decoded in the first video layer to determine the N decoded video segments, and the decoded key video frames are determined based on the N decoded video segments. The encoded non-critical video frames are decoded in the second video layer to identify the decoded non-critical video frames, wherein the second video layer is a picture-in-picture layer.
2. The video encoding and decoding method according to claim 1, characterized in that, The concurrent receiving terminal device sends N segmented video frames from the encoded key video frames, including: Establish N socket channels to concurrently receive N segmented video frames from the encoded key video frames sent by the terminal device.
3. The video encoding and decoding method according to claim 2, characterized in that, The encoded non-critical video frames sent by the receiving terminal device include: One of the N socket channels is reused to receive encoded non-critical video frames sent by the terminal device.
4. The video encoding and decoding method according to any one of claims 1 to 3, characterized in that, After decoding the encoded non-critical video frames at the second video layer to determine the decoded non-critical video frames, the process further includes: The decoded key video frames and the decoded non-key video frames are displayed alternately.
5. The video encoding and decoding method according to any one of claims 1 to 3, characterized in that, The following is included before the N segmented video frames in the encoded key video frames sent by the concurrent receiving terminal device: Obtain the video resolution and video frame interval duration of the video to be encoded / decoded; When the video resolution is higher than a preset resolution threshold and the video frame interval duration is longer than a preset duration, a segmentation encoding instruction is sent to the terminal device.
6. A video encoding / decoding method, characterized in that, Includes the following steps: The terminal device acquires an initial key video frame, performs concurrent encoding on the initial key video frame to determine N segmented video frames, where N is an even number greater than 1; determines the encoded key video frame based on the N segmented video frames; acquires an initial non-key video frame, and determines the encoded non-key video frame based on the initial non-key video frame. The server device concurrently receives N segmented video frames from the encoded key video frames sent by the terminal device, decodes the N segmented video frames in a first video layer to determine N decoded segmented video frames, and determines the decoded key video frames based on the N decoded segmented video frames; it also receives the encoded non-key video frames sent by the terminal device, decodes the encoded non-key video frames in a second video layer to determine the decoded non-key video frames, wherein the second video layer is a picture-in-picture layer.
7. The video encoding and decoding method according to claim 6, characterized in that, Before the terminal device acquires the initial key video frame and performs concurrent encoding on the initial key video frame to determine N segmented video frames, the following steps are also included: The server device obtains the video resolution and video frame interval duration of the video to be encoded and decoded. If the video resolution is higher than a preset resolution threshold and the video frame interval duration is greater than a preset duration, it sends a segmentation encoding instruction to the terminal device. The terminal device receives the segmentation encoding instruction sent by the server device, and determines the number of video frames N to be segmented according to the segmentation encoding instruction, where N is an even number greater than 1.
8. A video encoding / decoding apparatus for implementing the video encoding / decoding method as described in any one of claims 1 to 7, characterized in that, It includes a keyframe receiving module, a non-keyframe receiving module, a keyframe decoding module, and a non-keyframe decoding module: The key frame receiving module is used to concurrently receive N video fragments from the encoded key video frames sent by the terminal device, where N is an even number greater than 1. The non-critical frame receiving module is used to receive encoded non-critical video frames sent by the terminal device. The keyframe decoding module is used to decode the N video segments in the first video layer to determine the N decoded video segments, and to determine the decoded key video frames based on the N decoded video segments. The non-keyframe decoding module is used to decode the encoded non-key video frames in the second video layer to determine the decoded non-key video frames, wherein the second video layer is a picture-in-picture layer.
9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the video encoding / decoding method according to any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium stores a computer program, wherein the computer program is configured to execute the video encoding / decoding method according to any one of claims 1 to 7 when it is run.
Citation Information
Patent Citations
Screen projection method, screen projection equipment and storage medium
CN113316028A
Video stream transmission method, electronic equipment and storage medium
CN113542798A