Video processing method, device, equipment and storage medium
By filtering keyframes in the video picture group sequence, the problem of lag when the fast live video starts is solved, and a more efficient video frame delivery and smooth playback experience is achieved.
Patent Information
- Application Number
- CN202211431262.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-14
- Publication Date
- 2025-08-26
- Estimated Expiration
- 2042-11-14
AI Technical Summary
In fast live broadcast technology, existing video playback methods lead to lag, especially when video starts broadcasting, the difference in frames is ignored due to fixed speed delivery, resulting in a decline in user experience.
By determining multiple cached picture group sequences when the video starts broadcast, and determining the target frame skipping action set based on the status and frame skipping action, filtering out the keyframe sequence, retaining video frames with larger scene changes, and discarding video frames with smaller scene changes, so as to realize the issuance of the keyframe sequence.
It improves the efficiency of video frame delivery and playback fluency, avoids lag caused by large changes in the picture scene, and improves the user experience.
Smart Images

Figure CN115866330B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a video processing method, apparatus, device and storage medium. Background Art
[0002] In fast live broadcast technology, it is necessary to pre-cache GOP (Group of Pictures) to ensure fast playback. In order to avoid a black screen when starting broadcasting, the method of pre-caching GOP in CDN (Content Delivery Network) is usually adopted to ensure that the first frame of the cached content is an I frame; but this method will increase network latency, so when the playback end requests data, CDN is required to quickly deliver the cached GOP data, that is, to perform fast-forward processing. Currently, fast-forward processing is mainly achieved by high-speed delivery and random frame discarding. However, the frames are delivered at a fixed speed according to the set speed, and all frames are treated indiscriminately. In some scenarios, this will cause freezes and reduce the user-side viewing experience. Summary of the Invention
[0003] The main purpose of the present invention is to provide a video processing method, device, equipment and storage medium, aiming to solve the problem of how to improve the video playback freeze problem.
[0004] To achieve the above object, the present invention provides a video processing method, which includes the following steps:
[0005] When a video starts playing, multiple cached picture group sequences of the video are determined, and each video frame in each cached picture group sequence is used as a state, and a frame skipping action of the state is determined according to the number of frame skipping frames corresponding to the state;
[0006] Determine a target frame skipping action set corresponding to each cached picture group sequence according to the state and the frame skipping action;
[0007] A key frame sequence of each of the cached picture group sequences is determined according to the target frame skipping action set, and the key frame sequence is sent to a playback terminal.
[0008] Optionally, the step of determining a target frame skipping action set corresponding to each cached picture group sequence according to the state and the frame skipping action includes:
[0009] Determining, according to the state and the frame skipping action, a plurality of sets of frame skipping actions corresponding to each buffered group of picture sequence;
[0010] Determining a cumulative reward value for each frame skipping action set according to the reward value of each frame skipping action in each frame skipping action set;
[0011] The target frame skipping action set is determined according to the frame skipping action set with the largest cumulative reward value.
[0012] Optionally, the step of determining the target frame skipping action set according to the frame skipping action set with the largest cumulative reward value includes:
[0013] Constructing a Q value table corresponding to the frame skipping action set with the largest cumulative reward value, wherein the Q value table includes an initial Q value of each frame skipping action;
[0014] Updating the Q value table according to a preset attenuation factor, a preset learning rate, an initial Q value of each frame skipping action, and a reward value of each frame skipping action;
[0015] The target frame skipping action set is determined according to the updated Q value table.
[0016] Optionally, the step of updating the Q value table according to a preset attenuation factor, a preset learning rate, an initial Q value of each frame skipping action, and a reward value of each frame skipping action includes:
[0017] Determine the maximum initial Q value of the next frame skipping action of the frame skipping action according to the Q value table;
[0018] Determine a gap value according to the initial Q value of the frame skipping action, the maximum initial Q value, and the reward value corresponding to the frame skipping action;
[0019] The initial Q value of the frame skipping action in the Q value table is updated according to the initial Q value of the frame skipping action and the gap value.
[0020] Optionally, the method further includes:
[0021] determining an action score for each frame skipping action according to each frame skipping action and a time interval between video frames skipped by each frame skipping action;
[0022] Get user experience quality score;
[0023] A reward value for each frame skipping action is determined according to the action score and the quality score.
[0024] Optionally, the step of sending the key frame sequence to the playback terminal includes:
[0025] Determining whether the first video frame of the key frame sequence is the first video frame of the picture group sequence;
[0026] If so, the key frame sequence is sent to the playback terminal.
[0027] Optionally, before the step of determining a plurality of cached group-of-picture sequences of the video when the video starts playing, the method further includes:
[0028] Store the uploaded video frames in the cache queue;
[0029] Determining whether the number of GOP sequences stored in the cache queue is greater than a preset number;
[0030] If so, the GOP sequence with the earliest timestamp in the cache queue is deleted.
[0031] To achieve the above object, the present invention further provides a video processing device, comprising:
[0032] a determination module, configured to determine, when a video starts playing, multiple cached picture group sequences of the video, and use each video frame in each cached picture group sequence as a state, and determine a frame skipping action for the state according to a frame skipping number corresponding to the state;
[0033] a prediction module, configured to determine a target frame skipping action set corresponding to each cached picture group sequence according to the state and the frame skipping action;
[0034] The processing module is configured to determine a key frame sequence of each of the cached picture group sequences according to the target frame skipping action set, and send the key frame sequence to a playback terminal.
[0035] To achieve the above objectives, the present invention also provides a video processing device, which includes a memory, a processor, and a video processing program stored in the memory and executable on the processor. When the video processing program is executed by the processor, the various steps of the video processing method described above are implemented.
[0036] To achieve the above object, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a video processing program, and when the video processing program is executed by a processor, the various steps of the video processing method described above are implemented.
[0037] The present invention provides a video processing method, device, equipment and storage medium. When a video starts playing, multiple cached picture group sequences of the video are determined, and each video frame in each cached picture group sequence is used as a state. The frame skipping action of the state is determined according to the number of frame skipping frames corresponding to the state; a target frame skipping action set corresponding to each cached picture group sequence is determined according to the state and the frame skipping action; a key frame sequence of each cached picture group sequence is determined according to the target frame skipping action set, and the key frame sequence is sent to the playback terminal. When the video starts playing, the target frame skipping action set is determined, thereby determining the key frame sequence of the picture group sequence, and the video frames in each picture group sequence are screened, retaining video frames with large scene changes, and discarding video frames with small scene changes. The key frame sequence is sent to the playback terminal, thereby playing the video and preventing the playback terminal from experiencing screen freezes due to large scene changes, thereby improving the efficiency of video frame delivery and the smoothness of video playback. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 Schematic diagram of the hardware structure of a video processing device involved in an embodiment of the present invention;
[0039] Figure 2 1 is a flow chart of a first embodiment of a video processing method according to the present invention;
[0040] Figure 3 Schematic diagram of the Markov decision process of the video processing method of the present invention;
[0041] Figure 4 4 is a detailed flowchart of step S20 of the second embodiment of the video processing method of the present invention;
[0042] Figure 5 4 is a detailed flowchart of step S21 of the third embodiment of the video processing method of the present invention;
[0043] Figure 6 Schematic diagram of the logical structure of a video processing device according to an embodiment of the present invention.
[0044] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0045] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0046] The main solution of the embodiment of the present invention is: when the video starts playing, multiple cached picture group sequences of the video are determined, and each video frame in each cached picture group sequence is used as a state, and the frame skipping action of the state is determined according to the number of frame skipping frames corresponding to the state; the target frame skipping action set corresponding to each cached picture group sequence is determined according to the state and the frame skipping action; the key frame sequence of each cached picture group sequence is determined according to the target frame skipping action set, and the key frame sequence is sent to the playback terminal.
[0047] When the video starts playing, the target frame skipping action set is determined to determine the key frame sequence of the picture group sequence, so that the video frames in each picture group sequence are screened, the video frames with large scene changes are retained, and the video frames with small scene changes are discarded. The key frame sequence is sent to the playback terminal, which realizes the playback of the video and prevents the playback terminal from experiencing screen freezes caused by large changes in the scene, thereby improving the efficiency of video frame delivery and the smoothness of video playback.
[0048] As an implementation solution, the video processing device can be as follows Figure 1 shown.
[0049] The embodiment of the present invention relates to a video processing device, which includes a processor 101, such as a CPU, a memory 102, and a communication bus 103. The communication bus 103 is used to implement connection and communication between these components.
[0050] The memory 102 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. Figure 1 As shown, the memory 102 as a computer-readable storage medium may include a video processing program; and the processor 101 may be used to call the video processing program stored in the memory 102 and perform the following operations:
[0051] When a video starts playing, multiple cached picture group sequences of the video are determined, and each video frame in each cached picture group sequence is used as a state, and a frame skipping action of the state is determined according to the number of frame skipping frames corresponding to the state;
[0052] Determine a target frame skipping action set corresponding to each cached picture group sequence according to the state and the frame skipping action;
[0053] A key frame sequence of each of the cached picture group sequences is determined according to the target frame skipping action set, and the key frame sequence is sent to a playback terminal.
[0054] Optionally, the processor 101 may be configured to call a video processing program stored in the memory 102 and perform the following operations:
[0055] Determining, according to the state and the frame skipping action, a plurality of sets of frame skipping actions corresponding to each buffered group of picture sequence;
[0056] Determining a cumulative reward value for each frame skipping action set according to the reward value of each frame skipping action in each frame skipping action set;
[0057] The target frame skipping action set is determined according to the frame skipping action set with the largest cumulative reward value.
[0058] Optionally, the processor 101 may be configured to call a video processing program stored in the memory 102 and perform the following operations:
[0059] Constructing a Q value table corresponding to the frame skipping action set with the largest cumulative reward value, wherein the Q value table includes an initial Q value of each frame skipping action;
[0060] Updating the Q value table according to a preset attenuation factor, a preset learning rate, an initial Q value of each frame skipping action, and a reward value of each frame skipping action;
[0061] The target frame skipping action set is determined according to the updated Q value table.
[0062] Optionally, the processor 101 may be configured to call a video processing program stored in the memory 102 and perform the following operations:
[0063] Determine the maximum initial Q value of the next frame skipping action of the frame skipping action according to the Q value table;
[0064] Determine a gap value according to the initial Q value of the frame skipping action, the maximum initial Q value, and the reward value corresponding to the frame skipping action;
[0065] The initial Q value of the frame skipping action in the Q value table is updated according to the initial Q value of the frame skipping action and the gap value.
[0066] Optionally, the processor 101 may be configured to call a video processing program stored in the memory 102 and perform the following operations:
[0067] determining an action score for each frame skipping action according to each frame skipping action and a time interval between video frames skipped by each frame skipping action;
[0068] Get user experience quality score;
[0069] A reward value for each frame skipping operation is determined according to the action score and the quality score.
[0070] Optionally, the processor 101 may be configured to call a video processing program stored in the memory 102 and perform the following operations:
[0071] Determining whether the first video frame of the key frame sequence is the first video frame of the picture group sequence;
[0072] If so, the key frame sequence is sent to the playback terminal.
[0073] Optionally, the processor 101 may be configured to call a video processing program stored in the memory 102 and perform the following operations:
[0074] Store the uploaded video frames in the cache queue;
[0075] Determining whether the number of GOP sequences stored in the cache queue is greater than a preset number;
[0076] If so, the GOP sequence with the earliest timestamp in the cache queue is deleted.
[0077] Based on the hardware architecture of the above video processing device, an embodiment of the video processing method of the present invention is proposed.
[0078] Reference Figure 2 , Figure 2 This is a first embodiment of the video processing method of the present invention, and the video processing method includes the following steps:
[0079] Step S10: When the video starts playing, multiple cached picture group sequences of the video are determined, and each video frame in each cached picture group sequence is used as a state, and a frame skipping action of the state is determined according to the frame skipping number corresponding to the state.
[0080] Optionally, when a video starts playing, the video's GOP (Group of Pictures) sequence is cached. To ensure fast playback and a black screen at startup, the first frame in the GOP sequence cache is an I-frame, and the remaining frames in the GOP sequence can be I-frames, B-frames, or P-frames. Caching the video's GOP sequence allows for fast playback, but it also increases network latency. Therefore, after the video starts playing, the cached frames need to be delivered quickly.
[0081] Optionally, the process of GOP cache delivery is abstracted into a Markov decision process, which consists of four elements: the state of the GOP sequence, the frame skipping action, the reward, and the transfer strategy.
[0082] Each video frame in the GOP sequence is represented as a state in the Markov decision process, that is, any video frame in the GOP sequence is a state, and the state is represented by a feature vector of the video frame.
[0083] The frame skipping action corresponding to the state is represented as an action in the Markov decision process. In a certain state, the frame skipping action includes whether it is necessary to skip video frames and the number of frame skipping frames, wherein when it is not necessary to skip video frames, the number of frame skipping frames is 0. The frame skipping action from the state can be represented by a set of discrete numerical values. Different frame skipping actions correspond to different states. For example, the current state is s1, the number of frame skipping frames corresponding to the frame skipping action is 2, and the frame skipping action is executed to skip frames from the current state s1 to state s3; the current state is s1, the number of frame skipping frames corresponding to the frame skipping action is 5, and the frame skipping action is executed to skip frames from the current state s1 to state s6. Optionally, the frame skipping action corresponding to the state is determined according to the number of frame skipping frames corresponding to the state. For example, if the current state is s k , the next state is s k+1 , according to the current state s k The corresponding number of skipped frames determines the frame skipping action a k , execute frame skip action a k From the current state k Jump to the next state s k+1 .
[0084] The reward value is the feedback received when a frame skipping action is taken and the state transitions to another state. The reward value is determined by the reward function. Optionally, the QoE (Quality of Experience) function is used as the reward function of the Markov decision process. Figure 3 As shown, s k Indicates the state of the k-th GOP sequence. k It represents the frame skipping action made according to the current state. The discrete action space A corresponding to the frame skipping action is A={a1,a2,......,a k}. r k Reward value, r k =r(s k ,a k ,s k+1 ) indicates that the system is in state s k When you select action a k By state s k Transfer to state s k+1 The rewards obtained when.
[0085] Optionally, before step S10, the method further includes: storing the uploaded video frames in a cache queue; determining whether the number of picture group sequences stored in the cache queue is greater than a preset number; if so, deleting the picture group sequence with the earliest timestamp in the cache queue to avoid a large number of picture group sequences to be delivered, which increases the delay in video frame delivery; if not, executing step S10.
[0086] Step S20 : determining a target frame skipping action set corresponding to each cached picture group sequence according to the state and the frame skipping action.
[0087] Optionally, in order to quickly deliver the cached video frames to the playback terminal, it is necessary to filter the video frames in each picture group sequence, retain the important video frames, and discard the unimportant video frames. Since different content scenes have different sensitivities to video delivery, if the video frame is in a scene with little change, the impact of skipping the video frame is small. If the video frame is in a scene with large changes, the impact of skipping the cached video frame is large. Therefore, it is necessary to filter the video frames in each picture group sequence, retain the video frames with large scene changes, and discard the video frames with small scene changes.
[0088] To determine the key frame sequence for each GOP sequence, a frame skipping action is performed on each GOP sequence to select the key frame sequence. The frame skipping action includes a frame skipping number, where the frame skipping number is the number of video frames skipped when skipping from the current video frame to the target video frame. For example, a GOP sequence includes video frames s1, s2, and s3. A frame skipping action is performed on video frame s1, and the corresponding frame skipping number is 1. Therefore, the video frame skips from s1 to s3.
[0089] When the video starts playing, the target frame skipping action set of each cached picture group sequence is determined, wherein the target frame skipping action set is a set of frame skipping actions corresponding to the state of the picture group sequence, that is, a set of frame skipping actions from the first frame to the last frame of the picture group sequence. The target frame skipping action set includes multiple sets of frame skipping actions, and the frame skipping action is to skip from the previous video frame in the picture group sequence to the next video frame. For example, the target frame skipping action set corresponding to the picture group sequence includes frame skipping actions a1 to am, wherein a1 is a frame skipping from state s1 to state s i1 , a2 is from state s i1 Jump frame to state s i2 , and so on, am is from state s i,m-1 Jump frame to state s im , skipping to the last frame or ending the frame skipping action when the last frame skipping action is performed.
[0090] Step S30 : determining a key frame sequence of each of the cached picture group sequences according to the target frame skipping action set, and sending the key frame sequence to a playback terminal.
[0091] Optionally, the key frame sequence includes key video frames in the GOP sequence, and the video content corresponding to the key frame sequence includes the key video content of the GOP sequence. The number of video frames in the key frame sequence is smaller than the number of video frames in the GOP sequence.
[0092] Optionally, when a frame skipping action in a target frame skipping action set is executed in a group of pictures sequence, a key frame sequence corresponding to the group of pictures sequence is obtained. Exemplarily, the video frames of the group of pictures sequence are video frames s1, s2, ..., s6, and the frame skipping actions are a1, ..., a3, where frame skipping action a1 includes skipping from video frame s1 to video frame s3, and frame skipping action a2 includes skipping from video frame s3 to video frame s6. The key frame sequence obtained for the group of pictures sequence is video frames s1, video frame s3, and video frame s6.
[0093] Optionally, determine whether the first video frame of the key frame sequence is the first video frame of the picture group sequence; if so, send the key frame sequence to the playback terminal; if not, discard the currently determined key frame sequence, or re-determine the key frame sequence of the cached picture group sequence.
[0094] In the technical solution of this embodiment, when the video starts playing, the target frame skipping action set is determined to determine the key frame sequence of the picture group sequence, so that the video frames in each picture group sequence are screened, the video frames with larger scene changes are retained, and the video frames with smaller scene changes are discarded. The key frame sequence is sent to the playback terminal, thereby realizing the playback of the video and preventing the playback terminal from experiencing screen freezes caused by large changes in the scene, thereby improving the efficiency of video frame delivery and the smoothness of video playback.
[0095] Reference Figure 4 , Figure 4 This is a second embodiment of the video processing method of the present invention, based on the first embodiment, and step S20 includes:
[0096] Step S21, determining a plurality of frame skipping action sets corresponding to each buffered picture group sequence according to the state and the frame skipping action;
[0097] Step S22, determining a cumulative reward value for each frame skipping action set according to the reward value of each frame skipping action in each frame skipping action set;
[0098] Step S23 : determining the target frame skipping action set according to the frame skipping action set with the largest cumulative reward value.
[0099] Optionally, each cached picture group sequence can correspond to multiple sets of frame skipping actions. Different frame skipping action sets have different cumulative reward values, and different frame skipping action sets determine different key frame sequences. A larger cumulative reward value indicates better video playback and a higher user experience. Therefore, it is necessary to determine the frame skipping action set with the highest cumulative reward value, i.e., the target frame skipping action set.
[0100] Optionally, for each frame skipping action set, the cumulative reward value of the frame skipping action set is determined based on the reward value of each frame skipping action in the frame skipping action set. Optionally, the calculation formula of the cumulative reward value R is as follows:
[0101]
[0102] Among them, r k represents the reward value corresponding to the k-th frame skipping action, r k =r(s k ,a k ,s k+1 ) indicates that the system is in state s k When you select action a k , the state is determined by s k Transfer to s k+1 The reward obtained when , γ∈[0,1] represents the attenuation factor of the reward value. The attenuation factor determines the importance of the rewards between adjacent states to the current state. The farther the distance, the smaller the impact on the current reward.
[0103] Multiple sets of frame skipping actions corresponding to each cached picture group sequence are determined. Different frame skipping action sets have different cumulative reward values, and different frame skipping action sets determine different key frame sequences. Therefore, it is necessary to determine the cumulative reward value corresponding to each frame skipping action set. The target frame skipping action set is determined based on the frame skipping action set with the largest cumulative reward value. A larger cumulative reward value indicates better video playback and a higher user experience.
[0104] Optionally, the target frame skipping action set is determined based on the frame skipping action set with the largest cumulative reward value. Optionally, the target frame skipping action set is determined based on the transfer strategy π. Exemplarily, the calculation formula of the transfer strategy π is as follows:
[0105]
[0106] Where R is the cumulative reward value, and the arg function is used to determine the transition strategy π corresponding to the maximum cumulative reward value. The transition strategy π includes the frame skipping actions selected in each state to maximize the expected cumulative reward value.
[0107] In the technical solution of this embodiment, by determining the frame skipping action set with the largest cumulative reward value, the target frame skipping action set is determined, so that the subsequently determined key frame sequence is more accurate, and the video frames in each picture group sequence are screened, retaining the video frames with larger scene changes and discarding the video frames with smaller scene changes, thereby improving the smoothness of video playback and reducing the delay of video playback.
[0108] Reference Figure 5 , Figure 5This is a third embodiment of the video processing method of the present invention, based on the first or second embodiment, step S23 includes:
[0109] Step S231, constructing a Q value table corresponding to the frame skipping action set with the largest cumulative reward value, wherein the Q value table includes an initial Q value of each frame skipping action;
[0110] Step S232, updating the Q value table according to a preset attenuation factor, a preset learning rate, an initial Q value of each frame skipping action, and a reward value of each frame skipping action;
[0111] Step S233: Determine the target frame skipping action set according to the updated Q value table.
[0112] Optionally, a reward value for each frame skipping action is determined based on the action score and the quality score. The calculation formula of the reward value is as follows:
[0113] r k =-skip k +QoE k ;
[0114] Among them, r k It represents the reward value corresponding to each frame skipping action, skip is the action score of the number of skipped frames, and QoE represents the QoE (Quality of Experience) score.
[0115] The action score is determined according to the frame skipping action and the time interval between the video frames skipped by the frame skipping action. The calculation formula of the action score skip is as follows:
[0116]
[0117] Where sign() is a sign function that evaluates to 1 if true, and 0 otherwise. l(i) is derived from the training data annotations. l(i) = 1 indicates that the frame does not need to be skipped, while l(i) = 0 indicates that the frame needs to be skipped. T represents the time interval between the video frames skipped during the frame skipping action. For example, when skipping from video frame s1 to video frame s3, T is the time interval between video frames s1 and s3.
[0118] Optionally, the QoE score may be determined by parameters such as quality, bit rate, startup delay, number of freezes, freeze duration, and bit rate fluctuation of the played video.
[0119] Alternatively, after abstracting the GOP delivery problem into a Markov decision process, the goal of the entire process is to find the transition policy π while maximizing the cumulative reward. Using the Q function Q(s,a) from Q-learning to replace the transition policy π in the Markov decision process, the problem becomes finding the maximum Q value.
[0120] Optionally, step S213 includes: determining a maximum initial Q value for the next frame skipping action of the frame skipping action based on the Q value table; determining a gap value based on the initial Q value, the maximum initial Q value, and the reward value corresponding to the frame skipping action; and updating the initial Q value of the frame skipping action in the Q value table based on the initial Q value and the gap value. An exemplary initial Q value updating process is as follows.
[0121]
[0122] Among them, Q k+1 (s k ,a k ) means in state s k Execute frame skip action a k The updated expected return Q value after that, Q k (s k ,a k ) means in state s k Execute frame skip action a k The initial Q value after k (s k+1 ,a k+1 ) indicates that in the new state s k+1 Execute the new a k+1 The initial Q value after the action, α∈[0,1] represents the learning rate, r k represents the reward value corresponding to the k-th frame skipping action, and γ∈[0,1] represents the attenuation factor of the reward value.
[0123] Optionally, a multilayer perceptron (MLP) is used to fit the Q-value estimation function to calculate the Q-value. The multilayer perceptron inputs the current state, the next state, the frame skipping action, and the reward value, and outputs the Q-value. Given a GOP sequence, starting from the first frame, the multilayer perceptron is first initialized with random parameters. For each video frame, the feature vector is first extracted to obtain the state s k , select a frame skipping action a according to the current state k , according to the frame skipping action a k Jump to a new video frame, state s k+1 , the current state s k Transition to state s k+1 , from state s k+1 Extract features again and calculate the frame skipping action ak Reward r k , then pass the parameter (s k ,a k ,s k+1 ,r k ) to update the Q network.
[0124] The Q value corresponding to each frame skipping action is determined according to the updated Q value table, the frame skipping action with the largest Q value is determined, and the target frame skipping action set is determined according to the frame skipping action with the largest Q value.
[0125] In the technical solution of this embodiment, by determining the Q value table of the frame skipping action set with the largest cumulative reward value, and then determining the target frame skipping action set, the subsequently determined key frame sequence is made more accurate, and the video frames in each picture group sequence are screened, retaining video frames with larger scene changes and discarding video frames with smaller scene changes, thereby improving the smoothness of video playback and reducing the delay of video playback.
[0126] Reference Figure 6 The present invention provides a video processing device, the video processing device comprising:
[0127] The determination module 100 is configured to determine, when a video starts playing, multiple cached picture group sequences of the video, and use each video frame in each cached picture group sequence as a state, and determine a frame skipping action for the state based on the number of frame skipping frames corresponding to the state;
[0128] A prediction module 200 is configured to determine a target frame skipping action set corresponding to each cached picture group sequence according to the state and the frame skipping action;
[0129] The processing module 300 is configured to determine a key frame sequence of each of the cached picture group sequences according to the target frame skipping action set, and send the key frame sequence to a playback terminal.
[0130] Optionally, the step of determining a target frame skipping action set corresponding to each cached picture group sequence according to the state and the frame skipping action includes:
[0131] Determining, according to the state and the frame skipping action, a plurality of sets of frame skipping actions corresponding to each buffered group of picture sequence;
[0132] Determining a cumulative reward value for each frame skipping action set according to the reward value of each frame skipping action in each frame skipping action set;
[0133] The target frame skipping action set is determined according to the frame skipping action set with the largest cumulative reward value.
[0134] Optionally, the step of determining the target frame skipping action set according to the frame skipping action set with the largest cumulative reward value includes:
[0135] Constructing a Q value table corresponding to the frame skipping action set with the largest cumulative reward value, wherein the Q value table includes an initial Q value of each frame skipping action;
[0136] Updating the Q value table according to a preset attenuation factor, a preset learning rate, an initial Q value of each frame skipping action, and a reward value of each frame skipping action;
[0137] The target frame skipping action set is determined according to the updated Q value table.
[0138] Optionally, the step of updating the Q value table according to a preset attenuation factor, a preset learning rate, an initial Q value of each frame skipping action, and a reward value of each frame skipping action includes:
[0139] Determine the maximum initial Q value of the next frame skipping action of the frame skipping action according to the Q value table;
[0140] Determine a gap value according to the initial Q value of the frame skipping action, the maximum initial Q value, and the reward value corresponding to the frame skipping action;
[0141] The initial Q value of the frame skipping action in the Q value table is updated according to the initial Q value of the frame skipping action and the gap value.
[0142] Optionally, the step of determining the reward value of each frame skipping action includes:
[0143] determining an action score for each frame skipping action according to each frame skipping action and a time interval between video frames skipped by each frame skipping action;
[0144] Get user experience quality score;
[0145] A reward value for each frame skipping action is determined according to the action score and the quality score.
[0146] Optionally, the step of sending the key frame sequence to the playback terminal includes:
[0147] Determining whether the first video frame of the key frame sequence is the first video frame of the picture group sequence;
[0148] If so, the key frame sequence is sent to the playback terminal.
[0149] Optionally, before the step of determining a plurality of cached group-of-picture sequences of the video when the video starts playing, the method further includes:
[0150] Store the uploaded video frames in the cache queue;
[0151] Determining whether the number of GOP sequences stored in the cache queue is greater than a preset number;
[0152] If so, the GOP sequence with the earliest timestamp in the cache queue is deleted.
[0153] The present invention also provides a video processing device, which includes a memory, a processor, and a video processing program stored in the memory and executable on the processor. When the video processing program is executed by the processor, the various steps of the video processing method described in the above embodiment are implemented.
[0154] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a video processing program, and when the video processing program is executed by a processor, the video processing program implements the various steps of the video processing method described in the above embodiment.
[0155] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0156] It should be noted that, in this document, the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, system, article, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or elements inherent to such process, system, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, system, article, or device comprising the element.
[0157] Through the description of the above embodiments, those skilled in the art can clearly understand that the above-mentioned embodiment system can be implemented by means of software plus the necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases the former is a better embodiment. Based on this understanding, the technical solution of the present invention, or the part that contributes to the existing technology, can be embodied in the form of a software product. The computer software product is stored in a computer-readable storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, parking management equipment, air conditioner, or network equipment, etc.) to execute the system described in each embodiment of the present invention.
[0158] The above are only preferred embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made using the contents of the present invention description and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A video processing method, characterized in that: The video processing method comprises: When a video starts playing, multiple cached picture group sequences of the video are determined, and each video frame in each cached picture group sequence is used as a state. A frame skipping action for the state is determined according to the number of frame skipping frames corresponding to the state, wherein the frame skipping action includes whether a video frame needs to be skipped and the number of frame skipping frames; Determining, according to the state and the frame skipping action, a plurality of sets of frame skipping actions corresponding to each buffered group of picture sequence; Determining an action score for each frame skipping action based on each frame skipping action and a time interval between video frames skipped by each frame skipping action; obtaining a user experience quality score; determining a reward value for each frame skipping action based on the action score and the quality score; and determining a cumulative reward value for each set of frame skipping actions based on the reward value of each frame skipping action in each set of frame skipping actions; determining a target frame skipping action set based on the frame skipping action set with the largest cumulative reward value, wherein the target frame skipping action set is a set of frame skipping actions corresponding to the state of the group of pictures sequence, and the target frame skipping action set includes multiple sets of frame skipping actions, each of which includes skipping from a preceding video frame to a succeeding video frame in the group of pictures sequence; Determine the key frame sequence of each cached picture group sequence according to the target frame skipping action set, and judge whether the first video frame of the key frame sequence is the first video frame of the picture group sequence; if so, send the key frame sequence to the playback terminal, the key frame sequence includes the key video frames in the picture group sequence, and the video content corresponding to the key frame sequence includes the key video content of the picture group sequence.
2. The video processing method according to claim 1, wherein: The step of determining the target frame skipping action set according to the frame skipping action set with the largest cumulative reward value comprises: Constructing a Q value table corresponding to the frame skipping action set with the largest cumulative reward value, wherein the Q value table includes an initial Q value of each frame skipping action; Updating the Q value table according to a preset attenuation factor, a preset learning rate, an initial Q value of each frame skipping action, and a reward value of each frame skipping action; The target frame skipping action set is determined according to the updated Q value table.
3. The video processing method according to claim 2, wherein: The step of updating the Q value table according to a preset attenuation factor, a preset learning rate, an initial Q value of each frame skipping action, and a reward value of each frame skipping action includes: Determine the maximum initial Q value of the next frame skipping action of the frame skipping action according to the Q value table; Determine a gap value according to the initial Q value of the frame skipping action, the maximum initial Q value, and the reward value corresponding to the frame skipping action; The initial Q value of the frame skipping action in the Q value table is updated according to the initial Q value of the frame skipping action and the gap value.
4. The video processing method according to claim 1, wherein: Before the step of determining a plurality of buffered group of pictures sequences of the video at the start of the video, the method further includes: Store the uploaded video frames in the cache queue; Determining whether the number of GOP sequences stored in the cache queue is greater than a preset number; If so, the GOP sequence with the earliest timestamp in the cache queue is deleted.
5. A video processing device, characterized in that: The video processing device comprises: a determination module, configured to determine, when a video starts playing, multiple cached picture group sequences of the video, and use each video frame in each cached picture group sequence as a state, and determine a frame skipping action for the state based on the number of frame skipping frames corresponding to the state, wherein the frame skipping action includes whether a video frame needs to be skipped and the number of frame skipping frames; A prediction module is configured to determine, based on the state and the frame skipping actions, multiple sets of frame skipping actions corresponding to each cached group of pictures sequence; determine an action score for each frame skipping action based on a time interval between each frame skipping action and a video frame skipped by executing each frame skipping action; obtain a user experience quality score; determine a reward value for each frame skipping action based on the action score and the quality score; determine a cumulative reward value for each set of frame skipping actions based on the reward value of each frame skipping action in each set of frame skipping actions; and determine a target frame skipping action set based on the frame skipping action set with the largest cumulative reward value, the target frame skipping action set being a set of frame skipping actions corresponding to the state of the group of pictures sequence, the target frame skipping action set including multiple sets of frame skipping actions, each frame skipping action including skipping from a preceding video frame to a succeeding video frame in the group of pictures sequence; A processing module is used to determine the key frame sequence of each cached picture group sequence according to the target frame skipping action set, and judge whether the first frame video frame of the key frame sequence is the first frame video frame of the picture group sequence; if so, the key frame sequence is sent to the playback terminal, the key frame sequence includes the key video frames in the picture group sequence, and the video content corresponding to the key frame sequence includes the key video content of the picture group sequence.
6. A video processing device, characterized in that: The video processing device includes a memory, a processor, and a video processing program stored in the memory and executable on the processor. When the video processing program is executed by the processor, each step of the video processing method according to any one of claims 1 to 4 is implemented.
7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a video processing program, and when the video processing program is executed by a processor, each step of the video processing method according to any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Wireless network video transmission adaptive control method based on Q learning
CN108391143A
Code rate self-adaption method and device of live video, electronic equipment and readable medium
CN113411628A