WO2022037331A1 - Video processing method, video processing apparatus, storage medium, and electronic device - Google Patents

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

Info

Publication number
WO2022037331A1
WO2022037331A1 PCT/CN2021/106309 CN2021106309W WO2022037331A1 WO 2022037331 A1 WO2022037331 A1 WO 2022037331A1 CN 2021106309 W CN2021106309 W CN 2021106309W WO 2022037331 A1 WO2022037331 A1 WO 2022037331A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
frame
image
video clip
spliced
Prior art date
Application number
PCT/CN2021/106309
Other languages
French (fr)
Chinese (zh)
Inventor
张弓
Original Assignee
Oppo广东移动通信有限公司
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 Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2022037331A1 publication Critical patent/WO2022037331A1/en

Links

Images

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/44016Processing 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 splicing one content stream with another content stream, e.g. for substituting a video clip
    • 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/44008Processing 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 operations for analysing video streams, e.g. detecting features or characteristics in the video stream
    • 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/440245Processing 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 the reformatting operation being performed only on part of the stream, e.g. a region of the image or a time segment
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Definitions

  • the present disclosure relates to the technical field of image and video processing, and in particular, to a video processing method, a video processing apparatus, a computer-readable storage medium, and an electronic device.
  • Video stitching refers to stitching multiple videos into one video. In the related art, it is common to simply combine different videos, for example, splicing the next video after the last frame of the previous video, that is, end-to-end splicing, to form a spliced video that can be played continuously.
  • the present disclosure provides a video processing method, a video processing apparatus, a computer-readable storage medium, and an electronic device.
  • a video processing method comprising: acquiring at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images; At least one of the positions to be spliced is inserted into a frame to generate an inserted frame image; the video clip and the inserted frame image are spliced to obtain a target video.
  • a video processing apparatus comprising: an acquisition module for acquiring at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images; a frame insertion module , for inserting frames at at least one of the at least two video clips to be spliced to generate an inserted frame image; a splicing module for splicing the video clip and the inserted frame image to obtain a target video.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the video processing method of the first aspect and possible implementations thereof.
  • an electronic device comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to The video processing method of the above-mentioned first aspect and possible implementations thereof are performed.
  • FIG. 1 shows a schematic diagram of a mobile terminal in this exemplary embodiment
  • FIG. 2 shows a flowchart of a video processing method in this exemplary embodiment
  • FIG. 3 shows a schematic diagram of a sequence of video clips in this exemplary embodiment
  • FIG. 4 shows a flowchart of frame insertion in this exemplary embodiment
  • FIG. 5 shows a schematic diagram of frame insertion by MEMC in this exemplary embodiment
  • Fig. 6 shows the flow chart of determining the number and time phase of the interpolated frame in this exemplary embodiment
  • FIG. 7 shows a schematic diagram of video processing in this exemplary embodiment
  • FIG. 8 shows a structural block diagram of a video processing apparatus in this exemplary embodiment
  • FIG. 9 shows a structural block diagram of a video processing apparatus in this exemplary embodiment.
  • Example embodiments will now be described more fully with reference to the accompanying drawings.
  • Example embodiments can be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art.
  • the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
  • numerous specific details are provided in order to give a thorough understanding of the embodiments of the present disclosure.
  • those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be employed.
  • well-known solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
  • video is usually spliced end-to-end.
  • the videos obtained by splicing in this way have poor content continuity, and there may be sudden changes in the picture at the splicing position, which affects the viewing experience.
  • exemplary embodiments of the present disclosure provide a video processing method for performing splicing processing on different video segments.
  • the application scenarios of this method include but are not limited to: the user selects multiple video clips in the album, and splices them into a target video and plays them through this exemplary embodiment; in the video clip, the multiple videos to be spliced
  • the present exemplary embodiment performs a splicing process.
  • Exemplary embodiments of the present disclosure provide an electronic device to execute the above-described video processing method.
  • the electronic device generally includes a processor and a memory.
  • the memory is used to store executable instructions of the processor, and can also store application data such as images and videos.
  • the processor is used to execute the executable instructions to realize video processing.
  • the electronic device can be a terminal device such as a smart phone, a tablet computer, a smart wearable device, a drone, a desktop computer, a vehicle-mounted smart device, and a game console, or a server device, such as a platform server that provides video processing services.
  • the following takes the mobile terminal 100 in FIG. 1 as an example to illustrate the structure of the above electronic device. It will be understood by those skilled in the art that the configuration in Figure 1 can also be applied to stationary type devices, in addition to components specifically for mobile purposes.
  • the mobile terminal 100 may specifically include: a processor 110, an internal memory 121, an external memory interface 122, a USB (Universal Serial Bus, Universal Serial Bus) interface 130, a charging management module 140, a power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 171, receiver 172, microphone 173, headphone jack 174, sensor module 180, display screen 190, camera module 191, indication 192, a motor 193, a key 194, a Subscriber Identification Module (SIM) card interface 195, and the like.
  • SIM Subscriber Identification Module
  • the processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), an image signal processor (Image Signal Processor, ISP), controller, encoder, decoder, digital signal processor (Digital Signal Processor, DSP), baseband processor and/or neural network processor (Neural-Network Processing Unit, NPU), etc.
  • the AP, GPU, etc. can perform processing on images and video data, such as inserting frames at the positions of the video clips to be spliced, generating an inserted frame image, and splicing the video clip and the inserted frame image into a target video, etc.
  • the encoder can encode (ie compress) image or video data, for example, encode the target video data obtained after video processing to form corresponding code stream data to reduce the bandwidth occupied by data transmission; the decoder can Or the code stream data of the video is decoded (ie, decompressed) to restore the image or video data, for example, the obtained original video segment is decoded to obtain the image data of each frame in the video segment.
  • the mobile terminal 100 may support one or more encoders and decoders. In this way, the mobile terminal 100 can process images or videos in various encoding formats, such as: JPEG (Joint Photographic Experts Group, Joint Photographic Experts Group), PNG (Portable Network Graphics, Portable Network Graphics), BMP (Bitmap, Bitmap), etc. Image format, MPEG (Moving Picture Experts Group, Moving Picture Experts Group) 1, MPEG2, H.263, H.264, HEVC (High Efficiency Video Coding, High Efficiency Video Coding) and other video formats.
  • JPEG Joint Photographic Expert
  • the processor 110 may include one or more interfaces through which connections are formed with other components of the mobile terminal 100 .
  • the external memory interface 122 may be used to connect an external memory card.
  • the internal memory 121 may be used to store computer executable program codes, and may also store data (such as images, videos) and the like created during the use of the mobile terminal 100 .
  • the USB interface 130 is an interface conforming to the USB standard specification, and can be used to connect a charger to charge the mobile terminal 100, and can also be connected to an earphone or other electronic devices.
  • the charging management module 140 is used to receive charging input from the charger. While charging the battery 142, the charging management module 140 can also supply power to the device through the power management module 141; the power management module 141 can also monitor the state of the battery.
  • the wireless communication function of the mobile terminal 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like.
  • Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G etc. applied on the mobile terminal 100.
  • the wireless communication module 160 can provide wireless local area networks (Wireless Local Area Networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) networks), Bluetooth (Bluetooth, BT), global navigation satellite Wireless communication solutions such as Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR).
  • WLAN wireless Local Area Networks
  • GNSS Global Navigation Satellite System
  • FM Frequency Modulation
  • NFC Near Field Communication
  • IR Infrared
  • the mobile terminal 100 can realize the display function through the GPU, the display screen 190 and the application processor, etc., can realize the shooting function through the ISP, the camera module 191, the encoder, the decoder, the GPU, the display screen 190 and the application processor, etc., and can also realize the shooting function.
  • the audio function is realized by the audio module 170 , the speaker 171 , the receiver 172 , the microphone 173 , the headphone interface 174 and the application processor.
  • the sensor module 180 may include a depth sensor 1801, a pressure sensor 1802, a gyro sensor 1803, an air pressure sensor 1804, and the like.
  • the indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
  • the motor 193 can generate vibration prompts, and can also be used for touch vibration feedback and the like.
  • the keys 194 include a power-on key, a volume key, and the like.
  • the mobile terminal 100 may support one or more SIM card interfaces 195 for connecting SIM cards.
  • FIG. 2 shows a schematic flow of the video processing method, which may include the following steps S210 to S230, and each step will be described in detail below:
  • Step S210 Acquire at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images.
  • a video clip refers to the original video material, which is essentially an independent video. Since subsequent splicing is required, in order to distinguish it from the spliced video, the video material is referred to as a "segment" here.
  • Each video clip is generally composed of two or more frames of images.
  • a single-frame video clip can also be acquired, that is, a single image is regarded as a special type of video clip.
  • the initially acquired video segment may be encoded video data, and the video data may be processed by a video decoder or other parser to obtain image data of each frame in the video segment.
  • video clips with the same background part and similar foreground parts may be acquired to facilitate subsequent splicing.
  • step S210 the following processing can also be performed on any one or more video clips according to actual requirements:
  • a video clip into multiple video clips.
  • a video clip can be split, for example, by detecting the similarity between two adjacent frames of images in the video clip, and determining the position with lower similarity as the change point, at the change point Do video splits. In each video segment obtained in this way, the content continuity is relatively high, which is favorable for subsequent splicing.
  • a video clip can be selected as the main video, the main video can be split, and subsequent video clips can be spliced with each split clip of the main video, which is equivalent to inserting into different positions of the main video. .
  • two video clips are video clips obtained by two cameras synchronously shooting the same scene from different angles. You can select two frames with the same timestamp from the two video clips, register the two frames, and then use the registration parameters. Register and synthesize two video clips to obtain a video clip with more comprehensive and rich scene content; or one video clip is the shot scene video, and the other video clip is the picture video, and the picture video can be inserted into the scene A certain position in the video, to achieve a composite of two video clips, and so on.
  • Adjust the resolution of the video clips you can adjust each video clip to the same resolution. For example, set a standard resolution in advance, perform up-sampling processing on video clips lower than this resolution, down-sampling processing on video clips higher than this resolution, or use the video clip with the lowest resolution as the standard, and perform up-sampling processing on other video clips. Fragments are downsampled, and so on.
  • Step S220 performing frame insertion at at least one to-be-spliced position of the at least two video clips to generate an inserted frame image.
  • the position to be spliced refers to the position where different video clips are spliced, and may include a start position, an end position, and a position between any two adjacent video clips.
  • the start position is located before the first video segment of the at least two video segments
  • the end position is located after the last video segment of the at least two video segments.
  • the first video clip and the last video clip may be first spliced, so the above-mentioned start position and end position can be used as the position to be spliced.
  • FIG. 3 obtain the video clip 1, video clip 2, ..., and video clip n to be spliced, the start position P1 before the video clip 1, the end position Pn+1 after the video clip n,
  • the positions between the two adjacent video clips in the middle include P2, P3, etc., and P1 to Pn+1 are positions to be spliced.
  • the number of video segments to be spliced is at least two, thus including at least three locations to be spliced.
  • frame interpolation may be performed at at least one of the positions to be spliced, so as to increase the continuity between the two video segments before and after the position to be spliced.
  • the start position P1 and the end position Pn+1 are two relatively special positions, and only one side has a video clip.
  • the positions to be spliced are divided into two categories below.
  • the first type of positions to be spliced is the intermediate positions to be spliced, that is, the positions between two adjacent video clips, including P2, P3, etc. in Figure 3;
  • the second type of positions to be spliced are the start and end positions. Describe how to insert frames for the two types of positions to be spliced:
  • step S220 may include the following steps S410:
  • Step S410 perform frame interpolation according to at least one frame of image in the previous video clip at the position to be spliced and at least one frame of image in the next video clip at the position to be spliced to generate an inserted frame image.
  • the previous video clip is video clip 2
  • the next video clip is video clip 3.
  • One or more frames of images are selected from video clip 2, and one or more frames are also selected from video clip 3.
  • frame interpolation is performed at P3 according to the selected images.
  • FRC Full Rate Conversion
  • MEMC Motion Estimation and Motion Compensation, motion estimation and motion compensation
  • optical flow method neural network processing, etc.
  • the above-mentioned images selected for frame insertion in the previous video clip and the next video clip may be: the end frame image in the previous video clip and the start frame image in the next video clip, these two
  • the frame is also the boundary frame image at the position to be spliced, and the frame interpolation is performed through these two frames, and the accuracy of the result is high.
  • a video clip is a single-frame video clip, such as video clip 4 in Figure 3, the single frame is the start frame of video clip 4 and the end frame of video clip 4.
  • the single frame of clip 4 and the end frame of video clip 3 are interpolated at P4.
  • the previous video clip and the next video clip are both single-frame video clips, and it is sufficient to insert frames at the position to be spliced in the middle of the two single frames.
  • step S220 may further include the following steps S420:
  • Step S420 according to at least one frame of image in the first video clip and at least one frame of image in the last video clip, perform frame interpolation at the above-mentioned starting position and/or the above-mentioned ending position to generate an interpolated frame image.
  • one or more frames of images can be selected from video clip 1, and one or more frames of images can be selected from video clip n.
  • the previous video clip can be regarded as the last video clip of the video clip sequence
  • the following video clip can be regarded as the first video clip of the video clip sequence.
  • interpolate between the two video clips For the generated interpolated frame images, all of them can be placed at the start position, or all of them can be placed at the end position, and part of the interpolated frame images can be placed at the start position and the other part at the end position.
  • the above-mentioned images selected for frame insertion in the first video segment and the last video segment may be: a start frame image in the first video segment and an end frame image in the last video segment.
  • the content of the inserted frame is a transition picture from the end frame image of all video clips back to the start frame image of all video clips.
  • determine one image as the reference image and the other as the current image for example, take F1 as the reference image and F2 as the current image;
  • the size of the image block can be set according to the actual situation, traverse the reference image F1 according to different image blocks, find the matching block of each image block, and determine according to the position change between the image block and its matching block.
  • the MV (Motion Vector) of the current image relative to the reference image is recorded as the forward MV;
  • the motion state of the image block at different time phases is estimated, and the MV is re-corrected to determine the interpolated block.
  • the mapping MV of the image F1 performs weight interpolation for the interpolation blocks in the corresponding image blocks of the current image F2 and the reference image F1, so as to obtain each pixel value and generate an interpolated frame image.
  • the number and time phase of the inserted frames can be determined through the following steps S610 to S650:
  • Step S610 select at least two frames of images in the previous video segment of the position to be spliced, and obtain a first MV by performing motion estimation on them;
  • Step S602 select at least two frames of images in the next video segment of the position to be spliced, and obtain a second MV by performing motion estimation on them;
  • Step S630 according to the boundary motion state between the previous video clip and the next video clip, obtain a third MV between the two video clips;
  • Step S640 draw a time-motion curve according to the first MV, the second MV, the third MV, and the time stamps of the images selected in the previous video clip and the next video clip;
  • Step S650 in the part between the previous video segment and the next video segment in the time-motion curve, according to the actual motion state, determine the number and time phase of the interpolated frames.
  • a number of interpolation points can be determined by equal time phase or unequal time phase, so as to determine the number and time phase of the interpolation frames.
  • Step S230 splicing the video clip and the interpolated frame image to obtain the target video.
  • Splicing all video clips and interleaved frame images, and setting the timestamp of each frame image for example, it can be set according to the required video frame rate (such as 24fps, 30fps, 60fps, etc.), so as to obtain a complete target video.
  • the required video frame rate such as 24fps, 30fps, 60fps, etc.
  • the target video can be set to loop playback, that is, after playing to the end of the video, jump to the beginning of the video to replay, and the insertion based on the start position or the end position Frame images, when jumping from the end of the target video to the beginning, the picture shows continuity, forming a self-looping look and feel.
  • the foregoing video clips may be arranged in a splicing sequence.
  • the splicing order between video clips can be any specified or determined order.
  • An exemplary manner for determining the splicing sequence is provided below, but the following content should not limit the scope of protection of the present disclosure:
  • the splicing sequence is set by the user. For example, after acquiring multiple video clips, they are displayed in a sorting interface, and the user is allowed to drag the video clips to change the order.
  • the splicing sequence is determined according to the shooting time of the video clips, and the video clips are usually arranged in the order of shooting time from early to late.
  • the moving path of the foreground part in the video clip for example, identify the background part and the foreground part in the video clip, and determine the static reference object in the background part, such as a tree, a building, etc., through the foreground part
  • the moving path of the foreground part is determined, for example, moving from the left side of the reference object to the right side, and the splicing sequence between different video segments is determined according to the path.
  • a duplicate frame between two adjacent video clips may also be detected, and the duplicate frame may be deleted from any one of the video clips.
  • Duplicate frames refer to duplicate pictures that appear in two adjacent video clips. For example, if there is an intersection between two video clips, deleting duplicate frames from any video clip can prevent the same picture from appearing repeatedly. It should be noted that there may be a situation where a certain video clip appears completely in another video clip. For example, if video clip A appears completely in video clip B, A can be regarded as a subset of B, and all A can be considered as a subset of B. Delete, at this time, you can further compare the duplicate frames of B and other adjacent video clips, and perform deletion processing.
  • Example 1 Referring to FIG. 7 , two video clips are acquired, namely video clip 1 and video clip 2 .
  • the video clip 1 includes N frames of images, and it is detected that the Kth frame is a change point, and the video content before and after the change point is quite different. Taking the K frame as the split point, the video clip 1 is divided into the first short video clip (the first short video clip (the first short video clip).
  • the video clip 2 includes M frame images, the background part is similar to the video clip 1, only the position of the foreground part is different, select the A representative frame (denoted as Z frame) is retained, and the rest is deleted to form a single-frame video clip; according to the first short video clip, Z frame, and the second short video clip, a video clip sequence is formed.
  • the video clip sequence Including 4 positions to be spliced; insert frame T1 between the first short video clip and Z frame, insert frame T2 between Z frame and the second short video clip, splicing 1 ⁇ K-1, T1, Z, T2, K ⁇ N, get the target video.
  • Example 2 Acquire two video clips, namely video clip 1 and video clip 2. Select a change point in video clip 1, and split video clip 1 into a first short video clip and a second short video clip; select two change points in video clip 2, and split video clip 2 into a third short video clip Video clips, fourth short video clips and fifth short video clips; according to the set splicing sequence, in the order of the first, third, second, fifth, and fourth short video clips, respectively in every two short video clips. Interpolate frames between clips, and finally splicing into the target video.
  • the correlation between video image frames is used to insert frames between different video clips to increase transitional content between video clips, Improve the continuity of the picture and solve the problem of sudden picture changes in video splicing.
  • the processing process of this solution is simple, and can be implemented based on the video clips to be spliced, without additional information, and has high practicability.
  • the video processing apparatus 800 may include a processor 810 and a memory 820 , wherein the processor 810 is configured to execute the following program stored in the memory 820 Module:
  • the acquiring module 821 is configured to acquire at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images;
  • the frame insertion module 822 is configured to perform frame insertion at at least one to-be-spliced position in the above-mentioned at least two video clips to generate an inserted frame image;
  • the splicing module 823 is configured to splicing the video segment and the interpolated frame image to obtain the target video.
  • the position to be spliced includes a start position, an end position, and a position between any two adjacent video clips, and the start position is located before the first video clip of the at least two video clips , the end position is after the last video clip of the at least two video clips.
  • the frame insertion module 822 is configured to:
  • Frame interpolation is performed according to at least one frame of image in the previous video clip of the position to be spliced and at least one frame of image in the next video clip of the position to be spliced to generate an inserted frame image.
  • At least one frame image in the previous video clip includes an end frame image in the previous video clip
  • at least one frame image in the subsequent video clip includes a starting frame image in the subsequent video clip frame image
  • the frame insertion module 822 is configured to:
  • frame interpolation is performed at the start position and/or the end position to generate an interpolated frame image.
  • At least one frame of image in the first video clip includes a start frame image in the first video clip
  • at least one frame of image in the last video clip includes an image in the last video clip end frame image
  • the splicing module 823 is further configured to:
  • the frame insertion module 822 is further configured to:
  • the number and time phase of the interpolated frames are determined according to the actual motion state.
  • the frame insertion module 822 is further configured to:
  • the at least two video clips are arranged in a splicing sequence.
  • the frame insertion module 822 is further configured to:
  • the splicing sequence is determined by any one or more of the following methods:
  • the splicing sequence is determined according to the moving path of the foreground part in each video clip.
  • the frame insertion module 822 is further configured to:
  • duplicate frames between two adjacent video clips are detected, and duplicate frames are removed from either video clip.
  • the at least two video clips include single-frame video clips.
  • the obtaining module 821 is further configured to:
  • Exemplary embodiments of the present disclosure further provide another video processing apparatus.
  • the video processing apparatus 900 may include:
  • the acquiring module 910 is configured to acquire at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images;
  • the frame insertion module 920 is configured to perform frame insertion at at least one to-be-spliced position in the above at least two video clips to generate an inserted frame image;
  • the splicing module 930 is configured to splicing the video segment and the interpolated frame image to obtain the target video.
  • the position to be spliced includes a start position, an end position, and a position between any two adjacent video clips, and the start position is located at the first video clip of the at least two video clips. Before, the end position is located after the last video clip of the at least two video clips.
  • the frame insertion module 920 is configured to:
  • Frame interpolation is performed according to at least one frame of image in the previous video clip of the position to be spliced and at least one frame of image in the next video clip of the position to be spliced to generate an inserted frame image.
  • At least one frame of image in the previous video clip includes an end frame image in the previous video clip
  • at least one frame image in the next video clip includes a start frame image in the next video clip
  • the frame insertion module 920 is configured to:
  • frame interpolation is performed at the start position and/or the end position to generate the frame interpolation image.
  • At least one frame of image in the first video clip includes a start frame image in the first video clip
  • at least one frame of image in the last video clip includes the last video The end frame image in the clip.
  • the splicing module 930 is further configured to:
  • the frame insertion module 920 is further configured to:
  • the number and time phase of the interpolated frames are determined according to the actual motion state.
  • the frame insertion module 920 is further configured to:
  • the at least two video clips are arranged in a splicing sequence.
  • the frame insertion module 920 is further configured to:
  • the splicing sequence is determined by any one or more of the following methods:
  • the splicing sequence is determined according to the moving path of the foreground part in each video clip.
  • the frame insertion module 920 is further configured to:
  • duplicate frames between two adjacent video clips are detected, and duplicate frames are removed from either video clip.
  • the at least two video clips include single-frame video clips.
  • the obtaining module 910 is further configured to:
  • Exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-described method of the present specification is stored.
  • various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code, when the program product runs on a terminal device, the program code is used to cause the terminal device to execute the above-mentioned procedures in this specification.
  • the steps described in the "Exemplary Methods" section according to various exemplary embodiments of the present disclosure for example, any one or more of the steps in FIG. 2 or FIG. 4 may be performed.
  • the program product may take the form of a portable compact disk read only memory (CD-ROM) and include program code, and may be executed on a terminal device, such as a personal computer.
  • a readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • the program product may employ any combination of one or more readable media.
  • the readable medium may be a readable signal medium or a readable storage medium.
  • the readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
  • a computer readable signal medium may include a propagated data signal in baseband or as part of a carrier wave with readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a readable signal medium can also be any readable medium, other than a readable storage medium, that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
  • Program code embodied on a readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
  • Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming Language - such as the "C" language or similar programming language.
  • the program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server execute on.
  • the remote computing device may be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (eg, using an Internet service provider business via an Internet connection).
  • LAN local area network
  • WAN wide area network
  • an external computing device eg, using an Internet service provider business via an Internet connection
  • aspects of the present disclosure may be implemented as a system, method or program product. Therefore, various aspects of the present disclosure can be embodied in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, which may be collectively referred to herein as implementations "circuit", “module” or "system”.

Abstract

A video processing method, a video processing apparatus, a computer-readable storage medium, and an electronic device. The video processing method comprises: acquiring at least two video clips to be spliced, at least one of which comprises two or more frames of images (S210); performing frame insertion at at least one position, at which splicing is to be performed, in the at least two video clips, so as to generate a frame inserted image (S220); and splicing the video clips and the frame inserted image, so as to obtain a target video (S230). As such, the problem of picture mutation in video splicing is solved.

Description

视频处理方法、视频处理装置、存储介质与电子设备Video processing method, video processing device, storage medium and electronic device
本申请要求于2020年08月17日提交的,申请号为202010827407.7,名称为“视频处理方法、视频处理装置、存储介质与电子设备”的中国专利申请的优先权,该中国专利申请的全部内容通过引用结合在本文中。This application claims the priority of the Chinese patent application filed on August 17, 2020 with the application number of 202010827407.7 and titled "Video Processing Method, Video Processing Device, Storage Medium and Electronic Equipment", and the entire content of the Chinese patent application Incorporated herein by reference.
技术领域technical field
本公开涉及图像与视频处理技术领域,尤其涉及一种视频处理方法、视频处理装置、计算机可读存储介质与电子设备。The present disclosure relates to the technical field of image and video processing, and in particular, to a video processing method, a video processing apparatus, a computer-readable storage medium, and an electronic device.
背景技术Background technique
视频拼接是指将多个视频拼合为一个视频。相关技术中,普遍是将不同视频进行简单的合并,例如将后一个视频拼接到前一个视频的最后一帧之后,即首尾拼接,以形成可连续播放的拼接视频。Video stitching refers to stitching multiple videos into one video. In the related art, it is common to simply combine different videos, for example, splicing the next video after the last frame of the previous video, that is, end-to-end splicing, to form a spliced video that can be played continuously.
发明内容SUMMARY OF THE INVENTION
本公开提供了一种视频处理方法、视频处理装置、计算机可读存储介质与电子设备。The present disclosure provides a video processing method, a video processing apparatus, a computer-readable storage medium, and an electronic device.
根据本公开的第一方面,提供一种视频处理方法,包括:获取待拼接的至少两个视频片段,其中的至少一个视频片段包括两帧或两帧以上图像;在所述至少两个视频片段中的至少一个待拼接位置进行插帧,生成插帧图像;将所述视频片段和所述插帧图像进行拼接,得到目标视频。According to a first aspect of the present disclosure, there is provided a video processing method, comprising: acquiring at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images; At least one of the positions to be spliced is inserted into a frame to generate an inserted frame image; the video clip and the inserted frame image are spliced to obtain a target video.
根据本公开的第二方面,提供一种视频处理装置,包括:获取模块,用于获取待拼接的至少两个视频片段,其中的至少一个视频片段包括两帧或两帧以上图像;插帧模块,用于在所述至少两个视频片段中的至少一个待拼接位置进行插帧,生成插帧图像;拼接模块,用于将所述视频片段和所述插帧图像进行拼接,得到目标视频。According to a second aspect of the present disclosure, a video processing apparatus is provided, comprising: an acquisition module for acquiring at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images; a frame insertion module , for inserting frames at at least one of the at least two video clips to be spliced to generate an inserted frame image; a splicing module for splicing the video clip and the inserted frame image to obtain a target video.
根据本公开的第三方面,提供一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述第一方面的视频处理方法及其可能的实施方式。According to a third aspect of the present disclosure, there is provided a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the video processing method of the first aspect and possible implementations thereof.
根据本公开的第四方面,提供一种电子设备,包括:处理器;以及存储器,用于存储所述处理器的可执行指令;其中,所述处理器配置为经由执行所述可执行指令来执行上述第一方面的视频处理方法及其可能的实施方式。According to a fourth aspect of the present disclosure, there is provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the executable instructions to The video processing method of the above-mentioned first aspect and possible implementations thereof are performed.
附图说明Description of drawings
图1示出本示例性实施方式中移动终端的示意图;FIG. 1 shows a schematic diagram of a mobile terminal in this exemplary embodiment;
图2示出本示例性实施方式中一种视频处理方法的流程图;FIG. 2 shows a flowchart of a video processing method in this exemplary embodiment;
图3示出本示例性实施方式中视频片段序列的示意图;FIG. 3 shows a schematic diagram of a sequence of video clips in this exemplary embodiment;
图4示出本示例性实施方式中进行插帧的流程图;FIG. 4 shows a flowchart of frame insertion in this exemplary embodiment;
图5示出本示例性实施方式中通过MEMC插帧的示意图;FIG. 5 shows a schematic diagram of frame insertion by MEMC in this exemplary embodiment;
图6示出本示例性实施方式中确定插帧数量与时间相位的流程图;Fig. 6 shows the flow chart of determining the number and time phase of the interpolated frame in this exemplary embodiment;
图7示出本示例性实施方式中视频处理的示意图;FIG. 7 shows a schematic diagram of video processing in this exemplary embodiment;
图8示出本示例性实施方式中一种视频处理装置的结构框图;FIG. 8 shows a structural block diagram of a video processing apparatus in this exemplary embodiment;
图9示出本示例性实施方式中一种视频处理装置的结构框图。FIG. 9 shows a structural block diagram of a video processing apparatus in this exemplary embodiment.
具体实施方式detailed description
现在将参考附图更全面地描述示例实施方式。然而,示例实施方式能够以多种形式实施,且不应被理解为限于在此阐述的范例;相反,提供这些实施方式使得本公开将更加全面和完整,并将示例实施方式的构思全面地传达给本领域的技术人员。所描述的特征、结构或特性可以以任何合适的方式结合在一个或更多实施方式中。在下面的描述中,提供许多具体细节从而给出对本公开的实施方式的充分理解。然而,本领域技术人员将意识到,可以实践本公开的技术方案而省略所述特定细节中的一个或更多,或者可以采用其它的方法、组元、装置、步骤等。在其它情况下,不详细示出或描述公知技术方案以避免喧宾夺主而使得本公开的各方面变得模糊。Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments, however, can be embodied in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided in order to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be employed. In other instances, well-known solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
此外,附图仅为本公开的示意性图解,并非一定是按比例绘制。图中相同的附图标记表示相同或类似的部分,因而将省略对它们的重复描述。附图中所示的一些方框图是功能实体,不一定必须与物理或逻辑上独立的实体相对应。可以采用软件形式来实现这些功能实体,或在一个或多个硬件模块或集成电路中实现这些功能实体,或在不同网络和/或处理器装置和/或微控制器装置中实现这些功能实体。Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repeated descriptions will be omitted. Some of the block diagrams shown in the figures are functional entities that do not necessarily necessarily correspond to physically or logically separate entities. These functional entities may be implemented in software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
相关技术中,通常对视频进行首尾拼接。然而,不同视频的内容通常存在差异,这样拼接得到的视频,其内容连续性较差,在拼接位置可能出现画面突变的情况,影响观看体验。In the related art, video is usually spliced end-to-end. However, there are usually differences in the content of different videos. The videos obtained by splicing in this way have poor content continuity, and there may be sudden changes in the picture at the splicing position, which affects the viewing experience.
鉴于上述问题,本公开的示例性实施方式提供一种视频处理方法,用于对不同的视频片段进行拼接处理。该方法的应用场景包括但不限于:用户在相册中选择多个视频片段,通过本示例性实施方式将其拼接为一个目标视频并进行播放;在视频剪辑中,对待拼接的多个视频,通过本示例性实施方式进行拼接处理。In view of the above problems, exemplary embodiments of the present disclosure provide a video processing method for performing splicing processing on different video segments. The application scenarios of this method include but are not limited to: the user selects multiple video clips in the album, and splices them into a target video and plays them through this exemplary embodiment; in the video clip, the multiple videos to be spliced The present exemplary embodiment performs a splicing process.
本公开的示例性实施方式提供一种电子设备,以运行上述视频处理方法。该电子设备一般包括处理器和存储器,存储器用于存储处理器的可执行指令,也可以存储如图像、视频等应用数据,处理器用于执行可执行指令,以实现视频处理。该电子设备可以是智能手机、平板电脑、智能可穿戴设备、无人机、台式电脑、车载智能设备、游戏机等终端设备,也可以是服务端设备,如提供视频处理服务的平台服务器。Exemplary embodiments of the present disclosure provide an electronic device to execute the above-described video processing method. The electronic device generally includes a processor and a memory. The memory is used to store executable instructions of the processor, and can also store application data such as images and videos. The processor is used to execute the executable instructions to realize video processing. The electronic device can be a terminal device such as a smart phone, a tablet computer, a smart wearable device, a drone, a desktop computer, a vehicle-mounted smart device, and a game console, or a server device, such as a platform server that provides video processing services.
下面以图1中的移动终端100为例,对上述电子设备的构造进行示例性说明。本领域技术人员应当理解,除了特别用于移动目的的部件之外,图1中的构造也能够应用于固定类型的设备。The following takes the mobile terminal 100 in FIG. 1 as an example to illustrate the structure of the above electronic device. It will be understood by those skilled in the art that the configuration in Figure 1 can also be applied to stationary type devices, in addition to components specifically for mobile purposes.
如图1所示,移动终端100具体可以包括:处理器110、内部存储器121、外部存储器接口122、USB(Universal Serial Bus,通用串行总线)接口130、充电管理模块140、电源管理模块141、电池142、天线1、天线2、移动通信模块150、无线通信模块160、音频模块170、扬声器171、受话器172、麦克风173、耳机接口174、传感器模块180、显示屏190、摄像模组191、指示器192、马达193、按键194以及用户标识模块(Subscriber Identification Module,SIM)卡接口195等。As shown in FIG. 1 , the mobile terminal 100 may specifically include: a processor 110, an internal memory 121, an external memory interface 122, a USB (Universal Serial Bus, Universal Serial Bus) interface 130, a charging management module 140, a power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 171, receiver 172, microphone 173, headphone jack 174, sensor module 180, display screen 190, camera module 191, indication 192, a motor 193, a key 194, a Subscriber Identification Module (SIM) card interface 195, and the like.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(Application Processor,AP)、调制解调处理器、图形处理器(Graphics Processing Unit,GPU)、图像信号处理器(Image Signal Processor,ISP)、控制器、编码器、解码器、数字信号处理器(Digital Signal Processor,DSP)、基带处理器和/或神经网络处理器(Neural-Network Processing Unit,NPU)等。其中,AP、GPU等可以执行对图像与视频数据的处理,例如在视频片段的待拼接位置进行插帧,生成插帧图像,将视频片段与插帧图像拼接为目标视频等。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (Application Processor, AP), a modem processor, a graphics processor (Graphics Processing Unit, GPU), an image signal processor (Image Signal Processor, ISP), controller, encoder, decoder, digital signal processor (Digital Signal Processor, DSP), baseband processor and/or neural network processor (Neural-Network Processing Unit, NPU), etc. The AP, GPU, etc. can perform processing on images and video data, such as inserting frames at the positions of the video clips to be spliced, generating an inserted frame image, and splicing the video clip and the inserted frame image into a target video, etc.
编码器可以对图像或视频数据进行编码(即压缩),例如对视频处理后所得到的目标视频数据进行编码,形成对应的码流数据,以减少数据传输所占的带宽;解码器可以对图像或视频的码流数据进行解码(即解压缩),以还原出图像或视频数据,例如对获取的原始的视频片段进行解码,以得到视频片段中每一帧的图像数据。移动终端100可以支持一种或多种编码器和解码器。这样,移动终端100可以处理多种编码格式的图像或视频,例如:JPEG(Joint Photographic Experts Group,联合图像专家组)、PNG(Portable Network Graphics,便携式网络图形)、BMP(Bitmap,位图)等图像格式,MPEG(Moving Picture Experts Group,动态图像专家组)1、MPEG2、H.263、H.264、HEVC(High Efficiency Video Coding,高效率视频编码)等视频格式。The encoder can encode (ie compress) image or video data, for example, encode the target video data obtained after video processing to form corresponding code stream data to reduce the bandwidth occupied by data transmission; the decoder can Or the code stream data of the video is decoded (ie, decompressed) to restore the image or video data, for example, the obtained original video segment is decoded to obtain the image data of each frame in the video segment. The mobile terminal 100 may support one or more encoders and decoders. In this way, the mobile terminal 100 can process images or videos in various encoding formats, such as: JPEG (Joint Photographic Experts Group, Joint Photographic Experts Group), PNG (Portable Network Graphics, Portable Network Graphics), BMP (Bitmap, Bitmap), etc. Image format, MPEG (Moving Picture Experts Group, Moving Picture Experts Group) 1, MPEG2, H.263, H.264, HEVC (High Efficiency Video Coding, High Efficiency Video Coding) and other video formats.
在一些实施方式中,处理器110可以包括一个或多个接口,通过不同的接口和移动终端100的其他部件形成连接。In some embodiments, the processor 110 may include one or more interfaces through which connections are formed with other components of the mobile terminal 100 .
外部存储器接口122可以用于连接外部存储卡。内部存储器121可以用于存储计算机可执行程序代码,还可以存储移动终端100使用过程中所创建的数据(比如图像,视频)等。The external memory interface 122 may be used to connect an external memory card. The internal memory 121 may be used to store computer executable program codes, and may also store data (such as images, videos) and the like created during the use of the mobile terminal 100 .
USB接口130是符合USB标准规范的接口,可以用于连接充电器为移动终端100充电,也可以连接耳机或其他电子设备。The USB interface 130 is an interface conforming to the USB standard specification, and can be used to connect a charger to charge the mobile terminal 100, and can also be connected to an earphone or other electronic devices.
充电管理模块140用于从充电器接收充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为设备供电;电源管理模块141还可以监测电池的状态。The charging management module 140 is used to receive charging input from the charger. While charging the battery 142, the charging management module 140 can also supply power to the device through the power management module 141; the power management module 141 can also monitor the state of the battery.
移动终端100的无线通信功能可以通过天线1、天线2、移动通信模块150、无线通信模块160、调制解调处理器以及基带处理器等实现。天线1和天线2用于发射和接收电磁波信号。移动通信模块150可以提供应用在移动终端100上的包括2G/3G/4G/5G等无线通 信的解决方案。无线通信模块160可以提供应用在移动终端100上的包括无线局域网(Wireless Local Area Networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络)、蓝牙(Bluetooth,BT)、全球导航卫星系统(Global Navigation Satellite System,GNSS)、调频(Frequency Modulation,FM)、近距离无线通信技术(Near Field Communication,NFC)、红外技术(Infrared,IR)等无线通信解决方案。The wireless communication function of the mobile terminal 100 may be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modulation and demodulation processor, the baseband processor, and the like. Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. The mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G etc. applied on the mobile terminal 100. The wireless communication module 160 can provide wireless local area networks (Wireless Local Area Networks, WLAN) (such as wireless fidelity (Wireless Fidelity, Wi-Fi) networks), Bluetooth (Bluetooth, BT), global navigation satellite Wireless communication solutions such as Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR).
移动终端100可以通过GPU、显示屏190及应用处理器等实现显示功能,可以通过ISP、摄像模组191、编码器、解码器、GPU、显示屏190及应用处理器等实现拍摄功能,还可以通过音频模块170、扬声器171、受话器172、麦克风173、耳机接口174及应用处理器等实现音频功能。The mobile terminal 100 can realize the display function through the GPU, the display screen 190 and the application processor, etc., can realize the shooting function through the ISP, the camera module 191, the encoder, the decoder, the GPU, the display screen 190 and the application processor, etc., and can also realize the shooting function. The audio function is realized by the audio module 170 , the speaker 171 , the receiver 172 , the microphone 173 , the headphone interface 174 and the application processor.
传感器模块180可以包括深度传感器1801、压力传感器1802、陀螺仪传感器1803、气压传感器1804等。The sensor module 180 may include a depth sensor 1801, a pressure sensor 1802, a gyro sensor 1803, an air pressure sensor 1804, and the like.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。马达193可以产生振动提示,也可以用于触摸振动反馈等。按键194包括开机键,音量键等。The indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like. The motor 193 can generate vibration prompts, and can also be used for touch vibration feedback and the like. The keys 194 include a power-on key, a volume key, and the like.
移动终端100可以支持一个或多个SIM卡接口195,用于连接SIM卡。The mobile terminal 100 may support one or more SIM card interfaces 195 for connecting SIM cards.
下面结合图2对本公开示例性实施方式的视频处理方法进行说明,图2示出了视频处理方法的示意性流程,可以包括以下步骤S210至S230,下面对每个步骤进行具体说明:The video processing method according to the exemplary embodiment of the present disclosure will be described below with reference to FIG. 2 . FIG. 2 shows a schematic flow of the video processing method, which may include the following steps S210 to S230, and each step will be described in detail below:
步骤S210,获取待拼接的至少两个视频片段,其中的至少一个视频片段包括两帧或两帧以上图像。Step S210: Acquire at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images.
视频片段是指原始的视频素材,其本质上是独立的视频,由于后续需要进行拼接,为了区别于拼接后的视频,这里将视频素材称为“片段”。每个视频片段一般由两帧或两帧以上图像组成,本示例性实施方式中,也可以获取单帧视频片段,也就是将单张图像作为一类特殊的视频片段。A video clip refers to the original video material, which is essentially an independent video. Since subsequent splicing is required, in order to distinguish it from the spliced video, the video material is referred to as a "segment" here. Each video clip is generally composed of two or more frames of images. In this exemplary embodiment, a single-frame video clip can also be acquired, that is, a single image is regarded as a special type of video clip.
在视频录制的场景中,可以获取不同时间拍摄的多段短视频或图像,或者不同设备(包括不同摄像头)拍摄的多段短视频或图像,将每段短视频或每张图像分别作为不同的视频片段。不同的视频片段可以串行输入,也可以并行输入。In the scene of video recording, you can obtain multiple short videos or images shot at different times, or multiple short videos or images shot by different devices (including different cameras), and treat each short video or image as a different video segment. . Different video clips can be input serially or in parallel.
需要说明的是,初始获取的视频片段可能是经过编码的视频数据,则可以通过视频解码器或其他解析器对视频数据进行处理,得到视频片段中每一帧的图像数据。It should be noted that the initially acquired video segment may be encoded video data, and the video data may be processed by a video decoder or other parser to obtain image data of each frame in the video segment.
在一种可选的实施方式中,可以获取背景部分相同、前景部分相似的视频片段,以便于后续进行拼接。In an optional implementation manner, video clips with the same background part and similar foreground parts may be acquired to facilitate subsequent splicing.
在一种可选的实施方式中,执行步骤S210后,还可以根据实际需求,对任意一个或多个视频片段进行以下处理:In an optional implementation manner, after step S210 is performed, the following processing can also be performed on any one or more video clips according to actual requirements:
①将一个视频片段拆分为多个视频片段。一般的,一个视频片段中如果包含多段内容,则可以进行拆分,例如检测视频片段中相邻两帧图像之间的相似度,将相似度较低的位置确定为变化点,在变化点处进行视频拆分。这样得到的每个视频片段中,内容连续性较高, 有利于后续拼接。在一种可选的实施方式中,可以选取一个视频片段作为主视频,对主视频进行拆分,后续其他视频片段与主视频的各个拆分片段进行拼接,相当于插入到主视频的不同位置。① Split a video clip into multiple video clips. Generally, if a video clip contains multiple pieces of content, it can be split, for example, by detecting the similarity between two adjacent frames of images in the video clip, and determining the position with lower similarity as the change point, at the change point Do video splits. In each video segment obtained in this way, the content continuity is relatively high, which is favorable for subsequent splicing. In an optional implementation, a video clip can be selected as the main video, the main video can be split, and subsequent video clips can be spliced with each split clip of the main video, which is equivalent to inserting into different positions of the main video. .
②将两个或两个以上视频片段合成为一个视频片段。例如两个视频片段是两个摄像头从不同角度同步拍摄同一场景所得到的视频片段,可以在两个视频片段中选取时间戳相同的两帧,对这两帧进行配准,然后采用配准参数对两个视频片段进行配准与合成,得到一个场景内容更加全面、丰富的视频片段;或者一个视频片段为拍摄的场景视频,另一个视频片段为配图视频,可以将配图视频插入到场景视频中的某个位置,实现两个视频片段的合成,等等。② Combine two or more video clips into one video clip. For example, two video clips are video clips obtained by two cameras synchronously shooting the same scene from different angles. You can select two frames with the same timestamp from the two video clips, register the two frames, and then use the registration parameters. Register and synthesize two video clips to obtain a video clip with more comprehensive and rich scene content; or one video clip is the shot scene video, and the other video clip is the picture video, and the picture video can be inserted into the scene A certain position in the video, to achieve a composite of two video clips, and so on.
③从视频片段中删除一帧或多帧图像,以对视频片段中的内容进行筛选。例如从视频片段中删除模糊不清的帧,或者删除与视频主题相关性较低的帧,或者提取视频片段中具有代表性的一帧图像,删除其他帧,等等。③ Delete one or more frames of images from the video clip to filter the content in the video clip. For example, removing ambiguous frames from a video clip, or removing frames that are less relevant to the subject of the video, or extracting a representative frame of the video clip, removing other frames, and so on.
④对视频片段进行分辨率调整,可以将每个视频片段调整为相同的分辨率。例如预先设定标准分辨率,对低于该分辨率的视频片段进行上采样处理,对高于该分辨率的视频片段进行下采样处理,或者以分辨率最低的视频片段为标准,对其他视频片段进行下采样处理,等等。④ Adjust the resolution of the video clips, you can adjust each video clip to the same resolution. For example, set a standard resolution in advance, perform up-sampling processing on video clips lower than this resolution, down-sampling processing on video clips higher than this resolution, or use the video clip with the lowest resolution as the standard, and perform up-sampling processing on other video clips. Fragments are downsampled, and so on.
需要说明的是,实际应用中,可以根据需求对上述四种处理方式进行任意组合,当然也可以采用上述未列出的其他处理方式,本公开对此不做限定。It should be noted that, in practical applications, any combination of the above four processing methods may be performed according to requirements, and of course other processing methods not listed above may also be used, which is not limited in the present disclosure.
步骤S220,在上述至少两个视频片段中的至少一个待拼接位置进行插帧,生成插帧图像。Step S220, performing frame insertion at at least one to-be-spliced position of the at least two video clips to generate an inserted frame image.
待拼接位置是指不同视频片段进行拼接的位置,可以包括起始位置、结尾位置以及任意相邻两个视频片段之间的位置。其中,起始位置位于上述至少两个视频片段中的第一个视频片段之前,结尾位置位于上述至少两个视频片段中的最后一个视频片段之后。需要说明的是,在一些情况下,可以将第一个视频片段与最后一个视频片段进行首位拼接,因此上述起始位置和结尾位置可以作为待拼接位置。The position to be spliced refers to the position where different video clips are spliced, and may include a start position, an end position, and a position between any two adjacent video clips. Wherein, the start position is located before the first video segment of the at least two video segments, and the end position is located after the last video segment of the at least two video segments. It should be noted that, in some cases, the first video clip and the last video clip may be first spliced, so the above-mentioned start position and end position can be used as the position to be spliced.
参考图3所示,获取待拼接的视频片段1、视频片段2、…、和视频片段n,位于视频片段1之前的为起始位置P1,位于视频片段n之后的为结尾位置Pn+1,中间相邻两个视频片段之间的位置包括P2、P3等,P1到Pn+1均为待拼接位置。Referring to Fig. 3, obtain the video clip 1, video clip 2, ..., and video clip n to be spliced, the start position P1 before the video clip 1, the end position Pn+1 after the video clip n, The positions between the two adjacent video clips in the middle include P2, P3, etc., and P1 to Pn+1 are positions to be spliced.
待拼接的视频片段数量为至少两个,因此包括至少三个待拼接位置。本示例性实施方式中,可以在其中至少一个待拼接位置处进行插帧,以增加待拼接位置前后两个视频片段之间的连续性。The number of video segments to be spliced is at least two, thus including at least three locations to be spliced. In this exemplary embodiment, frame interpolation may be performed at at least one of the positions to be spliced, so as to increase the continuity between the two video segments before and after the position to be spliced.
在待拼接位置中,起始位置P1、结尾位置Pn+1是两个比较特殊的位置,只有一侧有视频片段。下面将待拼接位置分为两类,第一类待拼接位置是中间待拼接位置,即相邻两个视频片段之间的位置,包括图3中的P2、P3等;第二类待拼接位置是起始位置和结尾位置。对两类待拼接位置分别说明如何插帧:Among the positions to be spliced, the start position P1 and the end position Pn+1 are two relatively special positions, and only one side has a video clip. The positions to be spliced are divided into two categories below. The first type of positions to be spliced is the intermediate positions to be spliced, that is, the positions between two adjacent video clips, including P2, P3, etc. in Figure 3; the second type of positions to be spliced are the start and end positions. Describe how to insert frames for the two types of positions to be spliced:
针对于第一类待拼接位置,参考图4所示,步骤S220可以包括以下步骤S410:For the first type of positions to be spliced, referring to FIG. 4 , step S220 may include the following steps S410:
步骤S410,根据待拼接位置的前一视频片段中的至少一帧图像,与待拼接位置的后一视频片段中的至少一帧图像,进行插帧,生成插帧图像。Step S410, perform frame interpolation according to at least one frame of image in the previous video clip at the position to be spliced and at least one frame of image in the next video clip at the position to be spliced to generate an inserted frame image.
以图3中的P3为例,前一视频片段即视频片段2,后一视频片段即视频片段3,从视频片段2中选取一帧或多帧图像,从视频片段3中也选取一帧或多帧图像,根据所选取的图像在P3处进行插帧。在插帧时可以采用FRC(Frame Rate Conversion,帧率转换)技术,如MEMC(Motion Estimation and Motion Compensation,运动估计与运动补偿)、光流法、神经网络处理等。Taking P3 in FIG. 3 as an example, the previous video clip is video clip 2, and the next video clip is video clip 3. One or more frames of images are selected from video clip 2, and one or more frames are also selected from video clip 3. For multiple frames of images, frame interpolation is performed at P3 according to the selected images. FRC (Frame Rate Conversion) technology can be used when inserting frames, such as MEMC (Motion Estimation and Motion Compensation, motion estimation and motion compensation), optical flow method, neural network processing, etc.
进一步的,上述在前一视频片段与后一视频片段中所选取的用于插帧的图像可以是:前一视频片段中的结尾帧图像和后一视频片段中的起始帧图像,这两帧也是待拼接位置处的边界帧图像,通过这两帧进行插帧,结果的准确度较高。Further, the above-mentioned images selected for frame insertion in the previous video clip and the next video clip may be: the end frame image in the previous video clip and the start frame image in the next video clip, these two The frame is also the boundary frame image at the position to be spliced, and the frame interpolation is performed through these two frames, and the accuracy of the result is high.
需要说明的是,如果某一视频片段为单帧视频片段,如图3中的视频片段4,则单帧即是视频片段4的起始帧,也是视频片段4的结尾帧,例如可以通过视频片段4的单帧与视频片段3的结尾帧,在P4处进行插帧。当然,也可能存在前一视频片段与后一视频片段均为单帧视频片段的情况,则通过两个单帧,在其中间的待拼接位置进行插帧即可。It should be noted that if a video clip is a single-frame video clip, such as video clip 4 in Figure 3, the single frame is the start frame of video clip 4 and the end frame of video clip 4. The single frame of clip 4 and the end frame of video clip 3 are interpolated at P4. Of course, there may also be a situation in which the previous video clip and the next video clip are both single-frame video clips, and it is sufficient to insert frames at the position to be spliced in the middle of the two single frames.
针对于第二类待拼接位置,参考图4所示,步骤S220还可以包括以下步骤S420:For the second type of positions to be spliced, referring to FIG. 4 , step S220 may further include the following steps S420:
步骤S420,根据上述第一个视频片段中的至少一帧图像,与上述最后一个视频片段中的至少一帧图像,在上述起始位置和/或上述结尾位置进行插帧,生成插帧图像。Step S420, according to at least one frame of image in the first video clip and at least one frame of image in the last video clip, perform frame interpolation at the above-mentioned starting position and/or the above-mentioned ending position to generate an interpolated frame image.
如图3所示,可以在视频片段1中选取一帧或多帧图像,在视频片段n中选取一帧或多帧图像,根据视频片段n中的图像到视频片段1中的图像的运动趋势,进行插帧。换而言之,对于起始位置和结尾位置,可以将其前一视频片段看作是视频片段序列的最后一个视频片段,将其后一视频片段看作是视频片段序列的第一个视频片段,然后在这两个视频片段之间进行插帧。对于生成的插帧图像,可以全部放至起始位置,也可以全部放至结尾位置,还可以将一部分插帧图像放至起始位置,另一部分放至结尾位置。As shown in FIG. 3 , one or more frames of images can be selected from video clip 1, and one or more frames of images can be selected from video clip n. According to the movement trend of the image in video clip n to the image in video clip 1 to insert frames. In other words, for the start position and end position, the previous video clip can be regarded as the last video clip of the video clip sequence, and the following video clip can be regarded as the first video clip of the video clip sequence. , then interpolate between the two video clips. For the generated interpolated frame images, all of them can be placed at the start position, or all of them can be placed at the end position, and part of the interpolated frame images can be placed at the start position and the other part at the end position.
进一步的,上述在第一个视频片段与最后一个视频片段中所选取的用于插帧的图像可以是:第一个视频片段中的起始帧图像和最后一个视频片段中的结尾帧图像。Further, the above-mentioned images selected for frame insertion in the first video segment and the last video segment may be: a start frame image in the first video segment and an end frame image in the last video segment.
需要说明的是,此处插帧的内容为从全部视频片段的结尾帧图像回到全部视频片段的起始帧图像的过渡画面。It should be noted that the content of the inserted frame here is a transition picture from the end frame image of all video clips back to the start frame image of all video clips.
下面以MEMC为例,对插帧的过程进行具体说明。参考图5所示,假设选取了前一视频片段的结尾帧图像F1与后一视频片段的起始帧图像F2。The following takes MEMC as an example to describe the frame insertion process in detail. Referring to FIG. 5 , it is assumed that the end frame image F1 of the previous video clip and the start frame image F2 of the subsequent video clip are selected.
首先将一张图像确定为参考图像,另一张为当前图像,例如以F1为参考图像,F2为当前图像;First, determine one image as the reference image and the other as the current image, for example, take F1 as the reference image and F2 as the current image;
对当前图像F2分块,图像块的大小可以根据实际情况设定,按照不同图像块在参考图像F1中进行遍历,寻找各个图像块的匹配块,根据图像块与其匹配块之间的位置变化确定当前图像相对于参考图像的MV(Motion Vector,运动矢量),记为前向MV;For the current image F2, the size of the image block can be set according to the actual situation, traverse the reference image F1 according to different image blocks, find the matching block of each image block, and determine according to the position change between the image block and its matching block. The MV (Motion Vector) of the current image relative to the reference image is recorded as the forward MV;
同理,采用上述操作,也可以确定参考图像F1的各个图像块相对于当前图像F2的位置变化,得到后向MV;Similarly, by using the above operations, it is also possible to determine the position change of each image block of the reference image F1 relative to the current image F2 to obtain the backward MV;
将前向MV和后向MV进行一定的修正操作,如滤波、加权等;Perform certain correction operations on the forward MV and the backward MV, such as filtering, weighting, etc.;
根据插帧的时间相位,沿着前向MV和后向MV,估计图像块在不同时间相位的运动状态,并进行MV的重新校正,以确定插值块,按照插值块相对于当前图像F2和参考图像F1的映射MV,对插值块在当前图像F2和参考图像F1的对应图像块进行权重插值,从而得到每个像素值,生成插帧图像。According to the time phase of the interpolated frame, along the forward MV and the backward MV, the motion state of the image block at different time phases is estimated, and the MV is re-corrected to determine the interpolated block. According to the interpolated block relative to the current image F2 and the reference The mapping MV of the image F1 performs weight interpolation for the interpolation blocks in the corresponding image blocks of the current image F2 and the reference image F1, so as to obtain each pixel value and generate an interpolated frame image.
在一种可选的实施方式中,参考图6所示,插帧的数量与时间相位可以通过以下步骤S610至S650来确定:In an optional implementation manner, referring to FIG. 6 , the number and time phase of the inserted frames can be determined through the following steps S610 to S650:
步骤S610,在待拼接位置的前一视频片段中选取至少两帧图像,通过对其进行运动估计,得到第一MV;Step S610, select at least two frames of images in the previous video segment of the position to be spliced, and obtain a first MV by performing motion estimation on them;
步骤S602,在待拼接位置的后一视频片段中选取至少两帧图像,通过对其进行运动估计,得到第二MV;Step S602, select at least two frames of images in the next video segment of the position to be spliced, and obtain a second MV by performing motion estimation on them;
步骤S630,根据上述前一视频片段与后一视频片段之间的边界运动状态,得到这两个视频片段之间的第三MV;Step S630, according to the boundary motion state between the previous video clip and the next video clip, obtain a third MV between the two video clips;
步骤S640,根据第一MV、第二MV、第三MV,以及在上述前一视频片段与后一视频片段中所选取的图像的时间戳,绘制时间-运动曲线;Step S640, draw a time-motion curve according to the first MV, the second MV, the third MV, and the time stamps of the images selected in the previous video clip and the next video clip;
步骤S650,在时间-运动曲线中上述前一视频片段与后一视频片段之间的部分,根据实际运动状态,确定插帧的数量与时间相位。例如可以通过等时间相位或非等时间相位确定若干插值点,从而确定插帧的数量与时间相位。Step S650, in the part between the previous video segment and the next video segment in the time-motion curve, according to the actual motion state, determine the number and time phase of the interpolated frames. For example, a number of interpolation points can be determined by equal time phase or unequal time phase, so as to determine the number and time phase of the interpolation frames.
步骤S230,将视频片段和插帧图像进行拼接,得到目标视频。Step S230, splicing the video clip and the interpolated frame image to obtain the target video.
将全部的视频片段和插帧图像进行拼接,并设置每一帧图像的时间戳,例如可以按照所需的视频帧率(如24fps、30fps、60fps等)设置,从而得到完整的目标视频。Splicing all video clips and interleaved frame images, and setting the timestamp of each frame image, for example, it can be set according to the required video frame rate (such as 24fps, 30fps, 60fps, etc.), so as to obtain a complete target video.
需要说明的是,如果在起始位置或结尾位置进行插帧,则可以将目标视频设置为循环播放,即播放到视频结尾后跳转到视频开头重新播放,基于起始位置或结尾位置的插帧图像,在从目标视频的结尾跳转到开头时,画面呈现出连续性,形成首尾相接的自循环观感。It should be noted that if the frame is inserted at the start position or the end position, the target video can be set to loop playback, that is, after playing to the end of the video, jump to the beginning of the video to replay, and the insertion based on the start position or the end position Frame images, when jumping from the end of the target video to the beginning, the picture shows continuity, forming a self-looping look and feel.
在一种可选的实施方式中,在步骤S220之前,可以按照拼接顺序对上述各视频片段进行排列。视频片段之间的拼接顺序可以是任意指定或确定的顺序。下面提供确定拼接顺序的示例性方式,但下述内容不应对本公开的保护范围造成限定:In an optional implementation manner, before step S220, the foregoing video clips may be arranged in a splicing sequence. The splicing order between video clips can be any specified or determined order. An exemplary manner for determining the splicing sequence is provided below, but the following content should not limit the scope of protection of the present disclosure:
(1)由用户设置拼接顺序,例如在获取多个视频片段后,将其显示在某一排序界面中,允许用户拖动其中的视频片段以调换顺序。(1) The splicing sequence is set by the user. For example, after acquiring multiple video clips, they are displayed in a sorting interface, and the user is allowed to drag the video clips to change the order.
(2)根据视频片段的拍摄时间确定拼接顺序,通常按照拍摄时间由早到晚的顺序排列各视频片段。(2) The splicing sequence is determined according to the shooting time of the video clips, and the video clips are usually arranged in the order of shooting time from early to late.
(3)按照视频片段中前景部分的移动路径确定拼接顺序,例如识别视频片段中的背景部分与前景部分,并在背景部分中确定静止的参照物体,如一棵树、一个建筑等,通过 前景部分与该参照物体之间的位置关系,确定前景部分的移动路径,如从参照物体的左侧移动到右侧,按照该路径确定不同视频片段之间的拼接顺序。(3) Determine the splicing sequence according to the moving path of the foreground part in the video clip, for example, identify the background part and the foreground part in the video clip, and determine the static reference object in the background part, such as a tree, a building, etc., through the foreground part Based on the positional relationship with the reference object, the moving path of the foreground part is determined, for example, moving from the left side of the reference object to the right side, and the splicing sequence between different video segments is determined according to the path.
在一种可选的实施方式中,在步骤S220之前,还可以检测相邻两个视频片段之间的重复帧,并从其中任一视频片段中删除重复帧。重复帧是指相邻两个视频片段中出现的重复画面,例如两个视频片段中存在交集,从任一视频片段中删除重复帧,可以避免同一画面重复出现。需要说明的是,可能存在某一视频片段在另一视频片段中完全重复出现的情况,例如视频片段A在视频片段B中完全重复出现,A可视为B的子集,则可以将A全部删除,此时还可以进一步对比B与其他相邻视频片段的重复帧,并进行删除处理。In an optional implementation manner, before step S220, a duplicate frame between two adjacent video clips may also be detected, and the duplicate frame may be deleted from any one of the video clips. Duplicate frames refer to duplicate pictures that appear in two adjacent video clips. For example, if there is an intersection between two video clips, deleting duplicate frames from any video clip can prevent the same picture from appearing repeatedly. It should be noted that there may be a situation where a certain video clip appears completely in another video clip. For example, if video clip A appears completely in video clip B, A can be regarded as a subset of B, and all A can be considered as a subset of B. Delete, at this time, you can further compare the duplicate frames of B and other adjacent video clips, and perform deletion processing.
下面通过两个具体示例,对上述视频处理方法做进一步说明。The above video processing method will be further described below through two specific examples.
示例一、参考图7所示,获取两个视频片段,分别为视频片段1和视频片段2。其中视频片段1包括N帧图像,检测到其中第K帧为变化点,变化点前后的视频内容差别较大,以K帧为分割点,将视频片段1分割为第一短视频片段(第1帧到第K-1帧)和第二短视频片段(第K帧到第N帧);视频片段2包括M帧图像,背景部分与视频片段1相似,仅前景部分的位置不同,选取其中具有代表性的一帧(记为Z帧)予以保留,其余部分删除,形成单帧视频片段;按照第一短视频片段、Z帧、第二短视频片段排列,形成视频片段序列,该视频片段序列包括4个待拼接位置;在第一短视频片段与Z帧之间插帧T1,在Z帧与第二短视频片段之间插帧T2,拼接1~K-1、T1、Z、T2、K~N,得到目标视频。Example 1: Referring to FIG. 7 , two video clips are acquired, namely video clip 1 and video clip 2 . The video clip 1 includes N frames of images, and it is detected that the Kth frame is a change point, and the video content before and after the change point is quite different. Taking the K frame as the split point, the video clip 1 is divided into the first short video clip (the first short video clip (the first short video clip). frame to the K-1th frame) and the second short video clip (the Kth frame to the Nth frame); the video clip 2 includes M frame images, the background part is similar to the video clip 1, only the position of the foreground part is different, select the A representative frame (denoted as Z frame) is retained, and the rest is deleted to form a single-frame video clip; according to the first short video clip, Z frame, and the second short video clip, a video clip sequence is formed. The video clip sequence Including 4 positions to be spliced; insert frame T1 between the first short video clip and Z frame, insert frame T2 between Z frame and the second short video clip, splicing 1~K-1, T1, Z, T2, K~N, get the target video.
示例二、获取两个视频片段,分别为视频片段1和视频片段2。在视频片段1中选取一个变化点,将视频片段1拆分为第一短视频片段和第二短视频片段;在视频片段2中选取两个变化点,将视频片段2拆分为第三短视频片段、第四短视频片段和第五短视频片段;根据设定拼接顺序,按照第一、第三、第二、第五、第四短视频片段的顺序排列,分别在每两个短视频片段之间进行插帧,最终拼接为目标视频。Example 2: Acquire two video clips, namely video clip 1 and video clip 2. Select a change point in video clip 1, and split video clip 1 into a first short video clip and a second short video clip; select two change points in video clip 2, and split video clip 2 into a third short video clip Video clips, fourth short video clips and fifth short video clips; according to the set splicing sequence, in the order of the first, third, second, fifth, and fourth short video clips, respectively in every two short video clips. Interpolate frames between clips, and finally splicing into the target video.
基于上述内容,本示例性实施方式中,一方面,在视频拼接时,利用视频图像帧之间的相关性,在不同视频片段之间进行插帧,以增加视频片段之间的过渡性内容,改善画面的连续性,解决视频拼接中画面突变的问题。另一方面,本方案处理过程简单,基于待拼接的视频片段即可实现,无需额外的信息,实用性较高。Based on the above content, in this exemplary embodiment, on the one hand, during video splicing, the correlation between video image frames is used to insert frames between different video clips to increase transitional content between video clips, Improve the continuity of the picture and solve the problem of sudden picture changes in video splicing. On the other hand, the processing process of this solution is simple, and can be implemented based on the video clips to be spliced, without additional information, and has high practicability.
本公开的示例性实施方式还提供一种视频处理装置,如图8所示,该视频处理装置800可以包括处理器810与存储器820,其中,处理器810用于执行存储器820中存储的以下程序模块:Exemplary embodiments of the present disclosure also provide a video processing apparatus. As shown in FIG. 8 , the video processing apparatus 800 may include a processor 810 and a memory 820 , wherein the processor 810 is configured to execute the following program stored in the memory 820 Module:
获取模块821,被配置为获取待拼接的至少两个视频片段,其中的至少一个视频片段包括两帧或两帧以上图像;The acquiring module 821 is configured to acquire at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images;
插帧模块822,被配置为在上述至少两个视频片段中的至少一个待拼接位置进行插帧,生成插帧图像;The frame insertion module 822 is configured to perform frame insertion at at least one to-be-spliced position in the above-mentioned at least two video clips to generate an inserted frame image;
拼接模块823,被配置为将视频片段和插帧图像进行拼接,得到目标视频。The splicing module 823 is configured to splicing the video segment and the interpolated frame image to obtain the target video.
在一种可选的实施方式中,待拼接位置包括起始位置、结尾位置以及任意相邻两个视 频片段之间的位置,起始位置位于至少两个视频片段中的第一个视频片段之前,结尾位置位于至少两个视频片段中的最后一个视频片段之后。In an optional implementation manner, the position to be spliced includes a start position, an end position, and a position between any two adjacent video clips, and the start position is located before the first video clip of the at least two video clips , the end position is after the last video clip of the at least two video clips.
在一种可选的实施方式中,插帧模块822,被配置为:In an optional implementation manner, the frame insertion module 822 is configured to:
根据待拼接位置的前一视频片段中的至少一帧图像,与待拼接位置的后一视频片段中的至少一帧图像,进行插帧,生成插帧图像。Frame interpolation is performed according to at least one frame of image in the previous video clip of the position to be spliced and at least one frame of image in the next video clip of the position to be spliced to generate an inserted frame image.
在一种可选的实施方式中,前一视频片段中的至少一帧图像包括前一视频片段中的结尾帧图像,后一视频片段中的至少一帧图像包括后一视频片段中的起始帧图像。In an optional implementation manner, at least one frame image in the previous video clip includes an end frame image in the previous video clip, and at least one frame image in the subsequent video clip includes a starting frame image in the subsequent video clip frame image.
在一种可选的实施方式中,插帧模块822,被配置为:In an optional implementation manner, the frame insertion module 822 is configured to:
根据第一个视频片段中的至少一帧图像,与最后一个视频片段中的至少一帧图像,在起始位置和/或结尾位置进行插帧,生成插帧图像。According to at least one frame of image in the first video clip and at least one frame of image in the last video clip, frame interpolation is performed at the start position and/or the end position to generate an interpolated frame image.
在一种可选的实施方式中,第一个视频片段中的至少一帧图像包括第一个视频片段中的起始帧图像,最后一个视频片段中的至少一帧图像包括最后一个视频片段中的结尾帧图像。In an optional implementation manner, at least one frame of image in the first video clip includes a start frame image in the first video clip, and at least one frame of image in the last video clip includes an image in the last video clip end frame image.
在一种可选的实施方式中,拼接模块823,还被配置为:In an optional implementation manner, the splicing module 823 is further configured to:
在得到目标视频后,将目标视频设置为循环播放。After getting the target video, set the target video to play in a loop.
在一种可选的实施方式中,插帧模块822,还被配置为:In an optional implementation manner, the frame insertion module 822 is further configured to:
在待拼接位置的前一视频片段中选取至少两帧图像,通过对其进行运动估计,得到第一运动矢量;Select at least two frames of images in the previous video segment of the position to be spliced, and obtain a first motion vector by performing motion estimation on them;
在待拼接位置的后一视频片段中选取至少两帧图像,通过对其进行运动估计,得到第二运动矢量;Select at least two frames of images in the next video segment of the position to be spliced, and obtain a second motion vector by performing motion estimation on them;
根据前一视频片段与后一视频片段之间的边界运动状态,得到前一视频片段与后一视频片段之间的第三运动矢量;According to the boundary motion state between the previous video clip and the next video clip, obtain the third motion vector between the previous video clip and the next video clip;
根据第一运动矢量、第二运动矢量、第三运动矢量,以及在前一视频片段与后一视频片段中所选取的图像的时间戳,绘制时间-运动曲线;Draw a time-motion curve according to the first motion vector, the second motion vector, the third motion vector, and the time stamps of the images selected in the previous video segment and the next video segment;
在时间-运动曲线中前一视频片段与后一视频片段之间的部分,根据实际运动状态,确定插帧的数量与时间相位。In the part between the previous video segment and the next video segment in the time-motion curve, the number and time phase of the interpolated frames are determined according to the actual motion state.
在一种可选的实施方式中,插帧模块822,还被配置为:In an optional implementation manner, the frame insertion module 822 is further configured to:
在进行插帧之前,按照拼接顺序对上述至少两个视频片段进行排列。Before performing frame insertion, the at least two video clips are arranged in a splicing sequence.
在一种可选的实施方式中,插帧模块822,还被配置为:In an optional implementation manner, the frame insertion module 822 is further configured to:
在按照拼接顺序对上述至少两个视频片段进行排列之前,通过以下任意一种或多种方式确定拼接顺序:Before arranging the above at least two video clips according to the splicing sequence, the splicing sequence is determined by any one or more of the following methods:
获取用户设置的拼接顺序;Get the splicing order set by the user;
根据各视频片段的拍摄时间确定拼接顺序;Determine the splicing sequence according to the shooting time of each video clip;
按照各视频片段中前景部分的移动路径确定拼接顺序。The splicing sequence is determined according to the moving path of the foreground part in each video clip.
在一种可选的实施方式中,插帧模块822,还被配置为:In an optional implementation manner, the frame insertion module 822 is further configured to:
在进行插帧之前,检测相邻两个视频片段之间的重复帧,并从其中任一视频片段中删除重复帧。Before performing frame interpolation, duplicate frames between two adjacent video clips are detected, and duplicate frames are removed from either video clip.
在一种可选的实施方式中,上述至少两个视频片段包括单帧视频片段。In an optional implementation manner, the at least two video clips include single-frame video clips.
在一种可选的实施方式中,获取模块821,还被配置为:In an optional implementation manner, the obtaining module 821 is further configured to:
在获取待拼接的至少两个视频片段后,对其中的至少一个视频片段进行以下任意一项或多项处理:After acquiring at least two video clips to be spliced, perform any one or more of the following processing on at least one of the video clips:
将一个视频片段拆分为多个视频片段;Split a video clip into multiple video clips;
将两个或两个以上视频片段合成为一个视频片段;Combine two or more video clips into one video clip;
从视频片段中删除一帧或多帧图像;remove one or more frames from a video clip;
对视频片段进行分辨率调整。Make resolution adjustments to video clips.
本公开的示例性实施方式还提供另一种视频处理装置,如图9所示,该视频处理装置900可以包括:Exemplary embodiments of the present disclosure further provide another video processing apparatus. As shown in FIG. 9 , the video processing apparatus 900 may include:
获取模块910,被配置为获取待拼接的至少两个视频片段,其中的至少一个视频片段包括两帧或两帧以上图像;The acquiring module 910 is configured to acquire at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images;
插帧模块920,被配置为在上述至少两个视频片段中的至少一个待拼接位置进行插帧,生成插帧图像;The frame insertion module 920 is configured to perform frame insertion at at least one to-be-spliced position in the above at least two video clips to generate an inserted frame image;
拼接模块930,被配置为将视频片段和插帧图像进行拼接,得到目标视频。The splicing module 930 is configured to splicing the video segment and the interpolated frame image to obtain the target video.
在一种可选的实施方式中,待拼接位置包括起始位置、结尾位置以及任意相邻两个视频片段之间的位置,起始位置位于上述至少两个视频片段中的第一个视频片段之前,结尾位置位于上述至少两个视频片段中的最后一个视频片段之后。In an optional implementation manner, the position to be spliced includes a start position, an end position, and a position between any two adjacent video clips, and the start position is located at the first video clip of the at least two video clips. Before, the end position is located after the last video clip of the at least two video clips.
在一种可选的实施方式中,插帧模块920,被配置为:In an optional implementation manner, the frame insertion module 920 is configured to:
根据待拼接位置的前一视频片段中的至少一帧图像,与待拼接位置的后一视频片段中的至少一帧图像,进行插帧,生成插帧图像。Frame interpolation is performed according to at least one frame of image in the previous video clip of the position to be spliced and at least one frame of image in the next video clip of the position to be spliced to generate an inserted frame image.
进一步的,上述前一视频片段中的至少一帧图像包括前一视频片段中的结尾帧图像,上述后一视频片段中的至少一帧图像包括后一视频片段中的起始帧图像。Further, at least one frame of image in the previous video clip includes an end frame image in the previous video clip, and at least one frame image in the next video clip includes a start frame image in the next video clip.
在一种可选的实施方式中,插帧模块920,被配置为:In an optional implementation manner, the frame insertion module 920 is configured to:
根据上述第一个视频片段中的至少一帧图像,与上述最后一个视频片段中的至少一帧图像,在上述起始位置和/或上述结尾位置进行插帧,生成插帧图像。According to at least one frame of image in the first video clip and at least one frame of image in the last video clip, frame interpolation is performed at the start position and/or the end position to generate the frame interpolation image.
在一种可选的实施方式中,上述第一个视频片段中的至少一帧图像包括第一个视频片段中的起始帧图像,上述最后一个视频片段中的至少一帧图像包括最后一个视频片段中的结尾帧图像。In an optional implementation manner, at least one frame of image in the first video clip includes a start frame image in the first video clip, and at least one frame of image in the last video clip includes the last video The end frame image in the clip.
在一种可选的实施方式中,拼接模块930,还被配置为:In an optional implementation manner, the splicing module 930 is further configured to:
在得到目标视频后,将目标视频设置为循环播放。After getting the target video, set the target video to play in a loop.
在一种可选的实施方式中,插帧模块920,还被配置为:In an optional implementation manner, the frame insertion module 920 is further configured to:
在待拼接位置的前一视频片段中选取至少两帧图像,通过对其进行运动估计,得到第 一运动矢量;Select at least two frames of images in the previous video segment of the position to be spliced, and obtain the first motion vector by performing motion estimation on them;
在待拼接位置的后一视频片段中选取至少两帧图像,通过对其进行运动估计,得到第二运动矢量;Select at least two frames of images in the next video segment of the position to be spliced, and obtain a second motion vector by performing motion estimation on them;
根据前一视频片段与后一视频片段之间的边界运动状态,得到前一视频片段与后一视频片段之间的第三运动矢量;According to the boundary motion state between the previous video clip and the next video clip, obtain the third motion vector between the previous video clip and the next video clip;
根据第一运动矢量、第二运动矢量、第三运动矢量,以及在前一视频片段与后一视频片段中所选取的图像的时间戳,绘制时间-运动曲线;Draw a time-motion curve according to the first motion vector, the second motion vector, the third motion vector, and the time stamps of the images selected in the previous video segment and the next video segment;
在时间-运动曲线中前一视频片段与后一视频片段之间的部分,根据实际运动状态,确定插帧的数量与时间相位。In the part between the previous video segment and the next video segment in the time-motion curve, the number and time phase of the interpolated frames are determined according to the actual motion state.
在一种可选的实施方式中,插帧模块920,还被配置为:In an optional implementation manner, the frame insertion module 920 is further configured to:
在进行插帧之前,按照拼接顺序对上述至少两个视频片段进行排列。Before performing frame insertion, the at least two video clips are arranged in a splicing sequence.
在一种可选的实施方式中,插帧模块920,还被配置为:In an optional implementation manner, the frame insertion module 920 is further configured to:
在按照拼接顺序对上述至少两个视频片段进行排列之前,通过以下任意一种或多种方式确定拼接顺序:Before arranging the above at least two video clips according to the splicing sequence, the splicing sequence is determined by any one or more of the following methods:
获取用户设置的拼接顺序;Get the splicing order set by the user;
根据各视频片段的拍摄时间确定拼接顺序;Determine the splicing sequence according to the shooting time of each video clip;
按照各视频片段中前景部分的移动路径确定拼接顺序。The splicing sequence is determined according to the moving path of the foreground part in each video clip.
在一种可选的实施方式中,插帧模块920,还被配置为:In an optional implementation manner, the frame insertion module 920 is further configured to:
在进行插帧之前,检测相邻两个视频片段之间的重复帧,并从其中任一视频片段中删除重复帧。Before performing frame interpolation, duplicate frames between two adjacent video clips are detected, and duplicate frames are removed from either video clip.
在一种可选的实施方式中,上述至少两个视频片段包括单帧视频片段。In an optional implementation manner, the at least two video clips include single-frame video clips.
在一种可选的实施方式中,获取模块910,还被配置为:In an optional implementation manner, the obtaining module 910 is further configured to:
在获取待拼接的至少两个视频片段后,对其中的至少一个视频片段进行以下任意一项或多项处理:After acquiring at least two video clips to be spliced, perform any one or more of the following processing on at least one of the video clips:
将一个视频片段拆分为多个视频片段;Split a video clip into multiple video clips;
将两个或两个以上视频片段合成为一个视频片段;Combine two or more video clips into one video clip;
从视频片段中删除一帧或多帧图像;remove one or more frames from a video clip;
对视频片段进行分辨率调整。Make resolution adjustments to video clips.
上述装置中各部分的具体细节在方法部分实施方式中已经详细说明,因而不再赘述。The specific details of each part in the above-mentioned apparatus have been described in detail in the method part of the implementation, and thus will not be repeated.
本公开的示例性实施方式还提供了一种计算机可读存储介质,其上存储有能够实现本说明书上述方法的程序产品。在一些可能的实施方式中,本公开的各个方面还可以实现为一种程序产品的形式,其包括程序代码,当程序产品在终端设备上运行时,程序代码用于使终端设备执行本说明书上述“示例性方法”部分中描述的根据本公开各种示例性实施方式的步骤,例如可以执行图2或图4中任意一个或多个步骤。该程序产品可以采用便携式紧凑盘只读存储器(CD-ROM)并包括程序代码,并可以在终端设备,例如个人电脑上运 行。然而,本公开的程序产品不限于此,在本文件中,可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。Exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which a program product capable of implementing the above-described method of the present specification is stored. In some possible implementations, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program code, when the program product runs on a terminal device, the program code is used to cause the terminal device to execute the above-mentioned procedures in this specification. The steps described in the "Exemplary Methods" section according to various exemplary embodiments of the present disclosure, for example, any one or more of the steps in FIG. 2 or FIG. 4 may be performed. The program product may take the form of a portable compact disk read only memory (CD-ROM) and include program code, and may be executed on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
程序产品可以采用一个或多个可读介质的任意组合。可读介质可以是可读信号介质或者可读存储介质。可读存储介质例如可以为但不限于电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples (non-exhaustive list) of readable storage media include: electrical connections with one or more wires, portable disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了可读程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。可读信号介质还可以是可读存储介质以外的任何可读介质,该可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。A computer readable signal medium may include a propagated data signal in baseband or as part of a carrier wave with readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium can also be any readable medium, other than a readable storage medium, that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于无线、有线、光缆、RF等等,或者上述的任意合适的组合。Program code embodied on a readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
可以以一种或多种程序设计语言的任意组合来编写用于执行本公开操作的程序代码,程序设计语言包括面向对象的程序设计语言—诸如Java、C++等,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算设备上执行、部分地在用户设备上执行、作为一个独立的软件包执行、部分在用户计算设备上部分在远程计算设备上执行、或者完全在远程计算设备或服务器上执行。在涉及远程计算设备的情形中,远程计算设备可以通过任意种类的网络,包括局域网(LAN)或广域网(WAN),连接到用户计算设备,或者,可以连接到外部计算设备(例如利用因特网服务提供商来通过因特网连接)。Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages—such as Java, C++, etc., as well as conventional procedural programming Language - such as the "C" language or similar programming language. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server execute on. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (eg, using an Internet service provider business via an Internet connection).
所属技术领域的技术人员能够理解,本公开的各个方面可以实现为系统、方法或程序产品。因此,本公开的各个方面可以具体实现为以下形式,即:完全的硬件实施方式、完全的软件实施方式(包括固件、微代码等),或硬件和软件方面结合的实施方式,这里可以统称为“电路”、“模块”或“系统”。As will be appreciated by one skilled in the art, various aspects of the present disclosure may be implemented as a system, method or program product. Therefore, various aspects of the present disclosure can be embodied in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, which may be collectively referred to herein as implementations "circuit", "module" or "system".
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本公开的其他实施方式。本公开旨在涵盖本公开的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本公开的一般性原理并包括本公开未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施方式仅被视为示例性的,本公开的真正范围和精神由权利要求指出。Other embodiments of the present disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common general knowledge or techniques in the technical field not disclosed by this disclosure . The specification and embodiments are to be regarded as exemplary only, with the true scope and spirit of the disclosure being indicated by the claims.
应当理解的是,本公开并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本公开的范围仅由所附的权利要求来限定。It is to be understood that the present disclosure is not limited to the precise structures described above and illustrated in the accompanying drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (20)

  1. 一种视频处理方法,其特征在于,包括:A video processing method, comprising:
    获取待拼接的至少两个视频片段,其中的至少一个所述视频片段包括两帧或两帧以上图像;Obtain at least two video clips to be spliced, at least one of the video clips includes two or more frames of images;
    在所述至少两个视频片段中的至少一个待拼接位置进行插帧,生成插帧图像;Perform frame insertion at at least one to-be-spliced position in the at least two video clips to generate an inserted frame image;
    将所述视频片段和所述插帧图像进行拼接,得到目标视频。The target video is obtained by splicing the video clip and the interpolated frame image.
  2. 根据权利要求1所述的方法,其特征在于,所述待拼接位置包括起始位置、结尾位置以及任意相邻两个所述视频片段之间的位置,所述起始位置位于所述至少两个视频片段中的第一个视频片段之前,所述结尾位置位于所述至少两个视频片段中的最后一个视频片段之后。The method according to claim 1, wherein the position to be spliced includes a start position, an end position, and a position between any two adjacent video clips, and the start position is located in the at least two video clips. Before the first video clip of the video clips, the end position is located after the last video clip of the at least two video clips.
  3. 根据权利要求2所述的方法,其特征在于,所述在所述至少两个视频片段中的至少一个待拼接位置进行插帧,生成插帧图像,包括:The method according to claim 2, wherein the performing frame insertion at at least one position to be spliced in the at least two video clips to generate the frame insertion image, comprising:
    根据所述待拼接位置的前一视频片段中的至少一帧图像,与所述待拼接位置的后一视频片段中的至少一帧图像,进行插帧,生成插帧图像。Frame interpolation is performed according to at least one frame of image in the previous video clip of the position to be spliced and at least one frame of image in the next video clip of the to-be-spliced position to generate an inserted frame image.
  4. 根据权利要求3所述的方法,其特征在于,所述前一视频片段中的至少一帧图像包括所述前一视频片段中的结尾帧图像,所述后一视频片段中的至少一帧图像包括所述后一视频片段中的起始帧图像。The method according to claim 3, wherein at least one frame of image in the previous video clip comprises an end frame image in the previous video clip, and at least one frame of image in the subsequent video clip Including the start frame image in the latter video segment.
  5. 根据权利要求2所述的方法,其特征在于,所述在所述至少两个视频片段中的至少一个待拼接位置进行插帧,生成插帧图像,包括:The method according to claim 2, wherein the performing frame insertion at at least one position to be spliced in the at least two video clips to generate the frame insertion image, comprising:
    根据所述第一个视频片段中的至少一帧图像,与所述最后一个视频片段中的至少一帧图像,在所述起始位置和/或所述结尾位置进行插帧,生成插帧图像。According to at least one frame of image in the first video clip, and at least one frame of image in the last video clip, frame interpolation is performed at the start position and/or the end position to generate an interpolated frame image .
  6. 根据权利要求5所述的方法,其特征在于,所述第一个视频片段中的至少一帧图像包括所述第一个视频片段中的起始帧图像,所述最后一个视频片段中的至少一帧图像包括所述最后一个视频片段中的结尾帧图像。The method according to claim 5, wherein the at least one frame image in the first video clip comprises a start frame image in the first video clip, and at least one frame image in the last video clip A frame image includes the end frame image in the last video segment.
  7. 根据权利要求5所述的方法,其特征在于,在得到目标视频后,所述方法还包括:The method according to claim 5, wherein after obtaining the target video, the method further comprises:
    将所述目标视频设置为循环播放。Set the target video to loop.
  8. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    在所述待拼接位置的前一视频片段中选取至少两帧图像,通过对其进行运动估计,得到第一运动矢量;Select at least two frames of images in the previous video segment of the position to be spliced, and obtain a first motion vector by performing motion estimation on them;
    在所述待拼接位置的后一视频片段中选取至少两帧图像,通过对其进行运动估计,得到第二运动矢量;Select at least two frames of images in the next video segment of the position to be spliced, and obtain a second motion vector by performing motion estimation on them;
    根据所述前一视频片段与所述后一视频片段之间的边界运动状态,得到所述前一视频片段与所述后一视频片段之间的第三运动矢量;obtaining a third motion vector between the previous video segment and the latter video segment according to the boundary motion state between the former video segment and the latter video segment;
    根据所述第一运动矢量、第二运动矢量、第三运动矢量,以及在所述前一视频片段与所述后一视频片段中所选取的图像的时间戳,绘制时间-运动曲线;Drawing a time-motion curve according to the first motion vector, the second motion vector, the third motion vector, and the timestamps of the images selected in the previous video segment and the next video segment;
    在所述时间-运动曲线中所述前一视频片段与所述后一视频片段之间的部分,根据实际运动状态,确定插帧的数量与时间相位。In the part between the previous video segment and the next video segment in the time-motion curve, the number and time phase of the interpolated frames are determined according to the actual motion state.
  9. 根据权利要求1所述的方法,其特征在于,在所述至少两个视频片段中的至少一个待拼接位置进行插帧之前,所述方法还包括:The method according to claim 1, characterized in that, before frame interpolation is performed in at least one of the at least two video clips at the to-be-spliced position, the method further comprises:
    按照拼接顺序对所述至少两个视频片段进行排列。The at least two video segments are arranged in a splicing order.
  10. 根据权利要求9所述的方法,其特征在于,在按照拼接顺序对所述至少两个视频片段进行排列之前,所述方法还包括:The method according to claim 9, wherein before arranging the at least two video clips according to the splicing sequence, the method further comprises:
    通过以下任意一种或多种方式确定所述拼接顺序:The splicing sequence is determined by any one or more of the following methods:
    获取用户设置的所述拼接顺序;obtaining the splicing sequence set by the user;
    根据各所述视频片段的拍摄时间确定所述拼接顺序;Determine the splicing sequence according to the shooting time of each of the video clips;
    按照各所述视频片段中前景部分的移动路径确定所述拼接顺序。The splicing sequence is determined according to the moving path of the foreground part in each of the video segments.
  11. 根据权利要求1所述的方法,其特征在于,在所述至少两个视频片段中的至少一个待拼接位置进行插帧之前,所述方法还包括:The method according to claim 1, characterized in that, before frame interpolation is performed in at least one of the at least two video clips at the to-be-spliced position, the method further comprises:
    检测相邻两个视频片段之间的重复帧,并从其中任一视频片段中删除所述重复帧。Duplicate frames between two adjacent video clips are detected, and the duplicate frames are removed from any of the video clips.
  12. 根据权利要求1至11任一项所述的方法,其特征在于,所述至少两个视频片段包括单帧视频片段。The method according to any one of claims 1 to 11, wherein the at least two video clips comprise single-frame video clips.
  13. 根据权利要求1至11任一项所述的方法,其特征在于,在获取待拼接的至少两个视频片段后,所述方法还包括:The method according to any one of claims 1 to 11, wherein after acquiring at least two video segments to be spliced, the method further comprises:
    对所述至少两个视频片段中的至少一个视频片段,进行以下任意一项或多项处理:Perform any one or more of the following processing on at least one video clip of the at least two video clips:
    将一个所述视频片段拆分为多个视频片段;splitting one of the video clips into multiple video clips;
    将两个或两个以上所述视频片段合成为一个视频片段;combining two or more of said video clips into one video clip;
    从所述视频片段中删除一帧或多帧图像;remove one or more frames from the video clip;
    对所述视频片段进行分辨率调整。A resolution adjustment is performed on the video clip.
  14. 一种视频处理装置,其特征在于,包括处理器与存储器,所述处理器用于执行所述存储器中存储的以下程序模块:A video processing device, characterized in that it includes a processor and a memory, and the processor is configured to execute the following program modules stored in the memory:
    获取模块,被配置为获取待拼接的至少两个视频片段,其中的至少一个视频片段包括两帧或两帧以上图像;an acquisition module, configured to acquire at least two video clips to be spliced, wherein at least one video clip includes two or more frames of images;
    插帧模块,被配置为在所述至少两个视频片段中的至少一个待拼接位置进行插帧,生成插帧图像;a frame insertion module, configured to perform frame insertion at at least one position to be spliced in the at least two video clips to generate an inserted frame image;
    拼接模块,被配置为将所述视频片段和所述插帧图像进行拼接,得到目标视频。The splicing module is configured to splicing the video clip and the interpolated image to obtain a target video.
  15. 根据权利要求14所述的装置,其特征在于,所述待拼接位置包括起始位置、结尾位置以及任意相邻两个所述视频片段之间的位置,所述起始位置位于所述至少两个视频片段中的第一个视频片段之前,所述结尾位置位于所述至少两个视频片段中的最后一个视频片段之后。The apparatus according to claim 14, wherein the position to be spliced includes a start position, an end position, and a position between any two adjacent video clips, and the start position is located in the at least two video clips. Before the first video clip of the video clips, the end position is located after the last video clip of the at least two video clips.
  16. 根据权利要求15所述的装置,其特征在于,所述插帧模块,被配置为:The device according to claim 15, wherein the frame insertion module is configured to:
    根据所述待拼接位置的前一视频片段中的至少一帧图像,与所述待拼接位置的后 一视频片段中的至少一帧图像,进行插帧,生成插帧图像。According to at least one frame of image in the previous video clip of the position to be spliced, and at least one frame of image in the next video clip of the position to be spliced, frame insertion is performed to generate an inserted frame image.
  17. 根据权利要求16所述的装置,其特征在于,所述前一视频片段中的至少一帧图像包括所述前一视频片段中的结尾帧图像,所述后一视频片段中的至少一帧图像包括所述后一视频片段中的起始帧图像。The apparatus according to claim 16, wherein at least one frame of image in the previous video clip comprises an end frame image in the previous video clip, and at least one frame of image in the subsequent video clip Including the start frame image in the latter video segment.
  18. 根据权利要求15所述的装置,其特征在于,所述插帧模块,被配置为:The device according to claim 15, wherein the frame insertion module is configured to:
    根据所述第一个视频片段中的至少一帧图像,与所述最后一个视频片段中的至少一帧图像,在所述起始位置和/或所述结尾位置进行插帧,生成所述插帧图像。According to at least one frame of image in the first video clip and at least one frame of image in the last video clip, frame interpolation is performed at the start position and/or the end position to generate the interpolation frame. frame image.
  19. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至13任一项所述的方法。A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
  20. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    处理器;以及processor; and
    存储器,用于存储所述处理器的可执行指令;a memory for storing executable instructions for the processor;
    其中,所述处理器配置为经由执行所述可执行指令来执行权利要求1至13任一项所述的方法。wherein the processor is configured to perform the method of any one of claims 1 to 13 by executing the executable instructions.
PCT/CN2021/106309 2020-08-17 2021-07-14 Video processing method, video processing apparatus, storage medium, and electronic device WO2022037331A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010827407.7 2020-08-17
CN202010827407.7A CN111970562A (en) 2020-08-17 2020-08-17 Video processing method, video processing device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
WO2022037331A1 true WO2022037331A1 (en) 2022-02-24

Family

ID=73388138

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/106309 WO2022037331A1 (en) 2020-08-17 2021-07-14 Video processing method, video processing apparatus, storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN111970562A (en)
WO (1) WO2022037331A1 (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111970562A (en) * 2020-08-17 2020-11-20 Oppo广东移动通信有限公司 Video processing method, video processing device, storage medium and electronic equipment
CN114724055A (en) * 2021-01-05 2022-07-08 华为技术有限公司 Video switching method, device, storage medium and equipment
CN112887791A (en) * 2021-01-22 2021-06-01 深圳市优乐学科技有限公司 Method for controlling video fluency
CN113242465B (en) * 2021-04-27 2022-08-16 Oppo广东移动通信有限公司 Video processing method and device, electronic equipment and readable storage medium
CN113411668B (en) * 2021-06-16 2023-03-21 亿咖通(湖北)技术有限公司 Video playing system and method
CN113473224B (en) * 2021-06-29 2023-05-23 北京达佳互联信息技术有限公司 Video processing method, video processing device, electronic equipment and computer readable storage medium
CN114125324B (en) * 2021-11-08 2024-02-06 北京百度网讯科技有限公司 Video stitching method and device, electronic equipment and storage medium
CN114679605B (en) * 2022-03-25 2023-07-18 腾讯科技(深圳)有限公司 Video transition method, device, computer equipment and storage medium
CN116634226A (en) * 2023-06-15 2023-08-22 北京柏睿数据技术股份有限公司 Method and system for intelligent real-time processing of video stream data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6057859A (en) * 1997-03-31 2000-05-02 Katrix, Inc. Limb coordination system for interactive computer animation of articulated characters with blended motion data
CN102157009A (en) * 2011-05-24 2011-08-17 中国科学院自动化研究所 Method for compiling three-dimensional human skeleton motion based on motion capture data
CN111294644A (en) * 2018-12-07 2020-06-16 腾讯科技(深圳)有限公司 Video splicing method and device, electronic equipment and computer storage medium
CN111372087A (en) * 2020-05-26 2020-07-03 深圳看到科技有限公司 Panoramic video frame insertion method and device and corresponding storage medium
CN111970562A (en) * 2020-08-17 2020-11-20 Oppo广东移动通信有限公司 Video processing method, video processing device, storage medium and electronic equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6993081B1 (en) * 1999-11-23 2006-01-31 International Business Machines Corporation Seamless splicing/spot-insertion for MPEG-2 digital video/audio stream
CN110248115B (en) * 2019-06-21 2020-11-24 上海摩象网络科技有限公司 Image processing method, device and storage medium
CN110611840B (en) * 2019-09-03 2021-11-09 北京奇艺世纪科技有限公司 Video generation method and device, electronic equipment and storage medium
CN111526370B (en) * 2020-04-17 2023-06-02 Oppo广东移动通信有限公司 Video encoding and decoding methods and devices and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6057859A (en) * 1997-03-31 2000-05-02 Katrix, Inc. Limb coordination system for interactive computer animation of articulated characters with blended motion data
CN102157009A (en) * 2011-05-24 2011-08-17 中国科学院自动化研究所 Method for compiling three-dimensional human skeleton motion based on motion capture data
CN111294644A (en) * 2018-12-07 2020-06-16 腾讯科技(深圳)有限公司 Video splicing method and device, electronic equipment and computer storage medium
CN111372087A (en) * 2020-05-26 2020-07-03 深圳看到科技有限公司 Panoramic video frame insertion method and device and corresponding storage medium
CN111970562A (en) * 2020-08-17 2020-11-20 Oppo广东移动通信有限公司 Video processing method, video processing device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN111970562A (en) 2020-11-20

Similar Documents

Publication Publication Date Title
WO2022037331A1 (en) Video processing method, video processing apparatus, storage medium, and electronic device
CN111580765B (en) Screen projection method, screen projection device, storage medium, screen projection equipment and screen projection equipment
WO2019205872A1 (en) Video stream processing method and apparatus, computer device and storage medium
US9836267B2 (en) Image/audio playback device of mobile communication terminal
US20180192063A1 (en) Method and System for Virtual Reality (VR) Video Transcode By Extracting Residual From Different Resolutions
WO2022105597A1 (en) Method and apparatus for playing back video at speed multiples , electronic device, and storage medium
KR20150014722A (en) Device, system and method for providing screen shot
US11928152B2 (en) Search result display method, readable medium, and terminal device
CN111436005B (en) Method and apparatus for displaying image
CN111784614A (en) Image denoising method and device, storage medium and electronic equipment
CN102045578A (en) Image processing apparatus and image processing method
WO2021196994A1 (en) Encoding method and apparatus, terminal, and storage medium
US9509940B2 (en) Image output device, image output method, and recording medium
US11893770B2 (en) Method for converting a picture into a video, device, and storage medium
US20200213631A1 (en) Transmission system for multi-channel image, control method therefor, and multi-channel image playback method and apparatus
US20090244305A1 (en) Video Recording System and Imaging Apparatus
CN109862385B (en) Live broadcast method and device, computer readable storage medium and terminal equipment
CN111770332B (en) Frame insertion processing method, frame insertion processing device, storage medium and electronic equipment
CN113141480A (en) Screen recording method, device, equipment and storage medium
KR101299245B1 (en) Video reproduction device for decoding Region of Interest and method of thereof
CN117579843B (en) Video coding processing method and electronic equipment
CN116264640A (en) Viewing angle switching method, device and system for free viewing angle video
CN115988240A (en) Video generation method and device, readable medium and electronic equipment
CN113038270A (en) Video converter with protection function
CN116965042A (en) Video interpolation processing method, video interpolation processing device and readable storage medium

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: 21857426

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21857426

Country of ref document: EP

Kind code of ref document: A1