Video processing method and device, electronic equipment and storage medium
By dividing the video into clips and selecting keyframes, the problem of difficulty in positioning wonderful moments in long videos is solved, and the video viewing experience is achieved quickly browsing videos and quick understanding of highlight moments is simplified.
Patent Information
- Application Number
- CN202310601055.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-25
- Publication Date
- 2024-11-26
AI Technical Summary
The existing technology is difficult to quickly understand and locate the wonderful moments in long videos, which leads to users need to view the entire video frame by frame, making it difficult to experience it.
By dividing the target video into multiple video clips, selecting keyframes from each video clip, determining the preview screen based on the keyframes, and using the preview screen to include image information and associated information to quickly locate the video clips.
It achieves a quick understanding of the target video content, especially the fast positioning of highlight moments, simplifying the video viewing process.
Smart Images

Figure CN119031179A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic technology, and in particular to a video processing method, device, electronic device and storage medium. Background Art
[0002] With the continuous development of electronic devices, more and more functions are appearing in people's vision. Take mobile phones as an example. Mobile phones have assumed more and more functions, and all kinds of work can be done through mobile phones. Video shooting is a very common function in people's daily use, and the content that mobile phones can shoot is getting clearer and clearer and the modes are diverse. Video recording can help users better restore every wonderful moment to a certain extent. Summary of the invention
[0003] In view of this, embodiments of the present disclosure provide a video processing method, device, electronic device, and storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, a video processing method is provided, the method comprising:
[0005] Divide the target video into multiple video segments;
[0006] Selecting a key frame from a plurality of video frames included in each of the video clips; wherein each of the video clips corresponds to at least one of the key frames;
[0007] A preview screen of the target video is determined according to the key frame.
[0008] In some embodiments, the preview image in the preview screen is used to locate the video clip.
[0009] In some embodiments, the preview image includes: image information and associated information; wherein the associated information is used to locate the video clip.
[0010] In some embodiments, selecting a key frame from a plurality of video frames included in each of the video clips comprises:
[0011] Determining a quality score of each of the video frames according to frame information of the multiple video frames included in each of the video clips;
[0012] The target video frame with the highest quality score in each of the video segments is determined as the key frame.
[0013] In some embodiments, determining the preview image in the target video preview screen according to the key frame includes at least one of the following:
[0014] Sorting the plurality of key frames in chronological order to form a preview picture set;
[0015] splicing the plurality of key frames in chronological order to form a preview image;
[0016] A plurality of the key frames are spliced together to form a preview animation.
[0017] In some embodiments, dividing the target video into a plurality of video segments includes:
[0018] According to the similarity of the video frames in the target video, the target video is divided into a plurality of the video segments.
[0019] In some embodiments, dividing the target video into a plurality of video segments according to the similarity of the video frames in the target video includes:
[0020] Calculating the similarity between the current video frame and the previous video frame, and determining whether the similarity is less than or equal to a preset threshold;
[0021] If the similarity is less than or equal to a preset threshold, the current video frame is used as an initial video frame of a new video segment.
[0022] In some embodiments, the method further comprises:
[0023] Sampling the video frames in the target video according to a preset rule to obtain sampled video frames;
[0024] The sampled video frames are processed for similarity to obtain the similarity of the sampled video frames.
[0025] In some embodiments, sampling the video frames in the target video according to a preset rule includes:
[0026] Extract the video frame from the target video at intervals of a preset number of frames; or,
[0027] The video frame is extracted from the target video at every preset time interval.
[0028] In some embodiments, sampling the video frames in the target video according to a preset rule includes:
[0029] Acquire status information of the electronic device, and determine whether the status information meets a preset condition; wherein the status information of the electronic device includes: power information of the electronic device, and / or load status of a system in the electronic device;
[0030] If the state information meets the preset condition, the target video is sampled according to the preset rule.
[0031] In some embodiments, the target video is a video stored in the electronic device, or a video being captured by the electronic device.
[0032] According to a second aspect of an embodiment of the present disclosure, a video processing device is provided, the device comprising:
[0033] A processing module, used for dividing a target video into a plurality of video segments;
[0034] A selection module, used for selecting a key frame from a plurality of video frames contained in each of the video segments; wherein each of the video segments corresponds to at least one of the key frames;
[0035] A determination module is used to determine a preview screen of the target video according to the key frame; wherein the preview image in the preview screen is used to locate the video clip.
[0036] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device apparatus, comprising a processor, a memory, and an executable program stored in the memory and capable of being run by the processor, wherein the processor executes the steps of the video processing method described in the first aspect when running the executable program.
[0037] According to a fourth aspect of an embodiment of the present disclosure, a storage medium is provided, on which an executable program is stored, and when the executable program is executed by a processor, the steps of the video processing method described in the first aspect are implemented.
[0038] According to the video processing method provided by the embodiment of the present disclosure, the key frame can reflect the approximate content of the corresponding video clip, and the number of key frames is relatively small relative to the target video. The preview screen is determined according to the key frame, so that the preview screen contains the information of the key frame, and then by browsing the preview screen, the content of the target video can be quickly understood, and even the highlight moment (i.e., the wonderful moment) of the target video can be quickly understood, which facilitates the viewing of the target video.
[0039] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the embodiments of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present invention and, together with the description, serve to explain the principles of the embodiments of the present invention.
[0041] Figure 1 is a flowchart of a video processing method according to an exemplary embodiment;
[0042] Figure 2 is a flowchart of a video processing method proposed according to an exemplary embodiment;
[0043] Figure 3 is a schematic diagram of a video frame extraction structure according to an exemplary embodiment;
[0044] Figure 4 is a flowchart of a video processing method proposed according to an exemplary embodiment;
[0045] Figure 5 is a flowchart of a video processing method proposed according to an exemplary embodiment;
[0046] Figure 6 is a block diagram of a video processing device according to an exemplary embodiment;
[0047] Figure 7 The invention is a block diagram of a device for video processing according to an exemplary embodiment. DETAILED DESCRIPTION
[0048] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the embodiments of the present invention. Instead, they are merely examples of devices and methods consistent with some aspects of the embodiments of the present invention as detailed in the appended claims.
[0049] The terms used in the disclosed embodiments are only for the purpose of describing specific embodiments and are not intended to limit the disclosed embodiments. The singular forms of "a", "said" and "the" used in the disclosed embodiments and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0050] It should be understood that although the terms first, second, third, etc. may be used to describe various information in the disclosed embodiments, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of the disclosed embodiments, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0051] In daily shooting, there are often long videos of the same content. If you want to understand the content of the video, you need to watch the whole video. But sometimes users may only want to browse certain moments or a certain section of the video. Watching the video from beginning to end is troublesome and the user experience is poor.
[0052] Therefore, the embodiments of the present disclosure provide the following technical solutions.
[0053] like Figure 1 As shown, this exemplary embodiment provides a video processing method, the method comprising:
[0054] S110: Divide the target video into multiple video segments;
[0055] S120: Selecting a key frame from a plurality of video frames included in each video segment; wherein each video segment corresponds to at least one key frame;
[0056] S130: Determine a preview screen of the target video according to the key frame.
[0057] The execution subject of the video processing method of the embodiment of the present disclosure is an electronic device with an image processing function, such as a mobile phone, a camera, a tablet computer, a television, or a wearable device.
[0058] In some embodiments, the electronic device is a device having image processing and image acquisition functions. The target video may be a video stored in the electronic device, or a video being acquired by the electronic device.
[0059] In some embodiments, the electronic device is a device with an image processing function. The target video may be a video acquired by the electronic device from an image acquisition device.
[0060] In step S110, the durations of different video clips may be the same or different, and the numbers of video frames contained in different video clips may be the same or different.
[0061] In the embodiments of the present disclosure, “plurality” means two or more than two.
[0062] Generally, a video includes multiple video frames, each of which corresponds to an image. Both a target video and a video clip include multiple video frames.
[0063] Exemplarily, the target video may be divided into a plurality of video segments according to a set rule. The set rule may include the same time interval, or the same number of video frames (also referred to as frame interval).
[0064] In some embodiments, the target video is divided into multiple video segments in the same time interval in chronological order. For example, if the target video is 1 minute long and the time interval can be selected as 15 seconds, then the portion of video from 0 seconds to 15 seconds is the first video segment, the portion of video from 16 seconds to 30 seconds is the second video segment, and so on, until the entire target video is divided completely, thus the target video is divided into four video segments in total.
[0065] In some embodiments, the target video is divided into multiple video segments in time sequence with the same frame interval. For example, if the target video has 200 frames in total, the frame interval can be selected as 50 frames, then from the start time of the target video, the 1st frame to the 50th frame is the first video segment, and the partial video between the 51st frame and the 100th frame is the second video segment, and so on, until the entire target video is divided completely, so that the target video is divided into four video segments in total.
[0066] It is understandable that if the number of video frames contained in the target video is not an integer multiple of the frame interval, then the N video frames before the end time of the target video are also regarded as a separate video segment, where N is greater than or equal to 1 and less than the number of frames contained in the frame interval.
[0067] Exemplarily, the target video may be divided into a plurality of video segments according to the video content of the target video. For example, a video subject similar to the image subject in the target video may be determined by matching analysis with a preset image subject, and the video frame where the video subject begins to appear and / or the first video frame where the video subject disappears from the video subject is used as the division node of the target video.
[0068] In step S120 and step S130, the key frame may be an initial video frame of the video clip, or an ending video frame, or a video frame between the initial video frame and the ending video frame.
[0069] Without limitation, the key frame may be directly used as the preview image in the preview screen, or the key frame may be processed by reducing the pixels, reducing the screen size, etc. to obtain the preview image.
[0070] One preview image corresponds to one video clip.
[0071] One video frame may be extracted from one video clip, or two or more video frames may be extracted from one video clip.
[0072] If one video clip corresponds to one video frame, then one preview image in the preview screen corresponds to one video frame.
[0073] In some embodiments, the image information of the preview image is the same as the image information of the video frame. In other words, the content displayed by the preview image can be the same as the image content included in the video frame.
[0074] If a video clip corresponds to two or more video frames, a preview image corresponds to the two or more video frames. The two or more video frames can be displayed in the form of animated images.
[0075] In the disclosed embodiment, key frames are selected from video clips, and the key frames can reflect the approximate content of the corresponding video clips, and the number of key frames is relatively small relative to the target video. The preview screen is determined based on the key frames, so that the preview screen contains the information of the key frames, and the content of the target video can be quickly understood by browsing the preview screen. If the key frames represent the highlight moments of the target video, the wonderful moments of the target video can also be quickly understood through the preview screen, which facilitates the viewing of the target video.
[0076] According to some optional embodiments, the preview image of the preview screen is used to locate the video segment.
[0077] If you are interested in a certain moment in the target video, you can browse the preview screen and locate the corresponding video clip through the preview image to quickly find the corresponding moment, which facilitates the operation and secondary review of specific video clips.
[0078] In the disclosed embodiment, locating the video segment includes: locating the video frame corresponding to the start time of the video segment, or all video frames between the start time and the end time.
[0079] According to some optional embodiments, the preview image includes: image information and associated information; wherein the associated information is used to locate the video clip.
[0080] Exemplarily, the associated information may include: an identifier of the preview image, and / or an identifier of a video segment associated with the preview image. Through the identifier of the preview image and / or the identifier of the video segment, at least one of the start time, the start time and the end time of the video segment corresponding to the preview image, and the video frames included in the video segment can be determined.
[0081] Exemplarily, the identification of the video segment includes time information.
[0082] The time information may be the start time of the corresponding video segment, or the start time and end time of the corresponding video segment. Thus, when the user browses the preview image, if the associated information of the preview image shows the time as 01:05s, it indicates that the start time of the video segment corresponding to the preview image is the first minute and five seconds of the target video.
[0083] In the disclosed embodiment, locating the video segment includes: locating the video segment through the content displayed by the preview image, and / or locating the video segment by jumping.
[0084] For example, the user can manually adjust the progress bar of the target video according to the time displayed in the preview image, adjust the current playback progress to the progress corresponding to the time displayed in the preview image, and quickly locate the required video segment. Alternatively, the user clicks on the preview image to automatically jump to the video segment corresponding to the preview image.
[0085] In some embodiments, the associated information and the image information are used together as a preview image, and the associated information includes time information of the video clip.
[0086] In some embodiments, the associated information is used for preview, and the associated information is hidden in the preview image. In this way, the video clip can be located by jumping. For example, when the electronic device detects that a preview image is selected, the display screen of the electronic device can jump to the video clip corresponding to the selected preview image, which makes it more convenient for users to view wonderful moments.
[0087] It is understandable that when the associated information and the image information are used together as a preview image, the video clip can also be located by jumping.
[0088] In the disclosed embodiment, the video segment corresponding to the preview image is: a video segment including a key frame. For example, if the key frame is extracted from the first video segment of the target video, the video segment corresponding to the preview image determined according to the key frame is the first video segment.
[0089] In some embodiments, the video processing method further includes: determining a mapping table according to a mapping relationship between the preview image and the video clip; and determining the video clip corresponding to the preview image according to the mapping table and the preview image.
[0090] The preview image has a mapping relationship with the key frame, and the key frame has a mapping relationship with the video clip. Therefore, the preview image and the video clip also have a mapping relationship.
[0091] Before the user browses the preview screen, the electronic device can create a mapping table between preview images and video clips. If it is detected that a preview image in the preview screen is selected, the video clip corresponding to the selected preview image is determined according to the mapping table and jumps to the corresponding video clip.
[0092] Other methods may also be used to achieve positioning of the preview image on the video clip, which are not limited to the above description.
[0093] In some embodiments, the key frame is a cover of the corresponding video clip.
[0094] Exemplarily, the preview screen includes a first preview screen and a second preview screen, and the electronic device can determine the display content of the second preview screen according to the first preview screen. The first preview screen and the second preview screen can be located at different display positions on the display screen of the display device, or the first preview screen is located at least partially overlapping with the second preview screen.
[0095] Exemplarily, the first preview screen is used to display the preview image, and the second preview screen is used to display the content of the video clip corresponding to the preview image, and / or display the cover of the video clip.
[0096] In some embodiments, if the electronic device detects that a preview image in the first preview screen is selected, the second preview screen displays the cover and switch control of the video clip corresponding to the selected preview image. If the video clip needs to be further opened, the switch control needs to be triggered to display the content of the video clip.
[0097] In some embodiments, if the electronic device detects that a preview image of the first preview screen is selected, the second preview screen plays the video clip corresponding to the selected preview image. At this time, if the user selects a preview image of the first preview screen by any means such as touch, voice or gesture, the content of the video clip corresponding to the preview image is directly played.
[0098] like Figure 2 As shown, according to some optional embodiments, selecting a key frame from a plurality of video frames included in each video clip includes:
[0099] S121: determining a quality score of each video frame according to frame information of multiple video frames included in each video clip;
[0100] S122: Determine the target video frame with the highest quality score in each video segment as a key frame.
[0101] The quality score can be given to each video frame contained in the video clip, which can more accurately evaluate the video frame. The video clip can also be sampled first, and the quality score of the sampled video frames can be given, which can reduce computing resources and improve the efficiency of extracting key frames.
[0102] Exemplarily, the quality score includes at least one of the following: an image score of the video frame, an audio score of the video frame, and a subject expression score of the video frame.
[0103] Among them, the image score of the video includes pixel score, resolution score, signal-to-noise ratio score, etc.
[0104] The subject of the video can be a person, an animal, or a scene. For example, if the video is shot in portrait mode, the subject of the video can be determined to be a person. When a person appears, or the area of the person in the image reaches a preset area, or the person appears at a preset position in the image, it can be determined that the expression of the subject of the video is high. For another example, the subject of the video can also be determined based on the text information and / or voice information in the target video.
[0105] like Figure 3 As shown in the figure, the target video and the multiple video frames contained in the video clip are arranged on the video timeline. If a video frame in the video clip is determined as a key frame, it can be used Figure 3 The dotted box in the middle represents the selected video frame A. The selected video frame will also have corresponding time information a on the time axis.
[0106] In some embodiments, the frame information includes at least one of the following:
[0107] Image information;
[0108] Audio information;
[0109] Text information.
[0110] The image information includes at least one of the foreground information of the image, the background information of the image, the main video information, etc. The audio information may be the background sound at the time when the video frame is located. The text information may be the subtitles, titles or annotations that appear in the video frame.
[0111] According to some optional embodiments, determining the preview image in the target video preview screen according to the key frame includes at least one of the following:
[0112] Arrange multiple key frames in chronological order to form a preview picture set;
[0113] Splice multiple key frames in chronological order to form a preview image;
[0114] Combine multiple keyframes to form a preview animation.
[0115] By previewing a collection of pictures, previewing pictures or previewing animated pictures, you can quickly view or replay a target video, allowing users to quickly find the desired moment when viewing the video.
[0116] Exemplarily, the preview picture set, the preview picture, and the preview animated picture each include multiple preview images. One key frame corresponds to one preview image. By detecting a selection operation on a preview image, it is possible to jump to a video clip corresponding to the selected preview image. Taking a click as an example of the selection operation, if it is detected that a user clicks on a preview image in the preview picture set, the preview picture, or the preview animated picture, the video clip corresponding to the preview image can be displayed on the display screen.
[0117] Locating the corresponding video clip through the preview screen can help users quickly extract the wonderful moments in the video, allowing users to better operate and watch the target video.
[0118] According to some optional embodiments, dividing the target video into a plurality of video segments includes:
[0119] According to the similarity of video frames in the target video, the target video is divided into multiple video segments.
[0120] The wonderful moments of a video are often when the picture changes, and the picture change can be determined by the similarity. Therefore, dividing the target video according to the similarity of the video frames is more conducive to distinguishing the wonderful moments, making the division of the target video more in line with user needs.
[0121] Exemplarily, the similarity of video frames in the target video may be determined using a histogram similarity function (compareHist), a hash similarity algorithm (Hashalgorithm), or the like.
[0122] According to some optional embodiments, the target video is divided into a plurality of video segments according to the similarity of the video frames in the target video, including:
[0123] Calculate the similarity between the current video frame and the previous video frame, and determine whether the similarity is less than or equal to a preset threshold;
[0124] If the similarity is less than or equal to a preset threshold, the current video frame is used as the initial video frame of the new video segment.
[0125] In some embodiments, if the similarity is greater than a preset threshold, the current video frame and the previous video frame are regarded as video frames in the same video segment.
[0126] For example: for the n-1th video frame (i.e., the previous video frame) and the nth video frame (i.e., the current video frame) that are continuous in the time domain, if the similarity between the nth video frame and the n-1th video frame is greater than a preset threshold, the nth video frame and the n-1th video frame are divided into the same video segment. If the similarity between the n+1th video frame and the nth video frame is greater than a preset threshold, the n+1th video frame is also divided into the same video segment, and so on, until the similarity between the n+kth video frame and the n+k-1th video frame is less than or equal to the preset threshold, then the n+kth video frame is the initial video frame of the next video segment (i.e., the new video segment), and the n+k-1th video frame is the end video frame of the previous video segment. Wherein, n and k are both positive integers greater than or equal to 2.
[0127] Taking similarity in percentage as an example, the preset threshold may be 50%, 60% or 80%, but is not limited thereto.
[0128] If the similarity between the current video frame and the previous video frame is lower than the preset threshold, it indicates that the content of the current video frame has changed significantly. This video frame and subsequent video frames may be the wonderful moments of the target video. At this time, using the current video frame as a division node can more accurately distinguish the wonderful moments of the target video.
[0129] like Figure 4 As shown, according to some optional embodiments, the video processing method further includes:
[0130] S101: sampling video frames in a target video according to a preset rule to obtain sampled video frames;
[0131] S102: Perform similarity processing on video frames in the sampled video frames to obtain similarity conditions of the sampled video frames.
[0132] Compared with performing similarity processing on all video frames in the target video, the embodiment of the present disclosure first samples the target video and then performs similarity processing on the sampled video frames, which can reduce the number of video frames that need to be processed, thereby saving computing resources and improving the speed of similarity processing.
[0133] The sampled video frames in step S101 are partial video frames in the target video.
[0134] The similarity processing of the sampled video frames can be performed using a similarity algorithm, for example, a histogram similarity function (compareHist), a hash similarity algorithm (Hash algorithm), and the like can be used to perform similarity processing of the sampled video frames.
[0135] According to some optional embodiments, sampling video frames in a target video according to a preset rule includes:
[0136] Extract video frames from the target video at a preset frame interval; or,
[0137] Extract video frames from the target video at preset intervals.
[0138] Exemplarily, the preset number of frames may be 10 frames, 20 frames, 30 frames, etc.
[0139] Exemplarily, the preset time may be 0.5s, 1.0s, 1.5s or 2.0s, etc.
[0140] According to some optional embodiments, sampling video frames in a target video according to a preset rule includes:
[0141] Acquire status information of the electronic device, and determine whether the status information meets a preset condition; wherein the status information of the electronic device includes: power information of the electronic device, and / or load status of a system in the electronic device;
[0142] If the status information meets the preset conditions, the target video is sampled according to the preset rules.
[0143] According to the status information of the electronic device, it can be determined whether the current electronic device allows sampling. Sampling the target video when the electronic device allows it can reduce the impact on other functions of the electronic device.
[0144] The power information includes the remaining battery power and whether it is being charged.
[0145] The system load includes: the application programs running in the foreground of the electronic device, the usage rate of the central processing unit (CPU) of the electronic device, etc.
[0146] Exemplarily, the preset condition includes at least one of the following:
[0147] The remaining battery power of the electronic device is greater than or equal to the preset power;
[0148] Electronic devices are being charged;
[0149] The application program running in the foreground of the electronic device does not include an application program of a preset type;
[0150] The CPU usage of the electronic device is lower than or equal to the usage threshold.
[0151] The preset power level may be 70% or 80%, etc. The preset type of application may be a game, live broadcast, etc. The usage rate threshold may be 60%, 70%, or 80%, etc.
[0152] In some embodiments, if the status information does not meet a preset condition, sampling of the target video is stopped.
[0153] In one example, if Figure 5 As shown, the video processing method includes:
[0154] S210: Scanning the captured or saved video. The scanning time is selected when the battery of the mobile phone or touch display device is sufficient and there is no heavy load. If it is a captured video, the scanning will be performed while the video is being shot if the battery is sufficient;
[0155] S220: extract one frame at a fixed frame interval. The frame interval is N, which can be selected by the user or preset at the factory. N is a positive integer greater than or equal to 1.
[0156] S230: After the extraction is completed, the pictures in the video (i.e., the sampled video frames of the above technical solution) will be processed similarly. That is, when the pictures taken are the same, the same moments of the same pictures will be judged, and the picture with the highest quality score (i.e., the key frame) will be selected by the algorithm and used as the node cover of the same picture.
[0157] S240: When the picture changes, including the scene change or the picture change, the next same scene (i.e., the next video clip) is selected, and a key frame is also selected as the cover until all the clips in the video are covered;
[0158] S250: forming a preview screen. The selected screens in the video (i.e., the key frames selected in S230 and step S240) can be directly saved, or a GIF image can be generated with one key, so that a quick overview of the key screens of the video can be directly and quickly generated.
[0159] S260: When the user clicks on the node cover, he / she will directly jump to the corresponding node time period to work.
[0160] In this example, a node can be understood as a video segment of a video.
[0161] In the disclosed embodiment, it is possible to make it easier to jump to key nodes of a video, and to more conveniently jump to corresponding video content.
[0162] like Figure 6 As shown, the embodiment of the present disclosure further provides a video processing device 300, the device comprising:
[0163] A processing module 310, configured to divide a target video into a plurality of video segments;
[0164] A selection module 320, configured to select a key frame from a plurality of video frames included in each of the video segments; wherein each of the video segments corresponds to at least one of the key frames;
[0165] The determination module 330 is used to determine the preview screen of the target video according to the key frame; wherein the preview image in the preview screen is used to locate the video segment.
[0166] According to some optional embodiments, the preview image includes: image information and associated information; wherein the associated information is used to locate the video clip.
[0167] According to some optional embodiments, the selection module 320 is further used to:
[0168] Determining a quality score of each of the video frames according to frame information of the multiple video frames included in each of the video clips;
[0169] The target video frame with the highest quality score in each of the video segments is determined as the key frame.
[0170] According to some optional embodiments, the frame information includes at least one of the following:
[0171] Image information;
[0172] Audio information;
[0173] Text information.
[0174] According to some optional embodiments, the determination module 330 is further configured to:
[0175] Sorting the plurality of key frames in chronological order to form a preview picture set;
[0176] splicing the plurality of key frames in chronological order to form a preview image;
[0177] A plurality of the key frames are spliced together to form a preview animation.
[0178] According to some optional embodiments, the processing module 310 is further configured to:
[0179] According to the similarity of the video frames in the target video, the target video is divided into a plurality of the video segments.
[0180] According to some optional embodiments, the processing module 310 is further configured to:
[0181] Calculating the similarity between the current video frame and the previous video frame, and determining whether the similarity is less than or equal to a preset threshold;
[0182] If the similarity is less than or equal to a preset threshold, the current video frame is used as an initial video frame of a new video segment.
[0183] According to some optional embodiments, the device further includes:
[0184] A sampling module, used for sampling the video frames in the target video according to a preset rule to obtain sampled video frames;
[0185] The calculation module is used to perform similarity processing on the sampled video frames to obtain the similarity of the sampled video frames.
[0186] According to some optional embodiments, the sampling module is further configured to:
[0187] Extract the video frame from the target video at intervals of a preset number of frames; or,
[0188] The video frame is extracted from the target video at every preset time interval.
[0189] According to some optional embodiments, the sampling module is further configured to:
[0190] Acquire status information of the electronic device, and determine whether the status information meets a preset condition; wherein the status information of the electronic device includes: power information of the electronic device, and / or load status of a system in the electronic device;
[0191] If the status information meets the preset condition, the target video is sampled according to the preset rule; wherein the status information of the electronic device includes: power information of the electronic device, and / or load conditions of the system in the electronic device.
[0192] According to some optional embodiments, the target video is a video stored in the electronic device, or a video being captured by the electronic device.
[0193] An embodiment of the present disclosure provides an electronic device, including:
[0194] processor;
[0195] a memory for storing processor-executable instructions;
[0196] The processor is configured to implement the video processing method of any embodiment of the present disclosure when running executable instructions.
[0197] In one embodiment, the processor may include various types of storage media, which are non-transitory computer storage media that can continue to remember information stored thereon after the user device loses power.
[0198] The processor may be connected to the memory via a bus or the like to read the executable program stored in the memory, for example, Figures 1 to 5 At least one of the methods shown.
[0199] The present disclosure also provides a computer storage medium, which stores a computer executable program. When the executable program is executed by a processor, the data stream synchronization method of any embodiment of the present disclosure is implemented. Figures 1 to 5 At least one of the methods shown.
[0200] Regarding the device or storage medium in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated here.
[0201] Figure 7 A block diagram of a user device 3000 is shown according to an exemplary embodiment. For example, the user device 3000 may be a mobile phone, a computer, a digital broadcast user device, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0202] Reference Figure 7 The user device 3000 may include one or more of the following components: a processing component 3002 , a memory 3004 , a power component 3006 , a multimedia component 3008 , an audio component 3010 , an input / output (I / O) interface 3012 , a sensor component 3014 , and a communication component 3016 .
[0203] The processing component 3002 generally controls the overall operation of the user device 3000, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 3002 may include one or more processors 3020 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 3002 may include one or more modules to facilitate the interaction between the processing component 3002 and other components. For example, the processing component 3002 may include a multimedia module to facilitate the interaction between the multimedia component 3008 and the processing component 3002.
[0204] The memory 3004 is configured to store various types of data to support operations on the user device 3000. Examples of such data include instructions for any application or method operating on the user device 3000, contact data, phone book data, messages, pictures, videos, etc. The memory 3004 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0205] Power component 3006 provides power to various components of user device 3000. Power component 3006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to user device 3000.
[0206] The multimedia component 3008 includes a screen that provides an output interface between the user device 3000 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 3008 includes a front camera and / or a rear camera. When the user device 3000 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0207] The audio component 3010 is configured to output and / or input audio signals. For example, the audio component 3010 includes a microphone (MIC), and when the user device 3000 is in an operation mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 3004 or sent via the communication component 3016. In some embodiments, the audio component 3010 also includes a speaker for outputting audio signals.
[0208] I / O interface 812 provides an interface between processing component 3002 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0209] The sensor assembly 3014 includes one or more sensors for providing various aspects of status assessment for the user device 3000. For example, the sensor assembly 3014 can detect the open / closed state of the device 3000, the relative positioning of components, such as the display and keypad of the user device 3000, and the sensor assembly 3014 can also detect the position change of the user device 3000 or a component of the user device 3000, the presence or absence of contact between the user and the user device 3000, the orientation or acceleration / deceleration of the user device 3000, and the temperature change of the user device 3000. The sensor assembly 3014 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 3014 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 3014 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0210] The communication component 3016 is configured to facilitate wired or wireless communication between the user device 3000 and other devices. The user device 3000 can access a wireless network based on a communication standard, such as WiFi, 4G or 5G, or a combination thereof. In an exemplary embodiment, the communication component 3016 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0211] In an exemplary embodiment, the user device 3000 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0212] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 3004 including instructions, and the instructions can be executed by the processor 3020 of the user device 3000 to complete the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0213] Those skilled in the art will readily appreciate other implementations of the embodiments of the present invention after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the embodiments of the present invention that follow the general principles of the embodiments of the present invention and include common knowledge or customary technical means in the art that are not disclosed in the embodiments of the present disclosure. The specification and examples are to be regarded as exemplary only, and the true scope and spirit of the embodiments of the present invention are indicated by the following claims.
[0214] It should be understood that the embodiments of the present disclosure are not limited to the precise structures described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof. The scope of the embodiments of the present invention is limited only by the appended claims.
Claims
1. A video processing method, characterized in that: The method comprises: Divide the target video into multiple video segments; Selecting a key frame from a plurality of video frames included in each of the video clips; wherein each of the video clips corresponds to at least one of the key frames; A preview screen of the target video is determined according to the key frame.
2. The method according to claim 1, characterized in that The preview image in the preview screen is used to locate the video segment.
3. The method according to claim 2, characterized in that The preview image includes: image information and associated information; wherein the associated information is used to locate the video clip.
4. The method according to claim 1, characterized in that: The step of selecting a key frame from a plurality of video frames included in each of the video clips comprises: Determining a quality score of each of the video frames according to frame information of the multiple video frames included in each of the video clips; The target video frame with the highest quality score in each of the video segments is determined as the key frame.
5. The method according to any one of claims 1 to 4, characterized in that: Determining the preview screen of the target video according to the key frame includes at least one of the following: Sorting the plurality of key frames in chronological order to form a preview picture set; splicing the plurality of key frames in chronological order to form a preview image; A plurality of the key frames are spliced together to form a preview animation.
6. The method according to claim 1, characterized in that The step of dividing the target video into a plurality of video segments comprises: According to the similarity of the video frames in the target video, the target video is divided into a plurality of the video segments.
7. The method according to claim 6, characterized in that The step of dividing the target video into a plurality of video segments according to the similarity of the video frames in the target video comprises: Calculating the similarity between the current video frame and the previous video frame, and determining whether the similarity is less than or equal to a preset threshold; If the similarity is less than or equal to a preset threshold, the current video frame is used as an initial video frame of a new video segment.
8. The method according to claim 6, characterized in that The method further comprises: Sampling the video frames in the target video according to a preset rule to obtain sampled video frames; Perform similarity processing on the sampled video frames to obtain the similarity status of the sampled video frames.
9. The method according to claim 8, characterized in that The sampling of the video frames in the target video according to a preset rule includes: Extract the video frame from the target video at intervals of a preset number of frames; or, The video frame is extracted from the target video at every preset time interval.
10. The method according to claim 8, characterized in that The sampling of the video frames in the target video according to a preset rule includes: Acquire status information of the electronic device, and determine whether the status information meets a preset condition; wherein the status information of the electronic device includes: power information of the electronic device, and / or load status of a system in the electronic device; If the state information meets the preset condition, the target video is sampled according to the preset rule.
11. The method according to claim 1, characterized in that: The target video is a video stored in the electronic device, or a video being captured by the electronic device.
12. A video processing device, characterized in that: The device comprises: A processing module, used for dividing a target video into a plurality of video segments; A selection module, used for selecting a key frame from a plurality of video frames included in the video segment; wherein one video segment corresponds to at least one key frame; A determination module is used to determine a preview screen of the target video according to the key frame; wherein the preview image in the preview screen is used to locate the video clip.
13. An electronic device comprising a processor, a memory, and an executable program stored in the memory and capable of being run by the processor, characterized in that: When the processor runs the executable program, the steps of the method according to any one of claims 1 to 11 are performed.
14. A storage medium having an executable program stored thereon, characterized in that: When the executable program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
Citation Information
Patent Citations
Method and system for displaying suspended playing window
CN103986962A
Video playing method and mobile terminal
CN106507176A
Unlocking methods and related products
CN107657164A
Control method and device
CN109905782A
Equipment positioning method and device, storage medium and electronic device
CN110308471A
Cited By
Video thumbnail acquisition method and device, electronic equipment and storage medium
CN121357392A
Video stream processing method and device and electronic equipment
CN122093619A
