video processing method and device

文档序号:1784936 发布日期:2019-12-06 浏览:11次 中文

阅读说明:本技术 视频处理方法及装置 (video processing method and device ) 是由 汪锦武 周海涛 于 2018-05-29 设计创作,主要内容包括:本公开涉及视频处理方法及装置,所述方法包括:对待处理视频的多个视频帧进行处理,确定多个视频帧中属于黑帧的目标视频帧以及目标视频帧出现的时刻;根据目标视频帧出现的时刻,确定待处理视频中的黑场出现的时间段;根据黑场出现的时间段,将待处理视频分割为多个第一视频片段。根据本公开的实施例的视频处理方法,通过确定视频帧中的黑帧来识别视频中的黑场,并根据黑场来分割视频,能够准确确定分割视频的时刻,且实现视频的自动分割,提升了视频的处理效率。(The present disclosure relates to a video processing method and apparatus, the method comprising: processing a plurality of video frames of a video to be processed, and determining a target video frame belonging to a black frame in the plurality of video frames and the moment when the target video frame appears; determining the time period of the black field in the video to be processed according to the time of the target video frame; and according to the time period of the black field, dividing the video to be processed into a plurality of first video segments. According to the video processing method, the black field in the video is identified by determining the black frame in the video frame, and the video is segmented according to the black field, so that the moment of segmenting the video can be accurately determined, the automatic segmentation of the video is realized, and the processing efficiency of the video is improved.)

1. A method of video processing, the method comprising:

Processing a plurality of video frames of a video to be processed, and determining a target video frame belonging to a black frame in the plurality of video frames and the moment when the target video frame appears;

Determining the time period of the black field in the video to be processed according to the time of the target video frame;

and according to the time period of the black field, dividing the video to be processed into a plurality of first video segments.

2. The method according to claim 1, wherein processing a plurality of video frames of a video to be processed, and determining a target video frame belonging to a black frame and a time when the target video frame appears in the plurality of video frames comprises:

determining a first number of pixel points with the chrominance being less than or equal to a chrominance threshold value and the luminance being less than or equal to a luminance threshold value from all pixel points of a first video frame, wherein the first video frame is any one of the plurality of video frames;

Determining a ratio between the first quantity and a second quantity of all pixel points in the first video frame;

Determining the first video frame as the target video frame if the ratio is greater than or equal to a ratio threshold.

3. The method of claim 1, wherein determining the time period of occurrence of the black field in the video to be processed according to the time of occurrence of the target video frame comprises:

Determining a time period of occurrence of a second video clip according to the time of occurrence of the target video frame, wherein the second video clip is a video clip formed by a plurality of continuous target video frames;

And if the frame number of the target video frame included in the second video segment is greater than or equal to the frame number threshold value, determining the second video segment as a black field, and determining the time period in which the second video segment appears as the time period in which the black field appears.

4. the method of claim 1, wherein segmenting the video to be processed into a plurality of first video segments according to the time period of occurrence of the black field comprises:

determining a segmentation moment for segmenting the video according to the time period of the black field;

and according to the segmentation moment, segmenting the video to be processed into a plurality of first video segments.

5. the method of claim 4, wherein determining the segmentation instants for segmenting the video according to the time period of black field occurrence comprises at least one of:

Taking the starting time of the video to be processed and the starting time of the time period in which the black field appears as the segmentation time;

Taking the end time of the time period when the black field appears and the end time of the video to be processed as the segmentation time;

and taking the end time of the time period in which the first black field appears and the start time of the time period in which the second black field appears as the dividing time, wherein the first black field and the second black field are two adjacent black fields, and the start time of the time period in which the second black field appears is after the end time of the time period in which the first black field appears.

6. a video processing apparatus, characterized in that the apparatus comprises:

the target video frame determining module is used for processing a plurality of video frames of a video to be processed and determining a target video frame belonging to a black frame in the plurality of video frames and the moment when the target video frame appears;

A black field time period determining module, configured to determine, according to a time when the target video frame appears, a time period when a black field appears in the video to be processed;

and the video segmentation module is used for segmenting the video to be processed into a plurality of first video segments according to the time period of occurrence of the black field.

7. The apparatus of claim 6, wherein the target video frame determination module comprises:

A first number determining submodule, configured to determine, from all pixel points of a first video frame, a first number of pixel points whose chroma is less than or equal to a chroma threshold and whose luma is less than or equal to a luma threshold, where the first video frame is any one of the plurality of video frames;

A ratio determination submodule for determining a ratio between the first number and a second number of all pixel points in the first video frame;

a target video frame determination sub-module for determining the first video frame as the target video frame if the ratio is greater than or equal to a ratio threshold.

8. the apparatus of claim 6, wherein the black field time period determination module comprises:

the time period determining submodule is used for determining a time period of a second video clip according to the time when the target video frame appears, wherein the second video clip is a video clip formed by a plurality of continuous target video frames;

And the black field time period determining submodule is used for determining the second video segment as a black field and determining the time period in which the second video segment appears as the time period in which the black field appears if the frame number of the target video frame included in the second video segment is greater than or equal to the frame number threshold.

9. The apparatus of claim 6, wherein the video segmentation module comprises:

The segmentation moment determining submodule is used for determining the segmentation moment for segmenting the video according to the time period of the black field;

and the video segmentation sub-module is used for segmenting the video to be processed into a plurality of first video segments according to the segmentation time.

10. The apparatus of claim 9, wherein the split time determination submodule comprises at least one of:

a first segmentation moment determining submodule, configured to use a start moment of the video to be processed and a start moment of a time period in which the black field appears as the segmentation moments;

A second segmentation time determination submodule, configured to use an end time of a time period in which the black field appears and an end time of the to-be-processed video as the segmentation time;

And the third division time determining submodule is used for taking the end time of the time period in which the first black field appears and the start time of the time period in which the second black field appears as the division time, wherein the first black field and the second black field are two adjacent black fields, and the start time of the time period in which the second black field appears is behind the end time of the time period in which the first black field appears.

11. a video processing apparatus, comprising:

A processor;

a memory for storing processor-executable instructions;

wherein the processor is configured to: performing the method of any one of claims 1 to 5.

12. a non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of any of claims 1 to 5.

Technical Field

The present disclosure relates to the field of computer technologies, and in particular, to a video processing method and apparatus.

background

in the related art, a long video is often required to be divided into a plurality of short video segments, and the video is usually divided by adopting an artificial clipping method. Therefore, the workload of the video editing person may be large, and the work efficiency may be low. Furthermore, the failure to accurately determine the video segmentation time may result in the erroneous segmentation of the coherent video into two or more segments, which may destroy the coherence of the original video.

Disclosure of Invention

in view of this, the present disclosure provides a video processing method and apparatus.

according to an aspect of the present disclosure, there is provided a video processing method, the method including:

Processing a plurality of video frames of a video to be processed, and determining a target video frame belonging to a black frame in the plurality of video frames and the moment when the target video frame appears;

determining the time period of the black field in the video to be processed according to the time of the target video frame;

And according to the time period of the black field, dividing the video to be processed into a plurality of first video segments.

in a possible implementation manner, processing a plurality of video frames of a video to be processed, and determining a target video frame belonging to a black frame and a time when the target video frame appears in the plurality of video frames includes:

determining a first number of pixel points with the chrominance being less than or equal to a chrominance threshold value and the luminance being less than or equal to a luminance threshold value from all pixel points of a first video frame, wherein the first video frame is any one of the plurality of video frames;

Determining a ratio between the first quantity and a second quantity of all pixel points in the first video frame;

determining the first video frame as the target video frame if the ratio is greater than or equal to a ratio threshold.

In a possible implementation manner, determining, according to a time instant when the target video frame appears, a time period when a black field in the video to be processed appears includes:

Determining a time period of occurrence of a second video clip according to the time of occurrence of the target video frame, wherein the second video clip is a video clip formed by a plurality of continuous target video frames;

And if the frame number of the target video frame included in the second video segment is greater than or equal to the frame number threshold value, determining the second video segment as a black field, and determining the time period in which the second video segment appears as the time period in which the black field appears.

In one possible implementation manner, dividing the video to be processed into a plurality of first video segments according to the time period of occurrence of the black field includes:

Determining a segmentation moment for segmenting the video according to the time period of the black field;

And according to the segmentation moment, segmenting the video to be processed into a plurality of first video segments.

in one possible implementation, determining the segmentation time for segmenting the video according to the time period of occurrence of the black field includes at least one of:

taking the starting time of the video to be processed and the starting time of the time period in which the black field appears as the segmentation time;

taking the end time of the time period when the black field appears and the end time of the video to be processed as the segmentation time;

and taking the end time of the time period in which the first black field appears and the start time of the time period in which the second black field appears as the dividing time, wherein the first black field and the second black field are two adjacent black fields, and the start time of the time period in which the second black field appears is after the end time of the time period in which the first black field appears.

according to another aspect of the present disclosure, there is provided a video processing apparatus, the apparatus including:

The target video frame determining module is used for processing a plurality of video frames of a video to be processed and determining a target video frame belonging to a black frame in the plurality of video frames and the moment when the target video frame appears;

a black field time period determining module, configured to determine, according to a time when the target video frame appears, a time period when a black field appears in the video to be processed;

and the video segmentation module is used for segmenting the video to be processed into a plurality of first video segments according to the time period of occurrence of the black field.

in one possible implementation, the target video frame determination module includes:

A first number determining submodule, configured to determine, from all pixel points of a first video frame, a first number of pixel points whose chroma is less than or equal to a chroma threshold and whose luma is less than or equal to a luma threshold, where the first video frame is any one of the plurality of video frames;

A ratio determination submodule for determining a ratio between the first number and a second number of all pixel points in the first video frame;

a target video frame determination sub-module for determining the first video frame as the target video frame if the ratio is greater than or equal to a ratio threshold.

In one possible implementation, the black field time period determination module includes:

the time period determining submodule is used for determining a time period of a second video clip according to the time when the target video frame appears, wherein the second video clip is a video clip formed by a plurality of continuous target video frames;

And the black field time period determining submodule is used for determining the second video segment as a black field and determining the time period in which the second video segment appears as the time period in which the black field appears if the frame number of the target video frame included in the second video segment is greater than or equal to the frame number threshold.

in one possible implementation, the video segmentation module includes:

the segmentation moment determining submodule is used for determining the segmentation moment for segmenting the video according to the time period of the black field;

and the video segmentation sub-module is used for segmenting the video to be processed into a plurality of first video segments according to the segmentation time.

in one possible implementation, the segmentation time determination sub-module includes at least one of the following sub-modules:

A first segmentation moment determining submodule, configured to use a start moment of the video to be processed and a start moment of a time period in which the black field appears as the segmentation moments;

A second segmentation time determination submodule, configured to use an end time of a time period in which the black field appears and an end time of the to-be-processed video as the segmentation time;

and the third division time determining submodule is used for taking the end time of the time period in which the first black field appears and the start time of the time period in which the second black field appears as the division time, wherein the first black field and the second black field are two adjacent black fields, and the start time of the time period in which the second black field appears is behind the end time of the time period in which the first black field appears.

according to another aspect of the present disclosure, there is provided a video processing apparatus including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the above method.

according to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the above-described method.

according to the video processing method and device, the black field in the video is identified by determining the black frame in the video frame, and the video is segmented according to the black field, so that the moment of segmenting the video can be accurately determined, the automatic segmentation of the video is realized, and the video processing efficiency is improved.

other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.

Drawings

the accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

Fig. 1 shows a flow diagram of a video processing method according to an embodiment of the present disclosure;

fig. 2 shows a flowchart of step S11 of a video processing method according to an embodiment of the present disclosure;

Fig. 3 shows a flowchart of step S12 of a video processing method according to an embodiment of the present disclosure;

Fig. 4 shows a flowchart of step S13 of a video processing method according to an embodiment of the present disclosure;

FIG. 5 shows a schematic diagram of a playback timeline of a pending video according to an embodiment of the present disclosure;

fig. 6 shows an application diagram of a video processing method according to an embodiment of the present disclosure;

FIG. 7 shows a schematic diagram of a video processing apparatus according to an embodiment of the present disclosure;

FIG. 8 shows a schematic diagram of a video processing apparatus according to an embodiment of the present disclosure;

FIG. 9 shows a block diagram of an apparatus for video processing according to an example embodiment;

Fig. 10 shows a block diagram of an apparatus for video processing according to an example embodiment.

Detailed Description

various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.

The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.

Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.

Fig. 1 shows a flow diagram of a video processing method according to an embodiment of the present disclosure. As shown in fig. 1, the method comprises the steps of:

In step S11, processing a plurality of video frames of a video to be processed, and determining a target video frame belonging to a black frame and a time when the target video frame appears in the plurality of video frames;

In step S12, determining a time period of occurrence of a black field in the video to be processed according to the time of occurrence of the target video frame;

in step S13, the video to be processed is divided into a plurality of first video segments according to the time period of occurrence of the black field.

according to the video processing method, the black field in the video is identified by determining the black frame in the video frame, and the video is segmented according to the black field, so that the moment of segmenting the video can be accurately determined, the automatic segmentation of the video is realized, and the processing efficiency of the video is improved.

in one possible implementation manner, in step S11, the video to be processed may include a plurality of video frames, the plurality of video frames of the video to be processed may be processed, a target video frame belonging to a black frame in the plurality of video frames is determined, and the time when the target video frame appears is determined according to a timestamp or a frame number of the target video frame.

Fig. 2 shows a flowchart of step S11 of a video processing method according to an embodiment of the present disclosure. As shown in fig. 2, step S11 may include the following steps:

In step S111, determining a first number of pixels having a chromaticity less than or equal to a chromaticity threshold and a luminance less than or equal to a luminance threshold from all pixels of a first video frame, where the first video frame is any one of the plurality of video frames;

In step S112, determining a ratio between the first number and a second number of all pixel points in the first video frame;

In step S113, if the ratio is greater than or equal to a ratio threshold, the first video frame is determined as the target video frame.

in a possible implementation manner, in step S111, for any one video frame (first video frame) of a plurality of video frames of a video to be processed, the chroma and the luminance of all pixel points of the first video frame may be determined, and in all pixel points, a first number of pixel points whose chroma is less than or equal to a chroma threshold and whose luminance is less than or equal to a luminance threshold is determined. The chrominance threshold value may be set to a chrominance value near black, and the luminance threshold value may be set to a luminance value near 0 in luminance. By this step, a first number of pixels in the first video frame having a hue and a brightness that are both near black can be determined. The present disclosure does not limit the specific values of the chroma threshold and the luminance threshold.

In one possible implementation, in step S112, a ratio between the first number and the second number of all the pixels of the first video frame may be calculated. For example, in a video frame with a resolution of 1024 × 768, there are 786432 pixels, and thus, the second number is 786432. If the first number is 700000, the ratio is 0.89.

In one possible implementation manner, in step S113, if the ratio is greater than or equal to the ratio threshold, it may be determined that the first video frame belongs to a black frame, i.e., it may be determined that the first video frame is the target video frame. The ratio threshold may be set to a value close to 1 (e.g., 0.8-1), such as 0.9, 0.95, or 0.99, etc. If the ratio is greater than or equal to the ratio threshold, the first video frame may be considered to belong to a black frame, i.e., the first video frame is a target video frame. In an example, all target video frames belonging to the black frame can be determined in all video frames, and the time when the target video frame appears can be determined according to the time stamp or the frame number of the video frame.

By determining the ratio of the first number of the pixel points with the chrominance threshold value and the luminance less than or equal to the luminance threshold value to the second number of all the pixel points in the video frame, the black frame in all the video frames can be accurately judged, and errors caused by manual judgment can be avoided.

In one possible implementation manner, in step S12, the black field in the video to be processed may be identified according to the target video frame, and the time period for the black field to occur may be determined according to the time when the target video frame occurs.

Fig. 3 shows a flowchart of step S12 of a video processing method according to an embodiment of the present disclosure. As shown in fig. 3, step S12 may include the following steps:

In step S121, determining a time period of occurrence of a second video segment according to a time when the target video frame occurs, where the second video segment is a video segment formed by a plurality of continuous target video frames;

in step S122, if the number of frames of the target video frame included in the second video segment is greater than or equal to the frame number threshold, the second video segment is determined as a black field, and the period of time during which the second video segment occurs is determined as the period of time during which the black field occurs.

In a possible implementation manner, in step S121, a time period in which a second video segment composed of a plurality of consecutive target video frames appears may be determined according to a time at which the target video frame appears, and in this time period, all video frames are the target video frames, that is, all video frames in this time period are black frames.

In one possible implementation, the black field is a video segment consisting of a consecutive plurality of black frames. In step S122, if the number of frames of the target video frame included in the second video segment is greater than or equal to the frame number threshold, the second video segment is determined to be a black field. In an example, the second video segment is a video segment composed of a plurality of continuous black frames, and if the second video segment includes black frames with a frame number greater than or equal to a frame number threshold (the frame number threshold is, for example, 10-30 frames), the second video segment may appear as a black field when the video to be processed is played, and the scenario of the video is usually transited or converted when the black field is played. In an example, the time of the black field may be set to 0.5 seconds, which may cause a visual reaction of a viewer of the video, and the video frame rate at which the video is played is 30 frames/second, and thus, the frame number threshold may be set to 15 frames. When the target video frames continuously appear for more than 15 frames, the second video segment formed by the continuous target video frames is determined as a black field, and the time period for which the target video frames appear is determined as the time period for which the black field appears. The present disclosure does not limit the specific value of the frame number threshold.

In one possible implementation manner, in step S13, the to-be-processed video may be divided into a plurality of first video segments according to the time period of occurrence of the black field.

Fig. 4 shows a flowchart of step S13 of a video processing method according to an embodiment of the present disclosure. As shown in fig. 3, step S13 may include the following steps:

In step S131, a division timing for dividing the video is determined according to the period of time during which the black field occurs;

In step S132, the video to be processed is divided into a plurality of first video segments according to the dividing time.

in one possible implementation manner, in step S131, according to the timestamp or frame number of the target video frame, the time when the target video frame occurs can be determined, so as to determine the time period when the black field occurs. The first target video frame of the black field appears at the beginning of the period of the black field, and the last target video frame of the black field appears at the end of the period of the black field. The dividing time for dividing the video to be processed can be determined according to the starting time and the ending time of the time period in which the black field appears and the starting time and the ending time of the video to be processed.

in one possible implementation, determining the segmentation time for segmenting the video according to the time period of occurrence of the black field includes at least one of:

taking the starting time of the video to be processed and the starting time of the time period in which the black field appears as the segmentation time;

taking the end time of the time period when the black field appears and the end time of the video to be processed as the segmentation time;

And taking the end time of the time period in which the first black field appears and the start time of the time period in which the second black field appears as the dividing time, wherein the first black field and the second black field are two adjacent black fields, and the start time of the time period in which the second black field appears is after the end time of the time period in which the first black field appears.

In one possible implementation manner, in step S132, the video to be processed may be divided into a plurality of first video segments according to the dividing time. In an example, FFMPEG can be used to segment the video to be processed.

Fig. 5 shows a schematic diagram of a playback timeline of a to-be-processed video according to an embodiment of the present disclosure. As shown in fig. 5, the start time of the to-be-processed video is t1, the end time of the to-be-processed video is t2, the start time of the period in which the first black field appears is t3, the end time of the period in which the first black field appears is t4, the start time of the period in which the second black field appears is t5, and the end time of the period in which the second black field appears is t 6.

In one possible implementation manner, t1 and t3 may be used as the split time, and the video to be processed may be split into a first video segment with the playing time of t1-t3 and a first video segment with the playing time of t3-t 2.

In one possible implementation manner, t6 and t2 may be used as the split time, and the video to be processed may be split into a first video segment with the playing time of t1-t6 and a first video segment with the playing time of t6-t 2.

In one possible implementation manner, t4 and t5 may be taken as the split time, and the video to be processed may be split into a first video segment with the playing time of t1-t4, a first video segment with the playing time of t4-t5, and a first video segment with the playing time of t5-t 2.

in one possible implementation manner, t1, t3, t6 and t2 may be taken as the dividing time, and the video to be processed may be divided into a first video segment with playing time t1-t3, a first video segment with playing time t3-t6 and a first video segment with playing time t6-t 2.

In one possible implementation manner, t1, t3, t4 and t5 may be taken as the dividing time, and the video to be processed may be divided into a first video segment with playing time t1-t3, a first video segment with playing time t3-t4, a first video segment with playing time t4-t5 and a first video segment with playing time t5-t 2.

In one possible implementation manner, t4, t5, t6 and t2 may be taken as the dividing time, and the video to be processed may be divided into a first video segment with playing time t1-t4, a first video segment with playing time t4-t5, a first video segment with playing time t5-t6 and a first video segment with playing time t6-t 2.

In one possible implementation manner, t1, t3, t4, t5, t6 and t2 may be taken as the dividing time, and the video to be processed may be divided into a first video segment with playing time t1-t3, a first video segment with playing time t3-t4, a first video segment with playing time t4-t5, a first video segment with playing time t5-t6 and a first video segment with playing time t6-t 2. According to the segmentation mode, all video segments which are not black fields in the video to be processed can be segmented, and all black fields can be segmented.

In a possible implementation manner, the method may further process the plurality of divided first video segments, for example, at least one of format conversion, compression, encoding and decoding may be performed, or the video may be packaged or specially processed. The present disclosure does not limit the processing method.

in one possible implementation, the method may further upload the plurality of first video segments or the processed first video segments to an online storage space, for example, to a media repository through a server.

according to the video processing method, the ratio of the first number of the pixel points with the chrominance threshold value and the luminance less than or equal to the luminance threshold value to the second number of all the pixel points in the video frame is determined, the black frame in the video frame is determined, and errors caused by manual judgment can be avoided. And the black field in the video is identified through the black frame, so that the video can be segmented according to the black field, the moment of segmenting the video can be accurately determined, the automatic segmentation of the video is realized, and the processing efficiency of the video is improved.

Fig. 6 shows an application diagram of a video processing method according to an embodiment of the present disclosure. As shown in fig. 6, the method can be applied to a terminal 61.

in one possible implementation, the terminal 61 may download the video 63 to be processed through the server 62, and determine a target video frame belonging to a black frame and a time instant at which the target video frame appears, from among a plurality of video frames of the video 63 to be processed.

In one possible implementation, the terminal 61 may determine, in the video to be processed, a second video segment composed of a plurality of consecutive target video frames, determine, as a black field, the second video segment having a frame number greater than or equal to a frame number threshold, and determine a time period during which the black field occurs.

In one possible implementation, the terminal 61 may determine the division time according to the time period in which the black field occurs. For example, the segmentation instants may be determined in at least one of the following ways: the starting time of the video to be processed and the starting time of the period in which the black field appears are taken as dividing times, the ending time of the period in which the black field appears and the ending time of the video to be processed are taken as dividing times, and the ending time of the period in which the first black field appears and the starting time of the period in which the second black field appears are taken as dividing times. The terminal 61 may divide the video to be processed into a plurality of first video segments according to the dividing time.

In one possible implementation, the terminal 61 may perform at least one of format conversion, compression, encoding, and decoding on the plurality of first video segments, or perform packaging or special effect on the video, and upload the processed first video segments 64 to the media repository through the server 62.

In one possible implementation, the video processing method may also be performed by the server 62. The present disclosure does not limit an apparatus for performing the video processing method.

Fig. 7 shows a schematic diagram of a video processing apparatus according to an embodiment of the present disclosure. As shown in fig. 7, the apparatus includes:

a target video frame determining module 71, configured to process a plurality of video frames of a video to be processed, and determine a target video frame belonging to a black frame in the plurality of video frames and a time when the target video frame appears;

a black field time period determining module 72, configured to determine, according to the time when the target video frame appears, a time period when a black field appears in the video to be processed;

and a video segmentation module 73, configured to segment the to-be-processed video into a plurality of first video segments according to the time period in which the black field occurs.

Fig. 8 shows a schematic diagram of a video processing apparatus according to an embodiment of the present disclosure. As shown in fig. 8, the target video frame determination module 71 includes:

A first number determining submodule 711, configured to determine, from all pixel points of a first video frame, a first number of pixel points whose chroma is less than or equal to a chroma threshold and whose luminance is less than or equal to a luminance threshold, where the first video frame is any one of the plurality of video frames;

a ratio determining submodule 712, configured to determine a ratio between the first number and a second number of all pixel points in the first video frame;

A target video frame determination sub-module 713, configured to determine the first video frame as the target video frame if the ratio is greater than or equal to a ratio threshold.

in one possible implementation, the black field period determination module 72 includes:

the time period determining submodule 721 is configured to determine, according to a time when the target video frame appears, a time period when a second video segment appears, where the second video segment is a video segment formed by a plurality of continuous target video frames;

the black field time period determining submodule 722 is configured to determine the second video segment as a black field and determine the time period in which the second video segment occurs as the time period in which the black field occurs, if the frame number of the target video frame included in the second video segment is greater than or equal to the frame number threshold.

in one possible implementation, the video segmentation module 73 includes:

A division time determination submodule 731 configured to determine a division time for dividing the video according to a time period in which the black field occurs;

The video segmentation sub-module 732 is configured to segment the to-be-processed video into a plurality of first video segments according to the segmentation time.

In one possible implementation, the segmentation time determination submodule 731 may include at least one of the following submodules:

a first segmentation moment determining submodule, configured to use a start moment of the video to be processed and a start moment of a time period in which the black field appears as the segmentation moments;

A second segmentation time determination submodule, configured to use an end time of a time period in which the black field appears and an end time of the to-be-processed video as the segmentation time;

And the third division time determining submodule is used for taking the end time of the time period in which the first black field appears and the start time of the time period in which the second black field appears as the division time, wherein the first black field and the second black field are two adjacent black fields, and the start time of the time period in which the second black field appears is behind the end time of the time period in which the first black field appears.

fig. 9 is a block diagram illustrating an apparatus 800 for video processing according to an example embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.

referring to fig. 9, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.

The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.

The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.

power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.

The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

the audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.

the I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.

The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed status of the device 800, the relative positioning of components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration/deceleration of the device 800, and a change in the temperature of the device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.

In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.

in an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the device 800 to perform the above-described methods.

Fig. 10 is a block diagram illustrating an apparatus 1900 for video processing according to an example embodiment. For example, the apparatus 1900 may be provided as a server. Referring to FIG. 10, the device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by the processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.

the device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input/output (I/O) interface 1958. The device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.

In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the apparatus 1900 to perform the above-described methods.

the present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.

the computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.

the computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.

the computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).

various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.

These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.

The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.

the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.

Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于媒体文件转换的播放控制方法、装置及存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类