Disclosure of Invention
The embodiment of the application provides a data processing method and equipment, which can ensure the quality of a video thumbnail and improve the efficiency of thumbnail configuration.
An aspect of the present application provides a data processing method, which may include:
acquiring a target video for extracting a video thumbnail;
acquiring a key frame picture of the target video, and generating image quality information of the key frame picture according to the gray frequency of the key frame picture;
and determining the key frame picture with the image quality information meeting the quality condition as the video thumbnail of the target video.
Wherein the acquiring of the target video for extracting the video thumbnail includes:
acquiring address information of a video to be processed for extracting a video thumbnail and sending the address information to a message queue;
acquiring a target video corresponding to the target address information according to the target address information in the message queue; the message queue comprises address information of a plurality of videos to be processed, and the target address information is any address information in the message queue.
The obtaining of the target video corresponding to the target address information according to the target address information in the message queue includes:
determining the address information with the highest priority and unprocessed as target address information according to the priority sequence of the address information in the message queue;
and acquiring the target video indicated by the target address information according to the target address information.
The acquiring a key frame picture of the target video and generating image quality information of the key frame picture according to the gray frequency of the key frame picture comprises the following steps:
acquiring a target video scene of the target video according to the skipping information, and acquiring a key frame picture in the target video scene; the skip information is used for indicating the position information of a target video scene in a target video;
acquiring M gray information corresponding to the key frame picture, counting the distribution quantity of the M gray information in a plurality of gray levels, and generating the gray frequency corresponding to each gray level according to the distribution quantity of each gray level; wherein M is the number of pixel points of the key frame picture;
and acquiring image quality information corresponding to the key frame picture according to the gray frequency corresponding to each gray level and the gray level.
The acquiring M pieces of gray scale information corresponding to the key frame picture, acquiring the distribution quantity of each piece of gray scale information, and generating the gray scale frequency corresponding to each piece of gray scale information according to the distribution quantity includes:
extracting pixel points in the key frame picture according to the step length information, and storing the pixel points to a pixel point set;
and counting the gray information of all the pixel points in the pixel point set and the gray frequency corresponding to each gray information.
Wherein, the taking the key frame picture with the image quality information meeting the quality condition as the video thumbnail of the target video comprises:
when the image quality information is greater than a quality threshold, determining that the image quality information meets a quality condition;
and determining the key frame picture corresponding to the image quality information as a video thumbnail of the target video.
Wherein, still include:
and when the image quality information is less than or equal to a quality threshold value, acquiring a next video scene of a target video scene to which the key frame picture belongs, and determining the next video scene of the target video scene as the target video scene.
Wherein, when the image quality information is less than or equal to a quality threshold, acquiring a next video scene of a target video scene to which the key frame picture belongs, and determining the next video scene of the target video scene as the target video scene includes:
when the image quality information is smaller than or equal to a quality threshold, acquiring duration information corresponding to the image quality information, and storing the image quality information and time information corresponding to the image quality information into a quality information set; the duration information is a time consumed to generate the image quality information;
and acquiring a next video scene of a target video scene to which the key frame picture belongs, determining the next video scene of the target video scene as the target video scene, acquiring the maximum image quality information in the quality information set until the sum of all time length information in the statistical quality information set is greater than a time length threshold value, and determining the key frame picture corresponding to the maximum image quality information as a video thumbnail of the target video.
An aspect of an embodiment of the present application provides a data processing apparatus, which may include:
a target video acquisition unit configured to acquire a target video for extracting a video thumbnail;
the image quality generating unit is used for acquiring a key frame picture of the target video and generating image quality information of the key frame picture according to the gray frequency of the key frame picture;
and the video thumbnail determining unit is used for determining the key frame picture of which the image quality information meets the quality condition as the video thumbnail of the target video.
Wherein the target video acquiring unit includes:
the device comprises an address information acquisition subunit, a message queue and a processing unit, wherein the address information acquisition subunit is used for acquiring address information of a video to be processed for extracting a video thumbnail and sending the address information to the message queue;
the target video acquiring subunit is used for acquiring a target video corresponding to the target address information according to the target address information in the message queue; the message queue comprises address information of a plurality of videos to be processed, and the target address information is any address information in the message queue.
Wherein the target video acquisition subunit is specifically configured to:
determining the address information with the highest priority and unprocessed as target address information according to the priority sequence of the address information in the message queue;
and acquiring the target video indicated by the target address information according to the target address information.
Wherein the image quality generation unit includes:
the key frame acquiring subunit is used for acquiring a target video scene of the target video according to the skipping information and acquiring a key frame picture in the target video scene; the skip information is used for indicating the position information of a target video scene in a target video;
the gray frequency acquisition subunit is used for acquiring M pieces of gray information corresponding to the key frame picture, counting the distribution quantity of the M pieces of gray information in a plurality of gray levels, and generating the gray frequency corresponding to each gray level according to the distribution quantity of each gray level; wherein M is the number of pixel points of the key frame picture;
and the image quality generating subunit is used for acquiring the image quality information corresponding to the key frame picture according to the gray frequency corresponding to each gray level and the gray level.
Wherein the grayscale frequency acquisition subunit is specifically configured to:
extracting pixel points in the key frame picture according to the step length information, and storing the pixel points to a pixel point set;
and counting the gray information of all the pixel points in the pixel point set and the gray frequency corresponding to each gray information.
Wherein the video thumbnail determination unit is specifically configured to:
when the image quality information is greater than a quality threshold, determining that the image quality information meets a quality condition;
and determining the key frame picture corresponding to the image quality information as a video thumbnail of the target video.
Wherein, still include:
and the video scene acquisition unit is used for acquiring a next video scene of a target video scene to which the key frame picture belongs when the image quality information is less than or equal to a quality threshold value, and determining the next video scene of the target video scene as the target video scene.
The video scene acquisition unit is specifically configured to:
when the image quality information is smaller than or equal to a quality threshold, acquiring duration information corresponding to the image quality information, and storing the image quality information and time information corresponding to the image quality information into a quality information set; the duration information is a time consumed to generate the image quality information;
and acquiring a next video scene of a target video scene to which the key frame picture belongs, determining the next video scene of the target video scene as the target video scene, triggering a video thumbnail determining unit to acquire the maximum image quality information in the quality information set until the sum of all time length information in the statistical quality information set is greater than a time length threshold value, and determining the key frame picture corresponding to the maximum image quality information as the video thumbnail of the target video.
An aspect of the embodiments of the present application provides a computer storage medium storing a plurality of instructions adapted to be loaded by a processor and to perform the above-mentioned method steps.
In one aspect, an embodiment of the present application provides a data processing apparatus, including a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the above-mentioned method steps.
In the embodiment of the application, a target video for extracting the video thumbnail is obtained; acquiring a key frame picture of the target video, and generating image quality information of the key frame picture according to the gray frequency of the key frame picture; and determining the key frame picture with the image quality information meeting the quality condition as the video thumbnail of the target video. The video thumbnails are screened from the key frame pictures of the target video, multiple screening in the same video scene is avoided, the video thumbnails are determined according to the image quality information of the key frame pictures in the target video, the problem that the first frame of the target video, which is completely black, is used as the video thumbnails can be solved, the quality of the video thumbnails is guaranteed, and the efficiency of thumbnail configuration is improved.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1a is a block diagram of a data processing system according to an embodiment of the present invention. Theserver 10f establishes a connection with a user terminal cluster through theswitch 10e and thecommunication bus 10d, and the user terminal cluster may include:user terminal 10a,user terminal 10 b. Thedatabase 10g stores therein address information of a plurality of videos to be processed. Theserver 10f determines the unprocessed address information with the highest priority in thedatabase 10g as the target address information, and acquires the target video indicated by the target address information according to the target address information. The server 10f obtains a target video scene of the target video according to preset skip information, further obtains a key frame picture in the target video scene, and generates a gray frequency corresponding to each gray level according to the distribution quantity of each gray level in the key frame picture, in general, in order to reduce the calculation quantity of calculating the gray frequency and improve the calculation efficiency, generally, a pixel point in the key frame picture is extracted according to preset step length information and image quality information corresponding to the key frame picture is generated, and when the image quality information is greater than a quality threshold value, it is determined that the image quality information meets a quality condition; determining the key frame picture corresponding to the image quality information as a video thumbnail of a target video, when the image quality information is less than or equal to a quality threshold value, namely the image quality information does not meet the quality condition, the server 10f acquires a next video scene of the target video scene to which the key frame picture belongs, determines the next video scene of the target video scene as the target video scene, acquires the key frame picture of the target video scene, and detects whether the key frame picture meets the quality condition until the key frame picture meeting the quality condition is detected, and determines the key frame picture meeting the condition as the video thumbnail of the target video.
The data processing device related to the embodiment of the present application may be a server, and the user terminal includes: terminal equipment such as tablet personal computers, smart phones, Personal Computers (PCs), notebook computers, palmtop computers and the like.
The following description will be made with reference to fig. 1b for a specific implementation scenario provided in the embodiments of the present application, as shown in fig. 1 b. The method comprises the steps that the website front end sends address information of a to-be-processed video needing to extract a video thumbnail to a Proxy module, the website front end comprises a webpage capable of displaying the video, the address information of the to-be-processed video comprises a storage address of the to-be-processed video and a Uniform Resource Locator (url), the Proxy module can be a Proxy in a server, the Proxy module packs a video thumbnail obtaining request and IP information of the Proxy module and forwards the video thumbnail obtaining request and the IP information to a message queue, the message queue can comprise video thumbnail obtaining requests for a plurality of to-be-processed videos, a task module obtains a video thumbnail obtaining request for a target video from the message queue to complete transcoding of the target video, the server comprises a plurality of task modules such as a task module 1, a task module 2, a task module n and the like, and the task module determines a key frame picture of which image quality information in the target video meets a quality condition as the video thumbnail of the target video The task module sends the video thumbnails to the corresponding agent modules, the agent modules return the video thumbnail information to the front end of the website, a message queue is innovatively used in the process of obtaining the video thumbnails, synchronous calling is transparently realized through an asynchronous message queue, a plurality of video thumbnail obtaining requests of videos to be processed can be stored in the message queue, when a task module is in an idle state, the video thumbnail obtaining requests are obtained from the message queue, optimal load balance is achieved, through a large number of tests, the concurrency performance of a system adopting the message queue can be linearly increased along with the increase of the task module without attenuation, please refer to fig. 1c together, a specific implementation scene provided by the embodiment of the application is described, as shown in fig. 1c, the horizontal coordinate in the figure is the number of task modules, and the vertical coordinate is the number of messages concurrently processed by the system, the curve 1 is a system adopting a message queue, and thecurve 2 is a system not adopting a message queue, and it can be seen from the figure that the concurrency performance of the system adopting the message queue can be linearly increased along with the increase of the task modules without attenuation, while the concurrency performance of the system not adopting the message queue can be attenuated along with the increase of the task modules, and it can be seen that the performance of the system adopting the message queue is better for the high concurrency condition.
Referring to fig. 2, a flow chart of a data processing method according to an embodiment of the present application is schematically shown. As shown in fig. 2, the method of the embodiment of the present application may include the following steps S101 to S103.
S101, acquiring a target video for extracting a video thumbnail;
specifically, the data processing apparatus acquires a target video for extracting a video thumbnail, it is understood that the data processing apparatus may be theserver 10f in fig. 1a, the target video is a video for extracting a video thumbnail, the video thumbnail is a frame of picture of a preview video, and may be any frame of picture in the target video, or other pictures, the data processing apparatus acquires the target video, and the target video may be a video stored locally, or downloaded from a corresponding address of the target video, it should be noted that, in order to achieve optimal load balancing of the data processing apparatus, a message queue is used, synchronous call is transparently implemented through an asynchronous message queue, and the apparatus using the message queue can improve concurrency performance, specifically, the data processing apparatus acquires address information of a video to be processed for extracting the video thumbnail, and sending the address information to a message queue, and acquiring a target video corresponding to the target address information according to the target address information in the message queue.
S102, acquiring a key frame picture of the target video, and generating image quality information of the key frame picture according to the gray frequency of the key frame picture;
specifically, the data processing device acquires a key frame picture of the target video, and generates image quality information of the key frame picture according to a gray level frequency of the key frame picture, it can be understood that the key frame picture is a frame picture in video scenes, specifically, a first frame picture of the video scenes, the video scenes include at least one picture, each video scene corresponds to one key frame picture, the target video can include a plurality of video scenes, the data processing device acquires the key frame picture of the target video, the key frame picture can be a key frame picture of any one video scene of the target video, and generates image quality information of the key frame picture according to the gray level frequency of the key frame picture, the gray level frequency includes a gray level frequency corresponding to each gray level, and the gray level frequency corresponding to the gray level is a frequency at which the gray level appears in the picture, the gray level is a desirable value in a gray level value range, for example, a picture adopts YUV to perform color coding, Y represents brightness of a pixel point, that is, a gray level value, U and V represent chroma of the pixel point, the gray level value corresponds to the gray level, the value range of the gray level value is 0-255, the gray level is any integer in the range of 0-255, and the data processing device generates image quality information of the key frame picture according to the gray frequency corresponding to each gray level of the key frame picture.
S103, determining the key frame picture with the image quality information meeting the quality condition as the video thumbnail of the target video.
Specifically, the data processing device determines the key frame picture whose image quality information meets the quality condition as the video thumbnail of the target video, it can be understood that the quality condition is setting rule information, specifically, the image quality information may be greater than a set threshold, the data processing device sequentially obtains the image quality information of the key frame picture, if the image quality information does not meet the quality condition, the image quality information of the next key frame picture is detected, and when the image quality information of the key frame picture meets the quality condition, the key frame picture meeting the quality condition is determined as the video thumbnail of the target video.
In the embodiment of the application, a target video for extracting the video thumbnail is obtained; acquiring a key frame picture of the target video, and generating image quality information of the key frame picture according to the gray frequency of the key frame picture; and determining the key frame picture with the image quality information meeting the quality condition as the video thumbnail of the target video. The video thumbnails are screened from the key frame pictures of the target video, multiple screening in the same video scene is avoided, the video thumbnails are determined according to the image quality information of the key frame pictures in the target video, the problem that the first frame of the target video, which is completely black, is used as the video thumbnails can be solved, the quality of the video thumbnails is guaranteed, and the efficiency of thumbnail configuration is improved.
Referring to fig. 3, a flow chart of a data processing method according to an embodiment of the present application is schematically shown. As shown in fig. 3, the method of the embodiment of the present application may include the following steps S201 to S207.
S201, acquiring address information of a video to be processed for extracting a video thumbnail, and sending the address information to a message queue;
specifically, the data processing device obtains address information of a to-be-processed video for extracting a video thumbnail, and sends the address information to a message queue, where it can be understood that the to-be-processed video is a video for extracting and extracting a video thumbnail, the address information is a storage address of the to-be-processed video or a download address of the to-be-processed video, and the message queue is used for storing the address information of the to-be-processed video, and may include address information of a plurality of to-be-processed videos.
S202, acquiring a target video corresponding to target address information according to the target address information in the message queue; the message queue comprises address information of a plurality of videos to be processed, and the target address information is any address information in the message queue;
specifically, the data processing device obtains a target video corresponding to the target address information according to the target address information in the message queue; the message queue includes address information of a plurality of videos to be processed, the target address information is any address information in the message queue, and it can be understood that the data processing device acquires one of the address information from the message queue as the target address information and acquires the target video corresponding to the target address information, where the target address information may be any address information in the message queue, and the message queue includes address information of a plurality of videos to be processed.
The specific implementation process of obtaining the target video corresponding to the target address information from the target address information in the message queue is as follows:
the data processing equipment determines the address information with the highest priority and unprocessed as target address information according to the priority sequence of the address information in the message queue; and acquiring the target video indicated by the target address information according to the target address information. It can be understood that the priority order is a label carried by the address information, the priority order may be a time order, the information address carries time information earlier, the priority order of the address information is higher, or the priority order is determined according to the importance degree of the video to be processed, the data processing device determines the address information with the highest priority and without processing as the target address information, and obtains the target video indicated by the target address information according to the target address information.
S203, acquiring a target video scene of the target video according to the skipping information, and acquiring a key frame picture in the target video scene; the skip information is used for indicating the position information of a target video scene in a target video;
specifically, the data processing equipment acquires a target video scene of the target video according to the skip information, and acquires a key frame picture in the target video scene; it is understood that the data processing device acquires a target video scene of the target video according to skip information, which is preset, the skip information is specifically a time length ratio of the video, the time length ratio corresponds to a playing time point in the target video, the data processing device acquires the target video scene corresponding to the video frame according to the video frame at the playing time point, and then acquires a key frame picture of the target video scene, for example, the skip information is 10%, then the target video scene corresponding to the position with the target video duration of 10% is obtained, if the target video duration is 10 minutes, the data processing device acquires a target video scene corresponding to the target video at the playing time point of 1 minute, and further acquires a key frame picture of the target video scene.
S204, acquiring M gray information corresponding to the key frame picture, counting the distribution quantity of the M gray information in a plurality of gray levels, and generating the gray frequency corresponding to each gray level according to the distribution quantity of each gray level; wherein M is the number of pixel points of the key frame picture;
specifically, the data processing device obtains M pieces of gray scale information corresponding to the key frame picture, counts distribution amounts of the M pieces of gray scale information in a plurality of gray scales, and generates a gray scale frequency corresponding to each gray scale according to the distribution amount of each gray scale, it can be understood that the key frame picture includes M pieces of gray scale information, M is the number of pixel points of the key frame picture, one pixel point corresponds to one piece of gray scale information, counts the distribution amounts of the M pieces of gray scale information in a plurality of gray scales, and a gray scale is a desirable value in a gray scale value range, for example, the picture is color-coded using YUV, a gray scale value of the picture corresponds to a gray scale, and a gray scale value range is 0-255, and a gray scale value is any integer in the range of 0-255, and generates a gray scale frequency corresponding to each gray scale according to the distribution amount of each gray scale, the distribution quantity of each gray level is the number of pixel points of each gray level on the picture, and the gray frequency corresponding to each gray level is generated according to the number of the pixel points of each gray level and the total number of the pixel points of the picture.
It should be noted that, in order to reduce the calculation amount for calculating the grayscale frequency and improve the calculation efficiency, the grayscale information of each pixel point in the picture is usually not obtained, and step S204 may specifically be: extracting pixel points in the key frame picture according to the step length information, and storing the pixel points to a pixel point set; counting gray information of all pixel points in the pixel point set and gray frequency corresponding to each gray information, wherein the step information is preset information, extracting pixel points from a key frame picture by adopting the frequency corresponding to the step information, storing the pixel points into the pixel point set, for example, if the step information is 10, extracting a pixel point from the key frame picture for one time and storing the pixel point into the pixel point set by 10 pixel points, counting the gray information of all the pixel points in the pixel point set, and generating the gray frequency corresponding to each gray level according to the number of the pixel points of each gray level and the total number of the pixel points in the pixel point set.
S205, acquiring image quality information corresponding to the key frame picture according to the gray frequency corresponding to each gray level and the gray level.
Specifically, the data processing device obtains the image quality information corresponding to the key frame picture according to the gray frequency corresponding to each gray level and the gray level, and it can be understood that the image quality information corresponding to the key frame picture is obtained by using formula (1) according to the gray frequency corresponding to each gray level and the maximum value of the gray level, where formula (1) is as follows:
wherein, the picture adopts YUV to carry out color coding, E is the image quality information corresponding to the key frame picture, piIs the frequency of occurrence of the ith gray level, the value range [0, 255 ] of i]L is the maximum value of the gray level, and L is 255.
S206, when the image quality information is larger than a quality threshold value, determining that the image quality information meets a quality condition; and determining the key frame picture corresponding to the image quality information as a video thumbnail of the target video.
Specifically, when the image quality information is greater than a quality threshold, the data processing device determines that the image quality information meets a quality condition; determining the key frame picture corresponding to the image quality information as a video thumbnail of the target video, wherein the quality threshold is preset, the data processing device sequentially acquires the image quality information of the key frame picture, and when the image quality information E is greater than the quality threshold, the data processing device determines that the image quality information meets the quality condition, and determines the key frame picture corresponding to the image quality information as the video thumbnail of the target video.
And S207, when the image quality information is less than or equal to a quality threshold, acquiring a next video scene of a target video scene to which the key frame picture belongs, and determining the next video scene of the target video scene as the target video scene.
Specifically, when the image quality information is less than or equal to the quality threshold, the data processing device obtains a video scene next to the target video scene to which the key frame picture belongs, and determines the video scene next to the target video scene as the target video scene, it is understood that, when the image quality information is less than or equal to the quality threshold, namely, when the image quality information does not satisfy the quality condition, the data processing equipment acquires the next video scene of the target video scene to which the key frame picture belongs, determines the next video scene of the target video scene as the target video scene, acquires the key frame picture of the target video scene, and detecting whether the key frame pictures meet the quality condition until the key frame pictures meeting the quality condition are detected, and determining the key frame pictures meeting the quality condition as the video thumbnails of the target videos.
It should be noted that, in a target video, there may be a plurality of key frame pictures of a continuous video scene that do not satisfy quality conditions, which results in that a large number of key frame pictures need to be detected to obtain a video thumbnail, in order to prevent the above situation from occurring, a large number of key frame pictures are usually not detected, but a key frame picture with the largest image quality information is obtained from the detected key frame pictures as a video thumbnail of the target video, and the specific implementation steps are as follows:
when the image quality information is smaller than or equal to a quality threshold, acquiring duration information corresponding to the image quality information, and storing the image quality information and time information corresponding to the image quality information into a quality information set; the duration information is a time consumed to generate the image quality information; and acquiring a next video scene of a target video scene to which the key frame picture belongs, determining the next video scene of the target video scene as the target video scene, acquiring the maximum image quality information in the quality information set until the sum of all time length information in the statistical quality information set is greater than a time length threshold value, and determining the key frame picture corresponding to the maximum image quality information as a video thumbnail of the target video. It can be understood that the quality information set is used for storing image quality information of a key frame picture and time information corresponding to the image quality information, the duration threshold is preset, and when the sum of all the duration information in the quality information set is greater than the duration threshold, determining the key frame picture corresponding to the maximum image quality information in the quality information set as a video thumbnail of the target video, for example, after the image quality information of the ten key frame pictures is calculated in sequence, the quality conditions are not met, ten pieces of image quality information and time information corresponding to the image quality information are stored in the quality information set, if the sum of the ten pieces of time length information in the quality information set is greater than a time length threshold value, the key frame picture of the next video scene is not acquired to calculate the image quality information, but the key frame picture corresponding to the maximum image quality information in the ten pieces of image quality information is determined as the video thumbnail of the target video.
In the embodiment of the application, a target video for extracting the video thumbnail is obtained; acquiring a key frame picture of the target video, and generating image quality information of the key frame picture according to the gray frequency of the key frame picture; and determining the key frame picture with the image quality information meeting the quality condition as the video thumbnail of the target video. The video thumbnails are screened from the key frame pictures of the target video, multiple screening in the same video scene is avoided, the video thumbnails are determined according to the image quality information of the key frame pictures in the target video, the problem that the first frame of the target video, which is completely black, is used as the video thumbnails can be solved, the quality of the video thumbnails is guaranteed, and the efficiency of thumbnail configuration is improved.
Referring to fig. 4, a schematic structural diagram of a data processing apparatus is provided in an embodiment of the present application. As shown in fig. 4, the data processing apparatus 1 according to the embodiment of the present application may include: a targetvideo acquisition unit 11, an imagequality generation unit 12, a videothumbnail determination unit 13, a videoscene acquisition unit 14.
A targetvideo acquisition unit 11 configured to acquire a target video for extracting a video thumbnail;
specifically, the targetvideo obtaining unit 11 obtains a target video for extracting a video thumbnail, it is understood that the target video is a video for extracting a video thumbnail, the video thumbnail is a frame of picture of a preview video, and may be any frame of picture in the target video, or other pictures, the targetvideo obtaining unit 11 obtains the target video, the target video may be a video stored locally, or may be downloaded from a corresponding address of the target video, it should be noted that, in order to achieve the optimal load balance of the device, a message queue may be used, synchronous call is transparently realized through an asynchronous message queue, the device using the message queue can improve concurrency performance, specifically, the targetvideo obtaining unit 11 obtains address information of a video to be processed for extracting the video thumbnail, and sends the address information to the message queue, and acquiring a target video corresponding to the target address information according to the target address information in the message queue.
Referring to fig. 4, the targetvideo obtaining unit 11 according to the embodiment of the present application may include: an addressinformation acquisition sub-unit 111, a targetvideo acquisition sub-unit 112.
An addressinformation obtaining subunit 111, configured to obtain address information of a to-be-processed video for extracting a video thumbnail, and send the address information to a message queue;
a targetvideo obtaining subunit 112, configured to obtain, according to the target address information in the message queue, a target video corresponding to the target address information; the message queue comprises address information of a plurality of videos to be processed, and the target address information is any address information in the message queue.
The imagequality generating unit 12 is configured to acquire a key frame picture of the target video, and generate image quality information of the key frame picture according to a grayscale frequency of the key frame picture;
specifically, the image quality generating unit 12 obtains a key frame picture of the target video, and generates the image quality information of the key frame picture according to the gray frequency of the key frame picture, it can be understood that the key frame picture is a frame picture in video scenes, specifically, a first frame picture of the video scenes, the video scenes include at least one picture, each video scene corresponds to one key frame picture, the target video may include a plurality of video scenes, the image quality generating unit 12 obtains the key frame picture of the target video, the key frame picture may be a key frame picture of any one video scene of the target video, and generates the image quality information of the key frame picture according to the gray frequency of the key frame picture, the gray frequency includes the gray frequency corresponding to each gray level, and the gray frequency corresponding to the gray level is the frequency of the gray level appearing in the picture, the gray level is a desirable value in a gray level value range, for example, a picture is color-coded by using YUV, "Y" represents brightness of a pixel point, that is, a gray level value, "U" and "V" represent chromaticity of the pixel point, the gray level value corresponds to the gray level, the value range of the gray level value is 0 to 255, the gray level is any integer in the range of 0 to 255, and the image quality generating unit 12 generates the image quality information of the key frame picture according to the gray frequency corresponding to each gray level of the key frame picture.
Referring to fig. 4, the imagequality generating unit 12 according to the embodiment of the present application may include: a key frame acquisition sub-unit 121, a grayscalefrequency acquisition sub-unit 122, and an imagequality generation sub-unit 123.
A keyframe acquiring subunit 121, configured to acquire a target video scene of the target video according to the skip information, and acquire a key frame picture in the target video scene; the skip information is used for indicating the position information of a target video scene in a target video;
a grayfrequency obtaining subunit 122, configured to obtain M pieces of gray information corresponding to the key frame picture, count distribution quantities of the M pieces of gray information in multiple gray levels, and generate a gray frequency corresponding to each gray level according to the distribution quantity of each gray level; wherein M is the number of pixel points of the key frame picture;
and the imagequality generating subunit 123 is configured to obtain image quality information corresponding to the key frame picture according to the grayscale frequency and the grayscale corresponding to each grayscale.
A videothumbnail determination unit 13, configured to determine a key frame picture whose image quality information satisfies a quality condition as a video thumbnail of the target video.
Specifically, when the image quality information is greater than a quality threshold, the videothumbnail determining unit 13 determines that the image quality information satisfies a quality condition; and determining the key frame picture corresponding to the image quality information as a video thumbnail of the target video. It can be understood that the quality threshold is preset, the data processing device sequentially obtains the image quality information of the key frame pictures, and when the image quality information E is greater than the quality threshold, it is determined that the image quality information satisfies the quality condition, and the key frame picture corresponding to the image quality information is determined as the video thumbnail of the target video.
A videoscene obtaining unit 14, configured to, when the image quality information is less than or equal to a quality threshold, obtain a video scene next to a target video scene to which the key frame picture belongs, and determine the video scene next to the target video scene as the target video scene.
Specifically, when the image quality information is less than or equal to the quality threshold, the videoscene obtaining unit 14 obtains duration information corresponding to the image quality information, and stores the image quality information and time information corresponding to the image quality information into a quality information set; the duration information is a time consumed to generate the image quality information; the videoscene obtaining unit 14 obtains a next video scene of a target video scene to which the key frame picture belongs, determines the next video scene of the target video scene as the target video scene, and triggers the videothumbnail determining unit 13 to obtain the maximum image quality information in the quality information set until the sum of all the time length information in the statistical quality information set is greater than a time length threshold, and determines the key frame picture corresponding to the maximum image quality information as the video thumbnail of the target video.
In the embodiment of the application, a target video for extracting the video thumbnail is obtained; acquiring a key frame picture of the target video, and generating image quality information of the key frame picture according to the gray frequency of the key frame picture; and determining the key frame picture with the image quality information meeting the quality condition as the video thumbnail of the target video. The video thumbnails are screened from the key frame pictures of the target video, multiple screening in the same video scene is avoided, the video thumbnails are determined according to the image quality information of the key frame pictures in the target video, the problem that the first frame of the target video, which is completely black, is used as the video thumbnails can be solved, the quality of the video thumbnails is guaranteed, and the efficiency of thumbnail configuration is improved.
Referring to fig. 5, a schematic structural diagram of a data processing apparatus is provided in an embodiment of the present application. As shown in fig. 5, thedata processing apparatus 1000 may include: at least oneprocessor 1001, such as a CPU, at least onenetwork interface 1004, auser interface 1003,memory 1005, at least onecommunication bus 1002. Wherein acommunication bus 1002 is used to enable connective communication between these components. Theuser interface 1003 may include a Display screen (Display), and theoptional user interface 1003 may also include a standard wired interface or a wireless interface. Thenetwork interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). Thememory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. Thememory 1005 may optionally be at least one memory device located remotely from theprocessor 1001. As shown in fig. 5, thememory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a data processing application program.
In thedata processing apparatus 1000 shown in fig. 5, anetwork interface 1004 may provide a network communication function, and auser interface 1003 is mainly used as an interface for providing input for a user; theprocessor 1001 may be configured to call a data processing application stored in thememory 1005 to implement the description of the data processing method in the embodiment corresponding to any one of fig. 2 to fig. 3, which is not described herein again.
It should be understood that thedata processing apparatus 1000 described in this embodiment of the application may perform the description of the data processing method in the embodiment corresponding to any one of fig. 2 to fig. 3, and may also perform the description of the data processing apparatus in the embodiment corresponding to fig. 4, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: an embodiment of the present application further provides a computer-readable storage medium, where a computer program executed by the aforementioned data processing apparatus is stored in the computer-readable storage medium, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the data processing method in any one of the embodiments corresponding to fig. 2 to fig. 3 can be performed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in embodiments of the computer-readable storage medium referred to in the present application, reference is made to the description of embodiments of the method of the present application.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.