Video thumbnail processing method and device, electronic equipment and computer readable storage medium
By introducing the concept of thumbnail stitching rules and thumbnail stitching in video processing technology, the problem of video thumbnail loading is solved, fast and smooth display is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202411676769.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-03-14
- Estimated Expiration
- 2044-11-21
AI Technical Summary
The prior art is difficult to achieve smooth display when loading video thumbnails, resulting in poor user experience.
By introducing the concepts of thumbnail stitching rules and thumbnail stitching between the terminal and the server, the terminal obtains thumbnail stitching rules and thumbnail stitching from the server, and captures and displays the corresponding thumbnails from the target thumbnail stitching based on the playback time and splicing rules of the video.
It realizes the fast and smooth display of video thumbnails, saves resources and transmission time, and improves user experience.
Smart Images

Figure CN119629424A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of video processing technology, and specifically to a video thumbnail processing method, device, electronic device, and computer-readable storage medium. Background Art
[0002] The thumbnail of a video is a static image extracted from the video, usually a key frame of the video. Thumbnails can help users quickly understand the content of the video. In related technologies, when pausing or fast-forwarding a video, the terminal sends a thumbnail request to the server based on the video's playback time. The server returns the thumbnail corresponding to the playback time to the terminal, and the terminal loads the thumbnail. However, this method makes it difficult to load thumbnails in time, resulting in an unsmooth display of thumbnails. Summary of the invention
[0003] The embodiments of the present application provide a video thumbnail processing method, device, electronic device and computer-readable storage medium, which can smoothly display video thumbnails.
[0004] In a first aspect, an embodiment of the present application provides a video thumbnail processing method, which is applied to a terminal, including:
[0005] Get thumbnail splicing rules from the server;
[0006] Loading a video thumbnail mosaic from the server; the thumbnail mosaic is formed by splicing multiple thumbnails according to the thumbnail splicing rule;
[0007] In response to the thumbnail display request, obtaining the play time of the video;
[0008] According to the play time and the thumbnail splicing rule, a thumbnail corresponding to the play time is intercepted from a target thumbnail splicing image corresponding to the play time; and
[0009] Display the thumbnail corresponding to the playback time.
[0010] In one embodiment, the step of intercepting the thumbnail corresponding to the playback time from the target thumbnail mosaic image corresponding to the playback time according to the playback time and the thumbnail mosaic rule includes:
[0011] Determine the playback time range corresponding to each of the thumbnail splicing images according to the thumbnail splicing rule;
[0012] Determine the thumbnail mosaic image corresponding to the playback time range to which the playback time belongs as the target thumbnail mosaic image;
[0013] Obtaining the number of stitching represented by the thumbnail stitching rule;
[0014] Determine the index of the thumbnail corresponding to the playback time in the target thumbnail mosaic image according to the playback time, the number of mosaics, and the target playback time range corresponding to the target thumbnail mosaic image;
[0015] According to the index and the thumbnail splicing rule, a thumbnail corresponding to the playback time is intercepted from the target thumbnail splicing image.
[0016] In one embodiment, determining the index of the thumbnail corresponding to the playback time in the target thumbnail mosaic image according to the playback time, the number of mosaics, and the target playback time range corresponding to the target thumbnail mosaic image includes:
[0017] Determine the playback duration of the target thumbnail mosaic image according to the target playback time range;
[0018] Determine a start playback time in the target playback time range, and obtain a difference between the playback time and the start playback time;
[0019] A quotient of the difference and the playback duration is obtained, and an index of the thumbnail corresponding to the playback time in the target thumbnail splicing image is determined according to the quotient and the splicing quantity.
[0020] In one of the embodiments, the step of intercepting the thumbnail corresponding to the playback time from the target thumbnail splicing image according to the index and the thumbnail splicing rule includes:
[0021] Obtaining the resolution and arrangement rule represented by the thumbnail splicing rule;
[0022] According to the index, the resolution and the arrangement rule, a thumbnail corresponding to the playback time is intercepted from the target thumbnail mosaic image.
[0023] In a second aspect, an embodiment of the present application provides a video thumbnail processing method, which is applied to a server and includes:
[0024] Generate multiple thumbnails of the video based on the target playback duration and resolution;
[0025] According to thumbnail splicing rules, the plurality of thumbnails are spliced into a thumbnail splicing image;
[0026] The thumbnail mosaic image and the thumbnail mosaic rule are sent to the terminal; the thumbnail mosaic image is used to: according to the thumbnail mosaic image and the playback time of the video in the terminal, extract the thumbnail corresponding to the playback time from the target thumbnail mosaic image corresponding to the playback time.
[0027] In one embodiment, the step of splicing the plurality of thumbnails into a thumbnail splicing image according to a thumbnail splicing rule includes:
[0028] Obtaining the number of stitching and the arrangement rule represented by the thumbnail stitching rule;
[0029] Dividing the multiple thumbnails of the video into multiple groups of thumbnails in sequence according to the time sequence and the number of splicing;
[0030] According to the time sequence and the arrangement rule, each group of thumbnail images is spliced into the thumbnail splicing image.
[0031] In a third aspect, an embodiment of the present application provides a video thumbnail processing device, which is applied to a terminal, including:
[0032] A rule acquisition module is used to obtain thumbnail splicing rules from a server;
[0033] A loading module, used for loading a thumbnail mosaic of a video from the server; the thumbnail mosaic is formed by splicing a plurality of thumbnails according to the thumbnail splicing rule;
[0034] A time acquisition module, used to obtain the play time of the video in response to a thumbnail display request;
[0035] A capture module, configured to capture the thumbnail corresponding to the playback time from the target thumbnail mosaic corresponding to the playback time according to the playback time and the thumbnail mosaic rule; and
[0036] The display module is used to display the thumbnail corresponding to the playback time.
[0037] In one embodiment, the interception module includes:
[0038] A range unit, used to determine the playback time range corresponding to each of the thumbnail splicing images according to the thumbnail splicing rule;
[0039] A target determination unit, configured to determine the thumbnail mosaic image corresponding to the playback time range to which the playback time belongs as the target thumbnail mosaic image;
[0040] A quantity acquisition unit, used to acquire the splicing quantity represented by the thumbnail splicing rule;
[0041] An index determination unit, configured to determine the index of the thumbnail corresponding to the playback time in the target thumbnail mosaic image according to the playback time, the number of mosaics, and the target playback time range corresponding to the target thumbnail mosaic image;
[0042] The interception unit is used to intercept the thumbnail corresponding to the playback time from the target thumbnail splicing picture according to the index and the thumbnail splicing rule.
[0043] In one embodiment, the index determination unit includes:
[0044] A duration determination subunit, used to determine the playback duration corresponding to the target thumbnail mosaic image according to the target playback time range;
[0045] A difference acquisition subunit, used to determine the starting playback time in the target playback time range, and acquire the difference between the playback time and the starting playback time;
[0046] The index determination subunit is used to obtain the quotient of the difference and the playback duration, and determine the index of the thumbnail corresponding to the playback time in the target thumbnail splicing picture according to the quotient and the splicing quantity.
[0047] In one embodiment, the interception unit comprises:
[0048] An acquisition subunit, used to acquire the resolution and arrangement rule represented by the thumbnail splicing rule;
[0049] The interception subunit is used to intercept the thumbnail corresponding to the playback time from the target thumbnail mosaic image according to the index, the resolution and the arrangement rule.
[0050] In a fourth aspect, an embodiment of the present application provides a video thumbnail processing device, which is applied to a server and includes:
[0051] A generation module, used to generate multiple thumbnails of the video according to the target playback duration and resolution;
[0052] A splicing module, used for splicing the plurality of thumbnails into a thumbnail splicing image according to thumbnail splicing rules;
[0053] A sending module is used to send the thumbnail mosaic image and the thumbnail mosaic rule to the terminal; the thumbnail mosaic image is used to: according to the thumbnail mosaic image and the playback time of the video in the terminal, intercept the thumbnail corresponding to the playback time from the target thumbnail mosaic image corresponding to the playback time.
[0054] In one embodiment, the splicing module includes:
[0055] An acquisition unit, used to acquire the number of stitching and the arrangement rule represented by the thumbnail stitching rule;
[0056] A division unit, used to divide the plurality of thumbnails of the video into a plurality of groups of thumbnails in sequence according to the time sequence and the splicing quantity;
[0057] A splicing unit is used to splice each group of thumbnail images into the thumbnail splicing image according to the time sequence and the arrangement rule.
[0058] In a fifth aspect, an embodiment of the present application further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and which implements the steps in the above-mentioned video thumbnail processing method when the computer program is executed by the processor.
[0059] In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned video thumbnail processing method are implemented.
[0060] In a seventh aspect, the embodiments of the present application further provide a computer program product or a computer program, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the methods provided in the various optional implementations described in the embodiments of the present application.
[0061] In summary, in the embodiment of the present application, because the thumbnail mosaic includes multiple thumbnails, compared with loading multiple thumbnails, the embodiment of the present application loads one thumbnail mosaic, which can save resources and improve efficiency; when it is necessary to display the thumbnail of the video, it is only necessary to directly capture the corresponding thumbnail from the target thumbnail mosaic loaded in the terminal according to the video playback time and the thumbnail mosaic rules, and display it. There is no need to send a request to the server according to the video playback time and obtain the thumbnail returned by the server, which can save transmission time and realize fast and smooth display of thumbnails. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] In order to more clearly illustrate the technical solutions in the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0063] Figure 1 It is a schematic diagram of the steps of a video thumbnail processing method provided by an embodiment of the present application;
[0064] Figure 2 It is a schematic diagram of the steps of a video thumbnail processing method provided by an embodiment of the present application;
[0065] Figure 3is a schematic diagram of interaction between a terminal and a server provided in an embodiment of the present application;
[0066] Figure 4 It is a flowchart of a video thumbnail processing method provided by an embodiment of the present application;
[0067] Figure 5 It is a structural schematic diagram of a video thumbnail processing device provided by an embodiment of the present application;
[0068] Figure 6 This is a schematic diagram of the structure of a video thumbnail processing device provided by an embodiment of the present application.
[0069] Figure 7 It is a schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0070] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments in the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0071] In one embodiment, Figure 1 As shown, a video thumbnail processing method is provided. Although a logical order is shown in the step diagram, in some cases, the steps shown or described may be performed in an order different from that shown in the figure. Specifically, the video thumbnail processing method can be applied to a terminal, wherein the terminal may include but is not limited to one or more of a smart phone, a tablet computer, a portable computer, a desktop computer, and a car computer.
[0072] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0073] according to Figure 1 The video thumbnail processing method shown in the figure includes at least steps S110 to S150, which are described in detail as follows:
[0074] In step S110, thumbnail stitching rules are obtained from the server.
[0075] The thumbnail splicing rule is a rule for splicing multiple thumbnails into a thumbnail splicing picture; the thumbnail splicing rule may include but is not limited to: the number of thumbnails contained in a thumbnail splicing picture, the position of each thumbnail in the thumbnail splicing picture, the resolution of the thumbnail and / or the playback time corresponding to the thumbnail, etc. The resolution of the thumbnail includes the width information and height information of the thumbnail. For example, the resolution of the thumbnail is 192x108 pixels, which indicates that the width of the thumbnail is 192 pixels and the height is 108 pixels.
[0076] In one embodiment, when a terminal opens a video, the terminal sends a thumbnail splicing rule acquisition request to the server, and the server responds to the thumbnail splicing rule acquisition request and sends the thumbnail splicing rule to the terminal.
[0077] In step S120, a thumbnail mosaic of the video is loaded from the server; the thumbnail mosaic is formed by stitching together a plurality of thumbnails according to the thumbnail stitching rule.
[0078] The server may have a storage function, and the server may use its own storage function or use an object storage service (OSS) to store the pre-generated video thumbnail mosaics. A video may include multiple thumbnail mosaics, and each thumbnail mosaic may include multiple thumbnails.
[0079] The server extracts multiple thumbnails from the video, and splices the multiple thumbnails into a thumbnail splicing image according to the thumbnail splicing rule. The server extracts multiple thumbnails from the video by dividing the video into multiple video segments, and generating a thumbnail corresponding to the video segment according to a key video frame or an nth frame in each video segment, where n is a positive integer, and the key video frame may be a video frame with a high relevance to the content of the video segment. The method for determining the key video frame may refer to the relevant technology.
[0080] In one embodiment, when the terminal opens or plays a video, the terminal sends a thumbnail mosaic acquisition request to the server, and the server responds to the thumbnail mosaic acquisition request and sends multiple thumbnail mosaics of the video to the terminal, and the terminal loads the multiple thumbnail mosaics. Alternatively, the server can also actively send thumbnail mosaics to the terminal without the terminal making a request.
[0081] In step S130, in response to the thumbnail display request, the play time of the video is obtained.
[0082] The thumbnail display request is used to request the display of the thumbnail corresponding to the playback time of the video. The thumbnail display request may be triggered in response to a target operation on the video, and the target operations include: pause, fast forward, fast rewind and / or dragging the video playback progress bar, etc. It is understandable that the playback time of the video is the time after the target operation on the video is performed. For example, when the video plays to 1 minute and 40 seconds, the user fast-forwards the video by 10 seconds, then the playback time of the video is 1 minute and 50 seconds. For another example, when the user places the cursor at a specific position on the video progress bar, or drags the video progress (press and hold without releasing) to a specific position, the time corresponding to that position is the playback time of the video.
[0083] In step S140, based on the play time and the thumbnail stitching rule, a thumbnail corresponding to the play time is intercepted from the target thumbnail stitching image corresponding to the play time.
[0084] According to the video playback time, the target thumbnail mosaic corresponding to the playback time can be determined from multiple thumbnail mosaics of the loaded video. According to the video playback time and thumbnail mosaic rules, the image area occupied by the thumbnail corresponding to the playback time in the target thumbnail mosaic can be determined, and the image area can be intercepted to obtain the thumbnail corresponding to the playback time.
[0085] In one embodiment, thumbnails corresponding to the respective playing times of the video and thumbnail splicing rules may be pre-cut out from the respective thumbnail splicing images. In response to a thumbnail display request, the pre-cut thumbnail corresponding to the playing time corresponding to the thumbnail display request is directly obtained.
[0086] In step S150, a thumbnail corresponding to the playing time is displayed.
[0087] The thumbnail corresponding to the extracted playback time is displayed. Optionally, the extracted thumbnail can be displayed as a small picture above the video playback progress bar, or the extracted thumbnail can be displayed occupying the entire playback page of the video.
[0088] By adopting the technical solution of the embodiment of the present application, since the thumbnail mosaic includes multiple thumbnails, compared with loading multiple thumbnails, the embodiment of the present application loads one thumbnail mosaic, which can save resources and improve efficiency; when it is necessary to display the thumbnail of the video, it is only necessary to directly capture the corresponding thumbnail from the target thumbnail mosaic loaded in the terminal and display it according to the video playback time and thumbnail mosaic rules. There is no need to send a request to the server according to the video playback time and obtain the thumbnail returned by the server, which can save transmission time and realize fast and smooth display of thumbnails.
[0089] On the basis of the above technical solution, as an embodiment, the method of extracting a thumbnail corresponding to the playback time from a target thumbnail stitching picture corresponding to the playback time according to the playback time and the thumbnail stitching rule may include: determining the playback time range corresponding to each thumbnail stitching picture according to the thumbnail stitching rule; determining the thumbnail stitching picture corresponding to the playback time range to which the playback time belongs as the target thumbnail stitching picture; obtaining the number of stitching represented by the thumbnail stitching rule; determining the index of the thumbnail corresponding to the playback time in the target thumbnail stitching picture according to the playback time, the number of stitching and the target playback time range corresponding to the target thumbnail stitching picture; and extracting the thumbnail corresponding to the playback time from the target thumbnail stitching picture according to the index and the thumbnail stitching rule.
[0090] The playback time range of the video clip corresponding to each thumbnail is known. The number of thumbnails included in the thumbnail mosaic can be determined according to the thumbnail mosaic rule, and the thumbnails in the thumbnail mosaic are stitched in order according to the playback time corresponding to each thumbnail. Therefore, the playback time range corresponding to each thumbnail mosaic can be determined according to the playback time range and the number of stitching of the video clip corresponding to each thumbnail. If a playback time is within the playback time range corresponding to a thumbnail mosaic, then the thumbnail corresponding to the playback time is within the thumbnail mosaic. Therefore, the thumbnail mosaic corresponding to the playback time range to which the playback time belongs is determined as the target thumbnail mosaic.
[0091] In one embodiment, a thumbnail is generated according to each 10-second video clip, and 20 thumbnails are spliced into a thumbnail splicing picture. Then, the playback time range corresponding to the first thumbnail splicing picture is (0, 200], the playback time range corresponding to the second thumbnail splicing picture is (200, 400], and so on. When the playback time is the 260th second, because 260 seconds belongs to the playback time range corresponding to the second thumbnail splicing picture, it can be determined that the second thumbnail splicing picture is the target thumbnail splicing picture corresponding to the playback time of the 260th second.
[0092] The resolution of each thumbnail in the thumbnail mosaic is the same. Therefore, the image area occupied by the thumbnail corresponding to the playback time in the thumbnail mosaic can be determined by simply determining the index of the thumbnail corresponding to the playback time in the thumbnail mosaic according to the playback time.
[0093] The index of the thumbnail in the thumbnail mosaic can be determined according to the play time corresponding to the thumbnail, the number of splicing, and the target play time range corresponding to the target thumbnail mosaic. Optionally, the order of the play time in the target play time range is determined according to the play time corresponding to the thumbnail and the target play time range. The order of the play time in the target play time range is consistent with the order of the thumbnails corresponding to the play time in the thumbnail mosaic, so the index of the thumbnail in the target thumbnail mosaic can be determined according to the order of the play time in the target play time range and the number of splicing corresponding to the thumbnail mosaic.
[0094] In one embodiment, determining the index of the thumbnail corresponding to the playback time in the target thumbnail splicing picture based on the playback time, the splicing number and the target thumbnail splicing picture may include: determining the playback duration corresponding to the target thumbnail splicing picture based on the target playback time range; determining the starting playback time in the target playback time range, and obtaining the difference between the playback time and the starting playback time; obtaining the quotient of the difference and the playback duration, and determining the index of the thumbnail corresponding to the playback time in the target thumbnail splicing picture based on the quotient and the splicing number.
[0095] The difference between the play time and the start play time is calculated, and the quotient of the difference and the play time is calculated. The quotient actually represents the order of the play time in the target play time range. Therefore, according to the quotient and the number of splicing, the index of the thumbnail corresponding to the play time in the target thumbnail splicing map can be determined.
[0096] Using the previous example, the playback time is the 260th second, the playback time range corresponding to the target thumbnail mosaic is (200, 400], and the number of mosaics is 20. The difference between the playback time and the starting playback time is 260-200=60s, and the quotient of the difference and the playback time is 60÷(400-200)=6 / 20. The quotient indicates that the playback time is the 60th / 200th from the starting playback time. The index of the thumbnail corresponding to the 260th second playback time in the target thumbnail mosaic is 60 / 200×20=6, so the thumbnail is the 6th thumbnail in the target thumbnail mosaic.
[0097] When the calculated index is not an integer, the index can be rounded up, rounded down, or rounded to obtain the final index. In one embodiment, the index of the thumbnail corresponding to the 261st second in the target thumbnail mosaic is 61 / 200×20=6.1, and 6.1 is rounded up to obtain a final index of 7, so the thumbnail corresponding to the 261st second is the 7th thumbnail in the target thumbnail mosaic.
[0098] In this way, the index of the thumbnail corresponding to the playback time in the thumbnail splicing map can be determined according to the playback time, the splicing quantity and the target playback time range, and then the thumbnail corresponding to the playback time can be intercepted from the target thumbnail splicing map according to the index.
[0099] In one embodiment, intercepting the thumbnail corresponding to the playback time from the target thumbnail stitching image according to the index and the thumbnail stitching rule may include: obtaining the resolution and arrangement rule represented by the thumbnail stitching rule; and intercepting the thumbnail corresponding to the playback time from the target thumbnail stitching image according to the index, the resolution and the arrangement rule.
[0100] The thumbnail stitching rule specifies the resolution of thumbnails and the arrangement rules of multiple thumbnails. According to the resolution of thumbnails, the image area occupied by each thumbnail can be determined; according to the arrangement rules of multiple thumbnails, the number of rows and columns corresponding to the thumbnails of each index can be determined. According to the number of rows and columns corresponding to the thumbnails, as well as the resolution of the thumbnails, the image area of the thumbnails of each index in the thumbnail stitching can be determined.
[0101] In one embodiment, the resolution of the thumbnail is 192x108 pixels; a thumbnail includes 20 thumbnails, and the arrangement rule of the thumbnails represents that the 20 thumbnails are sequentially spliced in a format of 5 rows×4 columns. A coordinate system is established with the upper left corner of the thumbnail splicing image as the origin, vertically downward as the positive direction of the longitudinal axis, and horizontally to the right as the positive direction of the horizontal axis. The coordinates of the upper left corner pixel of the image area corresponding to the 2nd row and 2nd column of the thumbnail with index 6 are (192, 108), the coordinates of the lower left corner pixel are (192, 216), the coordinates of the upper right corner pixel are (384, 108), and the coordinates of the lower right corner pixel are (384, 216).
[0102] In this way, the image area of the thumbnail of each index in the thumbnail stitching image can be quickly determined based on the thumbnail index and the thumbnail stitching rule.
[0103] By adopting the technical solution of the embodiment of the present application, there is no need to request the thumbnail corresponding to the playback time from the server separately, and because the target thumbnail mosaic is loaded, when the thumbnail corresponding to the playback time needs to be displayed, only the image capture operation can be performed to display the thumbnail, which has the advantages of being fast and efficient.
[0104] In one embodiment, Figure 2As shown, a video thumbnail processing method is provided. Although a logical order is shown in the step diagram, in some cases, the steps shown or described may be performed in an order different from that shown in the accompanying drawings. Specifically, the video thumbnail processing method can be applied to a server, wherein the server can be a physical server or a cloud server that provides various cloud services. It is worth noting that the present application does not limit the number of terminals or servers. According to implementation needs, there can be any number of terminals or servers. For example, the server can be a single server or a server cluster consisting of multiple servers, etc.
[0105] It should be noted that the order of description of the following embodiments is not intended to limit the priority order of the embodiments.
[0106] according to Figure 2 The video thumbnail processing method shown in the figure includes at least steps S210 to S230, which are described in detail as follows:
[0107] In step S210, multiple thumbnails of the video are generated according to the target playback duration and resolution.
[0108] The target playback duration is the pre-configured playback duration corresponding to each thumbnail. The server divides the video into multiple video segments according to the target playback duration, and the playback duration of each video segment is the target playback duration. A thumbnail is generated for each video segment.
[0109] Optionally, a thumbnail corresponding to each video clip may be generated based on a key video frame or the nth frame in each video clip, where n is a positive integer. The key video frame may be a video frame whose content relevance to the video clip is higher than a threshold. The method for determining the key video frame may refer to related techniques.
[0110] After determining the key video frame or the nth frame in the video clip, the key video frame or the nth frame in the video clip can be adjusted according to the resolution defined by the thumbnail stitching rule so that the key video frame or the nth frame in the video clip has the resolution, thereby obtaining a thumbnail corresponding to the video clip.
[0111] In step S220, the plurality of thumbnails are spliced into a thumbnail splicing image according to thumbnail splicing rules.
[0112] The thumbnail splicing rule defines the number of thumbnails included in the thumbnail splicing picture and the arrangement rule of multiple thumbnails. According to the thumbnail splicing rule, the number of thumbnails are spliced into a thumbnail splicing picture in sequence.
[0113] In one embodiment, stitching the multiple thumbnails into a thumbnail stitching picture according to the thumbnail stitching rule may include: obtaining the stitching quantity and arrangement rule represented by the thumbnail stitching rule; dividing the multiple thumbnails of the video into multiple groups of thumbnails according to the time sequence and the stitching quantity; and stitching each group of thumbnails into the thumbnail stitching picture according to the time sequence and the arrangement rule.
[0114] The arrangement rule represents the number of rows and columns of thumbnails in the thumbnail mosaic. According to the time sequence of the playback time corresponding to the plurality of thumbnails and the number of thumbnails included in the thumbnail mosaic, the plurality of thumbnails are divided into a plurality of groups of thumbnails. According to the time sequence and the number of rows and columns of thumbnails in the thumbnail mosaic, each group of thumbnails is spliced into the thumbnail mosaic.
[0115] In one embodiment, the number of splicing is 20, and the arrangement rule of the thumbnails represents that the 20 thumbnails are spliced in order in the format of 5 rows × 4 columns. Then, according to the time sequence of each thumbnail, the number of rows and columns of each thumbnail in the thumbnail splicing image can be determined in turn, so that each thumbnail is spliced to obtain a thumbnail splicing image.
[0116] In step S230, the thumbnail mosaic image and the thumbnail mosaic rule are sent to the terminal; the thumbnail mosaic image is used to: based on the thumbnail mosaic image and the playback time of the video in the terminal, extract the thumbnail corresponding to the playback time from the target thumbnail mosaic image corresponding to the playback time.
[0117] In one embodiment, when a terminal opens a video, the terminal sends a thumbnail stitching rule acquisition request and a thumbnail stitching image acquisition request to the server, and the server responds to the thumbnail stitching rule acquisition request and the thumbnail stitching image acquisition request and sends the thumbnail stitching rules and multiple thumbnail stitching images to the terminal.
[0118] In response to a thumbnail display request triggered by a target operation on a video, the terminal obtains the play time of the video and captures a thumbnail corresponding to the play time from a target thumbnail mosaic corresponding to the play time.
[0119] By adopting the technical solution of the embodiment of the present application, since the thumbnail mosaic includes multiple thumbnails, compared with sending multiple thumbnails to the terminal, the server in the embodiment of the present application sends the thumbnail mosaic can reduce the number of images sent, save transmission resources and improve efficiency; when the terminal needs to display the thumbnail of the video, it only needs to directly capture the corresponding thumbnail from the target thumbnail mosaic and display it according to the video playback time and thumbnail stitching rules. There is no need to send a request to the server according to the video playback time and obtain the thumbnail returned by the server, which can save transmission time and realize fast and smooth display of thumbnails.
[0120] In one embodiment, Figure 3 is a communication diagram of a terminal and a server provided in an embodiment of the present application, such as Figure 3 As shown, the server generates multiple thumbnails according to the video, and stitches the thumbnails into thumbnail stitching images according to the thumbnail stitching rules, and stores the multiple thumbnails in the storage server, wherein the storage server can be a server independent of the server generating the thumbnail stitching images, or can be the same server as the server generating the thumbnail stitching images. When the terminal opens the video, it sends a thumbnail stitching rule acquisition request to the server, and the server responds to the thumbnail stitching rule acquisition request and sends the thumbnail stitching rules to the terminal.
[0121] The terminal can send a thumbnail mosaic acquisition request to the storage server when playing a video or opening a video. The storage server returns the thumbnail mosaic to the terminal, and the terminal preloads the thumbnail mosaic.
[0122] In response to the thumbnail display request triggered by the target operation on the video, the terminal obtains the play time of the video, extracts the thumbnail corresponding to the play time from the target thumbnail mosaic corresponding to the play time, and displays it.
[0123] In one embodiment, Figure 4 As shown in the figure, the server formulates thumbnail splicing rules and sends the thumbnail splicing rules to the terminal. The server uses FFmpeg to generate thumbnails, and uses ImageMagick to splice the thumbnails into thumbnail splicing images according to the thumbnail splicing rules, and stores the thumbnail splicing images in the storage server. FFmpeg is a set of open source computer programs that can be used to record, convert digital audio and video, and convert them into streams; ImageMagick is an application for creating, editing, and synthesizing pictures.
[0124] Considering that third parties that provide videos usually provide video links, and the format of video files is usually m3u8, it is necessary to support identifying video playback links to obtain thumbnails. Video editing software can only edit local videos, while FFmpeg is suitable for scenarios that require efficient batch processing and precise control, and OpenCV (a cross-platform computer vision and machine learning software library) is suitable for scenarios that require flexible integration and automated processing. Considering that FFmpeng is an open source multimedia framework and provides a wealth of tools and libraries for processing video files, the server can extract video thumbnails by calling FFmpeg.
[0125] The target playback time of the video clips for generating thumbnails can be determined according to actual needs. If the target playback time is too long, fewer thumbnails will be generated, and the user experience will be poor; if the target playback time is too short, it will incur huge costs. Considering that most videos are played on streaming media aggregation platforms (Roku), and a fast forward on the streaming media aggregation platform corresponds to 10 seconds, the target playback time of the video clip is set to 10 seconds to ensure that users can see thumbnails every time they fast forward. If the video playback time is within 10 seconds, the thumbnail closest to the playback time is taken for display.
[0126] Taking into account the current TV resolution is 16:9, so the picture resolution is also set to 16:9, combined with the commonly used video playback software, the small size thumbnail resolution is 120x90 pixels, the medium size thumbnail resolution is 320x180 pixels, the large size thumbnail resolution is 640x360 pixels, and finally 192x108 pixels is selected as the thumbnail resolution.
[0127] When the terminal is turned on, it sends a thumbnail stitching rule acquisition request to the server. The server responds to the thumbnail stitching rule acquisition request and sends the thumbnail stitching rule to the terminal. When the terminal opens the video, it preloads each thumbnail stitching image. When the user fast-forwards, the thumbnail is captured from the thumbnail stitching image and displayed.
[0128] In the related art, each time the user fast-forwards, the terminal requests a thumbnail from the server and displays it. When the user fast-forwards continuously, the terminal needs to keep requesting thumbnails from the server. Because requesting thumbnails takes time, the user will see that the thumbnails are not loaded in time. This problem can be solved by preloading multiple thumbnails. However, since the thumbnails will not be displayed if the user does not fast-forward, many thumbnails that will not be displayed may be loaded, and fast-forwarding to places where thumbnails are not preloaded will still encounter the problem of thumbnails not being loaded in time.
[0129] In order to alleviate the situation where thumbnails cannot be displayed when users fast forward, the embodiment of the present application adopts a thumbnail splicing solution, which splices multiple thumbnails into a large thumbnail splicing picture for distribution, generates a thumbnail every 10 seconds, and splices 10 thumbnails into a thumbnail splicing picture and sends it to the terminal. The thumbnail splicing picture can be pre-loaded when the terminal plays the video. When displaying the thumbnail, the resolution of the thumbnail in the thumbnail splicing picture is calculated according to the playback time, and then the thumbnail is captured and displayed on the terminal. In this way, fast forwarding within 100 seconds can ensure that the picture can be loaded quickly, and the probability of the user having to download the next picture immediately when fast forwarding is reduced. Each thumbnail can be quickly displayed within the time period covered by the thumbnail splicing picture, thereby improving the user experience.
[0130] In one embodiment, the server names the thumbnails in the format of "{domain name sent from the cloud}+{fixed prefix}+{unique identifier of the media content provider}+{unique identifier of the media asset}+number of rows x number of columns+{resolution}+index".
[0131] By adopting the technical solution of the embodiment of the present application, since the thumbnail mosaic includes multiple thumbnails, compared with loading multiple thumbnails, the embodiment of the present application loads one thumbnail mosaic, which can save resources and improve efficiency; when it is necessary to display the thumbnail of the video, it is only necessary to directly capture the corresponding thumbnail from the target thumbnail mosaic loaded in the terminal and display it according to the video playback time and thumbnail mosaic rules. There is no need to send a request to the server according to the video playback time and obtain the thumbnail returned by the server, which can save transmission time and realize fast and smooth display of thumbnails.
[0132] In order to better implement the video thumbnail processing method of the present application, the present application also provides a video thumbnail processing device based on the above video thumbnail processing method. The meanings of the terms are the same as those in the above video thumbnail processing method, and the specific implementation details can refer to the description in the method embodiment.
[0133] See also Figure 5 , Figure 5 : is a structural schematic diagram of a video thumbnail processing device provided in an embodiment of the present application, wherein the video thumbnail processing device is applied to a terminal, and the video thumbnail processing device includes:
[0134] A rule acquisition module 501 is used to acquire thumbnail splicing rules from a server;
[0135] A loading module 502 is used to load a thumbnail mosaic of a video from the server; the thumbnail mosaic is formed by splicing a plurality of thumbnails according to the thumbnail splicing rule;
[0136] The time acquisition module 503 is used to obtain the playing time of the video in response to the thumbnail display request;
[0137] The interception module 504 is used to intercept the thumbnail corresponding to the playback time from the target thumbnail mosaic corresponding to the playback time according to the playback time and the thumbnail mosaic rule;
[0138] The display module 505 is used to display the thumbnail corresponding to the playing time.
[0139] In one embodiment, the interception module 504 includes:
[0140] A range unit, used to determine the playback time range corresponding to each of the thumbnail splicing images according to the thumbnail splicing rule;
[0141] A target determination unit, configured to determine the thumbnail mosaic image corresponding to the playback time range to which the playback time belongs as the target thumbnail mosaic image;
[0142] A quantity acquisition unit, used to acquire the splicing quantity represented by the thumbnail splicing rule;
[0143] An index determination unit, configured to determine the index of the thumbnail corresponding to the playback time in the target thumbnail mosaic image according to the playback time, the number of mosaics, and the target playback time range corresponding to the target thumbnail mosaic image;
[0144] The interception unit is used to intercept the thumbnail corresponding to the playback time from the target thumbnail splicing picture according to the index and the thumbnail splicing rule.
[0145] In one embodiment, the index determination unit includes:
[0146] A duration determination subunit, used to determine the playback duration corresponding to the target thumbnail mosaic image according to the target playback time range;
[0147] A difference acquisition subunit, used to determine the starting playback time in the target playback time range, and acquire the difference between the playback time and the starting playback time;
[0148] The index determination subunit is used to obtain the quotient of the difference and the playback duration, and determine the index of the thumbnail corresponding to the playback time in the target thumbnail splicing picture according to the quotient and the splicing quantity.
[0149] In one embodiment, the interception unit comprises:
[0150] An acquisition subunit, used to acquire the resolution and arrangement rule represented by the thumbnail splicing rule;
[0151] The interception subunit is used to intercept the thumbnail corresponding to the playback time from the target thumbnail mosaic image according to the index, the resolution and the arrangement rule.
[0152] By adopting the technical solution of the embodiment of the present application, since the thumbnail mosaic includes multiple thumbnails, compared with loading multiple thumbnails, the embodiment of the present application loads one thumbnail mosaic, which can save resources and improve efficiency; when it is necessary to display the thumbnail of the video, it is only necessary to directly capture the corresponding thumbnail from the target thumbnail mosaic loaded in the terminal and display it according to the video playback time and thumbnail mosaic rules. There is no need to send a request to the server according to the video playback time and obtain the thumbnail returned by the server, which can save transmission time and realize fast and smooth display of thumbnails.
[0153] See also Figure 6 , Figure 6 : is a structural schematic diagram of a video thumbnail processing device provided in an embodiment of the present application, wherein the video thumbnail processing device is applied to a server, and the video thumbnail processing device includes:
[0154] A generating module 601 is used to generate multiple thumbnails of the video according to the target playback duration and resolution;
[0155] A splicing module 602, configured to splice the plurality of thumbnails into a thumbnail splicing image according to thumbnail splicing rules;
[0156] The sending module 603 is used to send the thumbnail mosaic image and the thumbnail mosaic rule to the terminal; the thumbnail mosaic image is used to: according to the thumbnail mosaic image and the playback time of the video in the terminal, intercept the thumbnail corresponding to the playback time from the target thumbnail mosaic image corresponding to the playback time.
[0157] In one embodiment, the splicing module 602 includes:
[0158] An acquisition unit, used to acquire the number of stitching and the arrangement rule represented by the thumbnail stitching rule;
[0159] A division unit, used to divide the plurality of thumbnails of the video into a plurality of groups of thumbnails in sequence according to the time sequence and the splicing quantity;
[0160] A splicing unit is used to splice each group of thumbnail images into the thumbnail splicing image according to the time sequence and the arrangement rule.
[0161] By adopting the technical solution of the embodiment of the present application, since the thumbnail mosaic includes multiple thumbnails, compared with sending multiple thumbnails to the terminal, the server in the embodiment of the present application sends the thumbnail mosaic can reduce the number of images sent, save transmission resources and improve efficiency; when the terminal needs to display the thumbnail of the video, it only needs to directly capture the corresponding thumbnail from the target thumbnail mosaic and display it according to the video playback time and thumbnail stitching rules. There is no need to send a request to the server according to the video playback time and obtain the thumbnail returned by the server, which can save transmission time and realize fast and smooth display of thumbnails.
[0162] For the specific definition of the video thumbnail processing device, please refer to the definition of the video thumbnail processing method above, which will not be repeated here. Each module in the above-mentioned video thumbnail processing device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0163] In addition, the present application also provides an electronic device, such as Figure 7 As shown, it shows a schematic diagram of the structure of the electronic device involved in this application, specifically:
[0164] The electronic device may include one or more processors 701 of processing cores and one or more computer-readable storage media memories 702 and other components. Those skilled in the art will appreciate that Figure 7 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0165] The processor 701 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 702, and calling data stored in the memory 702, it performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 701 may include one or more processing cores; preferably, the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 701.
[0166] The memory 702 can be used to store software programs and modules. The processor 701 executes various functional applications and data processing by running the software programs and modules stored in the memory 702. The memory 702 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 702 may also include a memory controller to provide the processor 701 with access to the memory 702.
[0167] In one embodiment, the electronic device further includes a power supply 703 for supplying power to various components. Preferably, the power supply 703 can be logically connected to the processor 701 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 703 can also include one or more DC or AC power supplies, recharging systems, power supply device debugging circuits, power converters or inverters, power status indicators and other arbitrary components.
[0168] In one embodiment, the electronic device may further include an input unit 704, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0169] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 701 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 702 according to the following instructions, and the processor 701 will run the application programs stored in the memory 702, thereby implementing the steps in any one of the video thumbnail processing methods provided in the embodiments of the present application.
[0170] Those skilled in the art will understand that Figure 7 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present application, and does not constitute a limitation on the electronic device to which the scheme of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0171] In one embodiment, an electronic device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the method described in any embodiment of the present application is implemented.
[0172] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method described in any embodiment of the present application is implemented.
[0173] In some embodiments, a computer program product is also proposed, including a computer program or instructions, which implement the method described in any embodiment of the present application when executed by a processor.
[0174] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0175] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0176] To this end, the present application provides a computer-readable storage medium, on which a computer program is stored. The computer program can be loaded by a processor to execute the steps in any video thumbnail processing method provided in the present application.
[0177] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.
[0178] The computer-readable storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0179] Since the instructions stored in the computer-readable storage medium can execute the steps in any video thumbnail processing method provided in the present application, the beneficial effects that can be achieved by any video thumbnail processing method provided in the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0180] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "including one..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0181] The above is a detailed introduction to a video thumbnail processing method, device, electronic device and computer-readable storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A video thumbnail processing method, characterized in that: Applied to terminals, including: Get thumbnail splicing rules from the server; Loading a video thumbnail mosaic from the server; the thumbnail mosaic is formed by splicing multiple thumbnails according to the thumbnail splicing rule; In response to the thumbnail display request, obtaining the play time of the video; According to the play time and the thumbnail splicing rule, a thumbnail corresponding to the play time is intercepted from a target thumbnail splicing image corresponding to the play time; and Display the thumbnail corresponding to the playback time.
2. The method according to claim 1, characterized in that The step of intercepting the thumbnail corresponding to the playback time from the target thumbnail mosaic image corresponding to the playback time according to the playback time and the thumbnail splicing rule comprises: Determine the playback time range corresponding to each of the thumbnail splicing images according to the thumbnail splicing rule; Determine the thumbnail mosaic image corresponding to the playback time range to which the playback time belongs as the target thumbnail mosaic image; Obtaining the number of stitching represented by the thumbnail stitching rule; Determine the index of the thumbnail corresponding to the playback time in the target thumbnail mosaic image according to the playback time, the number of mosaics, and the target playback time range corresponding to the target thumbnail mosaic image; According to the index and the thumbnail splicing rule, a thumbnail corresponding to the playback time is intercepted from the target thumbnail splicing image.
3. The method according to claim 2, characterized in that The step of determining the index of the thumbnail corresponding to the playback time in the target thumbnail mosaic image according to the playback time, the number of mosaics, and the target playback time range corresponding to the target thumbnail mosaic image comprises: Determine the playback duration of the target thumbnail mosaic image according to the target playback time range; Determine a start playback time in the target playback time range, and obtain a difference between the playback time and the start playback time; A quotient of the difference and the playback duration is obtained, and an index of the thumbnail corresponding to the playback time in the target thumbnail splicing image is determined according to the quotient and the splicing quantity.
4. The method according to claim 2, characterized in that: The step of intercepting the thumbnail corresponding to the playback time from the target thumbnail splicing image according to the index and the thumbnail splicing rule comprises: Obtaining the resolution and arrangement rule represented by the thumbnail splicing rule; According to the index, the resolution and the arrangement rule, a thumbnail corresponding to the playback time is intercepted from the target thumbnail mosaic image.
5. A video thumbnail processing method, characterized in that: Applicable to servers, including: Generate multiple thumbnails of the video based on the target playback duration and resolution; According to thumbnail splicing rules, the plurality of thumbnails are spliced into a thumbnail splicing image; The thumbnail mosaic image and the thumbnail mosaic rule are sent to the terminal; the thumbnail mosaic image is used to: according to the thumbnail mosaic image and the playback time of the video in the terminal, extract the thumbnail corresponding to the playback time from the target thumbnail mosaic image corresponding to the playback time.
6. The method according to claim 5, characterized in that The step of splicing the plurality of thumbnails into a thumbnail splicing image according to a thumbnail splicing rule includes: Obtaining the number of stitching and the arrangement rule represented by the thumbnail stitching rule; Dividing the multiple thumbnails of the video into multiple groups of thumbnails in sequence according to the time sequence and the number of splicing; According to the time sequence and the arrangement rule, each group of thumbnail images is spliced into the thumbnail splicing image.
7. A video thumbnail processing device, characterized in that: Applied to terminals, including: A rule acquisition module is used to obtain thumbnail splicing rules from a server; A loading module, used for loading a thumbnail mosaic of a video from the server; the thumbnail mosaic is formed by splicing a plurality of thumbnails according to the thumbnail splicing rule; A time acquisition module, used to obtain the play time of the video in response to a thumbnail display request; A capture module, configured to capture the thumbnail corresponding to the playback time from the target thumbnail mosaic corresponding to the playback time according to the playback time and the thumbnail mosaic rule; and The display module is used to display the thumbnail corresponding to the playback time.
8. A video thumbnail processing device, characterized in that: Applicable to servers, including: A generation module, used to generate multiple thumbnails of the video according to the target playback duration and resolution; A splicing module, used for splicing the plurality of thumbnails into a thumbnail splicing image according to thumbnail splicing rules; A sending module is used to send the thumbnail mosaic image and the thumbnail mosaic rule to the terminal; the thumbnail mosaic image is used to: according to the thumbnail mosaic image and the playback time of the video in the terminal, intercept the thumbnail corresponding to the playback time from the target thumbnail mosaic image corresponding to the playback time.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps in the video thumbnail processing method as described in any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the video thumbnail processing method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Video thumbnail processing method, video thumbnail processing system and video player
CN103873916A
Method and device for acquiring and generating video frame screen shot and acquiring system
CN107872729A
Image processing method and device and computer readable storage medium
CN109756776A
Preview display method and device, electronic equipment and storage medium
CN116916106A
Image display method, terminal and electronic equipment
CN117555464A