CN111147954A - Thumbnail extraction method and device - Google Patents
Thumbnail extraction method and device Download PDFInfo
- Publication number
- CN111147954A CN111147954A CN201911393671.8A CN201911393671A CN111147954A CN 111147954 A CN111147954 A CN 111147954A CN 201911393671 A CN201911393671 A CN 201911393671A CN 111147954 A CN111147954 A CN 111147954A
- Authority
- CN
- China
- Prior art keywords
- thumbnail
- target
- key frame
- image data
- display timestamp
- 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.)
- Pending
Links
- 238000000605 extraction Methods 0.000 title claims abstract description 68
- 238000000034 method Methods 0.000 claims abstract description 36
- 238000004891 communication Methods 0.000 claims description 19
- 238000004422 calculation algorithm Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 14
- 230000009467 reduction Effects 0.000 claims description 12
- 230000008569 process Effects 0.000 description 8
- 238000010586 diagram Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 3
- 230000006872 improvement Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8455—Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
- H04N21/4402—Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/854—Content authoring
- H04N21/8547—Content authoring involving timestamps for synchronizing content
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Television Signal Processing For Recording (AREA)
Abstract
The embodiment of the application provides a thumbnail extraction method and a thumbnail extraction device, which relate to the technical field of computers, and the method comprises the following steps: the electronic device can extract the thumbnail aiming at the video file by acquiring the thumbnail, wherein the thumbnail extraction instruction comprises a target display timestamp; and then, carrying out software decoding on the video file to obtain image data of a target key frame with a display time stamp closest to the target display time stamp, and determining a target thumbnail according to the image data of the target key frame.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a thumbnail extraction method and apparatus.
Background
With the popularization of intelligent devices and the great improvement of hardware performance of the intelligent devices, people increasingly strongly express their own needs by adopting short videos. Short video becomes the very hot field on present smart machine.
In the editing stage of the short video, in order to improve the user experience, the thumbnail needs to be extracted from the original video file and displayed. Currently, a method for extracting a thumbnail is to use an interface (e.g., getframeatttime interface of the type mediametarategateway) in a terminal system to extract an image at a designated display timestamp as the thumbnail. However, the specific implementation of the method for extracting the thumbnail by using the interface in the terminal system depends on the manufacturer, and the method is long in time consumption and low in efficiency of extracting the thumbnail.
Disclosure of Invention
The embodiment of the application aims to provide a thumbnail extraction method and device so as to reduce time consumption of thumbnail extraction and improve efficiency of thumbnail extraction. The specific technical scheme is as follows:
in a first aspect of an embodiment of the present application, a method for extracting a thumbnail is provided, where the method includes the following steps:
acquiring a thumbnail extraction instruction aiming at a video file, wherein the thumbnail extraction instruction comprises a target display timestamp;
performing software decoding on the video file to obtain image data of a target key frame with a display timestamp closest to the target display timestamp;
and determining a target thumbnail according to the image data of the target key frame.
Optionally, the step of performing software decoding on the video file to obtain image data of a target key frame with a display timestamp closest to the target display timestamp includes:
performing software decoding on the video file, and searching a target key frame with a display timestamp earlier than the target display timestamp and a display timestamp closest to the target display timestamp;
and extracting the image data of the target key frame.
Optionally, the step of determining a target thumbnail according to the image data of the target keyframe includes:
reducing the image data of the target key frame by adopting a bilinear interpolation algorithm to obtain thumbnail data;
and determining a target thumbnail according to the thumbnail data.
Optionally, the step of determining the target thumbnail according to the thumbnail data includes:
generating a bitmap corresponding to the thumbnail data, wherein each bit of the bitmap records a pixel value of a pixel point at position information corresponding to the position information of the bit in the thumbnail data;
and drawing the pixel values of the pixel points recorded in the bitmap to a view to obtain the target thumbnail.
In a second aspect of the embodiments of the present application, there is also provided a thumbnail extraction apparatus, including:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a thumbnail extraction instruction aiming at a video file, and the thumbnail extraction instruction comprises a target display timestamp;
the decoding module is used for carrying out software decoding on the video file to obtain image data of a target key frame with a display timestamp closest to the target display timestamp;
and the determining module is used for determining the target thumbnail according to the image data of the target key frame.
Optionally, the decoding module includes:
the searching submodule is used for carrying out software decoding on the video file and searching a target key frame of which the display timestamp is earlier than the target timestamp and is closest to the target display timestamp;
and the extraction sub-module is used for extracting the image data of the target key frame.
Optionally, the determining module includes:
the scaling submodule is used for carrying out reduction processing on the image data of the target key frame by adopting a bilinear interpolation algorithm to obtain thumbnail data;
and the determining submodule is used for determining the target thumbnail according to the thumbnail data.
Optionally, the determining sub-module includes:
the generating unit is used for generating a bitmap corresponding to the thumbnail data, and each bit of the bitmap records the pixel value of a pixel point at the position information corresponding to the position information of the bit in the thumbnail data;
and the drawing unit is used for drawing the pixel values of the pixel points recorded in the bitmap to a view to obtain the target thumbnail.
In a third aspect of the embodiments of the present application, there is further provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of the first aspect when executing the program stored in the memory.
In another aspect of the embodiments of the present application, there is further provided a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements any of the thumbnail extraction methods described above.
In yet another aspect of the embodiments of the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the thumbnail extraction methods described above.
According to the thumbnail extraction method and device provided by the embodiment of the application, the thumbnail extraction instruction for the video file is obtained, the image data of the target key frame with the display timestamp closest to the target display timestamp is extracted from the video file, and the target thumbnail is determined according to the image data of the target key frame.
In the technical scheme provided by the embodiment of the application, the image data of the target key frame with the display time stamp closest to the target display time stamp is obtained by utilizing software decoding. The software decoding is realized by the CPU, and the performance of the CPU has the performance of other hardware such as the GPU and the like, so that the thumbnail is extracted from the video file by using the software decoding, the time consumption of thumbnail extraction is effectively reduced, and the efficiency of thumbnail extraction is improved; in addition, in the embodiment of the application, the image data of the target key frame with the display time stamp closest to the target display time stamp is obtained by decoding, and the target thumbnail is determined based on the number of images of the target key frame. In the technical scheme provided by the embodiment of the application, the target thumbnail can be determined only by decoding once. In the prior art, image data of a reference frame corresponding to a frame at a target display timestamp is obtained by decoding, and then image data of a frame at the target display timestamp is obtained by decoding, that is, in the prior art, a thumbnail can be determined only by decoding at least twice. Therefore, by applying the technical scheme provided by the embodiment of the application, the frequency of video decoding during thumbnail extraction is reduced, the time consumption of thumbnail extraction is further reduced, and the efficiency of thumbnail extraction is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below.
Fig. 1 is a schematic flowchart of a thumbnail extraction method according to an embodiment of the present application;
fig. 2 is another schematic flowchart of a thumbnail extraction method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of another thumbnail extraction method according to an embodiment of the present application;
fig. 4 is a fourth flowchart illustrating a thumbnail extraction method according to an embodiment of the present application;
FIG. 5a is a schematic diagram of a bitmap provided by an embodiment of the present application;
FIG. 5b is another schematic diagram of a bitmap provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a thumbnail extraction apparatus according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application. It is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of them. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the embodiments in the present application.
In the prior art, a method for extracting a thumbnail is to use an interface (e.g., getframeatttime interface of the type mediametarategateway) in a terminal system to extract an image at a specified display timestamp as the thumbnail. However, the specific implementation of the method for extracting the thumbnail by using the interface in the terminal system depends on the manufacturer, and the method is long in time consumption and low in efficiency of extracting the thumbnail.
In order to solve the above problem, an embodiment of the present application provides a thumbnail extraction method. Referring to fig. 1, fig. 1 is a schematic flowchart of a thumbnail extraction method according to an embodiment of the present application. The method can be applied to electronic equipment such as smart phones, personal computers, and notebooks, and the embodiment of the present application is not particularly limited thereto. The method comprises the following steps.
And 102, performing software decoding on the video file to obtain image data of the target key frame with the display timestamp closest to the target display timestamp.
And 103, determining a target thumbnail according to the image data of the target key frame.
In the technical scheme provided by the embodiment of the application, the image data of the target key frame with the display time stamp closest to the target display time stamp is obtained by utilizing software decoding. The software decoding is realized by the CPU, and the performance of the CPU has the performance of other hardware such as the GPU and the like, so that the thumbnail is extracted from the video file by using the software decoding, the time consumption of thumbnail extraction is effectively reduced, and the efficiency of thumbnail extraction is improved; in addition, in the embodiment of the application, the image data of the target key frame with the display time stamp closest to the target display time stamp is obtained by decoding, and the target thumbnail is determined based on the number of images of the target key frame. In the technical scheme provided by the embodiment of the application, the target thumbnail can be determined only by decoding once. In the prior art, image data of a reference frame corresponding to a frame at a target display timestamp is obtained by decoding, and then image data of a frame at the target display timestamp is obtained by decoding, that is, in the prior art, a thumbnail can be determined only by decoding at least twice. Therefore, by applying the technical scheme provided by the embodiment of the application, the frequency of video decoding during thumbnail extraction is reduced, the time consumption of thumbnail extraction is further reduced, and the efficiency of thumbnail extraction is improved.
For convenience of understanding, the following explanation of the thumbnail extraction method provided in the embodiments of the present application is provided by taking an electronic device as an execution subject, and is not limited.
In the step of acquiring the thumbnail extraction instruction for the video file in step 101, the video file may be a video file pre-stored in the electronic device, or may also be a video file acquired from a network, which is not limited herein. The thumbnail instructions may include target display timestamps, where the target display timestamps may be one or more. The target display time stamp can be determined by user's pre-calculation, for example, in a 15 second video file, five thumbnail pictures are extracted uniformly, and by calculation, the target display time stamps can be known as 3 rd second, 6 th second, 9 th second, 12 th second and 15 th second. At this time, the electronic device can acquire the target display timestamp.
The video file is subjected to software decoding in the step 102 to obtain image data of a target key frame with a display timestamp closest to the target display timestamp, after the electronic device obtains the thumbnail extraction instruction for the video file, the electronic device can perform software decoding on the video file, and extract the image data of the target key frame with the display timestamp closest to the target display timestamp from the video file. For example, if the target display time stamp is 6 seconds, the image data of the target key frame whose display time stamp is closest to the 6 th second is acquired, and if there is a key frame 1 at the 4 th second and a key frame 2 at the 5 th second, the image data of the key frame 2 at the 5 th second is acquired as the image data of the target key frame.
The software decoding is implemented by the CPU. For image decoding, due to the fact that the number of decoding times is small when the thumbnail is extracted, extra calculation amount can be reduced by utilizing the CPU to decode the image, on the basis, the CPU is adopted by the electronic equipment to decode the video file in a software mode to obtain image data of a target key frame with a display time stamp being closest to a target display time stamp, and the efficiency of extracting the thumbnail is further improved.
In one example, when the electronic device employs the CPU to perform software decoding on the video file, the electronic device may perform software decoding on the video file using FFmpeg. FFmpeg is an open-source free cross-platform video and audio streaming scheme, belongs to free software, provides a complete solution for recording, converting and streaming audio and video, and comprises a very advanced audio/video coding and decoding library (such as libavcodec). Based on the method, the electronic equipment can utilize FFmpeg to perform software decoding on the video file and perform reduction processing on the image data of the target key frame by adopting a bilinear interpolation algorithm, so that the speed of decoding the video file is increased, and the smoothness of the target thumbnail determined according to the thumbnail data is improved.
In step 103, a target thumbnail is determined according to the image data of the target key frame, and after the electronic device obtains the image data of the target key frame, the electronic device may determine the extracted target thumbnail according to the image data.
For example, the electronic device generates the target thumbnail directly from the image data of the target key frame after obtaining the image data of the target key frame.
For another example, after obtaining the image data of the target key frame, the electronic device performs reduction processing on the image data of the target key frame to obtain thumbnail data, and generates a target thumbnail from the thumbnail data. At this time, the data size of the target thumbnail is reduced, and the target thumbnail is convenient to transmit, store and view by a user.
In an optional embodiment, the embodiment of the application further provides a thumbnail extraction method. Referring to fig. 2, fig. 2 is another schematic flowchart of a thumbnail extraction method provided in an embodiment of the present application, where the method may include the following steps:
The step 201 is the same as the step 101, the step 204 is the same as the step 103, and the specific implementation process of the steps 201 and 204 can refer to the description of the steps 101 and 103.
The key frame is similar to other frames after the key frame, and the video encoding process is to encode the key frame first and then encode other frames after the key frame based on the key frame. According to the technical scheme, the target key frame with the display timestamp earlier than the target display timestamp and the display timestamp closest to the target display timestamp is searched, the video coding process is consistent, the image closest to the image at the target display timestamp can be obtained, and the thumbnail closest to the position required to be extracted by a user can be obtained.
In step 202, the electronic device determines a target display timestamp, performs software decoding on the video file, and searches for a target key frame from the video file, where the display timestamp is earlier than the target display timestamp and is closest to the target display timestamp.
For example, the target display timestamp is 6 seconds, and in the video file there is a key frame 1 at 4 seconds, a key frame 2 at 5 seconds, a key frame 3 at 7 seconds, and a key frame 4 at 8 seconds. The 4 th second and the 5 th second are earlier than the 6 th second, and of the 4 th second and the 5 th second, the 5 th second is the closest to the 6 th second, the key frame 2 at the 5 th second is acquired as the target key frame, and then the image data of the key frame 2 is extracted.
In an embodiment, based on the embodiment shown in fig. 1, the embodiment of the present application further provides a thumbnail extraction method. Referring to fig. 3, fig. 3 is a schematic flowchart of another method for extracting a thumbnail according to an embodiment of the present application, where the method includes the following steps:
And 303, carrying out reduction processing on the image data of the target key frame by adopting a bilinear interpolation algorithm to obtain thumbnail data.
And step 304, determining a target thumbnail according to the thumbnail data.
The steps 301-302 are the same as the steps 101-102, and the specific implementation process of the steps 301-302 can refer to the description of the step 101-102.
According to the technical scheme, after the electronic equipment obtains the image data of the target key frame, the image data of the target key frame is subjected to reduction processing to obtain thumbnail data, and the target thumbnail is generated from the thumbnail data. At this time, the data size of the target thumbnail is reduced, and the target thumbnail is convenient to transmit, store and view by a user. In addition, the electronic device may perform reduction processing on the image data of the target key frame by using a bilinear interpolation algorithm to obtain thumbnail data, so that the target thumbnail determined according to the thumbnail data is smoother.
In step 303, linear interpolation is performed in two directions by a bilinear interpolation algorithm, and the image data of the target key frame is reduced by the bilinear interpolation algorithm to obtain thumbnail data, so that the finally obtained target thumbnail determined according to the thumbnail data is smoother.
In the embodiment of the present application, other image reduction algorithms may also be adopted to perform reduction processing on the image data of the target key frame. Such as nearest neighbor interpolation algorithm, lagrange interpolation algorithm, etc. In the embodiment of the application, the specifically adopted image reduction algorithm is not limited.
In step 304, a target thumbnail is determined according to the thumbnail data, and in an embodiment, the electronic device may generate a bitmap corresponding to the thumbnail data based on the thumbnail data, and draw the pixel value of the pixel point corresponding to the thumbnail data recorded in the bitmap onto a view to obtain the target thumbnail. Specifically referring to fig. 4, fig. 4 is a fourth schematic flowchart of a thumbnail extraction method provided in the embodiment of the present application, where the method includes the following steps:
And 403, carrying out reduction processing on the image data of the target key frame by adopting a bilinear interpolation algorithm to obtain thumbnail data.
The steps 401-.
According to the technical scheme, after the electronic equipment obtains the thumbnail data, the bitmap corresponding to the thumbnail data can be generated, then, the electronic equipment can draw the pixel value of each pixel point in the bitmap to a view to obtain the target thumbnail, the user can check the target thumbnail conveniently, and the user experience is improved.
In step 404, each bit of the bitmap records a pixel value of a pixel point at a position information corresponding to the position information of the bit in the thumbnail data, and the electronic device may generate the bitmap corresponding to the thumbnail data according to the thumbnail data. For example, if the thumbnail data 1 acquired by the electronic device includes data information of pixel points in 4 rows and 3 columns, the generated initial bitmap corresponding to the thumbnail data 1 includes bits in 4 rows and 3 columns, such as a bitmap shown in fig. 5a, each small square in the bitmap represents one bit, and each bit corresponds to a pixel point at a position information corresponding to the position information of the bit, for example, a bit in 1 row and 1 st column corresponds to a pixel point in 1 st row and 1 st column in the thumbnail data 1. Filling each bit with the pixel value of the pixel corresponding to the bit, such as the bitmap shown in fig. 5b, where the number in each bit in the bitmap represents the pixel value of the pixel corresponding to the bit. And the electronic equipment draws the pixel values of the pixel points recorded in the bitmap shown in the figure 5b to the view, so that the target thumbnail can be obtained.
The pixel values of the pixel points recorded in the bitmap are drawn to a view to obtain a target thumbnail, after the bitmap corresponding to the thumbnail is generated by the electronic device, the pixel values of the pixel points recorded in the bitmap can be drawn to the view to obtain the target thumbnail, and specific description can refer to partial description in the step 404.
Based on the same technical concept, an embodiment of the present application further provides a thumbnail extraction apparatus, as shown in fig. 6, the apparatus includes:
an obtaining module 601, configured to obtain a thumbnail extraction instruction for a video file, where the thumbnail extraction instruction includes a target display timestamp;
a decoding module 602, configured to perform software decoding on the video file to obtain image data of a target key frame with a display timestamp closest to the target display timestamp;
a determining module 603, configured to determine a target thumbnail according to the image data of the target key frame.
Optionally, the extracting module 602 may include:
the searching submodule is used for carrying out software decoding on the video file and searching a target key frame of which the display timestamp is earlier than the target timestamp and is closest to the target display timestamp;
and the extraction sub-module is used for extracting the image data of the target key frame.
Optionally, the determining module 603 may include:
the scaling submodule is used for carrying out reduction processing on the image data of the target key frame by adopting a bilinear interpolation algorithm to obtain thumbnail data;
and the determining submodule is used for determining the target thumbnail according to the thumbnail data.
Optionally, the determining sub-module may include:
the generating unit is used for generating a bitmap corresponding to the thumbnail data, and each bit of the bitmap records the pixel value of a pixel point at the position information corresponding to the position information of the bit in the thumbnail data;
and the drawing unit is used for drawing the pixel values of the pixel points recorded in the bitmap to the view to obtain the target thumbnail.
According to the thumbnail extraction device, the thumbnail extraction instruction for the video file is acquired, the image data of the target key frame with the display timestamp closest to the target display timestamp is extracted from the video file, the target thumbnail is determined according to the image data of the target key frame, and based on the target thumbnail, the target thumbnail to be extracted can be determined according to the image data of the key frame, so that the thumbnail extraction efficiency is improved.
The embodiment of the present application further provides an electronic device, as shown in fig. 7, which includes a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following steps when executing the program stored in the memory 703:
acquiring a thumbnail extraction instruction aiming at a video file, wherein the thumbnail extraction instruction comprises a target display timestamp;
performing software decoding on the video file to obtain image data of a target key frame with a display timestamp closest to the target display timestamp;
and determining a target thumbnail according to the image data of the target key frame.
Optionally, the step of performing software decoding on the video file to obtain the image data of the target key frame with the display timestamp closest to the target display timestamp may include:
performing software decoding on the video file, and searching a target key frame with a display timestamp earlier than a target display timestamp and the display timestamp closest to the target display timestamp;
and extracting image data of the target key frame.
Optionally, the step of determining the target thumbnail according to the image data of the target key frame may include:
reducing the image data of the target key frame by adopting a bilinear interpolation algorithm to obtain thumbnail data;
and determining a target thumbnail according to the thumbnail data.
Optionally, the step of determining the target thumbnail according to the thumbnail data may include:
generating a bitmap corresponding to the thumbnail data, wherein each bit of the bitmap records the pixel value of a pixel point at the position information corresponding to the position information of the bit in the thumbnail data;
and drawing the pixel values of the pixel points recorded in the bitmap to a view to obtain a target thumbnail.
According to the electronic equipment, the thumbnail extraction instruction for the video file is acquired, the image data of the target key frame with the display timestamp closest to the target display timestamp is extracted from the video file, the target thumbnail is determined according to the image data of the target key frame, based on the target thumbnail, the target thumbnail to be extracted can be determined according to the image data of the key frame, and the efficiency of extracting the thumbnail is improved.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment provided by the present application, a computer-readable storage medium having a computer program embodied therein is further provided, where the computer program is executed by a processor to implement the thumbnail extraction method in any of the above embodiments.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the thumbnail extraction method described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the computer-readable storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims (10)
1. A thumbnail extraction method, characterized in that the method comprises:
acquiring a thumbnail extraction instruction aiming at a video file, wherein the thumbnail extraction instruction comprises a target display timestamp;
performing software decoding on the video file to obtain image data of a target key frame with a display timestamp closest to the target display timestamp;
and determining a target thumbnail according to the image data of the target key frame.
2. The method of claim 1, wherein said step of software decoding said video file to obtain image data of a target key frame having a display timestamp closest to said target display timestamp comprises:
performing software decoding on the video file, and searching a target key frame with a display timestamp earlier than the target display timestamp and a display timestamp closest to the target display timestamp;
and extracting the image data of the target key frame.
3. The method of claim 1, wherein the step of determining a target thumbnail from the image data of the target keyframe comprises:
reducing the image data of the target key frame by adopting a bilinear interpolation algorithm to obtain thumbnail data;
and determining a target thumbnail according to the thumbnail data.
4. The method of claim 3, wherein the step of determining the target thumbnail from the thumbnail data comprises:
generating a bitmap corresponding to the thumbnail data, wherein each bit of the bitmap records a pixel value of a pixel point at position information corresponding to the position information of the bit in the thumbnail data;
and drawing the pixel values of the pixel points recorded in the bitmap to a view to obtain the target thumbnail.
5. An apparatus for extracting thumbnail images, the apparatus comprising:
the system comprises an acquisition module, a display module and a display module, wherein the acquisition module is used for acquiring a thumbnail extraction instruction aiming at a video file, and the thumbnail extraction instruction comprises a target display timestamp;
the decoding module is used for carrying out software decoding on the video file to obtain image data of a target key frame with a display timestamp closest to the target display timestamp;
and the determining module is used for determining the target thumbnail according to the image data of the target key frame.
6. The apparatus of claim 5, wherein the decoding module comprises:
the searching submodule is used for carrying out software decoding on the video file and searching a target key frame of which the display timestamp is earlier than the target display timestamp and is closest to the target display timestamp;
and the extraction sub-module is used for extracting the image data of the target key frame.
7. The apparatus of claim 5, wherein the determining module comprises:
the scaling submodule is used for carrying out reduction processing on the image data of the target key frame by adopting a bilinear interpolation algorithm to obtain thumbnail data;
and the determining submodule is used for determining the target thumbnail according to the thumbnail data.
8. The apparatus of claim 7, wherein the determination submodule comprises:
the generating unit is used for generating a bitmap corresponding to the thumbnail data, and each bit of the bitmap records the pixel value of a pixel point at the position information corresponding to the position information of the bit in the thumbnail data;
and the drawing unit is used for drawing the pixel values of the pixel points recorded in the bitmap to a view to obtain the target thumbnail.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 4 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911393671.8A CN111147954A (en) | 2019-12-30 | 2019-12-30 | Thumbnail extraction method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911393671.8A CN111147954A (en) | 2019-12-30 | 2019-12-30 | Thumbnail extraction method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111147954A true CN111147954A (en) | 2020-05-12 |
Family
ID=70521748
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911393671.8A Pending CN111147954A (en) | 2019-12-30 | 2019-12-30 | Thumbnail extraction method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111147954A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112114892A (en) * | 2020-08-11 | 2020-12-22 | 北京奇艺世纪科技有限公司 | Deep learning model obtaining method, loading method and selecting method |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110013882A1 (en) * | 2009-07-17 | 2011-01-20 | Yoshiaki Kusunoki | Video audio recording/playback apparatus and method |
CN102215404A (en) * | 2011-05-20 | 2011-10-12 | 恒通高科股份有限公司 | Decoding method and system of videos inside embedded system |
CN104065966A (en) * | 2013-03-20 | 2014-09-24 | 三星电子(中国)研发中心 | Method and device for extracting thumbnail in H.264 video file |
CN106844580A (en) * | 2017-01-09 | 2017-06-13 | 北京奇虎科技有限公司 | A kind of generation method of thumbnail, device and mobile terminal |
CN109379625A (en) * | 2018-11-27 | 2019-02-22 | Oppo广东移动通信有限公司 | Method for processing video frequency, device, electronic equipment and computer-readable medium |
CN110460790A (en) * | 2018-05-02 | 2019-11-15 | 北京视联动力国际信息技术有限公司 | A kind of abstracting method and device of video frame |
-
2019
- 2019-12-30 CN CN201911393671.8A patent/CN111147954A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110013882A1 (en) * | 2009-07-17 | 2011-01-20 | Yoshiaki Kusunoki | Video audio recording/playback apparatus and method |
CN102215404A (en) * | 2011-05-20 | 2011-10-12 | 恒通高科股份有限公司 | Decoding method and system of videos inside embedded system |
CN104065966A (en) * | 2013-03-20 | 2014-09-24 | 三星电子(中国)研发中心 | Method and device for extracting thumbnail in H.264 video file |
CN106844580A (en) * | 2017-01-09 | 2017-06-13 | 北京奇虎科技有限公司 | A kind of generation method of thumbnail, device and mobile terminal |
CN110460790A (en) * | 2018-05-02 | 2019-11-15 | 北京视联动力国际信息技术有限公司 | A kind of abstracting method and device of video frame |
CN109379625A (en) * | 2018-11-27 | 2019-02-22 | Oppo广东移动通信有限公司 | Method for processing video frequency, device, electronic equipment and computer-readable medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112114892A (en) * | 2020-08-11 | 2020-12-22 | 北京奇艺世纪科技有限公司 | Deep learning model obtaining method, loading method and selecting method |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11132555B2 (en) | Video detection method, server and storage medium | |
JP6735927B2 (en) | Video content summarization | |
US10984296B2 (en) | Methods and apparatus for identifying objects depicted in a video using extracted video frames in combination with a reverse image search engine | |
WO2021082667A1 (en) | Video data encoding method and device, apparatus, and storage medium | |
CN105744292A (en) | Video data processing method and device | |
CN108076377B (en) | Video storage and playing method and device, electronic equipment and storage medium | |
EP3099074A1 (en) | Systems, devices and methods for video coding | |
CN108989875B (en) | Method and device for generating bullet screen file | |
CN115861131A (en) | Training method and device based on image generation video and model and electronic equipment | |
US9195896B2 (en) | Methods and systems for image recognition | |
US10924637B2 (en) | Playback method, playback device and computer-readable storage medium | |
CN111147954A (en) | Thumbnail extraction method and device | |
US11051080B2 (en) | Method for improving video resolution and video quality, encoder, and decoder | |
US10819983B1 (en) | Determining a blurriness score for screen capture videos | |
CN111049735B (en) | Group head portrait display method, device, equipment and storage medium | |
TWI601075B (en) | Motion compensation image processing apparatus and image processing method | |
US8548275B2 (en) | Image processing device and image processing method | |
CN115396729B (en) | Video target frame determining method, device, equipment and storage medium | |
KR20210064587A (en) | High speed split device and method for video section | |
CN111083497B (en) | Video screenshot method and device | |
CN114372169A (en) | Method, device and storage medium for searching homologous videos | |
CN113836351A (en) | Method and device for determining homologous video clips and electronic equipment | |
TWI482099B (en) | Image processing and recording system and image processing and recording method thereof | |
CN113779304A (en) | Method and device for detecting infringement video | |
CN110719520A (en) | Video information extraction method, system and device |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200512 |