Movatterモバイル変換


[0]ホーム

URL:


CN110392306B - Data processing method and equipment - Google Patents

Data processing method and equipment
Download PDF

Info

Publication number
CN110392306B
CN110392306BCN201910689334.7ACN201910689334ACN110392306BCN 110392306 BCN110392306 BCN 110392306BCN 201910689334 ACN201910689334 ACN 201910689334ACN 110392306 BCN110392306 BCN 110392306B
Authority
CN
China
Prior art keywords
information
video
target video
key frame
image quality
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910689334.7A
Other languages
Chinese (zh)
Other versions
CN110392306A (en
Inventor
陈前
泮华杰
杨璧嘉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co LtdfiledCriticalTencent Technology Shenzhen Co Ltd
Priority to CN201910689334.7ApriorityCriticalpatent/CN110392306B/en
Publication of CN110392306ApublicationCriticalpatent/CN110392306A/en
Application grantedgrantedCritical
Publication of CN110392306BpublicationCriticalpatent/CN110392306B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The embodiment of the application discloses a data processing method and equipment, wherein the method comprises the following steps: 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. By the method and the device, the quality of the video thumbnail can be guaranteed, and the efficiency of thumbnail configuration is improved.

Description

Data processing method and equipment
Technical Field
The present application relates to the field of electronic technologies, and in particular, to a data processing method and device.
Background
With the advent of the mobile internet era, various video application programs are generated, users self-make videos, especially short videos show explosive growth, the demand of configuring video thumbnails for the videos is greatly increased, the video thumbnails for configuring the video thumbnails are mainly configured by manual configuration and open source video decoding software, the video thumbnails of part of video websites are manually configured by editors, for example, for videos of movie and television series, editors can directly configure the videos as video thumbnails of the videos by posters, the open source video decoding software is configured by automatically decoding a first frame of uploaded short videos and using a first frame of images as thumbnails of the videos, or decoding a plurality of frame of images firstly and taking a frame of image with better quality as the thumbnail; due to the efficiency problem of manual editing, manual image matching cannot meet the requirements of large-scale short video application, image matching is performed through open-source video decoding software, the probability that the first frame or the first frames are all black images is very high, only the first frame is decoded, the quality of a thumbnail is poor, if one frame of image is obtained from a plurality of decoded frame images to serve as the thumbnail, the calculation process is complex, the operation speed is low, and the image matching efficiency is influenced.
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.
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, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1a is a block diagram of a data processing architecture according to an embodiment of the present disclosure;
fig. 1b is a schematic view of a data processing method provided in an embodiment of the present application;
fig. 1c is a schematic view of a data processing method provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a data processing method according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
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:
Figure BDA0002147381310000111
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.

Claims (10)

1. A data processing method, comprising:
acquiring a target video for extracting a video thumbnail;
acquiring a key frame picture of the target video, extracting pixel points in the key frame picture according to step length information, storing the pixel points to a pixel point set, counting gray information of the pixel points contained in the pixel point set, and generating gray frequencies 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;
obtaining the image quality information of the key frame picture according to the gray frequency corresponding to each gray level and the gray level
Figure FDA0003211340490000011
Wherein, PiIs the gray frequency of the ith gray level, and the value range of i is [0, 255%]L is the maximum value of the gray level, L is 255;
and determining the key frame picture with the image quality information meeting the quality condition as the video thumbnail of the target video.
2. The method according to claim 1, wherein the obtaining of the target video for extracting the video thumbnail comprises:
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.
3. The method according to claim 2, wherein the obtaining the target video corresponding to the target address information according to the target address information in the message queue comprises:
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.
4. The method of claim 1, wherein the obtaining the key frame picture of the target video comprises:
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 the target video scene in the target video.
5. The method according to claim 1, wherein the taking the key frame picture whose image quality information satisfies 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.
6. The method of claim 5, further comprising:
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.
7. The method according to claim 6, 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 comprises:
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.
8. A data processing apparatus, characterized by comprising:
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, extracting pixel points in the key frame picture according to step length information, storing the pixel points to a pixel point set, counting gray information of the pixel points contained in the pixel point set, and generating 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;
the image quality generating unit is further configured to obtain the image quality information of the key frame picture according to the gray frequency and the gray level corresponding to each gray level
Figure FDA0003211340490000031
Wherein, PiIs the gray frequency of the ith gray level, and the value range of i is [0, 255%]L is the maximum value of the gray level, L is 255;
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.
9. A computer storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method according to any one of claims 1-7.
10. A data processing apparatus comprising a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the method of any of claims 1-7.
CN201910689334.7A2019-07-292019-07-29Data processing method and equipmentActiveCN110392306B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910689334.7ACN110392306B (en)2019-07-292019-07-29Data processing method and equipment

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910689334.7ACN110392306B (en)2019-07-292019-07-29Data processing method and equipment

Publications (2)

Publication NumberPublication Date
CN110392306A CN110392306A (en)2019-10-29
CN110392306Btrue CN110392306B (en)2021-11-05

Family

ID=68287861

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910689334.7AActiveCN110392306B (en)2019-07-292019-07-29Data processing method and equipment

Country Status (1)

CountryLink
CN (1)CN110392306B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111090778B (en)*2019-12-262023-06-27北京百度网讯科技有限公司 A method, device, equipment and storage medium for generating pictures
CN111083552A (en)*2019-12-302020-04-28上海闻泰信息技术有限公司Thumbnail generation method, device, equipment and medium
CN111901679A (en)*2020-08-102020-11-06广州繁星互娱信息科技有限公司Method and device for determining cover image, computer equipment and readable storage medium
CN113438475A (en)*2021-06-172021-09-24青岛海信传媒网络技术有限公司Thumbnail inspection method and display device
CN113556492B (en)*2021-07-092023-10-20深圳传音控股股份有限公司Thumbnail generation method, mobile terminal and readable storage medium
CN114071226B (en)*2022-01-142022-04-26飞狐信息技术(天津)有限公司Video preview graph generation method and device, storage medium and electronic equipment
CN114710707B (en)*2022-03-242024-10-22海信视像科技股份有限公司Display device and video thumbnail acquisition method

Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1538351A (en)*2003-04-012004-10-20Generating visually representative video thumbnails
CN103262096A (en)*2010-12-092013-08-21诺基亚公司Limited-context-ased identifying key frame from video sequence
CN106331786A (en)*2016-08-222017-01-11暴风集团股份有限公司Method and system for displaying playlist in image-text mode
CN106503693A (en)*2016-11-282017-03-15北京字节跳动科技有限公司The offer method and device of video front cover

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7612832B2 (en)*2005-03-292009-11-03Microsoft CorporationMethod and system for video clip compression
US7826657B2 (en)*2006-12-112010-11-02Yahoo! Inc.Automatically generating a content-based quality metric for digital images
CN107832724A (en)*2017-11-172018-03-23北京奇虎科技有限公司The method and device of personage's key frame is extracted from video file
CN108833938B (en)*2018-06-202021-05-28南京尚网网络科技有限公司Method and apparatus for selecting video covers
CN109996091A (en)*2019-03-282019-07-09苏州八叉树智能科技有限公司Generate method, apparatus, electronic equipment and the computer readable storage medium of video cover

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN1538351A (en)*2003-04-012004-10-20Generating visually representative video thumbnails
CN103262096A (en)*2010-12-092013-08-21诺基亚公司Limited-context-ased identifying key frame from video sequence
CN106331786A (en)*2016-08-222017-01-11暴风集团股份有限公司Method and system for displaying playlist in image-text mode
CN106503693A (en)*2016-11-282017-03-15北京字节跳动科技有限公司The offer method and device of video front cover

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于数字图像处理的自动调焦技术研究;刘雪超;《中国博士学位论文全文数据库 信息科技辑》;20140915;第62页4.3.4节*

Also Published As

Publication numberPublication date
CN110392306A (en)2019-10-29

Similar Documents

PublicationPublication DateTitle
CN110392306B (en)Data processing method and equipment
CN106911943B (en)Video display method and device and storage medium
KR101813196B1 (en)Method, device, program, and recording medium for video communication
CN110012217B (en)Method and device for determining acquisition resolution and electronic equipment
CN107682714B (en)Method and device for acquiring online video screenshot
CN105469381B (en)Information processing method and terminal
CN110392305A (en) Method for detecting video static picture, terminal and computer-readable storage medium
CN111093094A (en)Video transcoding method, device and system, electronic equipment and readable storage medium
CN111083496A (en) Data processing methods and related products
CN113839998A (en)Image data transmission method, device, equipment, storage medium and program product
CN113409199B (en)Image processing method, device, electronic equipment and computer readable medium
US9076207B1 (en)Image processing method, system and electronic device
CN115842915A (en)Video coding method and device
CN108924624B (en)Information processing method and device
CN106445353A (en)Display method and device of super-large pictures and electronic equipment
US11134180B2 (en)Detection method for static image of a video and terminal, and computer-readable storage medium
CN109710783B (en)Picture loading method and device, storage medium and server
CN115278278B (en)Page display method and device, electronic equipment and storage medium
CN112001842A (en)Picture generation method and device, electronic equipment and computer readable storage medium
CN113627363B (en)Video file processing method, device, equipment and storage medium
CN112788234A (en)Image processing method and related device
CN113766255A (en)Video stream merging method and device, electronic equipment and computer medium
CN112689158B (en) Method, device, apparatus and computer-readable medium for processing video
CN114286194B (en)Instant messaging video processing method and device, electronic equipment and storage medium
US20240013461A1 (en)Interactive Animation Generation

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp