Video processing method and device
By analyzing the characteristic data of the video frame, detecting the lens change points using preset thresholds, and automatically segmenting the video frames, solving the problems of low efficiency and low accuracy in the prior art, and achieving efficient and accurate video segmentation.
Patent Information
- Application Number
- PCT/CN2025/076002
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-02-06
- Filing Date
- 2025-02-06
- Publication Date
- 2025-08-14
AI Technical Summary
The existing video segmentation technology is inefficient and has low accuracy, and the manual screening workload is large.
By analyzing the characteristic data of the video frame, using preset thresholds to detect lens change points, automatically segment the video frames, using partially decoded RGB or motion vector data for analysis, and training the CNN model for segmentation.
It reduces the workload of manual screening and improves the efficiency and accuracy of video segmentation.
Smart Images

Figure CN2025076002_14082025_PF_FP_ABST
Abstract
Description
Video processing method and device
[0001] This application claims priority to Chinese Patent Application No. 202410168286.8 filed on February 6, 2024, and priority to Chinese Patent Application No. 202410171548.6 filed on February 6, 2024. The contents of the above-mentioned Chinese patent application disclosures are hereby incorporated by reference in their entirety as part of this application. Technical Field
[0002] The embodiments of the present disclosure relate to a video processing method and device. Background Art
[0003] In the field of video editing, users often have the demand to split and crop videos. One of the more common scenarios is to split a complete video into multiple small segments based on the degree of change of the shots in the current video, while the shots in each small segment after segmentation are relatively stable. Summary of the Invention
[0004] The embodiments of the present disclosure provide a video processing method and device to overcome the problems of low efficiency and accuracy in video segmentation.
[0005] In a first aspect, an embodiment of the present disclosure provides a video processing method, including:
[0006] Determining feature data corresponding to video frames in the video to be segmented according to the video to be segmented;
[0007] According to the feature data, a segmentation position corresponding to the video to be segmented is obtained; a change in feature data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold;
[0008] The video to be segmented is segmented according to the segmentation positions to obtain at least two video segments, and the video frames at the start and end positions of two adjacent video segments are adjacent in the video to be segmented.
[0009] In a second aspect, an embodiment of the present disclosure provides a video processing device, including:
[0010] a determining unit configured to determine feature data corresponding to video frames in the video to be segmented based on the video to be segmented;
[0011] The first processing unit is configured to determine a segmentation position corresponding to the video to be segmented based on the feature data; a change in feature data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold;
[0012] The second processing unit is configured to segment the video to be segmented according to the segmentation position to obtain at least two video segments, and the video frames at the start and end positions of two adjacent video segments are adjacent in the video to be segmented.
[0013] In a third aspect, an embodiment of the present disclosure provides an electronic device, including: a processor and a memory;
[0014] The memory stores computer-executable instructions;
[0015] The processor executes the computer-executable instructions stored in the memory, so that the at least one processor executes the video processing method described in the first aspect and various possible designs of the first aspect.
[0016] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored. When a processor executes the computer execution instructions, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0017] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the video processing method described in the first aspect and various possible designs of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0019] FIG1 is a thread diagram of a video processing method provided by an embodiment of the present disclosure;
[0020] FIG2 is a flow chart of a video processing method according to an embodiment of the present disclosure;
[0021] FIG3 is a second flow chart of a video processing method according to an embodiment of the present disclosure;
[0022] FIG4 is a third flow chart of a video processing method according to an embodiment of the present disclosure;
[0023] FIG5 is a thread diagram of a video processing method provided by an embodiment of the present disclosure;
[0024] FIG6 is a fourth flow chart of a video processing method according to an embodiment of the present disclosure;
[0025] FIG7 is a fifth flow chart of a video processing method provided by an embodiment of the present disclosure;
[0026] FIG8 is a sixth flow chart of a video processing method according to an embodiment of the present disclosure;
[0027] FIG9 is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure;
[0028] FIG10 is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure;
[0029] FIG11 is a schematic structural diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0030] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present disclosure without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0031] In the field of video editing, users often need to split and crop videos. One common scenario is to split a complete video into multiple small segments based on the degree of change in the current video shots. The shots in each segment after segmentation are relatively stable, thus achieving the purpose of video segmentation and cropping.
[0032] For example, a common method for video segmentation is to search for frames with shot changes throughout the video during the editing process. This method is labor-intensive and subjective, and also suffers from technical issues such as low efficiency and low accuracy.
[0033] To address this time-consuming and labor-intensive manual process, the inventors devised a technical solution: a feature-data-based intelligent scene shot segmentation solution. This solution analyzes and decodes the feature data corresponding to each video frame, automatically detecting soft and hard cuts in the video. Specifically, in practice, the feature data of the video frame corresponding to a segmentation point in the video differs significantly from the feature data of the previous frame.
[0034] Compared with traditional manual screening, it has higher accuracy and efficiency. This solution can not only greatly reduce the workload of manual screening, but also improve the efficiency and quality of video editing.
[0035] For example, compared to general video processing, only color data needs to be determined, that is, partially decoded data is used for analysis instead of fully decoded video, which is faster than full decoding. For example, compared to general video processing, partially decoded motion vector data is used for analysis instead of fully decoded video, which is faster than full decoding.
[0036] The video processing method provided by the disclosed embodiment determines, based on the video to be segmented, the feature data corresponding to the video frames in the video to be segmented, and then obtains the segmentation position corresponding to the video to be segmented based on the feature data corresponding to the video frames in the video to be segmented. The change in the feature data corresponding to the adjacent video frames at the segmentation position is greater than a preset threshold. The video to be segmented is then segmented based on the segmentation position to obtain at least two video segments, and the video frames at the start and end positions of the two adjacent video segments are adjacent in the video to be segmented. In this technical solution, when the lens changes, there is a large difference in the feature data between the two frames of the image. That is, the change in the feature data of the video frames can be used to determine the video frame corresponding to the segmentation point, thereby reducing the workload of manual screening and improving segmentation efficiency and accuracy.
[0037] FIG1 is a thread diagram of a video processing method provided by an embodiment of the present disclosure. As shown in FIG1 , the flow diagram includes: a decoding thread and an inference thread.
[0038] In the decoding thread, the video is decoded to obtain the red-green-blue (RGB) data corresponding to each video frame. The RGB data corresponding to all video frames are then downsampled and cached. When the video is segmented, the inference thread is started, the RGB data in the data cache is input into the segmentation model, and all segmentation points in the video are output. The video is then segmented based on each segmentation point.
[0039] The segmentation process may include calling back the segmentation point to the upper layer, and having the upper layer perform segmentation. The downsampling process may include using a graphics processing unit (GPU) to implement the downsampling process.
[0040] It should be understood that the color data may be RGB data or Luminance-Chrominance (YUV) data. The embodiments of the present disclosure are described using RGB data, and the implementation principle of YUV data is similar.
[0041] The execution subject of the video processing method involved in the embodiments of the present disclosure is an electronic device, which can be a mobile phone, a computer, a tablet, a server, etc.
[0042] The following is a specific implementation process of the video processing method, device, and electronic device involved in the embodiments of the present disclosure. Some examples are only for illustrative purposes and are not limiting.
[0043] FIG2 is a flow chart of a video processing method according to an embodiment of the present disclosure. As shown in FIG2 , the video processing method includes:
[0044] Step 21: determining color data corresponding to video frames in the video to be segmented according to the video to be segmented;
[0045] In this step, after obtaining the video to be segmented, the color data in the video frames of the video to be segmented are extracted to obtain the color data corresponding to the video frames in the video to be segmented.
[0046] The video to be segmented may be obtained by: obtaining it from an image acquisition device (eg, a camera), obtaining it from a preset physical space (eg, a computer, a USB flash drive), or downloading it from a network terminal, etc.
[0047] Optionally, step 21 may include the following implementation steps:
[0048] Step 1: Perform frame processing on the video to be segmented to obtain the video frames of the video to be segmented;
[0049] In this implementation, the video to be segmented is converted into frame images, which can be achieved using video processing software or programming libraries. The general steps include opening the video file, reading each video frame and decoding it into image data, and then saving each image as a frame (i.e., video frame).
[0050] Step 2: Extract the color data of the video frame to be segmented.
[0051] In this implementation, after decoding the video frame, the RGB channel information is extracted. Typically, the RGB data of each pixel is stored in a certain format (such as 24-bit representation) in the frame image. By reading the corresponding color channel value of each pixel, the complete RGB data of the video frame can be obtained.
[0052] It should be understood that the embodiments of the present disclosure do not limit the number of video frames obtained by decoding.
[0053] Step 22: Obtain the segmentation position corresponding to the video to be segmented according to the color data corresponding to the video frame in the video to be segmented;
[0054] The variation of color data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold.
[0055] That is, when the amount of change in the color data corresponding to two adjacent video frames is large, it is considered that a shot cut occurs between the two adjacent video frames.
[0056] In this step, the color data corresponding to each video frame in the video to be segmented obtained above is processed to obtain segmentation positions for segmenting the video to be segmented.
[0057] In this implementation, the RGB data corresponding to two adjacent video frames can describe whether the camera has rotated. This is because when the camera rotates, the scene captured by the image acquisition device (e.g., a camera) changes, resulting in different image content in consecutive frames. For example, when the camera rotates, the position of objects in adjacent frames may shift, and the color distribution may also change.
[0058] By comparing the RGB data between the two frames, these changes can be detected to determine whether the camera has rotated. In other words, the trained segmentation model can detect such changes based on the RGB data to obtain the segmentation position corresponding to the video to be segmented.
[0059] Optionally, one implementation of step 22 may be: inputting color data corresponding to video frames in the video to be segmented into a pre-trained segmentation model to obtain segmentation positions corresponding to the video to be segmented;
[0060] The segmentation model is trained based on the color data and the segmentation positions corresponding to the color data.
[0061] In a possible implementation, after obtaining the color data in the video to be segmented, it is directly input into the segmentation model, and the segmentation position of the video to be segmented can be output.
[0062] Step 23: Segment the video to be segmented according to the segmentation position to obtain at least two video segments.
[0063] The video frames at the start and end positions of the two adjacent video segments are adjacent in the video to be segmented, that is, the end video frame of the first video segment and the beginning video frame of the second video segment of the two adjacent video segments are two consecutive frames in the video to be segmented.
[0064] In this step, the video to be segmented is divided into several video segments based on the segmentation positions.
[0065] Optionally, when the segmentation position is at least one segmentation point, each segmentation point corresponds to the first video frame in the video to be segmented.
[0066] Then, step 23 may be: dividing the video to be divided into at least two video segments according to at least one segmentation point.
[0067] In a possible implementation, the video to be segmented can be divided into 100 video frames. At this time, the segmentation model outputs three segmentation points, namely: the 16th video frame, the 50th video frame, and the 70th video frame. Then the video to be segmented can be divided into 4 video segments, namely the video segments corresponding to the 1st to 15th frames, the video segments corresponding to the 16th to 49th frames, the video segments corresponding to the 50th to 69th frames, and the video segments corresponding to the 70th to 100th frames.
[0068] The video processing method provided in this embodiment determines the color data corresponding to the video frames in the video to be segmented, and then determines the segmentation position corresponding to the video to be segmented based on the color data corresponding to the video frames in the video to be segmented. The video to be segmented is then segmented based on the segmentation position and the amount of change in the color data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold, resulting in at least two video segments. The video frames at the start and end positions of the two adjacent video segments are adjacent in the video to be segmented. In this technical solution, when the camera changes, the color data between the two frames of the image differs significantly. That is, the change in the color data of the video frames can be used to determine the video frame corresponding to the segmentation point, thereby reducing the workload of manual screening and improving segmentation efficiency and accuracy.
[0069] Based on the above embodiment, FIG3 is a second flow chart of the video processing method provided by the embodiment of the present disclosure. As shown in FIG3 , the video processing method further includes:
[0070] Step 31: Obtain multiple sets of color data and the segmentation position corresponding to each set of color data;
[0071] In this step, multiple groups of color data and the segmentation positions corresponding to each group of color data can be obtained from some previous experiments and / or some data actually collected and stored in the physical space.
[0072] In a possible implementation, taking a set of color data as an example, it may include: 50 color data, wherein the 5th color data and the 36th color data are marked as the color data of the corresponding points in the segmentation position.
[0073] Step 32: According to the multiple sets of color data and the segmentation positions corresponding to each set of color data, a preset network model is trained to obtain a segmentation model.
[0074] In this step, the preset network model is trained using the multiple sets of color data obtained above and the segmentation positions corresponding to each set of color data, and the parameters in the network model are continuously adjusted until the loss function of the network model tends to converge, that is, the training results are close to or consistent with the actual segmentation positions.
[0075] For example, the network model can be any of the following (the following are examples):
[0076] BP neural network: BP neural network is a neural network learning algorithm. It is a hierarchical neural network composed of an input layer, an intermediate layer, and an output layer. The intermediate layer can be expanded to multiple layers. In order to reduce the error between the desired output and the actual output, the connection weights are corrected layer by layer from the output layer through each intermediate layer and back to the input layer. This process is repeated until the global error of the network tends to a given minimum value, that is, the learning process is completed.
[0077] Radial Basis Function Neural Network: RBF (Radial Basis Function, RBF) neural network is a neural network proposed in the late 1980s. It is a three-layer feedforward network with a single hidden layer.
[0078] Perceptron neural network: A perceptron neural network is a neural network with a single layer of computational neurons, and the transfer function of the network is a linear threshold unit;
[0079] Linear neural network: A linear neural network is a relatively simple neural network consisting of one or more linear neurons. It uses a linear function as the transfer function, so the output can be any value.
[0080] Convolutional Neural Networks (CNN): In convolutional neural networks, the convolution kernel is a very important part of the convolutional neural network. Each convolution kernel can learn a feature of the image, and finally a feature map is obtained by full connection.
[0081] Therefore, in this embodiment, the CNN model can be preferably used as a training model for the segmentation model.
[0082] The disclosed embodiments provide a video processing method that obtains multiple sets of color data and the segmentation positions corresponding to each set of color data. This method then trains a pre-set network model based on the multiple sets of color data and the corresponding segmentation positions, thereby generating a segmentation model. This technical solution trains the segmentation model based on the multiple sets of color data and the corresponding segmentation positions, providing an accurate basis for outputting the corresponding segmentation positions when a motion vector is subsequently input.
[0083] Based on the above embodiment, FIG4 is a flow chart of the video processing method provided by the embodiment of the present disclosure. As shown in FIG4, after step 21, the video processing method further includes:
[0084] Step 41: downsample the color data corresponding to the video frames in the video to be segmented to obtain downsampled color data;
[0085] In this step, since the color data corresponding to the video frames obtained above has a large amount of data or contains some unstable information that may affect the accuracy, the color data corresponding to all video frames may be downsampled.
[0086] Optionally, a GPU is used to implement downsampling processing of color data corresponding to all video frames.
[0087] As a possible implementation, the RGB data of all video frames can be loaded into the GPU memory, and the RGB data of each video frame can be downsampled using a GPU-accelerated image processing algorithm. This can be done by using pixel mean, maximum, or other filters to reduce the resolution of the image. The downsampled RGB data is then saved to the GPU memory or main memory for subsequent processing or output.
[0088] Step 42: Input the downsampled color data into the segmentation model to obtain the segmentation position corresponding to the video to be segmented.
[0089] In this step, the obtained color data after downsampling is input into the segmentation model, so that the segmentation model outputs the segmentation position corresponding to the video to be segmented, which can be at least one segmentation point determined in the above embodiment.
[0090] The disclosed embodiments provide a video processing method that downsamples the color data corresponding to video frames in a video to be segmented, obtaining the downsampled color data. This downsampled color data is then input into a segmentation model to obtain the segmentation positions corresponding to the video to be segmented. This technical solution reduces the density of the color data by downsampling the color data corresponding to the video frames, thereby reducing the amount of data, lowering computational complexity, and increasing the speed of obtaining the segmentation positions while ensuring the accuracy of the segmentation positions.
[0091] FIG5 is a thread diagram of the video processing method provided by an embodiment of the present disclosure. As shown in FIG5 , the flow diagram includes: a decoding thread and an inference thread.
[0092] In the decoding thread, the video is decoded to obtain the MV data corresponding to each video frame relative to the first video frame of the picture group where the video frame is located, and then the MV data corresponding to all video frames are downsampled, and the MV data after downsampling is cached. When the video is segmented, the inference thread is started, the MV data in the data cache is input into the segmentation model, and all the segmentation points in the video are output. Then, the video is segmented based on each segmentation point. The details not shown here are explained in the following embodiments.
[0093] The process of segmentation processing may include: calling back the segmentation point to the upper layer, and the upper layer performs segmentation.
[0094] The execution subject of the video processing method involved in the embodiments of the present disclosure is an electronic device, which can be a mobile phone, a computer, a tablet, a server, etc.
[0095] The following is a specific implementation process of the video processing method, device, and electronic device involved in the embodiments of the present disclosure. Some examples are only for illustrative purposes and are not limiting.
[0096] FIG6 is a fourth flow chart of a video processing method provided by an embodiment of the present disclosure. As shown in FIG6 , the video processing method includes:
[0097] Step 61: Determine motion vector data of a video frame in the video to be segmented relative to a first video frame according to the video to be segmented;
[0098] The first video frame is the first video frame in the picture group in which the video frame is located;
[0099] In this step, since the video to be segmented may include at least one picture group, each picture group includes several video frames, for example, picture group A includes 20 frames of images.
[0100] At this time, for a video frame in the video to be segmented, motion vector data of the video frame relative to the first video frame in the picture group where the video frame is located can be determined.
[0101] The video to be segmented may be obtained by: obtaining it from an image acquisition device (eg, a camera, a mobile phone), obtaining it from a preset physical space (eg, a computer, a USB flash drive), or downloading it from a network terminal, etc.
[0102] Optionally, step 61 may include the following implementation steps:
[0103] Step 1: Get the pixel data corresponding to the video frame in the video to be segmented;
[0104] In this implementation, to obtain the pixel data corresponding to the video frame, it can be achieved through the relevant functions in the image processing library or programming language.
[0105] For example, a frame image (ie, a video frame) is read from the video stream to be segmented, and the image data of the video frame is decoded and converted into an operable pixel format, thereby obtaining pixel data.
[0106] Step 2: Determine motion vector data corresponding to the video frame based on pixel data corresponding to the video frame in the video to be segmented and pixel data corresponding to the first video frame in the picture group where the video frame is located.
[0107] For example, for each picture group, in the picture group, for each video frame, based on the pixel data corresponding to the video frame and the pixel data corresponding to the first video frame in the picture group, the corresponding point or area that best matches the specific key point or block area can be taken out, and the displacement between the corresponding points or areas in the two video frames can be calculated, that is, the motion vector data corresponding to the video frame can be obtained.
[0108] That is, the motion vector data may be represented as a displacement vector of a pixel, such as (x, y), where x and y represent the displacement of the pixel in the horizontal and vertical directions, respectively.
[0109] Optionally, before step 61 , the following step may be included: in response to the video segmentation request, decoding the video to be segmented to obtain video frames in the video to be segmented.
[0110] The video to be segmented may be decoded by using a decoder to obtain video frames in the video to be segmented. The number of video frames obtained by decoding is not limited here.
[0111] Step 62: Determine the segmentation position corresponding to the video to be segmented based on the motion vector data;
[0112] In this step, the acquired motion vector data corresponding to the video frames in the video to be segmented can be used to describe whether the camera has rotated, that is, it can be used as the segmentation position corresponding to the video to be segmented.
[0113] In this implementation, for example, the motion vector data corresponding to two adjacent video frames can be pixel displacement vectors, which describe whether the camera is rotating. When the camera rotates, the scene captured by the image acquisition device (e.g., a camera) changes, resulting in different motion vectors in consecutive frames. For example, when the camera rotates, the position of an object in adjacent frames may shift, meaning that the corresponding point or area may change.
[0114] By comparing the motion vector data between the two frames, these changes can be detected to determine whether the lens has rotated, thereby determining the segmentation position corresponding to the video to be segmented.
[0115] Optionally, step 62 may be implemented by: inputting the motion vector data in the video to be segmented into a pre-trained segmentation model to obtain the segmentation position corresponding to the video to be segmented;
[0116] The segmentation model is trained based on the motion vector data and the segmentation positions corresponding to the motion vector data.
[0117] In a possible implementation, after obtaining the motion vector data in the video to be segmented, the motion vector data is directly input into the segmentation model, and the segmentation position of the video to be segmented can be output.
[0118] Step 63: Segment the video to be segmented according to the segmentation position to obtain at least two video segments.
[0119] The video frames at the start and end positions of the two adjacent video segments are adjacent in the video to be segmented, that is, the end video frame of the first video segment and the beginning video frame of the second video segment of the two adjacent video segments are two consecutive frames in the video to be segmented.
[0120] In this step, the video to be segmented is divided into several sub-videos based on the segmentation positions output by the above segmentation model.
[0121] Optionally, the segmentation position is at least one segmentation point, and each segmentation point corresponds to the second video frame in the video to be segmented.
[0122] Then, step 63 may be: dividing the video to be divided into at least two video segments according to the at least one second video frame.
[0123] In one possible implementation, the video to be segmented can be divided into 50 video frames. At this time, the segmentation position includes two segmentation points, namely: the 22nd video frame and the 34th video frame. Then, the video to be segmented can be segmented into 3 video segments, namely the video segments corresponding to the 1st frame to the 21st frame, the video segments corresponding to the 22nd frame to the 33rd frame, and the video segments corresponding to the 34th frame to the 50th frame.
[0124] The disclosed embodiment provides a video processing method, which determines the motion vector data of a video frame in the video to be segmented relative to a first video frame based on the video to be segmented, where the first video frame is the first video frame in the picture group in which the video frame is located. Based on the motion vector data, the segmentation position corresponding to the video to be segmented is determined. The video to be segmented is then segmented based on the segmentation position to obtain at least two video segments, where the video frames at the start and end positions of the two adjacent video segments are adjacent in the video to be segmented. In this technical solution, since the motion vector data between the two frame images and the first frame image in the picture group in which they are located is significantly different when the lens changes, the motion vector data can be used to determine the video frame corresponding to the lens change in the video, thereby reducing the workload of manual screening and improving segmentation efficiency and accuracy.
[0125] Based on the above embodiment, FIG7 is a flowchart of a video processing method provided by an embodiment of the present disclosure. As shown in FIG7 , the video processing method further includes:
[0126] Step 71: Obtain motion vector data and the segmentation position corresponding to the motion vector data;
[0127] In this step, multiple sets of motion vector data and the segmentation positions corresponding to each set of motion vector data can be obtained from some previous experiments and / or some data actually collected and stored in the physical space.
[0128] Under this implementation, for a set of motion vector data and the segmentation position corresponding to the motion vector data can be: the technician obtains the segmentation points of the video that have been determined, and the motion vector data corresponding to each video frame in each picture group of the video relative to the first video frame in the picture group.
[0129] Step 72: Train the preset network model according to the motion vector data and the segmentation position corresponding to the motion vector data to obtain a segmentation model.
[0130] In this step, the preset network model is trained using the multiple sets of motion vector data obtained above and the segmentation positions corresponding to each set of motion vector data, and the parameters in the network model are continuously adjusted until the loss function of the network model tends to converge, that is, the training results are close to or consistent with the actual segmentation positions.
[0131] For example, the network model can be any of the following (the following are examples):
[0132] BP neural network: BP neural network is a neural network learning algorithm. It is a hierarchical neural network composed of an input layer, an intermediate layer, and an output layer. The intermediate layer can be expanded to multiple layers. In order to reduce the error between the desired output and the actual output, the connection weights are corrected layer by layer from the output layer through each intermediate layer and back to the input layer. This process is repeated until the global error of the network tends to a given minimum value, that is, the learning process is completed.
[0133] Radial Basis Function Neural Network: RBF (Radial Basis Function, RBF) neural network is a neural network proposed in the late 1980s. It is a three-layer feedforward network with a single hidden layer.
[0134] Perceptron neural network: A perceptron neural network is a neural network with a single layer of computational neurons, and the transfer function of the network is a linear threshold unit;
[0135] Linear neural network: A linear neural network is a relatively simple neural network consisting of one or more linear neurons. It uses a linear function as the transfer function, so the output can be any value.
[0136] Convolutional Neural Networks (CNN): In convolutional neural networks, the convolution kernel is a very important part of the convolutional neural network. Each convolution kernel can learn a feature of the image, and finally a feature map is obtained by full connection.
[0137] Therefore, in this embodiment, the CNN model can be preferably used as a training model for the segmentation model.
[0138] The disclosed embodiments provide a video processing method that obtains motion vector data and the segmentation positions corresponding to the motion vector data, and then trains a preset network model based on the motion vector data and the segmentation positions corresponding to the motion vector data to obtain a segmentation model. This technical solution trains the segmentation model based on the motion vector data and the segmentation positions corresponding to the motion vector data, providing an accurate basis for outputting the corresponding segmentation positions when the motion vector data is subsequently input.
[0139] Based on the above embodiment, FIG8 is a sixth flow chart of the video processing method provided by the embodiment of the present disclosure. As shown in FIG8 , after step 61, the video processing method further includes:
[0140] Step 81: downsample the motion vector data corresponding to the video frames in the video to be segmented to obtain downsampled motion vector data;
[0141] In this step, since the amount of motion vector data corresponding to the video frames in the video to be segmented (which may be multiple or all video frames, etc.) is large, or there is some unstable information that may affect the accuracy, the motion vector data corresponding to all video frames can be downsampled.
[0142] As a possible implementation, mean filtering, maximum filtering or other filters can be used to reduce the resolution of the motion vector data. Then, according to the selected algorithm, the original motion vector data is aggregated or sampled with a certain window size to obtain the motion vector data after downsampling.
[0143] Step 82: Input the down-sampled motion vector data into the segmentation model to obtain the segmentation position corresponding to the video to be segmented.
[0144] In this step, the obtained motion vector data after downsampling is input into the segmentation model, so that the segmentation model outputs the segmentation position corresponding to the video to be segmented, which can be at least one segmentation point determined in the above embodiment.
[0145] The disclosed embodiments provide a video processing method that downsamples the motion vector data corresponding to video frames in a video to be segmented, obtaining the downsampled motion vector data. This downsampled motion vector data is then input into a segmentation model to obtain the segmentation positions corresponding to the video to be segmented. This technical solution reduces the density of the motion vector data by downsampling the motion vector data corresponding to the video frames, thereby reducing the amount of data, lowering computational complexity, and increasing the speed of obtaining the segmentation positions while ensuring the accuracy of the segmentation positions.
[0146] Based on the above method embodiment, FIG9 is a schematic structural diagram of a video processing device provided by an embodiment of the present disclosure. As shown in FIG9 , the video processing device includes:
[0147] A determination unit 91 is configured to determine color data corresponding to video frames in the video to be segmented based on the video to be segmented;
[0148] The first processing unit 92 is configured to obtain a segmentation position corresponding to the video to be segmented based on color data corresponding to video frames in the video to be segmented, where a change in color data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold;
[0149] The second processing unit 93 is configured to segment the video to be segmented according to the segmentation positions to obtain at least two video segments, wherein the video frames at the start and end positions of two adjacent video segments are adjacent in the video to be segmented.
[0150] According to one or more embodiments of the present disclosure, the first processing unit 92 is configured to:
[0151] The color data corresponding to the video frames in the video to be segmented are input into a pre-trained segmentation model to obtain the segmentation positions corresponding to the video to be segmented. The segmentation model is trained based on the color data and the segmentation positions corresponding to the color data.
[0152] According to one or more embodiments of the present disclosure, the determining unit 91 is configured to:
[0153] Perform frame processing on the video to be segmented to obtain video frames of the video to be segmented;
[0154] Extract the color data of the video frame to be segmented.
[0155] According to one or more embodiments of the present disclosure, after determining color data corresponding to video frames in the video to be segmented, the first processing unit 92 is further configured to:
[0156] Downsampling is performed on the color data corresponding to the video frames in the video to be segmented to obtain color data after downsampling.
[0157] According to one or more embodiments of the present disclosure, the first processing unit 92 is further configured to:
[0158] The downsampled color data is input into the segmentation model to obtain the segmentation position corresponding to the video to be segmented.
[0159] According to one or more embodiments of the present disclosure, the segmentation position is at least one segmentation point, and each segmentation point corresponds to a first video frame in the video to be segmented;
[0160] Accordingly, the second processing unit 93 is configured to:
[0161] The video to be segmented is segmented according to the at least one first video frame to obtain at least two video segments.
[0162] Based on the above method embodiment, FIG10 is a schematic diagram of the structure of a video processing device provided by an embodiment of the present disclosure. As shown in FIG10 , the video processing device includes:
[0163] A determining unit 101 is configured to determine, based on the video to be segmented, motion vector data of a video frame in the video to be segmented relative to a first video frame, where the first video frame is the first video frame in a picture group in which the video frame is located;
[0164] The first processing unit 102 is configured to determine a segmentation position corresponding to the video to be segmented according to the motion vector data;
[0165] The second processing unit 103 is configured to segment the video to be segmented according to the segmentation positions to obtain at least two video segments, wherein the video frames at the start and end positions of two adjacent video segments are adjacent in the video to be segmented.
[0166] According to one or more embodiments of the present disclosure, the first processing unit 102 is configured to:
[0167] The motion vector data in the video to be segmented is input into a pre-trained segmentation model to obtain the segmentation position corresponding to the video to be segmented. The segmentation model is trained based on the motion vector data and the segmentation position corresponding to the motion vector data.
[0168] According to one or more embodiments of the present disclosure, the determining unit 101 is configured to:
[0169] Obtain pixel data corresponding to the video frame in the video to be segmented;
[0170] Motion vector data corresponding to the video frame is determined based on pixel data corresponding to the video frame in the video to be segmented and pixel data corresponding to the first video frame.
[0171] According to one or more embodiments of the present disclosure, after determining motion vector data of a video frame in the video to be segmented relative to the first video frame based on the video to be segmented, the first processing unit 102 is further configured to:
[0172] Downsampling is performed on the motion vector data corresponding to the video frames in the video to be segmented to obtain the motion vector data after downsampling.
[0173] According to one or more embodiments of the present disclosure, the first processing unit 102 is further configured to:
[0174] The segmentation position corresponding to the video to be segmented is determined according to the motion vector data after downsampling processing.
[0175] According to one or more embodiments of the present disclosure, the segmentation position is at least one segmentation point, and each segmentation point corresponds to the second video frame in the video to be segmented;
[0176] Accordingly, the second processing unit 103 is configured to:
[0177] The video to be segmented is segmented into at least two video segments according to the at least one second video frame.
[0178] According to one or more embodiments of the present disclosure, before determining, based on the video to be segmented, motion vector data of a video frame in the video to be segmented relative to the first video frame, the first processing unit 102 is further configured to:
[0179] In response to the video segmentation request, the video to be segmented is decoded to obtain video frames in the video to be segmented.
[0180] The video processing device provided in the embodiment of the present disclosure has technical solutions and technical effects similar to those in the above-mentioned embodiment, and will not be described in detail here.
[0181] To implement the above embodiment, the present disclosure further provides an electronic device. FIG11 is a schematic structural diagram of an electronic device provided by the present disclosure. Referring to FIG11 , the electronic device may be a terminal device.
[0182] The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (PMPs), vehicle-mounted terminals (e.g., vehicle-mounted navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in FIG11 is merely an example and should not limit the functionality and scope of use of the embodiments of the present disclosure.
[0183] As shown in FIG11 , the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 111, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 112 or a program loaded from a storage device 118 into a random access memory (RAM) 113. Various programs and data required for the operation of the electronic device are also stored in the RAM 113. The processing device 111, the ROM 112, and the RAM 113 are connected to each other via a bus 114. An input / output (I / O) interface 115 is also connected to the bus 114.
[0184] Typically, the following devices may be connected to the I / O interface 115: an input device 116 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 117 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 118 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 119. The communication device 119 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 11 shows an electronic device with various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
[0185] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network via the communication device 119, or installed from the storage device 118, or installed from the ROM 112. When the computer program is executed by the processing device 111, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0186] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-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, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0187] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0188] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method shown in the above embodiment.
[0189] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet Service Provider).
[0190] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0191] The units involved in the embodiments described in this disclosure may be implemented in software or hardware. In some cases, the name of a unit does not limit the unit itself. For example, the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses."
[0192] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0193] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0194] In a first aspect, according to one or more embodiments of the present disclosure, a video processing method is provided, including:
[0195] Determining feature data corresponding to video frames in the video to be segmented according to the video to be segmented;
[0196] According to the feature data, a segmentation position corresponding to the video to be segmented is obtained; a change in feature data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold;
[0197] The video to be segmented is segmented according to the segmentation positions to obtain at least two video segments, and the video frames at the start and end positions of two adjacent video segments are adjacent in the video to be segmented.
[0198] According to one or more embodiments of the present disclosure, the feature data includes color data;
[0199] Determining the segmentation position corresponding to the video to be segmented according to the feature data includes:
[0200] A segmentation position corresponding to the video to be segmented is obtained according to color data corresponding to video frames in the video to be segmented, and a variation of color data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold.
[0201] According to one or more embodiments of the present disclosure, obtaining a segmentation position corresponding to the video to be segmented according to color data corresponding to a video frame in the video to be segmented includes:
[0202] The color data corresponding to the video frames in the video to be segmented are input into a pre-trained segmentation model to obtain the segmentation positions corresponding to the video to be segmented. The segmentation model is trained based on the color data and the segmentation positions corresponding to the color data.
[0203] According to one or more embodiments of the present disclosure, determining color data corresponding to video frames in the video to be segmented according to the video to be segmented includes:
[0204] Performing frame processing on the video to be segmented to obtain video frames of the video to be segmented;
[0205] Extract color data of the video frame of the video to be segmented.
[0206] According to one or more embodiments of the present disclosure, the feature data includes motion vector data of a video frame in the video to be segmented relative to a first video frame, where the first video frame is the first video frame in the picture group where the video frame is located.
[0207] According to one or more embodiments of the present disclosure, determining the segmentation position corresponding to the video to be segmented according to the feature data includes:
[0208] The motion vector data in the video to be segmented is input into a pre-trained segmentation model to obtain the segmentation position corresponding to the video to be segmented, wherein the segmentation model is trained based on the motion vector data and the segmentation position corresponding to the motion vector data.
[0209] According to one or more embodiments of the present disclosure, determining, based on the video to be segmented, the feature data corresponding to the video frames in the video to be segmented includes:
[0210] Obtain pixel data corresponding to video frames in the video to be segmented;
[0211] Motion vector data corresponding to the video frame is determined based on pixel data corresponding to the video frame in the video to be segmented and pixel data corresponding to the first video frame.
[0212] According to one or more embodiments of the present disclosure, after determining, based on the video to be segmented, the feature data corresponding to the video frames in the video to be segmented, the method further includes:
[0213] Downsampling is performed on the feature data corresponding to the video frames in the video to be segmented to obtain feature data after downsampling.
[0214] According to one or more embodiments of the present disclosure, the method further includes:
[0215] The feature data after downsampling processing is input into the segmentation model to obtain the segmentation position corresponding to the video to be segmented.
[0216] According to one or more embodiments of the present disclosure, the segmentation position is at least one segmentation point, and each segmentation point corresponds to the first video frame in the video to be segmented;
[0217] Accordingly, the video to be segmented is segmented according to the segmentation position to obtain at least two video segments, including:
[0218] The video to be segmented is segmented according to at least one first video frame to obtain the at least two video segments.
[0219] According to one or more embodiments of the present disclosure, before determining, based on the video to be segmented, the feature data corresponding to the video frames in the video to be segmented, the method further includes:
[0220] In response to the video segmentation request, the video to be segmented is decoded to obtain video frames in the video to be segmented.
[0221] In a second aspect, according to one or more embodiments of the present disclosure, a video processing device is provided, including:
[0222] a determining unit configured to determine feature data corresponding to video frames in the video to be segmented based on the video to be segmented;
[0223] The first processing unit is configured to determine a segmentation position corresponding to the video to be segmented based on the feature data; a change in feature data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold;
[0224] The second processing unit is configured to segment the video to be segmented according to the segmentation position to obtain at least two video segments, and the video frames at the start and end positions of two adjacent video segments are adjacent in the video to be segmented.
[0225] According to one or more embodiments of the present disclosure, the first processing unit is configured to:
[0226] The color data corresponding to the video frames in the video to be segmented are input into a pre-trained segmentation model to obtain the segmentation positions corresponding to the video to be segmented. The segmentation model is trained based on the color data and the segmentation positions corresponding to the color data.
[0227] According to one or more embodiments of the present disclosure, the determining unit is configured to:
[0228] Performing frame processing on the video to be segmented to obtain video frames of the video to be segmented;
[0229] Extract color data of the video frame of the video to be segmented.
[0230] According to one or more embodiments of the present disclosure, after determining color data corresponding to video frames in the video to be segmented based on the video to be segmented, the first processing unit is further configured to:
[0231] Downsampling is performed on the color data corresponding to the video frames in the video to be segmented to obtain color data after downsampling.
[0232] According to one or more embodiments of the present disclosure, the first processing unit is further configured to:
[0233] The color data after downsampling is input into the segmentation model to obtain the segmentation position corresponding to the video to be segmented.
[0234] According to one or more embodiments of the present disclosure, the segmentation position is at least one segmentation point, and each segmentation point corresponds to the first video frame in the video to be segmented;
[0235] Accordingly, the second processing unit is configured to:
[0236] The video to be segmented is segmented according to at least one first video frame to obtain the at least two video segments.
[0237] According to one or more embodiments of the present disclosure, the first processing unit is configured to:
[0238] The motion vector data in the video to be segmented is input into a pre-trained segmentation model to obtain the segmentation position corresponding to the video to be segmented, wherein the segmentation model is trained based on the motion vector data and the segmentation position corresponding to the motion vector data.
[0239] According to one or more embodiments of the present disclosure, the determining unit is configured to:
[0240] Obtain pixel data corresponding to video frames in the video to be segmented;
[0241] Motion vector data corresponding to the video frame is determined based on pixel data corresponding to the video frame in the video to be segmented and pixel data corresponding to the first video frame.
[0242] According to one or more embodiments of the present disclosure, after determining, based on the video to be segmented, motion vector data of a video frame in the video to be segmented relative to the first video frame, the first processing unit is further configured to:
[0243] Downsampling is performed on the motion vector data corresponding to the video frames in the video to be segmented to obtain downsampling motion vector data.
[0244] According to one or more embodiments of the present disclosure, the first processing unit is further configured to:
[0245] The segmentation position corresponding to the video to be segmented is determined according to the motion vector data after the downsampling process.
[0246] According to one or more embodiments of the present disclosure, the segmentation position is at least one segmentation point, and each segmentation point corresponds to the second video frame in the video to be segmented;
[0247] Accordingly, the second processing unit is configured to:
[0248] The video to be segmented is segmented into at least two video segments according to at least one second video frame.
[0249] According to one or more embodiments of the present disclosure, before determining, based on the video to be segmented, motion vector data of a video frame in the video to be segmented relative to the first video frame, the first processing unit is further configured to:
[0250] In response to the video segmentation request, the video to be segmented is decoded to obtain video frames in the video to be segmented.
[0251] In a third aspect, according to one or more embodiments of the present disclosure, there is provided an electronic device, comprising: at least one processor and a memory;
[0252] The memory stores computer-executable instructions;
[0253] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the video processing method described in the first aspect and various possible designs of the first aspect.
[0254] In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the video processing method described in the first aspect and various possible designs of the first aspect is implemented.
[0255] In a fifth aspect, according to one or more embodiments of the present disclosure, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the video processing method as described in the first aspect and various possible designs of the first aspect.
[0256] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0257] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0258] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A video processing method, comprising: Determining feature data corresponding to video frames in the video to be segmented according to the video to be segmented; According to the feature data, a segmentation position corresponding to the video to be segmented is obtained; a change in feature data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold; The video to be segmented is segmented according to the segmentation positions to obtain at least two video segments, and the video frames at the start and end positions of two adjacent video segments are adjacent in the video to be segmented.
2. The method according to claim 1, wherein The characteristic data includes color data; Determining the segmentation position corresponding to the video to be segmented according to the feature data includes: A segmentation position corresponding to the video to be segmented is obtained according to color data corresponding to video frames in the video to be segmented, and a variation of color data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold.
3. The method according to claim 2, wherein: Obtaining a segmentation position corresponding to the video to be segmented according to color data corresponding to a video frame in the video to be segmented, including: The color data corresponding to the video frames in the video to be segmented are input into a pre-trained segmentation model to obtain the segmentation positions corresponding to the video to be segmented. The segmentation model is trained based on the color data and the segmentation positions corresponding to the color data.
4. The method according to claim 2 or 3, wherein: Determining color data corresponding to video frames in the video to be segmented according to the video to be segmented includes: Performing frame processing on the video to be segmented to obtain video frames of the video to be segmented; Extract color data of the video frame of the video to be segmented.
5. The method according to claim 1, wherein The feature data includes motion vector data of a video frame in the video to be segmented relative to a first video frame, where the first video frame is the first video frame in the picture group in which the video frame is located.
6. The method according to claim 5, wherein: Determining a segmentation position corresponding to the video to be segmented according to the feature data includes: The motion vector data in the video to be segmented is input into a pre-trained segmentation model to obtain the segmentation position corresponding to the video to be segmented, wherein the segmentation model is trained based on the motion vector data and the segmentation position corresponding to the motion vector data.
7. The method according to claim 5 or 6, wherein: Determining, according to the video to be segmented, the feature data corresponding to the video frames in the video to be segmented, includes: Obtain pixel data corresponding to video frames in the video to be segmented; Motion vector data corresponding to the video frame is determined based on pixel data corresponding to the video frame in the video to be segmented and pixel data corresponding to the first video frame.
8. The method according to any one of claims 1 to 7, wherein: After determining the feature data corresponding to the video frames in the video to be segmented according to the video to be segmented, the method further includes: Downsampling is performed on the feature data corresponding to the video frames in the video to be segmented to obtain feature data after downsampling.
9. The method according to claim 8, further comprising: The segmentation position corresponding to the video to be segmented is determined according to the feature data after the downsampling process.
10. The method according to any one of claims 1 to 9, wherein: The segmentation position is at least one segmentation point, each segmentation point corresponding to the second video frame in the video to be segmented; Accordingly, the video to be segmented is segmented according to the segmentation position to obtain at least two video segments, including: The video to be segmented is segmented into at least two video segments according to at least one second video frame.
11. The method according to any one of claims 1 to 10, wherein: Before determining the feature data corresponding to the video frames in the video to be segmented according to the video to be segmented, the method further includes: In response to the video segmentation request, the video to be segmented is decoded to obtain video frames in the video to be segmented.
12. A video processing device comprising: a determining unit configured to determine, based on the video to be segmented, feature data corresponding to video frames in the video to be segmented; The first processing unit is configured to determine a segmentation position corresponding to the video to be segmented based on the feature data; a change in feature data corresponding to adjacent video frames at the segmentation position is greater than a preset threshold; The second processing unit is configured to segment the video to be segmented according to the segmentation position to obtain at least two video segments, and the video frames at the start and end positions of two adjacent video segments are adjacent in the video to be segmented.
13. An electronic device comprising: processor and memory; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the video processing method according to any one of claims 1 to 11.
14. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the video processing method according to any one of claims 1 to 11 is implemented.
15. A computer program product comprising a computer program, wherein When the computer program is executed by a processor, the video processing method according to any one of claims 1 to 11 is implemented.
Citation Information
Patent Citations
Video shot boundary detection method based on mixed projection function and support vector machine
CN101719271A
Video shot detection method based on histogram improvement and clustering algorithm
CN103426176A
Video clip extraction method, device and apparatus and storage medium
CN110287949A
Cutting method and device of shear lens, storage medium and electronic equipment
CN117197707A
Video Segmentation Method and Apparatus, Device, and Medium
US20220375225A1