Video frame insertion method and apparatus, and electronic device
AssigneeVivo Mobile Communication Co., Ltd.
InventorYayu Li
Life of this patent
Estimating the term…
Abstract
A video frame insertion method and apparatus and an electronic device. The method includes: in a case that resolution of a first video is greater than preset resolution, processing each video frame of the first video according to a target rule to obtain a second video, where resolution of the second video is less than or equal to the preset resolution; performing frame insertion processing on the second video to obtain a third video; and generating a fourth video according to the target rule and the third video, where resolution of the fourth video is equal to the resolution of the first video, and a quantity of frames in the fourth video is the same as a quantity of frames in the third video.
Claims7
A video frame insertion method, wherein the method comprises:
- in a case that resolution of a first video is greater than preset resolution, processing each video frame of the first video according to a target rule to obtain a second video, wherein resolution of the second video is less than or equal to the preset resolution;
- performing frame insertion processing on the second video to obtain a third video;
- and
- generating a fourth video according to the target rule and the third video, wherein resolution of the fourth video is equal to the resolution of the first video, and a quantity of frames in the fourth video is the same as a quantity of frames in the third video,
- wherein the preset resolution comprises a preset horizontal pixel and a preset vertical pixel;
- and
- that the resolution of the first video is greater than the preset resolution comprises at least one of the following:
- a horizontal pixel of each video frame of the first video is greater than the preset horizontal pixel;
- and
- a vertical pixel of each video frame of the first video is greater than the preset vertical pixel,
- wherein the target rule is a video frame segmenting rule, the second video comprises M second sub-videos, the third video comprises M third sub-videos, and M is an integer greater than or equal to 2;
- the processing each video frame of the first video according to a target rule to obtain a second video comprises:
- segmenting each video frame of the first video into M subframes according to the video frame segmenting rule, and combining an ith subframe corresponding to each video frame of the first video in a playback order to obtain an ith second sub-video, wherein a value of i is successively 1 to M;
- the performing frame insertion processing on the second video to obtain a third video comprises:
- performing frame insertion processing on the ith second sub-video to obtain an ith third sub-video;
- and
- the generating a fourth video according to the target rule and the third video comprises:
- sequentially splicing M jth video frames corresponding to the M third sub-videos according to the video frame segmenting rule as a jth video frame of the fourth video, and sequentially combining all video frames of the fourth video to obtain the fourth video, wherein j is a positive integer;
- wherein
- a horizontal pixel of each of the M subframes is less than or equal to the preset horizontal pixel, and a vertical pixel of each of the M subframes is less than or equal to the preset vertical pixel,
- wherein the M subframes corresponding to each video frame of the first video comprise N first subframes and M-N second subframes, a spliced image of the N first subframes is a video frame of the first video, and there is an image overlapping area between one second subframe and each of two adjacent first subframes;
- and
- the sequentially splicing M jth video frames corresponding to the M third sub-videos according to the video frame segmenting rule as a jth video frame of the fourth video comprises:
- sequentially splicing N jth video frames corresponding to N third sub-videos according to the video frame segmenting rule, to obtain a jth initial spliced frame;
- and
- smoothing an image overlapping area in the jth initial spliced frame by using M-N jth video frames corresponding to M-N third sub-videos to obtain the jth video frame of the fourth video;
- wherein
- the N third sub-videos are video frames obtained after frame insertion processing is performed on the N first subframes, and the M-N third sub-videos are videos obtained after frame insertion processing is performed on the M-N second subframes, wherein N is an integer greater than or equal to 2, and M is an integer greater than or equal to 3.
An electronic device, comprising a processor, a memory, and a program or an instruction that is stored in the memory and that is executable on the processor, wherein the program or the instruction, when executed by the processor, causes the processor to:
- in a case that resolution of a first video is greater than preset resolution, process each video frame of the first video according to a target rule to obtain a second video, wherein resolution of the second video is less than or equal to the preset resolution;
- perform frame insertion processing on the second video to obtain a third video;
- and
- generate a fourth video according to the target rule and the third video, wherein resolution of the fourth video is equal to the resolution of the first video, and a quantity of frames in the fourth video is the same as a quantity of frames in the third video, wherein the target rule is a video frame redundant block compression rule,
- wherein the processer is specifically configured to:
- perform image compression processing on a redundant block in each video frame of the first video according to the video frame redundant block compression rule to obtain a compressed video frame, and sequentially combine the compressed video frames in a chronological order to obtain the second video, wherein a difference between a pixel value of each pixel in the redundant block is less than or equal to a preset value, a horizontal pixel of the compressed video frame is less than or equal to the preset horizontal pixel, and a vertical pixel of the compressed video frame is less than or equal to the preset vertical pixel;
- insert an intermediate video frame between every two adjacent compressed video frames of the second video to obtain the third video;
- and
- determine a sub-image according to the video frame redundant block compression rule and a target insertion manner based on corresponding redundant blocks in two adjacent video frames of the first video, and use the sub-image as a partial image of an intermediate video frame of the two adjacent video frames;
- and
- after an intermediate video frame inserted between every two adjacent video frames of the first video is obtained, sequentially combine the video frames to obtain the fourth video;
- wherein
- the target insertion manner is a manner of inserting the partial image of the intermediate video frame between a first sub-image of a first compressed video frame and a second sub-image of a second compressed video frame, and the first sub-image and the second sub-image are images obtained after corresponding redundant blocks in the two adjacent video frames are compressed.
A video frame insertion method, wherein the method comprises:
- in a case that resolution of a first video is greater than preset resolution, processing each video frame of the first video according to a target rule to obtain a second video, wherein resolution of the second video is less than or equal to the preset resolution;
- performing frame insertion processing on the second video to obtain a third video;
- and
- generating a fourth video according to the target rule and the third video, wherein resolution of the fourth video is equal to the resolution of the first video, and a quantity of frames in the fourth video is the same as a quantity of frames in the third video,
- wherein the target rule is a video frame redundant block compression rule;
- the processing each video frame of the first video according to a target rule to obtain a second video comprises:
- performing image compression processing on a redundant block in each video frame of the first video according to the video frame redundant block compression rule to obtain a compressed video frame, and sequentially combining the compressed video frames in a chronological order to obtain the second video, wherein a difference between a pixel value of each pixel in the redundant block is less than or equal to a preset value, a horizontal pixel of the compressed video frame is less than or equal to the preset horizontal pixel, and a vertical pixel of the compressed video frame is less than or equal to the preset vertical pixel;
- the performing frame insertion processing on the second video to obtain a third video comprises:
- inserting an intermediate video frame between every two adjacent compressed video frames of the second video to obtain the third video;
- and
- the generating a fourth video according to the target rule and the third video comprises:
- determining a sub-image according to the video frame redundant block compression rule and a target insertion manner based on corresponding redundant blocks in two adjacent video frames of the first video, and using the sub-image as a partial image of an intermediate video frame of the two adjacent video frames;
- and
- after an intermediate video frame inserted between every two adjacent video frames of the first video is obtained, sequentially combining the video frames to obtain the fourth video;
- wherein
- the target insertion manner is a manner of inserting the partial image of the intermediate video frame between a first sub-image of a first compressed video frame and a second sub-image of a second compressed video frame, and the first sub-image and the second sub-image are images obtained after corresponding redundant blocks in the two adjacent video frames are compressed.
Dependencies are inferred from the claim text.