CN113676751B - Video thumbnail processing method and device - Google Patents

Video thumbnail processing method and device Download PDF

Info

Publication number
CN113676751B
CN113676751B CN202110956936.1A CN202110956936A CN113676751B CN 113676751 B CN113676751 B CN 113676751B CN 202110956936 A CN202110956936 A CN 202110956936A CN 113676751 B CN113676751 B CN 113676751B
Authority
CN
China
Prior art keywords
video
thumbnail
thumbnails
initial
processed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110956936.1A
Other languages
Chinese (zh)
Other versions
CN113676751A (en
Inventor
陈波
肖明珠
李鹏程
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202110956936.1A priority Critical patent/CN113676751B/en
Publication of CN113676751A publication Critical patent/CN113676751A/en
Application granted granted Critical
Publication of CN113676751B publication Critical patent/CN113676751B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams, manipulating MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8549Creating video summaries, e.g. movie trailer

Abstract

The application provides a video thumbnail processing method and a device, wherein the video thumbnail processing method comprises the following steps: acquiring initial thumbnails of the video to be processed and the number of the initial thumbnails according to the thumbnail parameter information; cutting the video to be processed in response to a video cutting instruction aiming at the video to be processed to obtain a cut video and a target video; determining the number of the clipping thumbnails according to the clipping video and the thumbnail parameter information; calculating the number of display thumbnails based on the initial number of thumbnails and the number of clipping thumbnails; according to the video clipping instruction and the number of the display thumbnails, the display thumbnails corresponding to the target video are drawn, and by the method, the stability of thumbnail images can be maintained in the video clipping process, and the user experience is enhanced.

Description

Video thumbnail processing method and device
Technical Field
The application relates to the technical field of computers, in particular to a video thumbnail processing method. The present application is also directed to a video thumbnail processing apparatus, a computing device, and a computer-readable storage medium.
Background
With the development of technology, video editing and sharing have become an entertainment mode for a large number of users, when users edit videos through a web video editor, thumbnail images of all time periods are displayed on a video segment in a track, when a mouse is suspended at the left side edge and the right side edge of the video segment, the length of the videos can be dragged and adjusted, in the dragging process, the thumbnail images can generate flickering change, the thumbnail images cannot be kept stable, and the operation experience of the users is poor.
Disclosure of Invention
In view of this, embodiments of the present application provide a video thumbnail processing method. The application relates to a video thumbnail processing device, a computing device and a computer readable storage medium, so as to solve the problems of flickering of a video thumbnail and poor user experience in the video editing process in the prior art.
According to a first aspect of an embodiment of the present application, there is provided a video thumbnail processing method, including:
acquiring initial thumbnails of the video to be processed and the number of the initial thumbnails according to the thumbnail parameter information;
cutting the video to be processed in response to a video cutting instruction aiming at the video to be processed to obtain a cut video and a target video;
Determining the number of the clipping thumbnails according to the clipping video and the thumbnail parameter information;
calculating the number of display thumbnails based on the initial number of thumbnails and the number of clipping thumbnails;
and drawing the display thumbnail corresponding to the target video according to the video clipping instruction and the display thumbnail quantity.
According to a second aspect of embodiments of the present application, there is provided a video thumbnail processing apparatus including:
the acquisition module is configured to acquire initial thumbnails of the video to be processed and the number of the initial thumbnails according to the thumbnail parameter information;
a cropping module configured to crop the video to be processed in response to a video cropping instruction for the video to be processed, to obtain a cropped video and a target video;
a determining module configured to determine a number of clip thumbnails from the clip video and the thumbnail parameter information;
a calculation module configured to calculate a number of presentation thumbnails based on the initial number of thumbnails and the cropped number of thumbnails;
and the drawing module is configured to draw the display thumbnail corresponding to the target video according to the video clipping instruction and the display thumbnail number.
According to a third aspect of embodiments of the present application, there is provided a computing device comprising a memory, a processor and computer instructions stored on the memory and executable on the processor, the processor implementing the steps of the video thumbnail processing method when executing the computer instructions.
According to a fourth aspect of embodiments of the present application, there is provided a computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the video thumbnail processing method.
The video thumbnail processing method provided by the application comprises the following steps: acquiring initial thumbnails of the video to be processed and the number of the initial thumbnails according to the thumbnail parameter information; cutting the video to be processed in response to a video cutting instruction aiming at the video to be processed to obtain a cut video and a target video; determining the number of the clipping thumbnails according to the clipping video and the thumbnail parameter information; calculating the number of display thumbnails based on the initial number of thumbnails and the number of clipping thumbnails; and drawing the display thumbnail corresponding to the target video according to the video clipping instruction and the display thumbnail quantity.
According to the embodiment of the application, the number of the thumbnail is determined in the process of clipping the video, the thumbnail is drawn by combining the video clipping instructions, and in the clipping process, the number of the thumbnail is determined by participating in calculation of the part of the clipping video, so that the consistency of the calculation results of the thumbnail before and after clipping is ensured, the flicker of the picture in the process of drawing the thumbnail can be effectively avoided, and the use experience of a user is improved.
Drawings
FIG. 1 is a flow chart of a method for processing video thumbnail according to an embodiment of the present application;
FIG. 2 is a schematic illustration of positioning in a video container according to one embodiment of the present application;
FIG. 3 is a schematic diagram of video thumbnail cropping before and after an embodiment of the present application;
FIG. 4 is a process flow diagram of a video thumbnail processing method applied to a clip video M according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a video thumbnail processing apparatus according to an embodiment of the present application;
FIG. 6 is a block diagram of a computing device according to one embodiment of the present application.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application. This application is, however, susceptible of embodiment in many other ways than those herein described and similar generalizations can be made by those skilled in the art without departing from the spirit of the application and the application is therefore not limited to the specific embodiments disclosed below.
The terminology used in one or more embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of one or more embodiments of the application. As used in this application in one or more embodiments and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present application refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that, although the terms first, second, etc. may be used in one or more embodiments of the present application to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, a first may also be referred to as a second, and similarly, a second may also be referred to as a first, without departing from the scope of one or more embodiments of the present application. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
In a video editor, especially a video editor applied to a browser, after video is loaded into the video editor, thumbnail images of each time period are displayed in a video track, and the length of the video can be adjusted by moving left and right sides of a video clip.
Based on this, in the present application, a video thumbnail processing method is provided, and the present application relates to a video thumbnail processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
Fig. 1 shows a flowchart of a video thumbnail processing method according to an embodiment of the present application, which specifically includes the following steps:
step 102: and acquiring initial thumbnails of the video to be processed and the number of the initial thumbnails according to the thumbnail parameter information.
The video thumbnail processing method provided by the application can be applied to application programs and browsers, and in the application, explanation is given by taking a web video editor as an example.
The video to be processed is a video which needs to be subjected to time length adjustment in the application. The thumbnail parameter information specifically refers to some parameter information of one thumbnail, such as width information of one thumbnail, duration information in a video corresponding to one thumbnail (e.g., one thumbnail is generated every 2 seconds), and so on. The initial thumbnails are obtained after the video to be processed is processed according to the thumbnail parameter information, and the number of the initial thumbnails is the total number of the initial thumbnails.
For example, the thumbnail parameter information is obtained every two seconds, the thumbnail width is w, if the video to be processed is 20 seconds, 10 initial thumbnails can be obtained after the video to be processed is processed.
In practical application, the obtaining of the thumbnail of the video to be processed can be completed in the server, or can be completed in the browser, and the specific thumbnail generating method is needed to be used according to specific use scenes, for example, the video to be processed needs to be uploaded to the server under the condition that the browser cannot recognize the format of the video to be processed; if the browser can identify the video to be processed, the video to be processed can be directly processed locally, and an initial thumbnail is obtained.
Under the condition that the browser cannot identify the format of the video to be processed, acquiring the initial thumbnail of the video to be processed and the initial thumbnail quantity according to the thumbnail parameter information comprises the following steps:
receiving a video to be processed;
uploading the video to be processed to a server, so that the server generates an initial thumbnail according to thumbnail parameter information in the process of decoding the video to be processed;
and downloading the initial thumbnail from the server, and counting the number of the initial thumbnails.
In practical application, the formats of the videos are many, some video formats cannot be analyzed in the browser, and the processing capacity of the server is needed to be used, so after the video to be processed uploaded by a user is received, the video to be processed is uploaded to the server, the server transcodes the video to be processed, in the process of transcoding the video to be processed by the server, the video is subjected to screenshot through the frequency of thumbnail generation in the thumbnail parameter information, the initial thumbnail is obtained, the initial thumbnail is stored in the static resource server, an initial thumbnail downloading link is generated, the initial thumbnail downloading link is sent to the browser, and the initial thumbnail can be downloaded through the initial thumbnail downloading link by the browser, and the number of the initial thumbnails is counted.
In the case that the browser can identify the format of the video to be processed, acquiring the initial thumbnail of the video to be processed and the number of the initial thumbnails according to the thumbnail parameter information includes:
receiving a video to be processed;
and decoding the video to be processed, generating initial thumbnails through preset thumbnail parameter information, and counting the number of the initial thumbnails.
After receiving the video to be processed uploaded by the user, the video to be processed can be subjected to screenshot through preset thumbnail parameter information by utilizing the video analysis capability of the browser, or the web assembly technology and the ffmpeg tool library decode the screenshot on the video file, so that initial thumbnails are generated, and the number of the initial thumbnails is counted.
In a specific embodiment provided in the application, taking processing of a Video V of 20 seconds as an example, the Video V is analyzed by the Video analysis capability of the local browser, and screenshot is performed at a frequency of one thumbnail every 2 seconds, so as to obtain initial thumbnails, where the number of initial thumbnails is 10.
Step 104: and cropping the video to be processed in response to a video cropping instruction for the video to be processed, and obtaining a cropped video and a target video.
The video clipping instruction is a clipping instruction of a video to be processed by a pointer, specifically, the video is dragged by dragging an edge on the left side or the right side of the video to be processed, for example, the left side (i.e. the head of the video) of the video to be processed can be selected to drag to the right side, and the length of the clipped video is determined according to the dragging distance.
The clipping video is a video part clipped from the video to be processed, and the clipping video is a non-display video; the target video is the video part of the video to be processed which remains after clipping, and the target video is the display video. For example, the duration of the video to be processed is 30 seconds, the video to be processed is cropped from the left side of the video to be processed through the video cropping command, the cropping length is 10 seconds, then the video of 10 seconds is the cropped video, and the video of the rest 20 seconds is the target video.
In a specific embodiment provided in the application, along the above example, a video cropping instruction for a video V is received, where the video cropping instruction is "left cropping and a duration of 5.4 seconds", and the video V is processed by the video cropping instruction to obtain a cropped video V1 and a target video V2, where the duration of the cropped video V1 is 5.4 seconds, and the duration of the target video V2 is 14.6 seconds.
Step 106: and determining the number of the clipping thumbnails according to the clipping video and the thumbnail parameter information.
The clip video is a video part clipped from the video to be processed, and the corresponding thumbnail should be deleted, so that the number of clip thumbnails can be determined according to the clip video and the thumbnail parameter information.
Specifically, determining the number of clipping thumbnails according to the clipping video and the thumbnail parameter information includes:
acquiring clipping video information of the clipping video;
and determining the number of the clipping thumbnails according to the clipping video information and the thumbnail parameter information.
The clipping video information is related attribute information of the clipping video, and the number of clipping thumbnails can be determined according to the clipping video information and the thumbnail parameter information.
The clipping video information comprises clipping video time length, and the thumbnail parameter information comprises a thumbnail unit width value and a thumbnail unit time length;
accordingly, determining the number of clip thumbnails from the clip video information and the thumbnail parameter information includes:
determining a clipping thumbnail width value according to the clipping video time length, the thumbnail unit width value and the thumbnail unit time length;
and calculating the number of the clipping thumbnails based on the clipping thumbnail width value and the thumbnail unit width value.
The unit width value of the thumbnail is a width value of a thumbnail, for example, a thumbnail has 20 pixels or 30 pixels and the like, the unit width value of the thumbnail is related to the display effect of the video to be processed, and when the width side of the video to be processed is long, the unit width value of the thumbnail correspondingly becomes large; the thumbnail unit duration specifically refers to a duration in a video corresponding to one thumbnail, for example, 2 seconds for one thumbnail, and the thumbnail unit duration is 2 seconds.
The method comprises the steps that the width value of the cut thumbnail of the cut video can be determined according to the length of the cut video, the unit width value of the thumbnail and the unit length of the thumbnail, specifically, the width value of the thumbnail corresponding to each 1 second video can be determined according to the unit width value of the thumbnail and the unit length of the thumbnail, and then the number of the cut thumbnails is determined according to the length of the cut video. For example, if the thumbnail unit width value of the thumbnail is 20 pixels and the thumbnail unit duration is 2 seconds, the thumbnail width value corresponding to each second of video can be determined to be 10 pixels, and if the clip video duration is 6 seconds, the clip thumbnail width value can be determined to be 60 pixels. And then dividing the width value of the cut video thumbnail by the unit width value of the thumbnail to calculate the number of the cut thumbnails.
In practical applications, the width value of the clipping thumbnail may not be divided by the unit width value of the thumbnail, and at this time, the number of clipping thumbnails needs to be determined by rounding down, for example, the width value of the clipping thumbnail is 55 pixels, the unit width value of the thumbnail is 20 pixels, the divided value is 2.75, and the number of clipping thumbnails is determined to be 2 after rounding down.
In a specific embodiment provided in the application, along the above example, the duration of the clip video V1 is 5 seconds, the duration of the thumbnail unit is 2 seconds, the width value of the thumbnail unit of the thumbnail is 40 pixels, the width of the thumbnail corresponding to each second of the video can be determined to be 20 pixels according to the duration of the thumbnail unit and the width value of the thumbnail unit, and the duration of the clip video V1 is 5.4 seconds, then the width value of the clip thumbnail of the clip video is 108 pixels, and further the number of the clip thumbnails is determined to be 2.
Step 108: and calculating the number of display thumbnails based on the initial number of thumbnails and the clipping number of thumbnails.
After determining the number of the clipping thumbnails, the number of the display thumbnails can be calculated and determined by subtracting the number of the clipping thumbnails from the number of the initial thumbnails, for example, the number of the initial thumbnails is 15, the number of the clipping thumbnails is 3, and the number of the display thumbnails is 12.
In one embodiment provided herein, the number of initial thumbnails is 10, the number of cropped thumbnails is 2, and thus the number of display thumbnails is 8.
Step 110: and drawing the display thumbnail corresponding to the target video according to the video clipping instruction and the display thumbnail quantity.
After the number of the display thumbnails is determined, the display thumbnails corresponding to the target video can be drawn according to the video clipping instruction and the number of the display thumbnails, and the thumbnails of the target video obtained after clipping are completed.
In practical application, in the process of generating the thumbnail after video cropping, the information of the video cropping instruction needs to be referred, specifically, the display thumbnail corresponding to the target video is drawn according to the video cropping instruction and the number of the display thumbnails, including S1102-S1104:
S1102, determining a drawing starting position and a drawing ending position of the display thumbnail according to the clipping instruction information.
The drawing start position specifically refers to a start position of drawing the display thumbnail, the drawing end position specifically refers to an end position of drawing the display thumbnail, and when the display thumbnail is actually drawn, drawing is started from the drawing start position to the drawing end position, and drawing is ended.
Specifically, determining the drawing start position and the drawing end position of the display thumbnail according to the clipping instruction information includes:
determining the cutting direction and the cutting position of the video to be processed according to the cutting instruction information;
determining a drawing initial position in the video to be processed according to the cutting direction, wherein the drawing initial position is positioned at the opposite side of the cutting direction;
and converting the clipping position into a drawing end position corresponding to the drawing start position.
In the present application, the drawing start position is not fixed, but needs to be determined according to the clipping instruction information in the video clipping instruction, and in the present application, the drawing start position of the display thumbnail is determined by means of opposite-side positioning.
In practical application, a user can cut a video by adjusting the left side or the right side of the video, and the thumbnail can be temporarily adjusted to different layout modes according to different operation modes, so that the calculation amount of the thumbnail position in the operation of the user is maximally reduced, and in the browser, the positioning at the horizontal position is divided into left positioning and right positioning. Referring to fig. 2, fig. 2 shows a schematic diagram of positioning in a video container according to an embodiment of the present application. Positioning will start from the left side of the container when left positioning is used and from the right side of the container when right positioning is used.
When a user cuts a video and adjusts the left side of the video to be processed, if the positioning mode of the thumbnail relative to the container is left side positioning, in order to keep the stability of the thumbnail, when each thumbnail is adjusted at the edge, the position coordinate needs to be recalculated once, and then the calculation result is applied to a picture to cause the picture to shake, so that the opposite side positioning mode is used in the application, namely, when the user adjusts the left side of the video to be processed, right side positioning is adopted; when a user adjusts the right side of the video to be processed, left side positioning is adopted, so that the adjustment cannot influence the coordinates of the thumbnails, the coordinates of each thumbnail cannot be changed, and the thumbnail picture cannot flicker if the coordinates are not changed.
Based on the above, after receiving the cropping video command, the cropping command information in the cropping video command is obtained, and the cropping direction and the cropping position are determined from the cropping command information, wherein the cropping direction is the direction of the adjusted video, such as the left side or the right side of the adjusted video, and the cropping position specifically refers to the position information of the cropping video adjusted to the video. According to the clipping direction, the drawing starting position of the video to be processed can be determined, for example, if the clipping direction is the left side of the video, the drawing starting position of the video to be processed is the right side of the video.
After the drawing starting position of the video to be processed is determined, the clipping position is converted into the drawing ending position in the coordinate system where the drawing starting position is located.
And S1104, drawing the display thumbnail corresponding to the target video according to the drawing starting position, the drawing ending position and the display thumbnail number.
And starting to draw from the drawing starting position, drawing the display thumbnail corresponding to the target video according to the number of the display thumbnails until the drawing is finished.
Specifically, drawing the display thumbnail corresponding to the target video according to the drawing start position, the drawing end position and the number of display thumbnails includes:
Determining a drawing path of the display thumbnail according to the drawing starting position and the drawing ending position;
and drawing the display thumbnail corresponding to the target video based on the drawing path and the display thumbnail quantity.
And determining a drawing path of the display thumbnail according to the drawing starting position and the drawing ending position, namely, the drawing length of the display thumbnail is the length between the drawing starting position and the drawing ending position. In practical application, the container in which the video to be processed is located is divided into a plurality of grids in advance, each grid corresponds to one thumbnail, for example, 10 grids are corresponding to the video to be processed in total, the time point of the center point of each grid is calculated, the thumbnail closest to the time point is obtained from the thumbnail according to the time point of each grid, and then the thumbnail is drawn to the position of the positioning coordinate according to the positioning coordinate of the grid in the container.
Referring to fig. 3, fig. 3 shows a schematic diagram before and after clipping of a video thumbnail according to an embodiment of the present application. As shown in fig. 3, there are 9 lattices corresponding to the initial video thumbnail before the video to be processed is cut, the user uses right positioning to position the coordinates of each lattice from the right side of the video, the length of cutting is 2.5 lattices, so that the lattices which do not participate in drawing are two on the left side, and the third lattice is not completely cut although half of the lattices are already cut, so that the thumbnail of the lattice still needs to be drawn, and after the cutting is completed, the coordinates of the lattices corresponding to each thumbnail are not changed, so that the thumbnail also does not generate flickering, and the use experience of the user is effectively improved.
It should be noted that in practical application, the lattices in the container correspond to the thumbnails, so that the number of the display thumbnails also corresponds to the lattices, after the number of the display thumbnails is determined, the display thumbnails corresponding to the target video can be drawn according to the drawing path, and the cutting thumbnails corresponding to the number of the cutting thumbnails do not need to be drawn.
In a specific embodiment provided in the application, along with the above example, the number of display thumbnails is 8, that is, the thumbnails of 8 lattices need to be drawn, and the clipping direction is left, then the drawing starting position may be determined to be the right side of the video V, from the right side of the video V, the 8 lattices are positioned, and the thumbnails corresponding to the 8 lattices are drawn.
The application provides a video thumbnail processing method, which comprises the steps of obtaining initial thumbnails and the number of the initial thumbnails of a video to be processed according to thumbnail parameter information; cutting the video to be processed in response to a video cutting instruction aiming at the video to be processed to obtain a cut video and a target video; determining the number of the clipping thumbnails according to the clipping video and the thumbnail parameter information; calculating the number of display thumbnails based on the initial number of thumbnails and the number of clipping thumbnails; and drawing the display thumbnail corresponding to the target video according to the video clipping instruction and the display thumbnail quantity. According to the video thumbnail processing method, the number of the cut thumbnails is determined, the number of the display thumbnails is determined according to the number of the initial thumbnails, finally the display thumbnails are rendered and generated according to the video cutting instruction, the consistency of the calculation results of the thumbnails before and after cutting is ensured, flickering is avoided when the thumbnails are drawn, and the user experience is improved.
Secondly, by selecting the opposite side of one side of the clip as a positioning point in the opposite side positioning mode, the position coordinates of each thumbnail can be effectively ensured not to change, and then when the thumbnail is generated, the picture can be kept stable, and the use experience of a user is further improved.
The application of the video thumbnail processing method provided in the present application to the video clip M is taken as an example, and the video thumbnail processing method will be further described below with reference to fig. 4. Fig. 4 shows a process flow chart of a video thumbnail processing method applied to a clip video M according to an embodiment of the present application, which specifically includes the following steps:
step 402: video M is received.
In the specific embodiment provided by the application, a user uploads a video M through a browser, receives the video M uploaded by the user, and performs clipping processing on the video M in a browser video editor.
Step 404: and decoding the video M, generating initial thumbnails through preset thumbnail parameter information, and counting the number N of the initial thumbnails.
In the specific embodiment provided by the application, according to the self-contained video analysis capability, the browser intercepts a video screenshot at intervals of 2 seconds according to preset thumbnail parameters to serve as a video thumbnail of the time period, the duration of the video M is 11.65 seconds, and finally 12 thumbnails are obtained to serve as initial thumbnails.
Step 406: a video clip instruction for video M is received.
In the specific embodiment provided in the application, along with the above example, a video cropping instruction of a user for the video M is received, specifically, the content of the first 8.5 seconds of the video is cropped.
Step 408: and processing the video M in response to the video cropping instruction to obtain a cropped video M1 and a target video M2.
In the specific embodiment provided in the present application, along with the above example, the video M is processed in response to the video clip instruction, and a clip video M1 of 8.5 seconds and a target video M2 of 14.8 seconds are obtained.
Step 410: and calculating the number N1 of the clipping thumbnails according to the clipping time length T1 of the clipping video M1 and the thumbnail parameter information.
In the specific embodiment provided in the application, along the previous example, the thumbnail parameter information is one piece of 2 seconds, and the cropping time period T1 of the cropping video M1 is 8.5 seconds, then the number N1 of cropping thumbnails can be determined to be 4.
Step 412: the number of display thumbnails N2 is calculated based on the initial number of thumbnails N and the number of clip thumbnails N1.
In the specific embodiment provided in the present application, along with the above example, the number of display thumbnails n2=8 may be calculated from the initial number of thumbnails 12 and the number of clip thumbnails 4.
Step 414: and determining the video cropping instruction as left cropping and cropping position.
In the specific embodiment provided by the application, according to the above example, the video cropping instruction can be determined to be left cropping according to the content of cropping the video beginning 8.5 seconds, and the cropping position is the 5 th thumbnail of the video M from the beginning.
Step 416: and determining that the video M is positioned on the right side according to the left clipping, and further determining the drawing starting position P1.
In the specific embodiment provided in the application, along the above example, the video M may be determined to be positioned on the right side according to the left clipping, and then the drawing start position P1 may be determined to be the first thumbnail on the right side of the video.
Step 418: the clipping position is converted into a drawing end position P2 corresponding to the drawing start position.
In the specific embodiment provided in the application, along the previous example, the initial thumbnail of the video M has 12 pieces, and the clipping position is the 5 th piece from the beginning, that is, the 5 th piece from the left side, and corresponds to the 8 th piece from the right side after the positioning on the right side.
Step 420: the thumbnail of the target video M2 is drawn from the drawing start position P1 until the drawing end position P2 is drawn.
In the specific embodiment provided in the application, the drawing is started from the 1 st thumbnail on the right side to the 8 th thumbnail on the right side along the application example.
The application provides a video thumbnail processing method, which comprises the steps of obtaining initial thumbnails and the number of the initial thumbnails of a video to be processed according to thumbnail parameter information; cutting the video to be processed in response to a video cutting instruction aiming at the video to be processed to obtain a cut video and a target video; determining the number of the clipping thumbnails according to the clipping video and the thumbnail parameter information; calculating the number of display thumbnails based on the initial number of thumbnails and the number of clipping thumbnails; and drawing the display thumbnail corresponding to the target video according to the video clipping instruction and the display thumbnail quantity. According to the video thumbnail processing method, the number of the cut thumbnails is determined, the number of the display thumbnails is determined according to the number of the initial thumbnails, finally the display thumbnails are rendered and generated according to the video cutting instruction, the consistency of the calculation results of the thumbnails before and after cutting is ensured, flickering is avoided when the thumbnails are drawn, and the user experience is improved.
Secondly, by selecting the opposite side of one side of the clip as a positioning point in the opposite side positioning mode, the position coordinates of each thumbnail can be effectively ensured not to change, and then when the thumbnail is generated, the picture can be kept stable, and the use experience of a user is further improved.
Corresponding to the embodiment of the video thumbnail processing method, the application also provides an embodiment of a video thumbnail processing device, and fig. 5 shows a schematic structural diagram of the video thumbnail processing device provided in an embodiment of the application. As shown in fig. 5, the apparatus includes:
an obtaining module 502 configured to obtain an initial thumbnail of the video to be processed and the number of the initial thumbnails according to the thumbnail parameter information;
a cropping module 504 configured to crop the video to be processed in response to a video cropping instruction for the video to be processed, obtaining a cropped video and a target video;
a determining module 506 configured to determine a number of cropped thumbnails based on the cropped video and the thumbnail parameter information;
a calculation module 508 configured to calculate a number of presentation thumbnails based on the initial number of thumbnails and the cropped number of thumbnails;
and the drawing module 510 is configured to draw the display thumbnail corresponding to the target video according to the video clipping instruction and the display thumbnail number.
Optionally, the determining module 506 is further configured to:
acquiring clipping video information of the clipping video;
and determining the number of the clipping thumbnails according to the clipping video information and the thumbnail parameter information.
Optionally, the clipping video information includes clipping video time length, and the thumbnail parameter information includes a thumbnail unit width value and a thumbnail unit time length;
the determining module 506 is further configured to:
determining a clipping thumbnail width value according to the clipping video time length, the thumbnail unit width value and the thumbnail unit time length;
and calculating the number of the clipping thumbnails based on the clipping thumbnail width value and the thumbnail unit width value.
Optionally, the video cropping instruction includes cropping instruction information;
the drawing module 510 is further configured to:
determining a drawing starting position and a drawing ending position of the display thumbnail according to the clipping instruction information;
and drawing the display thumbnail corresponding to the target video according to the drawing starting position, the drawing ending position and the display thumbnail quantity.
Optionally, the drawing module 510 is further configured to:
determining the cutting direction and the cutting position of the video to be processed according to the cutting instruction information;
determining a drawing initial position in the video to be processed according to the cutting direction, wherein the drawing initial position is positioned at the opposite side of the cutting direction;
And converting the clipping position into a drawing end position corresponding to the drawing start position.
Optionally, the drawing module 510 is further configured to:
determining a drawing path of the display thumbnail according to the drawing starting position and the drawing ending position;
and drawing the display thumbnail corresponding to the target video based on the drawing path and the display thumbnail quantity.
Optionally, the obtaining module 502 is further configured to:
receiving a video to be processed;
uploading the video to be processed to a server, so that the server generates an initial thumbnail according to thumbnail parameter information in the process of decoding the video to be processed;
and downloading the initial thumbnail from the server, and counting the number of the initial thumbnails.
Optionally, the obtaining module 502 is further configured to:
receiving a video to be processed;
and decoding the video to be processed, generating initial thumbnails through preset thumbnail parameter information, and counting the number of the initial thumbnails.
The application provides a video thumbnail processing device, which comprises the steps of acquiring initial thumbnails of videos to be processed and the number of the initial thumbnails according to thumbnail parameter information; cutting the video to be processed in response to a video cutting instruction aiming at the video to be processed to obtain a cut video and a target video; determining the number of the clipping thumbnails according to the clipping video and the thumbnail parameter information; calculating the number of display thumbnails based on the initial number of thumbnails and the number of clipping thumbnails; and drawing the display thumbnail corresponding to the target video according to the video clipping instruction and the display thumbnail quantity. Through the video thumbnail processing device provided by the application, the number of the cut thumbnails is determined, the number of the display thumbnails is determined according to the number of the initial thumbnails, finally the display thumbnails are rendered and generated according to the video cutting instruction, the consistency of the calculation results of the thumbnails before and after cutting is ensured, the flicker is avoided when the thumbnails are drawn, and the user experience is improved.
Secondly, by selecting the opposite side of one side of the clip as a positioning point in the opposite side positioning mode, the position coordinates of each thumbnail can be effectively ensured not to change, and then when the thumbnail is generated, the picture can be kept stable, and the use experience of a user is further improved.
The above is an exemplary scheme of a video thumbnail processing apparatus of the present embodiment. It should be noted that, the technical solution of the video thumbnail processing apparatus and the technical solution of the video thumbnail processing method belong to the same concept, and details of the technical solution of the video thumbnail processing apparatus, which are not described in detail, can be referred to the description of the technical solution of the video thumbnail processing method.
Fig. 6 illustrates a block diagram of a computing device 600 provided in accordance with an embodiment of the present application. The components of computing device 600 include, but are not limited to, memory 610 and processor 620. The processor 620 is coupled to the memory 610 via a bus 630 and a database 650 is used to hold data.
Computing device 600 also includes access device 640, access device 640 enabling computing device 600 to communicate via one or more networks 660. Examples of such networks include the Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the internet. The access device 640 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.11 Wireless Local Area Network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a bluetooth interface, a Near Field Communication (NFC) interface, and so forth.
In one embodiment of the present application, the above-described components of computing device 600, as well as other components not shown in FIG. 6, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device illustrated in FIG. 6 is for exemplary purposes only and is not intended to limit the scope of the present application. Those skilled in the art may add or replace other components as desired.
Computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smart phone), wearable computing device (e.g., smart watch, smart glasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 600 may also be a mobile or stationary server.
Wherein the processor 620, when executing the computer instructions, implements the steps of the video thumbnail processing method.
The foregoing is a schematic illustration of a computing device of this embodiment. It should be noted that, the technical solution of the computing device and the technical solution of the video thumbnail processing method belong to the same concept, and details of the technical solution of the computing device, which are not described in detail, can be referred to the description of the technical solution of the video thumbnail processing method.
An embodiment of the present application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the video thumbnail processing method as described above.
The above is an exemplary version of a computer-readable storage medium of the present embodiment. It should be noted that, the technical solution of the storage medium and the technical solution of the video thumbnail processing method belong to the same concept, and details of the technical solution of the storage medium, which are not described in detail, can be referred to the description of the technical solution of the video thumbnail processing method.
The foregoing describes specific embodiments of the present application. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
The computer instructions include computer program code that may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the computer readable medium contains content that can be appropriately scaled according to the requirements of jurisdictions in which such content is subject to legislation and patent practice, such as in certain jurisdictions in which such content is subject to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.
It should be noted that, for the sake of simplicity of description, the foregoing method embodiments are all expressed as a series of combinations of actions, but it should be understood by those skilled in the art that the present application is not limited by the order of actions described, as some steps may be performed in other order or simultaneously in accordance with the present application. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily all necessary for the present application.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to the related descriptions of other embodiments.
The above-disclosed preferred embodiments of the present application are provided only as an aid to the elucidation of the present application. Alternative embodiments are not intended to be exhaustive or to limit the invention to the precise form disclosed. Obviously, many modifications and variations are possible in light of the teaching of this application. The embodiments were chosen and described in order to best explain the principles of the invention and the practical application, to thereby enable others skilled in the art to best understand and utilize the invention. This application is to be limited only by the claims and the full scope and equivalents thereof.

Claims (8)

1. A video thumbnail processing method, comprising:
acquiring initial thumbnails and the number of the initial thumbnails of the video to be processed according to thumbnail parameter information, wherein the thumbnail parameter information comprises a thumbnail unit width value and a thumbnail unit duration;
cutting the video to be processed according to a video cutting instruction of the video to be processed to obtain a cut video and a target video, wherein the video cutting instruction comprises cutting instruction information;
determining the number of the clipping thumbnails according to the clipping video time length of the clipping video, the thumbnail unit width value and the thumbnail unit time length;
calculating the number of display thumbnails based on the initial number of thumbnails and the number of clipping thumbnails;
determining the cutting direction and the cutting position of the video to be processed according to the cutting instruction information;
determining a drawing initial position in the video to be processed according to the cutting direction, wherein the drawing initial position is positioned at the opposite side of the cutting direction;
converting the clipping position into a drawing end position corresponding to the drawing start position;
and drawing the display thumbnail corresponding to the target video according to the drawing starting position, the drawing ending position and the display thumbnail quantity.
2. The video thumbnail processing method of claim 1, wherein determining the number of clip thumbnails from the clip video duration of the clip video, the thumbnail unit width value, and the thumbnail unit duration comprises:
determining a clipping thumbnail width value according to the clipping video time length, the thumbnail unit width value and the thumbnail unit time length;
and calculating the number of the clipping thumbnails based on the clipping thumbnail width value and the thumbnail unit width value.
3. The video thumbnail processing method according to claim 1, wherein drawing the presentation thumbnail corresponding to the target video according to the drawing start position, the drawing end position, and the number of presentation thumbnails includes:
determining a drawing path of the display thumbnail according to the drawing starting position and the drawing ending position;
and drawing the display thumbnail corresponding to the target video based on the drawing path and the display thumbnail quantity.
4. The video thumbnail processing method of any one of claims 1 to 3, wherein acquiring the initial thumbnail and the initial thumbnail number of the video to be processed based on the thumbnail parameter information, comprises:
Receiving a video to be processed;
uploading the video to be processed to a server, so that the server generates an initial thumbnail according to thumbnail parameter information in the process of decoding the video to be processed;
and downloading the initial thumbnail from the server, and counting the number of the initial thumbnails.
5. The video thumbnail processing method of any one of claims 1 to 3, wherein acquiring the initial thumbnail and the initial thumbnail number of the video to be processed based on the thumbnail parameter information, comprises:
receiving a video to be processed;
and decoding the video to be processed, generating initial thumbnails through preset thumbnail parameter information, and counting the number of the initial thumbnails.
6. A video thumbnail processing apparatus, comprising:
the acquisition module is configured to acquire initial thumbnails of the video to be processed and the number of the initial thumbnails according to the thumbnail parameter information, wherein the thumbnail parameter information comprises a thumbnail unit width value and a thumbnail unit duration;
a cropping module configured to crop the video to be processed in response to a video cropping instruction for the video to be processed, to obtain a cropped video and a target video, wherein the video cropping instruction includes cropping instruction information;
A determining module configured to determine a number of cropped thumbnails according to a cropped video duration of the cropped video, the thumbnail unit width value, and the thumbnail unit duration;
a calculation module configured to calculate a number of presentation thumbnails based on the initial number of thumbnails and the cropped number of thumbnails;
the drawing module is configured to determine the cutting direction and the cutting position of the video to be processed according to the cutting instruction information; determining a drawing initial position in the video to be processed according to the cutting direction, wherein the drawing initial position is positioned at the opposite side of the cutting direction; converting the clipping position into a drawing end position corresponding to the drawing start position; and drawing the display thumbnail corresponding to the target video according to the drawing starting position, the drawing ending position and the display thumbnail quantity.
7. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein the processor, when executing the computer instructions, performs the steps of the method of any one of claims 1-5.
8. A computer readable storage medium storing computer instructions which, when executed by a processor, implement the steps of the method of any one of claims 1-5.
CN202110956936.1A 2021-08-19 2021-08-19 Video thumbnail processing method and device Active CN113676751B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110956936.1A CN113676751B (en) 2021-08-19 2021-08-19 Video thumbnail processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110956936.1A CN113676751B (en) 2021-08-19 2021-08-19 Video thumbnail processing method and device

Publications (2)

Publication Number Publication Date
CN113676751A CN113676751A (en) 2021-11-19
CN113676751B true CN113676751B (en) 2024-03-01

Family

ID=78544098

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110956936.1A Active CN113676751B (en) 2021-08-19 2021-08-19 Video thumbnail processing method and device

Country Status (1)

Country Link
CN (1) CN113676751B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007189558A (en) * 2006-01-13 2007-07-26 Toshiba Corp Video display system and video storage distribution apparatus
CN112540713A (en) * 2020-11-13 2021-03-23 广州市百果园网络科技有限公司 Video preview progress bar scaling method, system, device and storage medium
CN113099288A (en) * 2021-03-31 2021-07-09 上海哔哩哔哩科技有限公司 Video production method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007189558A (en) * 2006-01-13 2007-07-26 Toshiba Corp Video display system and video storage distribution apparatus
CN112540713A (en) * 2020-11-13 2021-03-23 广州市百果园网络科技有限公司 Video preview progress bar scaling method, system, device and storage medium
CN113099288A (en) * 2021-03-31 2021-07-09 上海哔哩哔哩科技有限公司 Video production method and device

Also Published As

Publication number Publication date
CN113676751A (en) 2021-11-19

Similar Documents

Publication Publication Date Title
US11978485B2 (en) Video processing method and apparatus, and electronic device and storage medium
US20170285916A1 (en) Camera effects for photo story generation
KR102616013B1 (en) System and method for creating personalized video with customized text message
US11721367B2 (en) Synchronizing multiple images or videos to an audio track
CN113055709B (en) Video publishing method, device, equipment, storage medium and program product
US20190199763A1 (en) Systems and methods for previewing content
US11393134B2 (en) Customizing soundtracks and hairstyles in modifiable videos of multimedia messaging application
CN114331820A (en) Image processing method, image processing device, electronic equipment and storage medium
JP2022526053A (en) Techniques for capturing and editing dynamic depth images
KR20160095058A (en) Handling video frames compromised by camera motion
KR20220043247A (en) Personalized Auto Video Crop
CN111835985A (en) Video editing method, device, apparatus and storage medium
CN113330453A (en) System and method for providing personalized video for multiple persons
CN111787354A (en) Video generation method and device
CN113676751B (en) Video thumbnail processing method and device
CN114025103A (en) Video production method and device
CN116847147A (en) Special effect video determining method and device, electronic equipment and storage medium
CN111385638B (en) Video processing method and device
CN115917647A (en) Automatic non-linear editing style transfer
CN113992866B (en) Video production method and device
CN113674750B (en) Data processing method and device
CN116527956B (en) Virtual object live broadcast method, device and system based on target event triggering
CN114170362A (en) Image rendering method and device
CN115086742B (en) Audio and video generation method and device
KR101765133B1 (en) Method of producing animated image of mobile app, computer program and mobile device executing thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant