Video file preview method, device, computer-readable medium, and equipment

By dividing the video file into segments and extracting video frames that meet the predetermined color ratio rules as preview images, the problem of invalid preview images in video file preview is solved and a better preview effect is achieved.

CN115834955BActive Publication Date: 2025-09-05XIAMEN HUANLEGUANG TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211450923.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-18
Publication Date
2025-09-05
Estimated Expiration
2042-11-18

AI Technical Summary

Technical Problem

In the prior art, the preview images of video files often have a large proportion of a single color, resulting in invalid preview images and affecting the preview effect.

Method used

By receiving the preview request from the target terminal, after obtaining the video file, it is divided into multiple video segments according to the video length, and a video frame with a predetermined color ratio that meets the rules is extracted from each video segment as a preview image and sent to the target terminal.

Benefits of technology

It improves the effectiveness of preview images, ensures the preview effect of video files, avoids the appearance of invalid preview images, and improves user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115834955B_ABST
    Figure CN115834955B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a preview method, apparatus, computer-readable medium, and device for video files. The method includes: receiving a preview request for a target video sent by a target terminal, the preview request including the storage address of the target video; obtaining a video file corresponding to the target video according to the storage address; parsing the video file to determine the video length of the video file; dividing the video file into at least one video segment in chronological order based on the video length and a pre-set minimum segment length; extracting a video frame from each video segment as a corresponding preview image, wherein the ratio of a predetermined color in the video frame to the area of ​​the video frame complies with a predetermined rule; and feeding back the preview image corresponding to each video segment to the target terminal. The technical solution of the embodiments of the present application improves the effectiveness of the preview image of the video file and thus ensures the preview effect of the video file.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer-readable medium, and device for previewing a video file. Background Art

[0002] Current technical solutions often use video screenshots to preview video files and display them as preview images to users. However, some video screenshots may contain too much of a single color, rendering them invalid. Therefore, improving the effectiveness of video file preview images and ensuring the quality of video file previews has become a pressing technical issue. Summary of the Invention

[0003] The embodiments of the present application provide a method, apparatus, computer-readable medium, and device for previewing a video file, which can improve the effectiveness of the preview image of the video file to at least a certain extent and thus ensure the preview effect of the video file.

[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by practice of the present application.

[0005] According to one aspect of an embodiment of the present application, a method for previewing a video file is provided, the method comprising:

[0006] receiving a preview request for a target video sent by a target terminal, wherein the preview request includes a storage address of the target video;

[0007] According to the storage address, obtaining a video file corresponding to the target video;

[0008] Parsing the video file to determine the video length of the video file;

[0009] Dividing the video file into at least one video segment in chronological order based on the video length and a preset minimum segment length;

[0010] Extracting a video frame from each of the video segments as a corresponding preview image, wherein a ratio of a predetermined color in the video frame to an area of ​​the video frame complies with a predetermined rule;

[0011] Feedback of preview images corresponding to the video segments to the target terminal is provided. According to one aspect of an embodiment of the present application, a video file preview device is provided, the device comprising:

[0012] A receiving module, configured to receive a preview request for a target video sent by a target terminal, wherein the preview request includes a storage address of the target video;

[0013] An acquisition module, configured to acquire a video file corresponding to the target video according to the storage address;

[0014] A parsing module, configured to parse the video file and determine the video length of the video file;

[0015] a segmentation module, configured to divide the video file into at least one video segment in chronological order based on the video length and a preset minimum segment length;

[0016] an extraction module, configured to extract a video frame from each of the video segments as a corresponding preview image, wherein a ratio of a predetermined color in the video frame to an area of ​​the video frame complies with a predetermined rule;

[0017] The processing module is used to feed back the preview image corresponding to each of the video segments to the target terminal.

[0018] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method for previewing a video file as described in the above embodiment is implemented.

[0019] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the video file preview method as described in the above embodiment.

[0020] According to one aspect of an embodiment of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the video file preview method provided in the above-described embodiment.

[0021] In the technical solutions provided in some embodiments of the present application, a preview request for a target video is received from a target terminal, the preview request including the storage address of the target video file. Based on the storage address, a video file corresponding to the target video is obtained, and the video length of the video file is determined. Based on the video length and a pre-set minimum segment length, the video file is divided into at least one video segment in chronological order. Video frames are extracted from the video segments as corresponding preview images, where the ratio of a predetermined color to the video frame area in the video frame complies with a predetermined rule. The preview images corresponding to each video segment are then fed back to the target terminal. Thus, by dividing the video file into at least one video segment and extracting a video frame from each video segment where the ratio of a predetermined color to the video frame area complies with the predetermined rule as a preview image, the effectiveness of the preview images can be improved, thereby ensuring the preview effect of the video file.

[0022] 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 present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The accompanying drawings are incorporated into and constitute a part of the specification, illustrating embodiments consistent with the present application and, together with the specification, explaining the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and those skilled in the art can derive other drawings based on these drawings without inventive effort. In the drawings:

[0024] Figure 1 A schematic diagram showing a flow chart of a method for previewing a video file according to an embodiment of the present application is shown;

[0025] Figure 2 A block diagram of a video file preview device according to an embodiment of the present application is shown;

[0026] Figure 3 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0027] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be thorough and complete and will fully convey the concepts of the example embodiments to those skilled in the art.

[0028] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner.In the following description, many specific details are provided so as to provide a full understanding of the embodiments of the present application. However, it will be appreciated by those skilled in the art that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps etc. can be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the application.

[0029] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0030] The flowcharts shown in the accompanying drawings are for illustrative purposes only and do not necessarily include all contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, while others may be combined or partially combined. Therefore, the actual execution order may vary depending on the actual situation.

[0031] Figure 1 A flow chart of a method for previewing a video file according to an embodiment of the present application is shown. The method for previewing a video file can be applied to a server. It should be noted that the server can be a physical server or a cloud server that provides various cloud services. It can also be a single server or a server cluster composed of multiple servers, etc. This application does not make any special restrictions on this.

[0032] Please refer to Figure 1 The video file preview method includes at least steps S110 to S160, which are described in detail as follows:

[0033] In step S110 , a preview request for a target video sent by a target terminal is received, where the preview request includes a storage address of the target video.

[0034] Specifically, the user can browse the video file through the target terminal. The video file can be uploaded by the user to an Internet storage space (such as a network disk, etc.), and the user can browse and manage the video file through the target terminal; or, the video file can also be provided by a third-party video playback organization, and the user can preview the video in advance before watching the video to determine whether it needs to be watched.

[0035] When the user determines that a target video needs to be previewed, the user can select the target video to be previewed. The target terminal can generate a preview request for the target video based on the user's operation information. The preview request can include the storage address of the target video. After receiving the preview request, the server can parse the preview request and obtain the storage address of the target video to determine the target video to be previewed.

[0036] In step S120, a video file corresponding to the target video is obtained according to the storage address.

[0037] In this embodiment, the storage address of the target video can be the server's own storage space, or it can be stored in a third-party storage space, such as a cloud storage server, etc. The server can obtain the video file corresponding to the target video from its corresponding storage space according to the storage address corresponding to the target video.

[0038] In step S130, the video file is parsed to determine the video length corresponding to the video file.

[0039] In this embodiment, after acquiring the video file, the server may parse the video file to determine relevant information of the video file, thereby determining the video length corresponding to the video file.

[0040] In step S140 , the video file is divided into at least one video segment in chronological order based on the video length and a preset minimum segment length.

[0041] Among them, the shortest segment length can be the shortest video segment length pre-set by technical personnel in this field based on prior experience. For example, the shortest segment length can be 1 minute, 2 minutes, etc., that is, the time length of the segmented video segment should be greater than or equal to the shortest segment length.

[0042] In this embodiment, the server may divide the video file into at least one video segment in chronological order based on the video length and the shortest segment length corresponding to the video file. It should be understood that if the total video length corresponding to the video file is less than the shortest segment length, the video file may not be segmented and the subsequent steps may be performed directly. If the total video length corresponding to the video file is greater than the shortest segment length, the server may segment the video file based on average segmentation or by segmenting in sequence according to the shortest segment length, etc., and this application does not impose any special restrictions on this.

[0043] In step S150, a video frame is extracted from each of the video segments as a corresponding preview image, wherein the ratio of the predetermined color in the video frame to the area of ​​the video frame complies with a predetermined rule.

[0044] In this embodiment, the predetermined color may be a specific color pre-set by those skilled in the art based on prior experience. It may be a single color, such as black, white, etc., or it may be multiple colors.

[0045] In this case, the server can extract frames from each video segment, for example randomly or at predetermined intervals. After extracting the video frame, the server can perform color recognition on the video frame to determine the proportion of each color in the video frame area. The server can then use the video frame with the predetermined color proportion as the preview image corresponding to the video segment, thereby avoiding the occurrence of invalid preview images.

[0046] In step S160, the preview image corresponding to each of the video segments is fed back to the target terminal.

[0047] In this embodiment, the server may feed back the preview images corresponding to the determined video segments to the target terminal for display in the target terminal, thereby allowing the user to preview the target video.

[0048] exist Figure 1 The illustrated embodiment receives a preview request for a target video from a target terminal. The preview request includes the storage address of the target video file. Based on the storage address, the video file corresponding to the target video is retrieved and the video length of the video file is determined. Based on the video length and a preset minimum segment length, the video file is divided into at least one video segment according to time. Video frames are extracted from the video segments as corresponding preview images, where the ratio of a predetermined color to the video frame area in the video frame meets a predetermined rule. The preview image corresponding to each video segment is then fed back to the target terminal. Thus, by dividing the video file into at least one video segment and extracting a video frame from each video segment where the ratio of a predetermined color to the video frame area meets the predetermined rule as a preview image, the effectiveness of the preview image can be improved, thereby ensuring the preview effect of the video file.

[0049] based on Figure 1 In the embodiment shown, in one embodiment of the present application, the predetermined colors include black and white, and extracting a video frame from each of the video segments as a corresponding preview image includes:

[0050] A video frame in which the proportion of black and white occupying the area of ​​the video frame is less than or equal to a predetermined threshold is extracted from each of the video segments as a preview image corresponding to the video segment.

[0051] In this embodiment, it should be understood that the higher the proportion of a particular color in a video frame, the less information the video frame carries, and the higher the probability of an invalid preview image being generated if it is used as a preview image. Therefore, based on prior experience, black and white can be used as predetermined colors, and the video frames extracted from each video segment can be parsed to determine the proportion of black and white in the video frame area. This proportion is then compared with a predetermined threshold. If the proportion of black and white in the same video frame is less than or equal to the predetermined threshold, the frame can be used as the preview image for the corresponding video segment, thereby ensuring the validity of the preview image.

[0052] Among them, the predetermined threshold can be pre-set by those skilled in the art based on prior experience, for example, it can be 60%, 70%, etc. The above numbers are only illustrative examples, and those skilled in the art can determine the corresponding proportional threshold according to actual implementation needs.

[0053] It should be noted that the preview images corresponding to the same video segment can be one or two or more, and this application does not impose any special restrictions on this.

[0054] In one embodiment of the present application, extracting, from each of the video segments, a video frame in which the proportion of black and white in the video frame area is less than or equal to a predetermined threshold as a preview image corresponding to the video segment includes:

[0055] At a predetermined time interval, video frames are extracted from each of the video frames. If the proportion of black or white in the currently extracted video frame to the area of ​​the video frame is greater than a predetermined threshold, the extraction continues until a video frame in which the proportion of black and white to the area of ​​the video frame is less than or equal to the predetermined threshold is extracted as a preview image.

[0056] In this embodiment, those skilled in the art can pre-set a time interval, for example, extracting a video frame every 10 seconds. Within the same video segment, if the proportion of black or white in the currently extracted video frame exceeds a predetermined threshold, the server will continue to extract the next frame until a video frame is extracted in which the proportion of black and white in the video frame is less than or equal to the predetermined threshold. Thus, by extracting one frame at a time, once a video frame that meets the predetermined criteria is extracted, extraction can be stopped, thereby improving the efficiency of generating subsequent preview images and reducing computing resources.

[0057] In one embodiment of the present application, if a video frame in which the proportion of black and white in the video frame area is less than or equal to a predetermined threshold is not extracted after the number of extractions reaches a predetermined number, the previously extracted video frame in which the proportion of useless colors in the video frame area is the lowest is used as a preview image, where the useless color is the color that occupies a larger proportion of the video frame area between black and white.

[0058] Specifically, those skilled in the art can pre-set a predetermined number of times, such as 10 times, 12 times, etc. For the same video segment, if a suitable video frame has not been extracted after the number of extractions reaches the predetermined number of times, then a selection will be made from the video frames extracted before the video segment. The video frame with the lowest proportion of useless colors in the video frame area can be selected as the preview image. The useless color is the color that occupies a larger proportion of the video frame area between black and white.

[0059] For example, if the predetermined number of times is two, the first extracted video frame has a white content of 70% and a black content of 30%. The second extracted video frame has a white content of 28% and a black content of 72%. Neither the first nor the second frame meets the predetermined criteria. In this case, the first video frame has white as the useless color, while the second video frame has black as the useless color. The two video frames are compared for their useless color proportions, and the first video frame with the lowest useless color content is selected as the preview image. This improves the efficiency of preview image determination and avoids the impact on user experience caused by lengthy determination times.

[0060] In one embodiment of the present application, obtaining a video file corresponding to the target video according to the storage address includes:

[0061] According to the storage address, a video file corresponding to the target video is obtained from the cloud storage server:

[0062] Feedback of the preview image corresponding to each video segment to the target terminal includes:

[0063] Uploading the preview image corresponding to each of the video segments to the cloud storage server for storage corresponding to the video file, and receiving the storage address of the preview image fed back by the cloud storage server;

[0064] The storage address of the preview image is sent to the target terminal.

[0065] In this embodiment, the video file is stored in the cloud storage server, which can save its own storage space and ensure the transmission efficiency of the video file. When the server feeds the preview image corresponding to each video segment to the target terminal, it can first upload the preview image corresponding to each video segment to the cloud storage server for storage corresponding to the video file. If there is a subsequent preview request for the same video, the preview image can be directly obtained without re-determining it, thereby improving the efficiency of obtaining the preview image.

[0066] After receiving the preview image, the cloud storage server can feedback the corresponding storage address to the server. After receiving the storage address, the server can feedback the storage address to the target terminal. The target terminal can obtain the corresponding preview image according to the storage address for display to ensure the transmission efficiency of the preview image.

[0067] The following describes an embodiment of the device of the present application, which can be used to execute the preview method of the video file in the above embodiment of the present application. For details not disclosed in the embodiment of the device of the present application, please refer to the embodiment of the preview method of the video file in the above embodiment of the present application.

[0068] Figure 2 A block diagram of a video file preview device according to an embodiment of the present application is shown.

[0069] Reference Figure 2 As shown, a video file preview device according to one embodiment of the present application includes:

[0070] The receiving module 210 is configured to receive a preview request for a target video sent by a target terminal, wherein the preview request includes a storage address of the target video;

[0071] An acquisition module 220 is configured to acquire a video file corresponding to the target video according to the storage address;

[0072] The parsing module 230 is configured to parse the video file to determine the video length of the video file;

[0073] a division module 240, configured to divide the video file into at least one video segment in chronological order based on the video length and a preset minimum segment length;

[0074] An extraction module 250 is configured to extract a video frame from each of the video segments as a corresponding preview image, wherein a ratio of a predetermined color in the video frame to an area of ​​the video frame complies with a predetermined rule;

[0075] The processing module 260 is configured to feed back the preview image corresponding to each of the video segments to the target terminal.

[0076] In one embodiment of the present application, the predetermined colors include black and white; the extraction module 250 is used to: extract from each of the video segments a video frame in which the proportion of black and white in the video frame area is less than or equal to a predetermined threshold as a preview image corresponding to the video segment.

[0077] In one embodiment of the present application, the extraction module 250 is used to extract video frames from each of the video frames at a predetermined time interval. If the proportion of black or white in the currently extracted video frame to the area of ​​the video frame is greater than a predetermined threshold, continue to extract backward until a video frame in which the proportion of black and white to the area of ​​the video frame is less than or equal to the predetermined threshold is extracted as a preview image.

[0078] In one embodiment of the present application, the extraction module 250 is further configured to: if a video frame in which the proportion of black and white in the video frame area is less than or equal to a predetermined threshold is not extracted after the predetermined number of extractions, then the previously extracted video frame in which the proportion of useless colors in the video frame area is the lowest is used as a preview image, where the useless color is a color that occupies a larger proportion of the video frame area between black and white.

[0079] In one embodiment of the present application, the acquisition module 220 is used to: obtain the video file corresponding to the target video from the cloud storage server according to the storage address; the processing module 260 is used to: upload the preview image corresponding to each of the video segments to the cloud storage server for storage corresponding to the video file, and receive the storage address of the preview image fed back by the cloud storage server; and send the storage address of the preview image to the target terminal.

[0080] Figure 3 A schematic diagram of the structure of a computer system suitable for implementing an electronic device according to an embodiment of the present application is shown.

[0081] It should be noted that Figure 3 The computer system of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0082] like Figure 3 As shown, the computer system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. Various programs and data required for system operation are also stored in the RAM 303. The CPU 301, ROM 302 and RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0083] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, and the like; an output section 307 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. Removable media 311, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 310 as needed, so that computer programs read therefrom can be installed into the storage section 308 as needed.

[0084] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 309, and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the various functions defined in the system of the present application are executed.

[0085] It should be noted that the computer-readable medium shown in the embodiments of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The 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), a 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 application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable computer program. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. 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 connection with an instruction execution system, apparatus, or device. A computer program embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, or any suitable combination thereof.

[0086] 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 application. Among them, each box in the flowchart or block diagram can represent a module, program segment, or part of the code, and the above-mentioned module, program segment, or part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from 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 or flowchart, and the combination of boxes in the block diagram 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.

[0087] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. In some cases, the names of these units do not constitute limitations on the units themselves.

[0088] As another aspect, the present application further provides a computer-readable medium, which may be included in the electronic device described in the above embodiments, or may exist independently without being incorporated into the electronic device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device implements the method described in the above embodiments.

[0089] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiment of the application, the features and functions of two or more modules or units described above can be concretized in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.

[0090] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the embodiments of the present application.

[0091] Those skilled in the art will readily conceive of other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present application that follow the general principles of this application and include common knowledge or customary techniques in the art that are not disclosed herein.

[0092] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A method for previewing a video file, characterized in that: include: receiving a preview request for a target video sent by a target terminal, wherein the preview request includes a storage address of the target video; According to the storage address, obtaining a video file corresponding to the target video; Parsing the video file to determine the video length of the video file; Dividing the video file into at least one video segment in chronological order based on the video length and a preset minimum segment length; Extracting a video frame from each of the video segments as a corresponding preview image, wherein a ratio of a predetermined color in the video frame to an area of ​​the video frame complies with a predetermined rule, and the predetermined colors include black and white; Feedback the preview image corresponding to each of the video segments to the target terminal; Extracting a video frame from each of the video segments as a corresponding preview image includes: A video frame in which the proportion of black and white occupying the area of ​​the video frame is less than or equal to a predetermined threshold is extracted from each of the video segments as a preview image corresponding to the video segment.

2. The method according to claim 1, characterized in that Extracting, from each of the video segments, a video frame in which the proportion of black and white occupying the video frame area is less than or equal to a predetermined threshold as a preview image corresponding to the video segment, comprising: At predetermined time intervals, video frames are extracted from each of the video segments. If the proportion of black or white in the currently extracted video frame to the area of ​​the video frame is greater than a predetermined threshold, the extraction continues until a video frame in which the proportion of black and white in the video frame area is less than or equal to the predetermined threshold is extracted as a preview image.

3. The method according to claim 2, characterized in that For the same video segment, if a video frame in which the proportion of black and white occupying the video frame area is less than or equal to a predetermined threshold is not extracted after the number of extractions reaches a predetermined number, a video frame in which the proportion of useless colors occupying the video frame area of ​​the video frame in which it is located is the lowest is selected from the video frames extracted before the video segment as the preview image, where the useless color is the color that occupies a larger proportion of the video frame area between black and white in the same video frame.

4. The method according to any one of claims 1 to 3, characterized in that Acquiring a video file corresponding to the target video according to the storage address, including: According to the storage address, a video file corresponding to the target video is obtained from the cloud storage server: Feedback of the preview image corresponding to each video segment to the target terminal includes: Uploading the preview image corresponding to each of the video segments to the cloud storage server for storage corresponding to the video file, and receiving the storage address of the preview image fed back by the cloud storage server; The storage address of the preview image is sent to the target terminal.

5. A video file preview device, characterized in that: include: A receiving module, configured to receive a preview request for a target video sent by a target terminal, wherein the preview request includes a storage address of the target video; An acquisition module, configured to acquire a video file corresponding to the target video according to the storage address; A parsing module, configured to parse the video file and determine the video length of the video file; a segmentation module, configured to divide the video file into at least one video segment in chronological order based on the video length and a preset minimum segment length; an extraction module, configured to extract a video frame from each of the video segments as a corresponding preview image, wherein a ratio of a predetermined color in the video frame to an area of ​​the video frame complies with a predetermined rule, and the predetermined colors include black and white; A processing module, configured to feed back a preview image corresponding to each of the video segments to the target terminal; The extraction module is used to extract, from each of the video segments, a video frame in which the proportion of black and white in the video frame area is less than or equal to a predetermined threshold as a preview image corresponding to the video segment.

6. The device according to claim 5, characterized in that The extraction module is used to: At predetermined time intervals, video frames are extracted from each of the video segments. If the proportion of black or white in the currently extracted video frame to the area of ​​the video frame is greater than a predetermined threshold, the extraction continues until a video frame in which the proportion of black and white in the video frame area is less than or equal to the predetermined threshold is extracted as a preview image.

7. A computer-readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the video file preview method according to any one of claims 1 to 4 is implemented.

8. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the video file preview method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Soccer video abstract generation method and device based on cloud television

    CN104123396A

  • Image analysis system applied to video monitoring tester and analysis method thereof

    CN113660427A