WO2023151489A1 - Video processing method, apparatus and device, and storage medium - Google Patents

Video processing method, apparatus and device, and storage medium Download PDF

Info

Publication number
WO2023151489A1
WO2023151489A1 PCT/CN2023/074054 CN2023074054W WO2023151489A1 WO 2023151489 A1 WO2023151489 A1 WO 2023151489A1 CN 2023074054 W CN2023074054 W CN 2023074054W WO 2023151489 A1 WO2023151489 A1 WO 2023151489A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame
video
video frame
decoded
playback
Prior art date
Application number
PCT/CN2023/074054
Other languages
French (fr)
Chinese (zh)
Inventor
陶燕波
张凯明
邓勇
Original Assignee
百果园技术(新加坡)有限公司
陶燕波
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 百果园技术(新加坡)有限公司, 陶燕波 filed Critical 百果园技术(新加坡)有限公司
Publication of WO2023151489A1 publication Critical patent/WO2023151489A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440218Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by transcoding between formats or standards, e.g. from MPEG-2 to MPEG-4

Definitions

  • the embodiments of the present application relate to the field of computer technology, and in particular, to a video processing method, device, device, and storage medium.
  • video frames are often transmitted in the form of video data packets.
  • the video receiving end receives the data packets and parses the video frames, it decodes the video frames and adds them to the queue to be rendered for rendering and playback. .
  • the user's viewing experience of video is very dependent on the frame rate of video playback.
  • the video sending end will sometimes reduce the sampling rate of the video to ensure the normal sending of video data packets, and when the network is weak, it will also There will be network congestion or serious packet loss, which will lead to a drop in the video playback frame rate and affect the user's video viewing experience.
  • the embodiment of the present application provides a video processing method, device, device, and storage medium to solve the technical problem in the related art that the video playback frame rate drops due to a weak network and affects the user's video viewing experience, so as to improve the video playback frame rate , to optimize the user video viewing experience.
  • the embodiment of the present application provides a video processing method, including:
  • the embodiment of the present application provides a video processing device, including a video acquisition module, a frame insertion judgment module, a frame insertion operation module, and a rendering push module, wherein:
  • the video acquisition module is configured to obtain a video frame to be decoded from the queue to be decoded and decode it to obtain a decoded video frame;
  • the frame insertion judging module is configured to determine whether the frame insertion operation condition is satisfied according to the set playback frame rate influencing parameters
  • the frame insertion operation module is configured to generate a virtual video frame according to the reference video frame recorded in the frame insertion buffer data and the decoded video frame when the frame insertion operation condition is met, and update the virtual video frame according to the decoded video frame The reference video frame in the interpolation frame buffer data;
  • the rendering push module is configured to add the virtual video frame and the decoded video frame to a playback queue to be rendered.
  • an embodiment of the present application provides a video processing device, including: a memory and one or more processors;
  • the memory configured to store one or more programs
  • the one or more processors When the one or more programs are executed by the one or more processors, the one or more processors implement the video processing method as described in the first aspect.
  • the embodiment of the present application provides a storage medium containing computer-executable instructions, and the computer-executable instructions are configured to execute the video processing method as described in the first aspect when executed by a computer processor.
  • the embodiment of the present application provides a computer program product, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, and at least one processor of the device reads the computer program from the computer-readable storage medium Acquiring and executing a computer program, so that the device executes the video processing method as described in the first aspect.
  • the decoded video frame is obtained by obtaining the video frame to be decoded from the queue to be decoded, and judging whether the frame insertion operation condition is satisfied according to the setting playback frame rate influence parameter, and when the frame insertion operation condition is satisfied, according to the insertion
  • the reference video frame recorded in the frame buffer data and the decoded video frame generate a virtual video frame, and update the reference video frame in the interpolation frame buffer data according to the decoded video frame to prepare for the next frame interpolation operation, and then the virtual video frame and the decoded video frame Add video frames to the playback queue to be rendered, increase the number of video frames waiting to be rendered and displayed in the playback queue to be rendered, effectively improve the frame rate of video playback, and optimize user experience.
  • FIG. 1 is a flow chart of a video processing method provided in an embodiment of the present application
  • FIG. 2 is a flow chart of another video processing method provided by an embodiment of the present application.
  • Fig. 3 is a schematic diagram of a judgment flow chart of a frame insertion operation condition provided by an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of a video processing device provided by an embodiment of the present application.
  • Fig. 5 is a schematic structural diagram of a video processing device provided by an embodiment of the present application.
  • Figure 1 shows a flow chart of a video processing method provided by the embodiment of the present application.
  • the video processing method provided by the embodiment of the present application can be executed by a video processing device, and the video processing device can use hardware and/or software Realized and integrated in video processing equipment.
  • this video processing method performed by a video processing device is taken as an example for description below. With reference to Fig. 1, this video processing method comprises:
  • S101 Obtain a video frame to be decoded from a queue to be decoded, and perform decoding to obtain a decoded video frame.
  • the video frames to be decoded in the queue to be decoded provided by this embodiment are obtained from a set communication network (such as UDP network, TCP network, HTTP network), wherein the video frames to be decoded in the set communication network are provided by the video sending device , that is, the video sending device sends the video frame to be decoded to the video processing device through a set communication network.
  • the video sending device can select an appropriate encoding method according to the network state to encode the video data packet corresponding to the video frame to be decoded, for example, generate a video data packet based on forward error correction coding (the video data packet includes the video frame to be decoded and corresponding redundant package).
  • the video processing device receives the video data packet and decodes to obtain the video frame to be decoded that satisfies the decoding condition (for example, the video frame to be decoded has been received completely, and the corresponding reference frame is also complete), the video frame to be decoded is added to the queue to be decoded waiting to be decoded.
  • the decoding condition for example, the video frame to be decoded has been received completely, and the corresponding reference frame is also complete
  • the video processing device acquires the video frames to be decoded from the queue to be decoded in real time, submits the video frames to be decoded to the decoding thread, and the decoding thread decodes the video frames to be decoded to obtain the decoded video frames.
  • S102 Determine whether the frame insertion operation condition is satisfied according to the set playing frame rate influencing parameter.
  • the set play frame rate influencing parameter is used to reflect whether the play frame rate of the video frame rendered and played by the video processing device satisfies the set play frame rate requirement. It is understandable that when the parameters affecting the playback frame rate are set to meet the frame insertion operation conditions, the video frame playback frame rate fails to meet the set playback frame rate requirements. At this time, the video playback frame rate may be small, causing users to watch When video freezes are obvious and affect the user's video viewing experience, frame insertion processing is required to increase the video playback frame rate, reduce video playback freeze, and optimize the user's video viewing experience. However, when the parameter affecting the playback frame rate does not meet the frame insertion operation conditions, that is, the video frame playback frame rate has reached the set playback frame rate requirement at this time, the frame insertion processing may not be performed to reduce the occupation of processing resources.
  • step S103 determine the set playback frame rate influencing parameter reflecting the video playback frame rate, and determine whether the currently decoded decoded video frame meets the frame insertion operation condition according to the set playback frame rate influence parameter, and if the frame insertion operation condition is satisfied, Then jump to step S103 to generate the virtual video frame. If the frame insertion operation condition is not satisfied, there is no need to generate a virtual video frame, and the decoded video frame can be directly added to the playback queue to be rendered, and replaced by the decoded video frame
  • the reference video frame in the interpolation frame cache data is convenient for generating a virtual video frame when the frame interpolation operation is required next time.
  • a virtual video frame is generated according to the reference video frame and the decoded video frame recorded in the frame interpolation buffer data. Further, after the virtual video frame is obtained, the reference video frame in the frame insertion buffer data is updated according to the decoded video frame. For example, replace the reference video frame in the interpolation frame buffer data with the decoded video frame currently decoded, at this time, the decoded video frame will be used as a new reference video frame, and the decoded video frame will be used as the next frame interpolation operation.
  • the reference video frame and the decoded video frame obtained next time are used to generate a reference video frame.
  • the generation of virtual video frames can be done through a preconfigured interpolation controller (INTER Controller), that is, the reference video frame is recorded in the frame interpolation buffer data of the frame interpolation controller (for example, the reference video frame is the decoded video frame of the previous frame), and the decoded video frame obtained by current decoding satisfies the frame interpolation requirements.
  • the decoded video frame is added to the frame interpolation controller, and the frame interpolation controller will generate a virtual video frame according to the newly received decoded video frame and the reference video frame recorded in the frame interpolation buffer record.
  • the virtual video frame is generated according to the reference video frame and the decoded video frame, which can be obtained by weighting the image bits corresponding to two adjacent real videos (that is, the reference video frame and the decoded video frame) to obtain the virtual video frame, and the virtual video frame is generated
  • the speed is faster and the CPU resource usage is reduced, and the Neon library can also be superimposed for assembly acceleration to further reduce the CPU usage.
  • a virtual video frame may also be generated based on an optical flow prediction algorithm or a frame interpolation algorithm based on deep learning, so as to achieve a more realistic image effect.
  • the rendering thread after obtaining the virtual video frame, add the virtual video frame and the decoded video frame to the queue to be rendered, and wait for the rendering thread to obtain the video frame from the queue to be rendered for rendering and displaying.
  • the rendering time of the virtual video frame is earlier than that of the currently decoded video frame
  • when adding the virtual video frame and the decoded video frame to the playback queue to be rendered first insert the virtual video frame into the playback queue to be rendered. frame, and then insert the decoded video frame.
  • the rendering thread acquires video frames for rendering and playback, it first acquires the virtual video frame with the earlier playback time for rendering and playback.
  • the video processing method inserts virtual video frames between real decoded video frames, increases the frame rate of rendering and playing video frames, reduces video playback freeze rate, improves user experience in weak network scenarios, and effectively increases user usage time (for example, In the same weak network environment, a smooth video call experience can effectively extend the average call duration of users).
  • the decoded video frame is obtained by obtaining the video frame to be decoded from the queue to be decoded, and judging whether the frame insertion operation condition is satisfied according to the set playback frame rate influence parameter, and the frame insertion operation is satisfied condition, generate a virtual video frame according to the reference video frame and decoded video frame recorded in the frame interpolation buffer data, and update the reference video frame in the interpolation frame buffer data according to the decoded video frame, to prepare for the next frame interpolation operation, and then Add virtual video frames and decoded video frames to the playback queue to be rendered, increase the video frames waiting to be rendered and displayed in the playback queue to be rendered, effectively improve the frame rate of video playback, and optimize user experience.
  • FIG. 2 shows a flow chart of another video processing method provided by the embodiment of the present application, and the video processing method is an embodiment of the above-mentioned video processing method.
  • this video processing method comprises:
  • S201 Obtain a video frame to be decoded from a queue to be decoded, and perform decoding to obtain a decoded video frame.
  • the reference video frame used for generating the virtual video frame is saved as frame interpolation buffer data, and the frame interpolation buffer data is recorded in a set memory space.
  • the memory space used for recording frame interpolation buffer data may be a fixedly opened space, or a corresponding space is opened when a setting application program (such as a video application program) is opened, or a setting function ( For example, a corresponding space is opened when a video application program starts a video call function, or a corresponding space is opened when the video call function is turned on and the first video frame is received.
  • the video processing method provided by this solution after obtaining the video frame to be decoded from the queue to be decoded and decoding to obtain the decoded video frame, also includes: after the decoded video frame is the first video frame Frame time, open the memory space for recording frame interpolation buffer data.
  • the frame insertion controller is initialized, and the memory space required for recording the frame insertion buffer data is opened, and the frame insertion Set the corresponding frame insertion attribute information in the controller.
  • the frame interpolation attribute information includes frame interpolation quantity information, frame interpolation resolution, frame interpolation algorithm, etc.
  • the frame interpolation quantity information is used to indicate the required generation and insertion between two real frames (reference video frame and decoded video frame).
  • the number of virtual video frames is used to indicate the resolution of the virtual video frame to be generated (for example, keep consistent with the reference video frame or decoded video frame)
  • the frame interpolation algorithm is used to indicate the virtual video frame used to generate Algorithm or interpolation frame generation function to call.
  • the frame insertion attribute information also includes the playing time information of the virtual frame, for example, when the number of inserted frames is 1, the playing time can be set in the middle of the corresponding playing time of two real video frames, and when the number of inserted frames is greater than 1 Frame time, according to the number of inserted frames, the respective playback times are evenly distributed between the corresponding playback times of the two real video frames.
  • the decoded video frame when the decoded video frame is the first video frame, after opening the memory space for recording the interpolation buffer data, the first video frame is added to the memory space for recording the interpolation buffer data In between, it is recorded as a reference video frame. It is understandable that when receiving the first video frame, the frame interpolation controller directly receives a video frame without generating a virtual frame or judging the change degree of subsequent video frames, and can directly convert the decoded video Frames are added to the playback queue to be rendered, waiting for the rendering display of the rendering thread.
  • S202 Determine the degree of video frame change between the decoded video frame and the previous decoded video frame.
  • the decoded video frame After the decoded video frame is obtained, it is necessary to determine the video frame change degree between the current decoded video frame and the last decoded video frame, and determine whether to execute the subsequent virtual video frame generation process according to the video frame change degree.
  • the degree of change in the resolution of two decoded video frames can be used to indicate the degree of change in the video frame. Based on this, when determining the degree of change in the video frame between the decoded video frame and the previous decoded video frame, the specific is: determine the change degree of the video frame according to the resolution change value of the decoded video frame and the resolution of the last decoded video frame.
  • the resolution of the currently decoded video frame and the resolution of the last decoded video frame are obtained, the resolution of the decoded video frame and the resolution change value of the last decoded video frame are determined, and the video frame is determined according to the resolution change value degree of change.
  • this solution divides the change degree of the video frame into two degrees of no change and change. or an abnormality in the video transmission process causes the resolution to change), the degree of change in the video frame is a change (for example, the corresponding flag bit is 1), and when the resolution of the two real video frames before and after the change does not change, the video frame change The degree is unchanged (for example, the corresponding flag bit is 0).
  • S203 Determine whether to update the reference video frame recorded in the frame insertion buffer data according to the comparison result of the change degree of the video frame and the set change threshold.
  • the determined change degree of the video frame is compared with a set change threshold, and it is determined whether the change degree of the video frame reaches the set change threshold according to the comparison result. Further, when the degree of change of the video frame does not reach the set change threshold (that is, the resolutions of the decoded video frames of the two frames before and after are consistent), it can be considered that the change degree of the decoded video frames of the two frames before and after this time is relatively small, which is suitable for frame insertion operate. Based on this, when the degree of change of the video frame does not reach the set change threshold, jump to step S204 to further determine whether the currently decoded video frame satisfies the frame insertion operation condition.
  • the change degree of the video frame reaches the set change threshold, it can be considered that the change degree of the decoded video frame of the two frames before and after this time is relatively large, and it is no longer suitable for the frame insertion operation, so as to avoid the situation that the generated virtual video frame has a poor effect.
  • the change degree of the video frame reaches the set change threshold, according to the decoded video
  • the frame updates the reference video frame recorded in the frame insertion buffer data, that is, the decoded video frame obtained by current decoding replaces the reference video frame recorded in the frame insertion buffer data. Further, after updating the reference video frame recorded in the frame interpolation buffer data, the current decoded video frame is directly added to the playback queue to be rendered.
  • step S205 When the degree of change of the video frame does not reach the set change threshold (that is, the resolutions of the two decoded video frames before and after are consistent), it is further judged whether the decoded video frame satisfies the frame insertion operation condition, and if the decoded video frame satisfies the frame insertion operation condition, Then jump to step S205.
  • the set change threshold that is, the resolutions of the two decoded video frames before and after are consistent
  • the reference video frame in the frame insertion buffer data is updated according to the decoded video frame, that is, the currently decoded decoded video frame replaces the reference video frame recorded in the frame insertion buffer data. Further, after updating the reference video frame recorded in the frame interpolation buffer data, the current decoded video frame is directly added to the playback queue to be rendered, without generating a virtual video frame.
  • setting the parameters affecting the playback frame rate includes the video receiving frame rate and/or the number of video frames to be played in the playback queue to be rendered.
  • the video receiving frame rate is a receiving frame rate at which the video processing device receives the video frame to be decoded.
  • the number of video frames to be played is the number of video frames to be decoded that are added to the playback queue to be rendered and wait for the rendering thread to extract, render and display.
  • S2041 Determine whether the video receiving frame rate is within the set frame rate range, and/or whether the number of video frames to be played in the to-be-rendered playback queue is within the set number threshold.
  • the video receiving frame rate may be the frame rate at which the video processing device receives the video frames to be decoded within a set time period (for example, 3 seconds). Exemplarily, it is determined that the video processing device receives the video receiving frame rate of the video frame to be decoded within the set time period, and compares the video receiving frame rate with the set frame rate range (for example, setting the set frame rate range to be less than or equal to 10fps) to determine whether the received video frame rate is within the set frame rate range.
  • the set frame rate range for example, setting the set frame rate range to be less than or equal to 10fps
  • a set number threshold for example, set the set number threshold to 1 frame
  • S2042 In response to the received video frame rate being within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered playback queue being within the set number threshold, determine that the frame insertion operation condition is met.
  • the currently decoded video frame is considered to meet the frame insertion operation condition. If the received video frame rate is not within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered playback queue is not within the set number threshold, it is considered that the currently decoded video frame does not meet the frame insertion operation conditions.
  • the virtual video frame is only generated when the video receiving frame rate is within the set frame rate range, and the virtual video frame is generated when the video receiving frame rate is within the set frame rate range Otherwise, since the receiving frame rate of the current user is relatively high, there is no need to enable the frame insertion function, which effectively reduces the CPU usage.
  • the setting playback frame rate influencing parameter for judging whether the decoded video frame satisfies the frame insertion operation condition can be one of the video receiving frame rate and the number of video frames to be played (that is, the video receiving frame rate is at the set frame rate range, or when the number of video frames to be played in the playback queue to be rendered is within the set number threshold, it is determined that the frame insertion operation condition is met), it can also be a combination of the video receiving frame rate and the number of video frames to be played ( That is, when the video receiving frame rate is within the set frame rate range, and the number of video frames to be played in the to-be-rendered playback queue is within the set number threshold, it is determined that the frame insertion operation condition is satisfied), this embodiment uses the video receiving frame rate
  • the combination with the number of video frames to be played is described as an example.
  • the received video frame rate within 3 seconds is less than 10fps, and the number of video frames to be played in the playback queue to be rendered is less than or equal to 1 frame, it can be determined that the currently decoded video frame satisfies the frame insertion operation condition.
  • the playing time of the virtual video frame can be set. Based on this, in one embodiment, before adding the virtual video frame and the decoded video frame to the playback queue to be rendered, it also includes: determining the virtual video frame according to the playback time of the decoded video frame and the playback time of the last decoded video frame playback time.
  • an intermediate value between the playing time of the current decoded video frame and the playing time of the last decoded video frame is used as the playing time of the virtual video frame.
  • the rendering thread can be based on the sequence of playback time The virtual video frame and the corresponding decoded video frame are successively acquired for rendering and playback.
  • the decoded video frame is obtained by obtaining the video frame to be decoded from the queue to be decoded, and judges whether the frame insertion operation condition is satisfied according to the set playback frame rate influence parameter, and when the frame insertion operation condition is satisfied, according to the frame insertion buffer
  • the reference video frame and decoded video frame recorded in the data generate a virtual video frame, and update the reference video frame in the interpolation frame buffer data according to the decoded video frame, in preparation for the next frame interpolation operation, and then convert the virtual video frame and the decoded video frame Add it to the playback queue to be rendered, increase the video frames waiting to be rendered and displayed in the playback queue to be rendered, effectively improve the video playback frame rate, and optimize the user experience.
  • the video processing method provided by this solution can be configured in the background of the system, and the frame insertion function will be automatically started when it is detected that the frame insertion operation conditions are met, without interactive confirmation with the user, optimizing the user experience.
  • the decoded video frame is obtained by obtaining the video frame to be decoded from the queue to be decoded, and judges whether the frame insertion operation condition is satisfied according to the set playback frame rate influence parameter, and when the frame insertion operation condition is satisfied, according to the frame insertion buffer
  • the reference video frame and decoded video frame recorded in the data generate a virtual video frame, and update the reference video frame in the interpolation frame buffer data according to the decoded video frame, in preparation for the next frame interpolation operation, and then convert the virtual video frame and the decoded video frame Add it to the playback queue to be rendered, increase the video frames waiting to be rendered and displayed in the playback queue to be rendered, effectively improve the video playback frame rate, and optimize the user experience.
  • Fig. 4 is a schematic structural diagram of a video processing device provided by an embodiment of the present application.
  • the video processing device includes a video acquisition module 41 , a frame insertion judgment module 42 , a frame insertion operation module 43 and a rendering push module 44 .
  • the video acquisition module 41 is configured to obtain the video frame to be decoded from the queue to be decoded and decoded to obtain a decoded video frame;
  • the frame insertion judgment module 42 is configured to determine whether the frame insertion operation condition is satisfied according to the set playback frame rate influencing parameters;
  • the frame insertion operation module 43 is configured to generate a virtual video frame according to the reference video frame and the decoded video frame recorded in the frame insertion buffer data when the frame insertion operation condition is met, and update the reference video in the frame insertion buffer data according to the decoded video frame frame;
  • the rendering push module 44 is configured to virtualize Video frames and decoded video frames are added to the playback queue to be rendered.
  • setting the play frame rate influence parameter includes video reception frame rate and/or the number of video frames to be played in the play queue to be rendered, and the frame insertion judging module 42 determines whether the insertion frame rate is satisfied according to the set play frame rate influence parameter.
  • the frame operation condition is configured as:
  • the frame insertion operation module 43 is further configured to update the reference video frame in the frame insertion buffer data according to the decoded video frame when the frame insertion operation condition is not met.
  • the frame insertion operation module 43 is further configured to:
  • the reference video frame recorded in the frame interpolation buffer data is updated according to the decoded video frame.
  • the frame insertion operation module 43 is configured to:
  • the video frame change degree is determined according to the resolution change value of the decoded video frame and the resolution of the last decoded video frame.
  • the rendering push module 44 is further configured to determine the virtual video frame according to the playback time of the decoded video frame and the playback time of the last decoded video frame before adding the virtual video frame and the decoded video frame to the playback queue to be rendered. The playback time of the frame.
  • the video acquisition module 41 is further configured to, after obtaining the video frame to be decoded from the queue to be decoded and decoded to obtain the decoded video frame, when the decoded video frame is the first video frame, enable the frame insertion buffer data for recording memory space.
  • FIG. 5 is a schematic structural diagram of a video processing device provided by an embodiment of the present application.
  • this video processing equipment comprises: input device 53, output device 54, memory A memory 52 and one or more processors 51; the memory 52 is configured to store one or more programs; when one or more programs are executed by one or more processors 51, the one or more processors 51 are implemented as The video processing method provided in the foregoing embodiments.
  • the video processing apparatus, equipment, and computer provided above can be configured to execute the video processing method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
  • the embodiment of the present application also provides a storage medium containing computer-executable instructions, and the computer-executable instructions are configured to execute the video processing method provided in the foregoing embodiments when executed by a computer processor.
  • a storage medium containing computer-executable instructions provided in the embodiments of the present application the computer-executable instructions are not limited to the video processing method provided above, and may also execute the video processing method provided in any embodiment of the present application. related operations.
  • the video processing device, equipment, and storage medium provided in the above-mentioned embodiments can execute the video processing method provided in any embodiment of the present application.
  • the embodiments of the present application also provide a computer program product.
  • the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be implemented as a software product
  • the computer program product is stored in a storage medium, and includes several instructions to make a computer device, a mobile terminal or a processor therein execute all or part of the video processing methods provided by various embodiments of the present application step.

Abstract

Disclosed in the embodiments of the present application are a video processing method, apparatus and device, and a storage medium. In the technical solution provided in the embodiments of the present application, a video frame to be decoded is acquired from a queue to be decoded, and is decoded, so as to obtain a decoded video frame; whether a frame insertion operation condition is met is determined according to a set playback frame rate influence parameter; when the frame insertion operation condition is met, a virtual video frame is generated according to a reference video frame which is recorded in frame insertion cache data, and according to the decoded video frame, and the reference video frame in the frame insertion cache data is updated according to the decoded video frame, so as to prepare for the next frame insertion operation; and the virtual video frame and the decoded video frame are added to a playback queue to be rendered. Video frames waiting to be rendered and displayed in a playback queue to be rendered are increased, thereby effectively improving a video playback frame rate, and optimizing the user experience.

Description

一种视频处理方法、装置、设备及存储介质A video processing method, device, equipment and storage medium
本申请要求在2022年02月10日提交中国专利局,申请号为202210126871.2的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with application number 202210126871.2 submitted to the China Patent Office on February 10, 2022, the entire content of which is incorporated in this application by reference.
技术领域technical field
本申请实施例涉及计算机技术领域,尤其涉及一种视频处理方法、装置、设备及存储介质。The embodiments of the present application relate to the field of computer technology, and in particular, to a video processing method, device, device, and storage medium.
背景技术Background technique
在视频传输过程中,经常是通过视频数据包的形式传输视频帧,视频接收端在接收到数据包并解析得到视频帧后,对视频帧进行解码并添加到待渲染播放队列中等待进行渲染播放。In the process of video transmission, video frames are often transmitted in the form of video data packets. After the video receiving end receives the data packets and parses the video frames, it decodes the video frames and adds them to the queue to be rendered for rendering and playback. .
用户对于视频的观看体验非常依赖于视频播放帧率的影响,但是在网络较弱时,视频发送端有时会降低视频的采样率以保证视频数据包的正常发送,并且在网络较弱时,还会出现网络堵塞或者是丢包比较严重的情况,都导致视频播放帧率下降,影响用户视频观看体验。The user's viewing experience of video is very dependent on the frame rate of video playback. However, when the network is weak, the video sending end will sometimes reduce the sampling rate of the video to ensure the normal sending of video data packets, and when the network is weak, it will also There will be network congestion or serious packet loss, which will lead to a drop in the video playback frame rate and affect the user's video viewing experience.
发明内容Contents of the invention
本申请实施例提供一种视频处理方法、装置、设备及存储介质,以解决相关技术中由于网络较弱而导致视频播放帧率下降,影响用户视频观看体验的技术问题,以提高视频播放帧率,优化用户视频观看体验。The embodiment of the present application provides a video processing method, device, device, and storage medium to solve the technical problem in the related art that the video playback frame rate drops due to a weak network and affects the user's video viewing experience, so as to improve the video playback frame rate , to optimize the user video viewing experience.
在第一方面,本申请实施例提供了一种视频处理方法,包括:In the first aspect, the embodiment of the present application provides a video processing method, including:
从待解码队列中获取待解码视频帧进行解码得到解码视频帧;Obtain the video frame to be decoded from the queue to be decoded and decode to obtain the decoded video frame;
根据设定播放帧率影响参数确定是否满足插帧操作条件;Determine whether the frame insertion operation condition is satisfied according to the set playback frame rate influencing parameters;
当满足所述插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和所述解码视频帧生成虚拟视频帧,并根据所述解码视频帧更新所述插帧缓存数据中的所述参考视频帧;When the frame insertion operation condition is met, generate a virtual video frame according to the reference video frame recorded in the frame insertion buffer data and the decoded video frame, and update the frame insertion buffer data according to the decoded video frame reference video frame;
将所述虚拟视频帧和所述解码视频帧添加至待渲染播放队列中。 Adding the virtual video frame and the decoded video frame to a playback queue to be rendered.
在第二方面,本申请实施例提供了一种视频处理装置,包括视频获取模块、插帧判断模块、插帧操作模块和渲染推送模块,其中:In the second aspect, the embodiment of the present application provides a video processing device, including a video acquisition module, a frame insertion judgment module, a frame insertion operation module, and a rendering push module, wherein:
所述视频获取模块,配置为从待解码队列中获取待解码视频帧进行解码得到解码视频帧;The video acquisition module is configured to obtain a video frame to be decoded from the queue to be decoded and decode it to obtain a decoded video frame;
所述插帧判断模块,配置为根据设定播放帧率影响参数确定是否满足插帧操作条件;The frame insertion judging module is configured to determine whether the frame insertion operation condition is satisfied according to the set playback frame rate influencing parameters;
所述插帧操作模块,配置为当满足所述插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和所述解码视频帧生成虚拟视频帧,并根据所述解码视频帧更新所述插帧缓存数据中的所述参考视频帧;The frame insertion operation module is configured to generate a virtual video frame according to the reference video frame recorded in the frame insertion buffer data and the decoded video frame when the frame insertion operation condition is met, and update the virtual video frame according to the decoded video frame The reference video frame in the interpolation frame buffer data;
所述渲染推送模块,配置为将所述虚拟视频帧和所述解码视频帧添加至待渲染播放队列中。The rendering push module is configured to add the virtual video frame and the decoded video frame to a playback queue to be rendered.
在第三方面,本申请实施例提供了一种视频处理设备,包括:存储器以及一个或多个处理器;In a third aspect, an embodiment of the present application provides a video processing device, including: a memory and one or more processors;
所述存储器,配置为存储一个或多个程序;the memory configured to store one or more programs;
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如第一方面所述的视频处理方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the video processing method as described in the first aspect.
在第四方面,本申请实施例提供了一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时配置为执行如第一方面所述的视频处理方法。In a fourth aspect, the embodiment of the present application provides a storage medium containing computer-executable instructions, and the computer-executable instructions are configured to execute the video processing method as described in the first aspect when executed by a computer processor.
在第五方面,本申请实施例提供了一种计算机程序产品,该计算机程序产品包括计算机程序,该计算机程序存储在计算机可读存储介质中,设备的至少一个处理器从计算机可读存储介质读取并执行计算机程序,使得设备执行如第一方面所述的视频处理方法。In the fifth aspect, the embodiment of the present application provides a computer program product, the computer program product includes a computer program, the computer program is stored in a computer-readable storage medium, and at least one processor of the device reads the computer program from the computer-readable storage medium Acquiring and executing a computer program, so that the device executes the video processing method as described in the first aspect.
本申请实施例通过从待解码队列中获取待解码视频帧进行解码得到解码视频帧,并根据设定播放帧率影响参数判断是否满足插帧操作条件,并在满足插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和解码视频帧生成虚拟视频帧,并根据解码视频帧更新插帧缓存数据中的参考视频帧,为下一次插帧操作做准备,然后将虚拟视频帧和解码视频帧添加至待渲染播放队列中,增加待渲染播放队列中等待渲染显示的视频帧,有效提升视频播放帧率,优化用户体验。 In the embodiment of the present application, the decoded video frame is obtained by obtaining the video frame to be decoded from the queue to be decoded, and judging whether the frame insertion operation condition is satisfied according to the setting playback frame rate influence parameter, and when the frame insertion operation condition is satisfied, according to the insertion The reference video frame recorded in the frame buffer data and the decoded video frame generate a virtual video frame, and update the reference video frame in the interpolation frame buffer data according to the decoded video frame to prepare for the next frame interpolation operation, and then the virtual video frame and the decoded video frame Add video frames to the playback queue to be rendered, increase the number of video frames waiting to be rendered and displayed in the playback queue to be rendered, effectively improve the frame rate of video playback, and optimize user experience.
附图说明Description of drawings
图1是本申请实施例提供的一种视频处理方法的流程图;FIG. 1 is a flow chart of a video processing method provided in an embodiment of the present application;
图2是本申请实施例提供的另一种视频处理方法的流程图;FIG. 2 is a flow chart of another video processing method provided by an embodiment of the present application;
图3是本申请实施例提供的一种插帧操作条件判断流程示意图;Fig. 3 is a schematic diagram of a judgment flow chart of a frame insertion operation condition provided by an embodiment of the present application;
图4是本申请实施例提供的一种视频处理装置的结构示意图;FIG. 4 is a schematic structural diagram of a video processing device provided by an embodiment of the present application;
图5是本申请实施例提供的一种视频处理设备的结构示意图。Fig. 5 is a schematic structural diagram of a video processing device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了使本申请的目的、技术方案和优点更加清楚,下面结合附图对本申请具体实施例作进一步的详细描述。可以理解的是,此处所描述的具体实施例仅仅用于解释本申请,而非对本申请的限定。另外还需要说明的是,为了便于描述,附图中仅示出了与本申请相关的部分而非全部内容。在更加详细地讨论示例性实施例之前应当提到的是,一些示例性实施例被描述成作为流程图描绘的处理或方法。虽然流程图将各项操作(或步骤)描述成顺序的处理,但是其中的许多操作可以被并行地、并发地或者同时实施。此外,各项操作的顺序可以被重新安排。当其操作完成时上述处理可以被终止,但是还可以具有未包括在附图中的附加步骤。上述处理可以对应于方法、函数、规程、子例程、子程序等等。In order to make the purpose, technical solution and advantages of the present application clearer, specific embodiments of the present application will be further described in detail below in conjunction with the accompanying drawings. It should be understood that the specific embodiments described here are only used to explain the present application, but not to limit the present application. In addition, it should be noted that, for the convenience of description, only parts relevant to the present application are shown in the drawings but not all content. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe various operations (or steps) as sequential processing, many of the operations may be performed in parallel, concurrently, or simultaneously. In addition, the order of operations can be rearranged. The above-described processing may be terminated when its operations are complete, but may also have additional steps not included in the figures. The above-described processes may correspond to methods, functions, procedures, subroutines, subroutines, and the like.
图1给出了本申请实施例提供的一种视频处理方法的流程图,本申请实施例提供的视频处理方法可以由视频处理装置来执行,该视频处理装置可以通过硬件和/或软件的方式实现,并集成在视频处理设备中。Figure 1 shows a flow chart of a video processing method provided by the embodiment of the present application. The video processing method provided by the embodiment of the present application can be executed by a video processing device, and the video processing device can use hardware and/or software Realized and integrated in video processing equipment.
下述以视频处理装置执行视频处理方法为例进行描述。参考图1,该视频处理方法包括:The video processing method performed by a video processing device is taken as an example for description below. With reference to Fig. 1, this video processing method comprises:
S101:从待解码队列中获取待解码视频帧进行解码得到解码视频帧。S101: Obtain a video frame to be decoded from a queue to be decoded, and perform decoding to obtain a decoded video frame.
本实施例提供的待解码队列中的待解码视频帧从设定通信网络(例如UDP网络、TCP网络、HTTP网络)中获取,其中,设定通信网络中的待解码视频帧由视频发送设备提供,即视频发送设备通过设定通信网络向视频处理装置发送待解码视频帧。示例性的,视频发送设备可根据网络状态选择合适的编码方式对待解码视频帧对应的视频数据包进行编码,例如基于前向纠错编码生成视频数据包(视频数据包中包括待解码视频帧和对应的冗余包)。 The video frames to be decoded in the queue to be decoded provided by this embodiment are obtained from a set communication network (such as UDP network, TCP network, HTTP network), wherein the video frames to be decoded in the set communication network are provided by the video sending device , that is, the video sending device sends the video frame to be decoded to the video processing device through a set communication network. Exemplarily, the video sending device can select an appropriate encoding method according to the network state to encode the video data packet corresponding to the video frame to be decoded, for example, generate a video data packet based on forward error correction coding (the video data packet includes the video frame to be decoded and corresponding redundant package).
视频处理装置在接收到视频数据包并解码得到满足解码条件(例如待解码视频帧已收全,并且对应的参考帧也完整)的待解码视频帧时,将待解码视频帧添加到待解码队列中等待进行解码。When the video processing device receives the video data packet and decodes to obtain the video frame to be decoded that satisfies the decoding condition (for example, the video frame to be decoded has been received completely, and the corresponding reference frame is also complete), the video frame to be decoded is added to the queue to be decoded waiting to be decoded.
在一个实施例中,视频处理装置实时从待解码队列中获取待解码视频帧,将待解码视频帧提交给解码线程,由解码线程对待解码视频帧进行解码处理得到解码视频帧。In one embodiment, the video processing device acquires the video frames to be decoded from the queue to be decoded in real time, submits the video frames to be decoded to the decoding thread, and the decoding thread decodes the video frames to be decoded to obtain the decoded video frames.
S102:根据设定播放帧率影响参数确定是否满足插帧操作条件。S102: Determine whether the frame insertion operation condition is satisfied according to the set playing frame rate influencing parameter.
其中,本实施例提供的设定播放帧率影响参数用于反映视频处理装置渲染播放视频的视频帧播放帧率是否满足设定的播放帧率要求。可以理解的是,在设定播放帧率影响参数满足插帧操作条件时,视频帧播放帧率未能达到设定的播放帧率要求,此时可能存在视频播放帧率较小,导致用户观看视频时卡顿较为明显,影响用户视频观看体验的情况,需要进行插帧处理,以提高视频播放帧率,减少视频播放的卡顿感,优化用户视频观看体验。而在设定播放帧率影响参数未满足插帧操作条件时,即此时视频帧播放帧率已达到设定的播放帧率要求,可不进行插帧处理,减少处理资源的占用。Wherein, the set play frame rate influencing parameter provided in this embodiment is used to reflect whether the play frame rate of the video frame rendered and played by the video processing device satisfies the set play frame rate requirement. It is understandable that when the parameters affecting the playback frame rate are set to meet the frame insertion operation conditions, the video frame playback frame rate fails to meet the set playback frame rate requirements. At this time, the video playback frame rate may be small, causing users to watch When video freezes are obvious and affect the user's video viewing experience, frame insertion processing is required to increase the video playback frame rate, reduce video playback freeze, and optimize the user's video viewing experience. However, when the parameter affecting the playback frame rate does not meet the frame insertion operation conditions, that is, the video frame playback frame rate has reached the set playback frame rate requirement at this time, the frame insertion processing may not be performed to reduce the occupation of processing resources.
示例性的,确定反映视频播放帧率的设定播放帧率影响参数,并根据设定播放帧率影响参数确定当前解码得到的解码视频帧是否满足插帧操作条件,若满足插帧操作条件,则跳转至步骤S103进行虚拟视频帧的生成流程,若不满足插帧操作条件,则不需要生成虚拟视频帧,可直接将解码视频帧添加到待渲染播放队列中,并利用解码视频帧替换插帧缓存数据中的参考视频帧,方便下一次需要进行插帧操作时生成虚拟视频帧。Exemplarily, determine the set playback frame rate influencing parameter reflecting the video playback frame rate, and determine whether the currently decoded decoded video frame meets the frame insertion operation condition according to the set playback frame rate influence parameter, and if the frame insertion operation condition is satisfied, Then jump to step S103 to generate the virtual video frame. If the frame insertion operation condition is not satisfied, there is no need to generate a virtual video frame, and the decoded video frame can be directly added to the playback queue to be rendered, and replaced by the decoded video frame The reference video frame in the interpolation frame cache data is convenient for generating a virtual video frame when the frame interpolation operation is required next time.
S103:当满足插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和解码视频帧生成虚拟视频帧,并根据解码视频帧更新插帧缓存数据中的参考视频帧。S103: When the frame insertion operation condition is met, generate a virtual video frame according to the reference video frame and the decoded video frame recorded in the frame insertion buffer data, and update the reference video frame in the frame insertion buffer data according to the decoded video frame.
示例性的,在当前解码得到的解码视频帧满足插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和解码视频帧生成虚拟视频帧。进一步的,在得到虚拟视频帧后,根据解码视频帧更新插帧缓存数据中的参考视频帧。例如,将当前解码得到的解码视频帧替换掉插帧缓存数据中的参考视频帧,此时,解码视频帧将作为新的参考视频帧,在下一次进行插帧操作时,该解码视频帧将作为参考视频帧与下一次得到的解码视频帧生成参考视频帧。Exemplarily, when the currently decoded decoded video frame satisfies the frame interpolation operation condition, a virtual video frame is generated according to the reference video frame and the decoded video frame recorded in the frame interpolation buffer data. Further, after the virtual video frame is obtained, the reference video frame in the frame insertion buffer data is updated according to the decoded video frame. For example, replace the reference video frame in the interpolation frame buffer data with the decoded video frame currently decoded, at this time, the decoded video frame will be used as a new reference video frame, and the decoded video frame will be used as the next frame interpolation operation. The reference video frame and the decoded video frame obtained next time are used to generate a reference video frame.
在一个实施例中,虚拟视频帧的生成可通过预设配置好的插帧控制器 (INTER Controller)进行,即在插帧控制器的插帧缓存数据中记录有参考视频帧(例如,参考视频帧为上一帧的解码视频帧),在当前解码得到的解码视频帧满足插帧操作条件时,将解码视频帧添加到插帧控制器,插帧控制器将根据最新收到的解码视频帧和插帧缓存记录中记录的参考视频帧成成虚拟视频帧。In one embodiment, the generation of virtual video frames can be done through a preconfigured interpolation controller (INTER Controller), that is, the reference video frame is recorded in the frame interpolation buffer data of the frame interpolation controller (for example, the reference video frame is the decoded video frame of the previous frame), and the decoded video frame obtained by current decoding satisfies the frame interpolation requirements. When operating conditions, the decoded video frame is added to the frame interpolation controller, and the frame interpolation controller will generate a virtual video frame according to the newly received decoded video frame and the reference video frame recorded in the frame interpolation buffer record.
其中,根据参考视频帧和解码视频帧生成虚拟视频帧,可以是根据相邻两个真实视频(即参考视频帧和解码视频帧)对应的图像位进行加权平均得到虚拟视频帧,虚拟视频帧生成速度较快,减少CPU资源的占用,还可叠加使用Neon库进行汇编加速后,进一步降低CPU占用率。在其他可行的实施例中,还可以是基于光流法预测算法或者基于深度学习的插帧算法来生成虚拟视频帧,以实现更为逼真的图像效果。Wherein, the virtual video frame is generated according to the reference video frame and the decoded video frame, which can be obtained by weighting the image bits corresponding to two adjacent real videos (that is, the reference video frame and the decoded video frame) to obtain the virtual video frame, and the virtual video frame is generated The speed is faster and the CPU resource usage is reduced, and the Neon library can also be superimposed for assembly acceleration to further reduce the CPU usage. In other feasible embodiments, a virtual video frame may also be generated based on an optical flow prediction algorithm or a frame interpolation algorithm based on deep learning, so as to achieve a more realistic image effect.
S104:将虚拟视频帧和解码视频帧添加至待渲染播放队列中。S104: Add the virtual video frame and the decoded video frame to a playback queue to be rendered.
示例性的,在得到虚拟视频帧后,将虚拟视频帧和解码视频帧添加到待渲染播放队列中,等待渲染线程从待渲染播放队列中获取视频帧进行渲染及显示。在一个实施例中,由于虚拟视频帧的渲染时间相对于当前解码视频帧更靠前,在将虚拟视频帧和解码视频帧添加到待渲染播放队列时,先将向待渲染播放队列插入虚拟视频帧,再插入解码视频帧。渲染线程在获取视频帧进行渲染播放时,先获取播放时间在前的虚拟视频帧进行渲染和播放。Exemplarily, after obtaining the virtual video frame, add the virtual video frame and the decoded video frame to the queue to be rendered, and wait for the rendering thread to obtain the video frame from the queue to be rendered for rendering and displaying. In one embodiment, since the rendering time of the virtual video frame is earlier than that of the currently decoded video frame, when adding the virtual video frame and the decoded video frame to the playback queue to be rendered, first insert the virtual video frame into the playback queue to be rendered. frame, and then insert the decoded video frame. When the rendering thread acquires video frames for rendering and playback, it first acquires the virtual video frame with the earlier playback time for rendering and playback.
可以理解的是,用户对视频的卡顿敏感度较高,而卡顿的判定标准是视频帧的播放间隔(即视频帧率的倒数),视频帧率是衡量视频质量的最重要指标之一,人眼对视频帧率的主观感受也较为敏感。本方案可针对弱网场景下,通过对低帧率下的视频帧进行帧率增强,以提升用户整体体验。在视频发送设备提供的视频帧的帧率较低,或者是网络环境较差导致丢包较为严重时,例如在RTC(Real-time Communications,实时通信)中,弱网对抗一直是不断被研究的课题,尽管有多种抗丢包手段可以覆盖一定程度的网络波动,但是在遇到网络出现严重拥塞、丢包或数据乱序时,常规的抗丢包策略也会失效,可通过本方案提供的视频处理方法在真实的解码视频帧之间插入虚拟视频帧,提高渲染播放视频帧的帧率,降低视频播放卡顿率,改善弱网场景下的用户体验,有效增长用户的使用时长(例如在相同弱网环境下,流畅的视频通话体验可有效延长用户的平均通话时长)。It is understandable that users are highly sensitive to video freezes, and the criterion for judging freezes is the playback interval of video frames (that is, the reciprocal of the video frame rate), and the video frame rate is one of the most important indicators for measuring video quality , the human eye is also more sensitive to the subjective perception of the video frame rate. This solution can improve the overall user experience by enhancing the frame rate of video frames at low frame rates in weak network scenarios. When the frame rate of the video frame provided by the video sending device is low, or when the network environment is poor and the packet loss is serious, such as in RTC (Real-time Communications, real-time communication), weak network confrontation has been continuously studied Subject, although there are many anti-packet loss methods that can cover a certain degree of network fluctuations, when the network encounters severe congestion, packet loss or data disorder, the conventional anti-packet loss strategy will also fail, which can be provided by this solution The video processing method inserts virtual video frames between real decoded video frames, increases the frame rate of rendering and playing video frames, reduces video playback freeze rate, improves user experience in weak network scenarios, and effectively increases user usage time (for example, In the same weak network environment, a smooth video call experience can effectively extend the average call duration of users).
上述,通过从待解码队列中获取待解码视频帧进行解码得到解码视频帧,并根据设定播放帧率影响参数判断是否满足插帧操作条件,并在满足插帧操作 条件时,根据插帧缓存数据中记录的参考视频帧和解码视频帧生成虚拟视频帧,并根据解码视频帧更新插帧缓存数据中的参考视频帧,为下一次插帧操作做准备,然后将虚拟视频帧和解码视频帧添加至待渲染播放队列中,增加待渲染播放队列中等待渲染显示的视频帧,有效提升视频播放帧率,优化用户体验。As mentioned above, the decoded video frame is obtained by obtaining the video frame to be decoded from the queue to be decoded, and judging whether the frame insertion operation condition is satisfied according to the set playback frame rate influence parameter, and the frame insertion operation is satisfied condition, generate a virtual video frame according to the reference video frame and decoded video frame recorded in the frame interpolation buffer data, and update the reference video frame in the interpolation frame buffer data according to the decoded video frame, to prepare for the next frame interpolation operation, and then Add virtual video frames and decoded video frames to the playback queue to be rendered, increase the video frames waiting to be rendered and displayed in the playback queue to be rendered, effectively improve the frame rate of video playback, and optimize user experience.
在上述实施例的基础上,图2给出了本申请实施例提供的另一种视频处理方法的流程图,该视频处理方法是对上述视频处理方法的具体化。参考图2,该视频处理方法包括:On the basis of the above-mentioned embodiments, FIG. 2 shows a flow chart of another video processing method provided by the embodiment of the present application, and the video processing method is an embodiment of the above-mentioned video processing method. With reference to Fig. 2, this video processing method comprises:
S201:从待解码队列中获取待解码视频帧进行解码得到解码视频帧。S201: Obtain a video frame to be decoded from a queue to be decoded, and perform decoding to obtain a decoded video frame.
在一个实施例中,用于进行虚拟视频帧生成的参考视频帧保存为插帧缓存数据,而插帧缓存数据记录在设定的内存空间中。其中,用于记录插帧缓存数据的内存空间可以是固定开设的空间,或者是在设定应用程序(例如视频应用程序)开启时开设对应空间,或者是在设定应用程序开始设定功能(例如视频应用程序开启视频通话功能)时开设对应空间,还可以是开启视频通话功能,并且接收到首帧视频帧时开设对应空间。In one embodiment, the reference video frame used for generating the virtual video frame is saved as frame interpolation buffer data, and the frame interpolation buffer data is recorded in a set memory space. Wherein, the memory space used for recording frame interpolation buffer data may be a fixedly opened space, or a corresponding space is opened when a setting application program (such as a video application program) is opened, or a setting function ( For example, a corresponding space is opened when a video application program starts a video call function, or a corresponding space is opened when the video call function is turned on and the first video frame is received.
对于在接收到首帧视频帧时开设对应空间,本方案提供的视频处理方法,在从待解码队列中获取待解码视频帧进行解码得到解码视频帧之后,还包括:在解码视频帧为首帧视频帧时,开启用于记录插帧缓存数据的内存空间。For opening the corresponding space when the first video frame is received, the video processing method provided by this solution, after obtaining the video frame to be decoded from the queue to be decoded and decoding to obtain the decoded video frame, also includes: after the decoded video frame is the first video frame Frame time, open the memory space for recording frame interpolation buffer data.
示例性的,在解码得到的解码视频帧为首帧视频帧(例如视频通话的首帧视频帧)时,初始化插帧控制器,并开启记录插帧缓存数据所需要的内存空间,并在插帧控制器中设置相应的插帧属性信息。Exemplarily, when the decoded video frame obtained by decoding is the first video frame (such as the first video frame of a video call), the frame insertion controller is initialized, and the memory space required for recording the frame insertion buffer data is opened, and the frame insertion Set the corresponding frame insertion attribute information in the controller.
其中,插帧属性信息包括插帧数量信息、插帧分辨率、插帧算法等,插帧数量信息用于指示在两个真实帧(参考视频帧和解码视频帧)之间所需要生成并插入的虚拟视频帧的数量,插帧分辨率用于指示所要生成的虚拟视频帧的分辨率(例如保持与参考视频帧或解码视频帧一致),插帧算法用于指示生成虚拟视频帧所使用的算法或调用的插帧生成函数。在一个实施例中,插帧属性信息还包括虚拟帧的播放时间信息,例如在插帧数量为1是可将播放时间设置在两个真实视频帧对应播放时间的中间,在插帧数量大于1帧时,按照插帧数量将各自的播放时间平均分布在两个真实视频帧对应播放时间之间。Among them, the frame interpolation attribute information includes frame interpolation quantity information, frame interpolation resolution, frame interpolation algorithm, etc., and the frame interpolation quantity information is used to indicate the required generation and insertion between two real frames (reference video frame and decoded video frame). The number of virtual video frames, the frame interpolation resolution is used to indicate the resolution of the virtual video frame to be generated (for example, keep consistent with the reference video frame or decoded video frame), and the frame interpolation algorithm is used to indicate the virtual video frame used to generate Algorithm or interpolation frame generation function to call. In one embodiment, the frame insertion attribute information also includes the playing time information of the virtual frame, for example, when the number of inserted frames is 1, the playing time can be set in the middle of the corresponding playing time of two real video frames, and when the number of inserted frames is greater than 1 Frame time, according to the number of inserted frames, the respective playback times are evenly distributed between the corresponding playback times of the two real video frames.
在一个实施例中,在解码视频帧为首帧视频帧时,在开启用于记录插帧缓存数据的内存空间之后,将首帧视频帧添加到用于记录插帧缓存数据的内存空 间中,作为参考视频帧进行记录。可以理解的是,在接收到首帧视频帧时,插帧控制器直接收到一帧视频帧,不需要生成虚拟帧,也不需要进行后续的视频帧变化程度的判断,可直接将解码视频帧添加到待渲染播放队列中等待渲染线程的渲染展示。In one embodiment, when the decoded video frame is the first video frame, after opening the memory space for recording the interpolation buffer data, the first video frame is added to the memory space for recording the interpolation buffer data In between, it is recorded as a reference video frame. It is understandable that when receiving the first video frame, the frame interpolation controller directly receives a video frame without generating a virtual frame or judging the change degree of subsequent video frames, and can directly convert the decoded video Frames are added to the playback queue to be rendered, waiting for the rendering display of the rendering thread.
S202:确定解码视频帧与上一个解码视频帧的视频帧变化程度。S202: Determine the degree of video frame change between the decoded video frame and the previous decoded video frame.
示例性的,在得到解码视频帧后,需要确定当前解码视频帧与上一个解码视频帧的视频帧变化程度,并根据视频帧变化程度确定是否执行后续虚拟视频帧的生成流程。Exemplarily, after the decoded video frame is obtained, it is necessary to determine the video frame change degree between the current decoded video frame and the last decoded video frame, and determine whether to execute the subsequent virtual video frame generation process according to the video frame change degree.
在一个实施例中,可利用前后两个解码视频帧的分辨率变化程度来表示视频帧变化程度,基于此,本方案在确定解码视频帧与上一个解码视频帧的视频帧变化程度时,具体为:根据解码视频帧的分辨率与上一个解码视频帧的分辨率变化值确定视频帧变化程度。In one embodiment, the degree of change in the resolution of two decoded video frames can be used to indicate the degree of change in the video frame. Based on this, when determining the degree of change in the video frame between the decoded video frame and the previous decoded video frame, the specific is: determine the change degree of the video frame according to the resolution change value of the decoded video frame and the resolution of the last decoded video frame.
示例性的,获取当前解码视频帧的分辨率和上一个解码视频帧的分辨率,确定解码视频帧的分辨率与上一个解码视频帧的分辨率变化值,并根据分辨率变化值确定视频帧变化程度。例如,本方案将视频帧变化程度划分为未发生变化和发生变化两个程度,在前后两个真实视频帧的分辨率发生变化时(例如视频发送设备根据自身资源情况或网络情况调整分辨率、或视频传输过程中出现异常导致分辨率发生变化),视频帧变化程度为发生变化(例如对应的标志位为1),而在前后两个真实视频帧的分辨率未发生变化时,视频帧变化程度为未发生变化(例如对应的标志位为0)。Exemplarily, the resolution of the currently decoded video frame and the resolution of the last decoded video frame are obtained, the resolution of the decoded video frame and the resolution change value of the last decoded video frame are determined, and the video frame is determined according to the resolution change value degree of change. For example, this solution divides the change degree of the video frame into two degrees of no change and change. or an abnormality in the video transmission process causes the resolution to change), the degree of change in the video frame is a change (for example, the corresponding flag bit is 1), and when the resolution of the two real video frames before and after the change does not change, the video frame change The degree is unchanged (for example, the corresponding flag bit is 0).
S203:根据视频帧变化程度与设定变化阈值的比较结果确定是否更新插帧缓存数据中记录的参考视频帧。S203: Determine whether to update the reference video frame recorded in the frame insertion buffer data according to the comparison result of the change degree of the video frame and the set change threshold.
示例性的,将上述确定的视频帧变化程度与设定变化阈值进行比较,并根据比较结果确定视频帧变化程度是否达到设定变化阈值。进一步的,当视频帧变化程度未达到设定变化阈值(即前后两帧解码视频帧的分辨率一致)时,可认为此时前后两帧的解码视频帧的变化程度较小,适用于插帧操作。基于此,在视频帧变化程度未达到设定变化阈值时,则跳转至步骤S204,进一步判断当前解码视频帧是否满足插帧操作条件。Exemplarily, the determined change degree of the video frame is compared with a set change threshold, and it is determined whether the change degree of the video frame reaches the set change threshold according to the comparison result. Further, when the degree of change of the video frame does not reach the set change threshold (that is, the resolutions of the decoded video frames of the two frames before and after are consistent), it can be considered that the change degree of the decoded video frames of the two frames before and after this time is relatively small, which is suitable for frame insertion operate. Based on this, when the degree of change of the video frame does not reach the set change threshold, jump to step S204 to further determine whether the currently decoded video frame satisfies the frame insertion operation condition.
当视频帧变化程度达到设定变化阈值时,可认为此时前后两帧的解码视频帧的变化程度较大,不再适用于插帧操作,以免出现生成的虚拟视频帧效果较差的情况。基于此,在视频帧变化程度达到设定变化阈值时时,根据解码视频 帧更新插帧缓存数据中记录的参考视频帧,即将当前解码得到的解码视频帧替换掉插帧缓存数据中记录的参考视频帧。进一步的,在更新插帧缓存数据中记录的参考视频帧后,直接将当前的解码视频帧添加到待渲染播放队列中。When the change degree of the video frame reaches the set change threshold, it can be considered that the change degree of the decoded video frame of the two frames before and after this time is relatively large, and it is no longer suitable for the frame insertion operation, so as to avoid the situation that the generated virtual video frame has a poor effect. Based on this, when the change degree of the video frame reaches the set change threshold, according to the decoded video The frame updates the reference video frame recorded in the frame insertion buffer data, that is, the decoded video frame obtained by current decoding replaces the reference video frame recorded in the frame insertion buffer data. Further, after updating the reference video frame recorded in the frame interpolation buffer data, the current decoded video frame is directly added to the playback queue to be rendered.
S204:在不需要更新插帧缓存数据中记录的参考视频帧时,根据设定播放帧率影响参数确定是否满足插帧操作条件。S204: When there is no need to update the reference video frame recorded in the frame insertion buffer data, determine whether the frame insertion operation condition is satisfied according to the set playback frame rate influencing parameter.
在视频帧变化程度未达到设定变化阈值(即前后两帧解码视频帧的分辨率一致)时,进一步判断该解码视频帧是否满足插帧操作条件,若该解码视频帧满足插帧操作条件,则跳转至步骤S205。When the degree of change of the video frame does not reach the set change threshold (that is, the resolutions of the two decoded video frames before and after are consistent), it is further judged whether the decoded video frame satisfies the frame insertion operation condition, and if the decoded video frame satisfies the frame insertion operation condition, Then jump to step S205.
而在解码视频帧不满足插帧操作条件时,根据解码视频帧更新插帧缓存数据中的参考视频帧,即将当前解码得到的解码视频帧替换掉插帧缓存数据中记录的参考视频帧。进一步的,在更新插帧缓存数据中记录的参考视频帧后,直接将当前的解码视频帧添加到待渲染播放队列中,不需要生成虚拟视频帧。When the decoded video frame does not satisfy the frame insertion operation condition, the reference video frame in the frame insertion buffer data is updated according to the decoded video frame, that is, the currently decoded decoded video frame replaces the reference video frame recorded in the frame insertion buffer data. Further, after updating the reference video frame recorded in the frame interpolation buffer data, the current decoded video frame is directly added to the playback queue to be rendered, without generating a virtual video frame.
在一个实施例中,设定播放帧率影响参数包括视频接收帧率和/或待渲染播放队列中待播放视频帧数量。其中,视频接收帧率为视频处理装置接收待解码视频帧的接收帧率。待播放视频帧数量为添加到待渲染播放队列中等待渲染线程提取并进行渲染显示的待解码视频帧的数量。基于此,如图3提供的一种插帧操作条件判断流程示意图所示,本方案在根据设定播放帧率影响参数确定是否满足插帧操作条件时,包括步骤S2041-S2043:In one embodiment, setting the parameters affecting the playback frame rate includes the video receiving frame rate and/or the number of video frames to be played in the playback queue to be rendered. Wherein, the video receiving frame rate is a receiving frame rate at which the video processing device receives the video frame to be decoded. The number of video frames to be played is the number of video frames to be decoded that are added to the playback queue to be rendered and wait for the rendering thread to extract, render and display. Based on this, as shown in Fig. 3, as shown in a schematic diagram of a frame insertion operation condition judgment flow chart, this solution includes steps S2041-S2043 when determining whether the frame insertion operation condition is satisfied according to the set playback frame rate influencing parameters:
S2041:确定视频接收帧率是否在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量是否在设定数量阈值内。S2041: Determine whether the video receiving frame rate is within the set frame rate range, and/or whether the number of video frames to be played in the to-be-rendered playback queue is within the set number threshold.
其中,视频接收帧率可以是视频处理装置在设定时间段(例如3秒)内接收待解码视频帧的帧率。示例性的,确定视频处理装置在设定时间段内接收待解码视频帧的视频接收帧率,并将视频接收帧率与设定帧率范围(例如将设定帧率范围设定为小于等于10fps)进行比较,判断视频接收帧率是否在设定帧率范围内。和/或确定待渲染播放队列中的待播放视频帧数量,并将待播放视频帧数量与设定数量阈值(例如将设定数量阈值设定为1帧)进行比较,判断待渲染播放队列中的待播放视频帧数量是否在设定数量阈值内。Wherein, the video receiving frame rate may be the frame rate at which the video processing device receives the video frames to be decoded within a set time period (for example, 3 seconds). Exemplarily, it is determined that the video processing device receives the video receiving frame rate of the video frame to be decoded within the set time period, and compares the video receiving frame rate with the set frame rate range (for example, setting the set frame rate range to be less than or equal to 10fps) to determine whether the received video frame rate is within the set frame rate range. And/or determine the number of video frames to be played in the playback queue to be rendered, and compare the number of video frames to be played with a set number threshold (for example, set the set number threshold to 1 frame), and determine the number of video frames to be played in the playback queue to be rendered. Whether the number of video frames to be played is within the set number threshold.
S2042:响应于视频接收帧率在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量在设定数量阈值内,确定满足插帧操作条件。S2042: In response to the received video frame rate being within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered playback queue being within the set number threshold, determine that the frame insertion operation condition is met.
S2043:响应于视频接收帧率不在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量不在设定数量阈值内,确定不满足插帧操作条件。 S2043: In response to the received video frame rate not within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered play queue is not within the set number threshold, determine that the frame insertion operation condition is not met.
示例性的,视频接收帧率在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量在设定数量阈值内时,认为当前解码视频帧满足插帧操作条件。而视频接收帧率不在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量不在设定数量阈值内时,认为当前解码视频帧不满足插帧操作条件。Exemplarily, when the received video frame rate is within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered playback queue is within the set number threshold, the currently decoded video frame is considered to meet the frame insertion operation condition. If the received video frame rate is not within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered playback queue is not within the set number threshold, it is considered that the currently decoded video frame does not meet the frame insertion operation conditions.
其中,判断视频接收帧率是否在设定帧率范围内,在视频接收帧率在设定帧率范围内时才进行虚拟视频帧的生成,而在视频接收帧率在设定帧率范围内之外时,由于当前用户的接收帧率已经比较高,没必要再启用插帧功能,有效减少对CPU的占用。判断待渲染播放队列中的待播放视频帧数量是否在设定数量阈值内,并在待渲染播放队列中的待播放视频帧数量在设定数量阈值内时才进行虚拟视频帧的生成,可有效减少发生待渲染播放队列缓存堆积问题,避免由于待渲染播放队列中缓存的视频帧过多而影响视频播放流畅度的情况,还可减少对已有的快播慢放机制(即渲染线程根据待渲染播放队列中缓存的视频帧的数量自适应调节视频帧的渲染播放速度)的影响,保证视频播放效果。Among them, it is judged whether the video receiving frame rate is within the set frame rate range, the virtual video frame is only generated when the video receiving frame rate is within the set frame rate range, and the virtual video frame is generated when the video receiving frame rate is within the set frame rate range Otherwise, since the receiving frame rate of the current user is relatively high, there is no need to enable the frame insertion function, which effectively reduces the CPU usage. Judging whether the number of video frames to be played in the playback queue to be rendered is within the set number threshold, and generating virtual video frames only when the number of video frames to be played in the playback queue to be rendered is within the set number threshold, which can be effective Reduce the problem of buffer accumulation in the playback queue to be rendered, avoid the situation that the fluency of video playback is affected by too many video frames cached in the playback queue to be rendered, and reduce the need for existing fast playback and slow playback mechanisms (that is, the rendering thread according to the pending The number of cached video frames in the rendering and playing queue adaptively adjusts the effect of the rendering and playing speed of video frames) to ensure the video playback effect.
在一个实施例中,判断解码视频帧是否满足插帧操作条件所依据的设定播放帧率影响参数可以是视频接收帧率和待播放视频帧数量中的一个(即视频接收帧率在设定帧率范围内,或待渲染播放队列中的待播放视频帧数量在设定数量阈值内时,即确定满足插帧操作条件),还可以是视频接收帧率和待播放视频帧数量的组合(即视频接收帧率在设定帧率范围内,并且待渲染播放队列中的待播放视频帧数量在设定数量阈值内时,才确定满足插帧操作条件),本实施例以视频接收帧率和待播放视频帧数量的组合为例进行描述。例如,在3秒内的视频接收帧率小于10fps,并且待渲染播放队列中的待播放视频帧数量小于等于1帧时,可确定当前解码视频帧满足插帧操作条件。In one embodiment, the setting playback frame rate influencing parameter for judging whether the decoded video frame satisfies the frame insertion operation condition can be one of the video receiving frame rate and the number of video frames to be played (that is, the video receiving frame rate is at the set frame rate range, or when the number of video frames to be played in the playback queue to be rendered is within the set number threshold, it is determined that the frame insertion operation condition is met), it can also be a combination of the video receiving frame rate and the number of video frames to be played ( That is, when the video receiving frame rate is within the set frame rate range, and the number of video frames to be played in the to-be-rendered playback queue is within the set number threshold, it is determined that the frame insertion operation condition is satisfied), this embodiment uses the video receiving frame rate The combination with the number of video frames to be played is described as an example. For example, when the received video frame rate within 3 seconds is less than 10fps, and the number of video frames to be played in the playback queue to be rendered is less than or equal to 1 frame, it can be determined that the currently decoded video frame satisfies the frame insertion operation condition.
S205:当满足插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和解码视频帧生成虚拟视频帧,并根据解码视频帧更新插帧缓存数据中的参考视频帧。S205: When the frame insertion operation condition is met, generate a virtual video frame according to the reference video frame and the decoded video frame recorded in the frame insertion buffer data, and update the reference video frame in the frame insertion buffer data according to the decoded video frame.
其中,每当生成虚拟视频帧时,可对虚拟视频帧的播放时间进行设置。基于此,在一个实施例中,在将虚拟视频帧和解码视频帧添加至待渲染播放队列中之前,还包括:根据解码视频帧的播放时间与上一个解码视频帧的播放时间确定虚拟视频帧的播放时间。Wherein, whenever a virtual video frame is generated, the playing time of the virtual video frame can be set. Based on this, in one embodiment, before adding the virtual video frame and the decoded video frame to the playback queue to be rendered, it also includes: determining the virtual video frame according to the playback time of the decoded video frame and the playback time of the last decoded video frame playback time.
示例性的,将当前的解码视频帧的播放时间与上一个解码视频帧的播放时间的中间值作为虚拟视频帧的播放时间。渲染线程可根据播放时间的先后顺序 先后获取虚拟视频帧和对应解码视频帧进行渲染及播放。Exemplarily, an intermediate value between the playing time of the current decoded video frame and the playing time of the last decoded video frame is used as the playing time of the virtual video frame. The rendering thread can be based on the sequence of playback time The virtual video frame and the corresponding decoded video frame are successively acquired for rendering and playback.
S206:将虚拟视频帧和解码视频帧添加至待渲染播放队列中。S206: Add the virtual video frame and the decoded video frame to a playback queue to be rendered.
上述,通过从待解码队列中获取待解码视频帧进行解码得到解码视频帧,并根据设定播放帧率影响参数判断是否满足插帧操作条件,并在满足插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和解码视频帧生成虚拟视频帧,并根据解码视频帧更新插帧缓存数据中的参考视频帧,为下一次插帧操作做准备,然后将虚拟视频帧和解码视频帧添加至待渲染播放队列中,增加待渲染播放队列中等待渲染显示的视频帧,有效提升视频播放帧率,优化用户体验。同时,根据视频接收帧率和/或待渲染播放队列中待播放视频帧数量判断当前的解码视频帧是否满足插帧操作条件,有效减少不必要的虚拟视频帧的生成和待渲染播放队列的缓存堆积的情况,提高视频的播放流畅度。并可将本方案提供的视频处理方法配置在系统后台进行,在检测到满足插帧操作条件时自动启动插帧功能,无需与用户进行交互确认,优化用户体验。并且在解码视频帧的分辨率发生变化或者接收到首帧视频帧时,利用当前解码视频帧更新插帧缓存数据中记录的参考视频帧或初始化插帧控制器,保证下一次生成正确的额虚拟视频帧,保证插帧后的视频播放效果。As mentioned above, the decoded video frame is obtained by obtaining the video frame to be decoded from the queue to be decoded, and judges whether the frame insertion operation condition is satisfied according to the set playback frame rate influence parameter, and when the frame insertion operation condition is satisfied, according to the frame insertion buffer The reference video frame and decoded video frame recorded in the data generate a virtual video frame, and update the reference video frame in the interpolation frame buffer data according to the decoded video frame, in preparation for the next frame interpolation operation, and then convert the virtual video frame and the decoded video frame Add it to the playback queue to be rendered, increase the video frames waiting to be rendered and displayed in the playback queue to be rendered, effectively improve the video playback frame rate, and optimize the user experience. At the same time, according to the video receiving frame rate and/or the number of video frames to be played in the playback queue to be rendered, it is judged whether the current decoded video frame meets the frame insertion operation conditions, effectively reducing the generation of unnecessary virtual video frames and the buffering of the playback queue to be rendered In case of accumulation, improve the fluency of video playback. And the video processing method provided by this solution can be configured in the background of the system, and the frame insertion function will be automatically started when it is detected that the frame insertion operation conditions are met, without interactive confirmation with the user, optimizing the user experience. And when the resolution of the decoded video frame changes or when the first video frame is received, use the current decoded video frame to update the reference video frame recorded in the interpolation frame buffer data or initialize the frame interpolation controller to ensure that the next generation of correct virtual Video frame, to ensure the video playback effect after frame insertion.
上述,通过从待解码队列中获取待解码视频帧进行解码得到解码视频帧,并根据设定播放帧率影响参数判断是否满足插帧操作条件,并在满足插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和解码视频帧生成虚拟视频帧,并根据解码视频帧更新插帧缓存数据中的参考视频帧,为下一次插帧操作做准备,然后将虚拟视频帧和解码视频帧添加至待渲染播放队列中,增加待渲染播放队列中等待渲染显示的视频帧,有效提升视频播放帧率,优化用户体验。As mentioned above, the decoded video frame is obtained by obtaining the video frame to be decoded from the queue to be decoded, and judges whether the frame insertion operation condition is satisfied according to the set playback frame rate influence parameter, and when the frame insertion operation condition is satisfied, according to the frame insertion buffer The reference video frame and decoded video frame recorded in the data generate a virtual video frame, and update the reference video frame in the interpolation frame buffer data according to the decoded video frame, in preparation for the next frame interpolation operation, and then convert the virtual video frame and the decoded video frame Add it to the playback queue to be rendered, increase the video frames waiting to be rendered and displayed in the playback queue to be rendered, effectively improve the video playback frame rate, and optimize the user experience.
图4是本申请实施例提供的一种视频处理装置的结构示意图。参考图4,该视频处理装置包括视频获取模块41、插帧判断模块42、插帧操作模块43和渲染推送模块44。Fig. 4 is a schematic structural diagram of a video processing device provided by an embodiment of the present application. Referring to FIG. 4 , the video processing device includes a video acquisition module 41 , a frame insertion judgment module 42 , a frame insertion operation module 43 and a rendering push module 44 .
其中,视频获取模块41,配置为从待解码队列中获取待解码视频帧进行解码得到解码视频帧;插帧判断模块42,配置为根据设定播放帧率影响参数确定是否满足插帧操作条件;插帧操作模块43,配置为当满足插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和解码视频帧生成虚拟视频帧,并根据解码视频帧更新插帧缓存数据中的参考视频帧;渲染推送模块44,配置为将虚拟 视频帧和解码视频帧添加至待渲染播放队列中。Among them, the video acquisition module 41 is configured to obtain the video frame to be decoded from the queue to be decoded and decoded to obtain a decoded video frame; the frame insertion judgment module 42 is configured to determine whether the frame insertion operation condition is satisfied according to the set playback frame rate influencing parameters; The frame insertion operation module 43 is configured to generate a virtual video frame according to the reference video frame and the decoded video frame recorded in the frame insertion buffer data when the frame insertion operation condition is met, and update the reference video in the frame insertion buffer data according to the decoded video frame frame; the rendering push module 44 is configured to virtualize Video frames and decoded video frames are added to the playback queue to be rendered.
在一个实施例中,设定播放帧率影响参数包括视频接收帧率和/或待渲染播放队列中待播放视频帧数量,插帧判断模块42在根据设定播放帧率影响参数确定是否满足插帧操作条件时,配置为:In one embodiment, setting the play frame rate influence parameter includes video reception frame rate and/or the number of video frames to be played in the play queue to be rendered, and the frame insertion judging module 42 determines whether the insertion frame rate is satisfied according to the set play frame rate influence parameter. When the frame operation condition is configured as:
确定视频接收帧率是否在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量是否在设定数量阈值内;Determine whether the video receiving frame rate is within the set frame rate range, and/or whether the number of video frames to be played in the playback queue to be rendered is within the set number threshold;
响应于视频接收帧率在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量在设定数量阈值内,确定满足插帧操作条件;In response to the video receiving frame rate being within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered playback queue being within the set number threshold, it is determined that the frame insertion operation condition is met;
响应于视频接收帧率不在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量不在设定数量阈值内,确定不满足插帧操作条件。In response to the received video frame rate not within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered playback queue not within the set number threshold, it is determined that the frame insertion operation condition is not satisfied.
在一个实施例中,插帧操作模块43还配置为在不满足插帧操作条件时,根据解码视频帧更新插帧缓存数据中的参考视频帧。In one embodiment, the frame insertion operation module 43 is further configured to update the reference video frame in the frame insertion buffer data according to the decoded video frame when the frame insertion operation condition is not met.
在一个实施例中,插帧操作模块43还配置为在视频获取模块41从待解码队列中获取待解码视频帧进行解码得到解码视频帧之后:In one embodiment, the frame insertion operation module 43 is further configured to:
确定解码视频帧与上一个解码视频帧的视频帧变化程度;Determine the degree of video frame change between the decoded video frame and the previous decoded video frame;
当视频帧变化程度达到设定变化阈值时,根据解码视频帧更新插帧缓存数据中记录的参考视频帧。When the change degree of the video frame reaches the set change threshold, the reference video frame recorded in the frame interpolation buffer data is updated according to the decoded video frame.
在一个实施例中,插帧操作模块43在确定解码视频帧与上一个解码视频帧的视频帧变化程度时,配置为:In one embodiment, the frame insertion operation module 43 is configured to:
根据解码视频帧的分辨率与上一个解码视频帧的分辨率变化值确定视频帧变化程度。The video frame change degree is determined according to the resolution change value of the decoded video frame and the resolution of the last decoded video frame.
在一个实施例中,渲染推送模块44还配置为在将虚拟视频帧和解码视频帧添加至待渲染播放队列中之前,根据解码视频帧的播放时间与上一个解码视频帧的播放时间确定虚拟视频帧的播放时间。In one embodiment, the rendering push module 44 is further configured to determine the virtual video frame according to the playback time of the decoded video frame and the playback time of the last decoded video frame before adding the virtual video frame and the decoded video frame to the playback queue to be rendered. The playback time of the frame.
在一个实施例中,视频获取模块41还配置为在从待解码队列中获取待解码视频帧进行解码得到解码视频帧之后,在解码视频帧为首帧视频帧时,开启用于记录插帧缓存数据的内存空间。In one embodiment, the video acquisition module 41 is further configured to, after obtaining the video frame to be decoded from the queue to be decoded and decoded to obtain the decoded video frame, when the decoded video frame is the first video frame, enable the frame insertion buffer data for recording memory space.
本申请实施例还提供了一种视频处理设备,该视频处理设备可集成本申请实施例提供的视频处理装置。图5是本申请实施例提供的一种视频处理设备的结构示意图。参考图5,该视频处理设备包括:输入装置53、输出装置54、存 储器52以及一个或多个处理器51;存储器52,配置为存储一个或多个程序;当一个或多个程序被一个或多个处理器51执行,使得一个或多个处理器51实现如上述实施例提供的视频处理方法。上述提供的视频处理装置、设备和计算机可配置为执行上述任意实施例提供的视频处理方法,具备相应的功能和有益效果。The embodiment of the present application also provides a video processing device, and the video processing device can integrate the video processing device provided in the embodiment of the present application. Fig. 5 is a schematic structural diagram of a video processing device provided by an embodiment of the present application. With reference to Fig. 5, this video processing equipment comprises: input device 53, output device 54, memory A memory 52 and one or more processors 51; the memory 52 is configured to store one or more programs; when one or more programs are executed by one or more processors 51, the one or more processors 51 are implemented as The video processing method provided in the foregoing embodiments. The video processing apparatus, equipment, and computer provided above can be configured to execute the video processing method provided in any of the above embodiments, and have corresponding functions and beneficial effects.
本申请实施例还提供一种包含计算机可执行指令的存储介质,计算机可执行指令在由计算机处理器执行时配置为执行如上述实施例提供的视频处理方法。当然,本申请实施例所提供的一种包含计算机可执行指令的存储介质,其计算机可执行指令不限于如上提供的视频处理方法,还可以执行本申请任意实施例所提供的视频处理方法中的相关操作。上述实施例中提供的视频处理装置、设备及存储介质可执行本申请任意实施例所提供的视频处理方法,未在上述实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的视频处理方法。The embodiment of the present application also provides a storage medium containing computer-executable instructions, and the computer-executable instructions are configured to execute the video processing method provided in the foregoing embodiments when executed by a computer processor. Certainly, a storage medium containing computer-executable instructions provided in the embodiments of the present application, the computer-executable instructions are not limited to the video processing method provided above, and may also execute the video processing method provided in any embodiment of the present application. related operations. The video processing device, equipment, and storage medium provided in the above-mentioned embodiments can execute the video processing method provided in any embodiment of the present application. For technical details not described in detail in the above-mentioned embodiments, please refer to the Video processing method.
在上述实施例的基础上,本申请实施例还提供一种计算机程序产品,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机程序产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备、移动终端或其中的处理器执行本申请各个实施例所提供的视频处理方法的全部或部分步骤。On the basis of the above-mentioned embodiments, the embodiments of the present application also provide a computer program product. The technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be implemented as a software product The computer program product is stored in a storage medium, and includes several instructions to make a computer device, a mobile terminal or a processor therein execute all or part of the video processing methods provided by various embodiments of the present application step.
上述仅为本申请的较佳实施例及所运用的技术原理。本申请不限于这里提供的特定实施例,对本领域技术人员来说能够进行的各种明显变化、重新调整及替代均不会脱离本申请的保护范围。因此,虽然通过以上实施例对本申请进行了较为详细的说明,但是本申请不仅仅限于以上实施例,在不脱离本申请构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由权利要求的范围决定。 The above are only preferred embodiments of the present application and the applied technical principles. The present application is not limited to the specific embodiments provided here, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not depart from the protection scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and can also include more other equivalent embodiments without departing from the concept of the present application, and the present application The scope is determined by the scope of the claims.

Claims (11)

  1. 一种视频处理方法,其特征在于,包括:A video processing method, characterized in that, comprising:
    从待解码队列中获取待解码视频帧进行解码得到解码视频帧;Obtain the video frame to be decoded from the queue to be decoded and decode to obtain the decoded video frame;
    根据设定播放帧率影响参数确定是否满足插帧操作条件;Determine whether the frame insertion operation condition is satisfied according to the set playback frame rate influencing parameters;
    当满足所述插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和所述解码视频帧生成虚拟视频帧,并根据所述解码视频帧更新所述插帧缓存数据中的所述参考视频帧;When the frame insertion operation condition is met, generate a virtual video frame according to the reference video frame recorded in the frame insertion buffer data and the decoded video frame, and update the frame insertion buffer data according to the decoded video frame reference video frame;
    将所述虚拟视频帧和所述解码视频帧添加至待渲染播放队列中。Adding the virtual video frame and the decoded video frame to a playback queue to be rendered.
  2. 根据权利要求1所述的视频处理方法,其特征在于,所述设定播放帧率影响参数包括视频接收帧率和/或待渲染播放队列中待播放视频帧数量,所述根据设定播放帧率影响参数确定是否满足插帧操作条件,包括:The video processing method according to claim 1, wherein the parameters affecting the set playback frame rate include video receiving frame rate and/or the number of video frames to be played in the playback queue to be rendered, and the playback frame according to the set Rate-affecting parameters determine whether frame insertion operation conditions are met, including:
    确定视频接收帧率是否在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量是否在设定数量阈值内;Determine whether the video receiving frame rate is within the set frame rate range, and/or whether the number of video frames to be played in the playback queue to be rendered is within the set number threshold;
    响应于视频接收帧率在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量在设定数量阈值内,确定满足所述插帧操作条件;In response to the video receiving frame rate being within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered playback queue being within the set number threshold, determining that the frame insertion operation condition is satisfied;
    响应于视频接收帧率不在设定帧率范围内,和/或待渲染播放队列中的待播放视频帧数量不在设定数量阈值内,确定不满足所述插帧操作条件。In response to the received video frame rate not within the set frame rate range, and/or the number of video frames to be played in the to-be-rendered play queue not within the set number threshold, it is determined that the frame insertion operation condition is not met.
  3. 根据权利要求1所述的视频处理方法,其特征在于,所述方法还包括:The video processing method according to claim 1, wherein the method further comprises:
    在不满足所述插帧操作条件时,根据所述解码视频帧更新所述插帧缓存数据中的所述参考视频帧。When the frame insertion operation condition is not satisfied, the reference video frame in the frame insertion buffer data is updated according to the decoded video frame.
  4. 根据权利要求1所述的视频处理方法,其特征在于,所述从待解码队列中获取待解码视频帧进行解码得到解码视频帧之后,还包括:The video processing method according to claim 1, wherein after obtaining the video frame to be decoded from the queue to be decoded and decoding to obtain the decoded video frame, further comprising:
    确定所述解码视频帧与上一个解码视频帧的视频帧变化程度;Determine the video frame change degree between the decoded video frame and the previous decoded video frame;
    当所述视频帧变化程度达到设定变化阈值时,根据所述解码视频帧更新插帧缓存数据中记录的参考视频帧。When the degree of change of the video frame reaches the set change threshold, the reference video frame recorded in the frame interpolation buffer data is updated according to the decoded video frame.
  5. 根据权利要求4所述的视频处理方法,其特征在于,所述确定所述解码视频帧与上一个解码视频帧的视频帧变化程度,包括:The video processing method according to claim 4, wherein the determination of the degree of change in the video frame between the decoded video frame and the last decoded video frame comprises:
    根据所述解码视频帧的分辨率与上一个解码视频帧的分辨率变化值确定视频帧变化程度。The video frame change degree is determined according to the resolution change value of the decoded video frame and the resolution of the last decoded video frame.
  6. 根据权利要求1所述的视频处理方法,其特征在于,所述将所述虚拟视频帧和所述解码视频帧添加至待渲染播放队列中之前,还包括:The video processing method according to claim 1, wherein before adding the virtual video frame and the decoded video frame to the playback queue to be rendered, further comprising:
    根据所述解码视频帧的播放时间与上一个解码视频帧的播放时间确定所述 虚拟视频帧的播放时间。Determine the said The playback time of the virtual video frame.
  7. 根据权利要求1所述的视频处理方法,其特征在于,所述从待解码队列中获取待解码视频帧进行解码得到解码视频帧之后,还包括:The video processing method according to claim 1, wherein after obtaining the video frame to be decoded from the queue to be decoded and decoding to obtain the decoded video frame, further comprising:
    在所述解码视频帧为首帧视频帧时,开启用于记录插帧缓存数据的内存空间。When the decoded video frame is the first video frame, a memory space for recording frame insertion buffer data is opened.
  8. 一种视频处理装置,其特征在于,包括视频获取模块、插帧判断模块、插帧操作模块和渲染推送模块,其中:A video processing device, characterized in that it includes a video acquisition module, a frame insertion judgment module, a frame insertion operation module, and a rendering push module, wherein:
    所述视频获取模块,配置为从待解码队列中获取待解码视频帧进行解码得到解码视频帧;The video acquisition module is configured to obtain a video frame to be decoded from the queue to be decoded and decode it to obtain a decoded video frame;
    所述插帧判断模块,配置为根据设定播放帧率影响参数确定是否满足插帧操作条件;The frame insertion judging module is configured to determine whether the frame insertion operation condition is satisfied according to the set playback frame rate influencing parameters;
    所述插帧操作模块,配置为当满足所述插帧操作条件时,根据插帧缓存数据中记录的参考视频帧和所述解码视频帧生成虚拟视频帧,并根据所述解码视频帧更新所述插帧缓存数据中的所述参考视频帧;The frame insertion operation module is configured to generate a virtual video frame according to the reference video frame recorded in the frame insertion buffer data and the decoded video frame when the frame insertion operation condition is met, and update the virtual video frame according to the decoded video frame The reference video frame in the interpolation frame buffer data;
    所述渲染推送模块,配置为将所述虚拟视频帧和所述解码视频帧添加至待渲染播放队列中。The rendering push module is configured to add the virtual video frame and the decoded video frame to a playback queue to be rendered.
  9. 一种视频处理设备,其特征在于,包括:存储器以及一个或多个处理器;A video processing device, characterized in that it includes: a memory and one or more processors;
    所述存储器,配置为存储一个或多个程序;the memory configured to store one or more programs;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7任一项所述的视频处理方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the video processing method according to any one of claims 1-7.
  10. 一种包含计算机可执行指令的存储介质,其特征在于,所述计算机可执行指令在由计算机处理器执行时配置为执行如权利要求1-7任一项所述的视频处理方法。A storage medium containing computer-executable instructions, wherein the computer-executable instructions are configured to execute the video processing method according to any one of claims 1-7 when executed by a computer processor.
  11. 一种计算机程序产品,包括计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-7任一项所述的视频处理方法。 A computer program product, comprising a computer program, characterized in that, when the computer program is executed by a processor, the video processing method according to any one of claims 1-7 is implemented.
PCT/CN2023/074054 2022-02-10 2023-01-31 Video processing method, apparatus and device, and storage medium WO2023151489A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210126871.2 2022-02-10
CN202210126871.2A CN114584835B (en) 2022-02-10 2022-02-10 Video processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2023151489A1 true WO2023151489A1 (en) 2023-08-17

Family

ID=81770180

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/074054 WO2023151489A1 (en) 2022-02-10 2023-01-31 Video processing method, apparatus and device, and storage medium

Country Status (2)

Country Link
CN (1) CN114584835B (en)
WO (1) WO2023151489A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114584835B (en) * 2022-02-10 2024-04-02 百果园技术(新加坡)有限公司 Video processing method, device, equipment and storage medium
CN116684668B (en) * 2023-08-03 2023-10-20 湖南马栏山视频先进技术研究院有限公司 Self-adaptive video frame processing method and playing terminal

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070014531A1 (en) * 2005-07-15 2007-01-18 Streaming Networks (Pvt.) Ltd. Method and system for providing instant reverse play
CN106603543A (en) * 2016-12-22 2017-04-26 努比亚技术有限公司 Corrected streaming media audio and video synchronizing method and apparatus
CN110881136A (en) * 2019-11-14 2020-03-13 腾讯科技(深圳)有限公司 Video frame rate control method and device, computer equipment and storage medium
CN111131874A (en) * 2018-11-01 2020-05-08 珠海格力电器股份有限公司 Method and equipment for solving problem of H.256 code stream random access point playing jam
CN111641828A (en) * 2020-05-16 2020-09-08 Oppo广东移动通信有限公司 Video processing method and device, storage medium and electronic equipment
CN112422873A (en) * 2020-11-30 2021-02-26 Oppo(重庆)智能科技有限公司 Frame insertion method and device, electronic equipment and storage medium
CN114584835A (en) * 2022-02-10 2022-06-03 百果园技术(新加坡)有限公司 Video processing method, device, equipment and storage medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101287120B (en) * 2008-05-22 2010-10-20 腾讯科技(深圳)有限公司 Method for video sequence generating and coding the video sequence
KR102383117B1 (en) * 2017-07-21 2022-04-06 삼성전자주식회사 Display apparatus, display method and display system
CN108810281B (en) * 2018-06-22 2020-12-11 Oppo广东移动通信有限公司 Lost frame compensation method, lost frame compensation device, storage medium and terminal
CN110933315B (en) * 2019-12-10 2021-09-07 Oppo广东移动通信有限公司 Image data processing method and related equipment
CN113225619A (en) * 2021-04-23 2021-08-06 深圳创维-Rgb电子有限公司 Frame rate self-adaption method, device, equipment and readable storage medium
CN113727185B (en) * 2021-08-20 2024-04-02 百果园技术(新加坡)有限公司 Video frame playing method and system
CN114025202B (en) * 2021-11-03 2024-05-07 抖音视界有限公司 Video processing method, device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070014531A1 (en) * 2005-07-15 2007-01-18 Streaming Networks (Pvt.) Ltd. Method and system for providing instant reverse play
CN106603543A (en) * 2016-12-22 2017-04-26 努比亚技术有限公司 Corrected streaming media audio and video synchronizing method and apparatus
CN111131874A (en) * 2018-11-01 2020-05-08 珠海格力电器股份有限公司 Method and equipment for solving problem of H.256 code stream random access point playing jam
CN110881136A (en) * 2019-11-14 2020-03-13 腾讯科技(深圳)有限公司 Video frame rate control method and device, computer equipment and storage medium
CN111641828A (en) * 2020-05-16 2020-09-08 Oppo广东移动通信有限公司 Video processing method and device, storage medium and electronic equipment
CN112422873A (en) * 2020-11-30 2021-02-26 Oppo(重庆)智能科技有限公司 Frame insertion method and device, electronic equipment and storage medium
CN114584835A (en) * 2022-02-10 2022-06-03 百果园技术(新加坡)有限公司 Video processing method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN114584835A (en) 2022-06-03
CN114584835B (en) 2024-04-02

Similar Documents

Publication Publication Date Title
WO2023151489A1 (en) Video processing method, apparatus and device, and storage medium
CN111882626B (en) Image processing method, device, server and medium
US8670072B1 (en) Method and apparatus for streaming media data processing, and streaming media playback equipment
WO2017219896A1 (en) Method and device for transmitting video stream
CN111135569A (en) Cloud game processing method and device, storage medium and electronic equipment
US9363187B2 (en) Jitter buffering system and method of jitter buffering
US11217279B2 (en) Method and device for adjusting video playback speed
EP2757779A2 (en) Method and terminal for video processing
US9819715B2 (en) Client side control of adaptive streaming
US20220124403A1 (en) Seamless switching method, device and storage medium of software and hardware decoding resolution
US20180192090A1 (en) Method of implementing audio and video live broadcast and server
EP3899928B1 (en) Conditional forward error correction for network data
US11356739B2 (en) Video playback method, terminal apparatus, and storage medium
US10701124B1 (en) Handling timestamp inaccuracies for streaming network protocols
TWI663875B (en) Video processing method and device thereof
WO2020131594A1 (en) Combined forward and backward extrapolation of lost network data
CN104053002A (en) Video decoding method and device
CN115150638A (en) Data transmission method, device, equipment and storage medium based on cloud desktop
CN113727185A (en) Video frame playing method and system
CN109587555B (en) Video processing method and device, electronic equipment and storage medium
US20240040147A1 (en) Data processing method and apparatus, computer device, and storage medium
WO2021120124A1 (en) Method and apparatus for video display, and computer storage medium
CN115225902A (en) High-resolution VR cloud game solution method based on scatter coding and computer equipment
US10826838B2 (en) Synchronized jitter buffers to handle codec switches
CN115380487A (en) Data transmission method, sending equipment and receiving equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23752269

Country of ref document: EP

Kind code of ref document: A1