WO2022105341A1 - Video data processing method and apparatus, computer storage medium, and electronic device - Google Patents

Video data processing method and apparatus, computer storage medium, and electronic device Download PDF

Info

Publication number
WO2022105341A1
WO2022105341A1 PCT/CN2021/114602 CN2021114602W WO2022105341A1 WO 2022105341 A1 WO2022105341 A1 WO 2022105341A1 CN 2021114602 W CN2021114602 W CN 2021114602W WO 2022105341 A1 WO2022105341 A1 WO 2022105341A1
Authority
WO
WIPO (PCT)
Prior art keywords
video frame
window
message
target
message pop
Prior art date
Application number
PCT/CN2021/114602
Other languages
French (fr)
Chinese (zh)
Inventor
汤晓
Original Assignee
北京达佳互联信息技术有限公司
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 北京达佳互联信息技术有限公司 filed Critical 北京达佳互联信息技术有限公司
Publication of WO2022105341A1 publication Critical patent/WO2022105341A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/435Processing of additional data, e.g. decrypting of additional data, reconstructing software from modules extracted from the transport stream

Definitions

  • the present disclosure relates to the field of video technology, and in particular, to a method and device for processing video data.
  • Screen recording is a common function on various terminal devices. After the screen recording function is enabled on a terminal device, the screen recording program will record the screen of the terminal device in real time, thereby obtaining a screen recording video.
  • the screen recording video can be played locally or provided to other terminal devices in the network. play.
  • the screen recording program when the screen recording program starts to record the screen of the terminal device, it will disable the message push service of the terminal device, so as to avoid the message pop-up window with the user's private information appearing in the recorded video.
  • the present disclosure provides a video data processing method and device.
  • the technical solutions of the present disclosure are as follows:
  • a method for processing video data comprising: searching for a target video frame in video data, wherein the video data is video data obtained by recording a screen of a target device; the target video The frame contains a message pop-up window; in response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame; process the area where the message pop-up window is located in the target video frame , to obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the replacement video frame is used to replace the target video frame.
  • the method further includes: monitoring the message push service of the target device in real time, and obtaining the push time of the message to be pushed of the message push service; wherein, the target device is a host in a webcast system The device; wherein the searching for the target video frame in the video data includes: searching for the target video frame from the video frames included in the video data and located within a preset time period after the push moment of the message to be pushed.
  • the method further includes: detecting a message prompt sound corresponding to a message pop-up window in the audio track of the video data; wherein, the searching for a target video frame in the video data includes: extracting from the video In the data, intercept a plurality of video frames within a preset duration before the appearance of the message prompt sound, and multiple video frames within a preset period after the appearance of the message prompt sound; Find the target video frame among the plurality of video frames.
  • the processing the area where the message pop-up window is located in the target video frame to obtain the replacement video frame includes: cutting the message pop-up window from the target video frame to obtain the replacement video frame.
  • the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes: performing a blurring process on pixels in the area where the message pop-up window is located to obtain a replacement video frame.
  • the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes: determining the size of the area where the message pop-up window is located; generating a size equal to that of the message pop-up window.
  • the method further includes: acquiring a user's selection instruction; determining the candidate image template selected by the selection instruction among the preset multiple candidate image templates as the target image template;
  • the multiple candidate image templates including multiple candidate mosaic styles and multiple preset images; wherein the generating an occlusion image with a size consistent with the size of the area where the message pop-up window is located includes: according to the A target image template to generate an occlusion image whose size is consistent with the size of the area where the message pop-up window is located.
  • the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located includes: reading, from the video data, a previous frame of the target video frame that does not include the message pop-up window. A video frame; intercepting an image located in the same area as the message pop-up window in the previous video frame that does not contain the message pop-up window to obtain an occlusion image.
  • an apparatus for processing video data comprising: a searching unit configured to perform searching for a target video frame in video data, wherein the video data is obtained by recording a screen of a target device video data; the target video frame contains a message pop-up window; a determining unit is configured to perform a search in the video data to obtain the target video frame, and determine the area where the message pop-up window is located in the target video frame; processing a unit, configured to process the area where the message pop-up window is located in the target video frame to obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the The replacement video frame is used to replace the target video frame.
  • the apparatus further includes: a monitoring unit configured to perform real-time monitoring of the message push service of the target device, and obtain the push time of the message to be pushed of the message push service; wherein the target device is An anchor device in a network live broadcast system; wherein the search unit is configured to perform: search for the target video from a video frame included in the video data and located within a preset time period after the push moment of the message to be pushed frame.
  • the apparatus further includes: a detection unit configured to detect a message prompt corresponding to a message pop-up window in the audio track of the video data; wherein the search unit searches the video data for a target video frame, the specific execution is: from the video data, intercepting a plurality of video frames within a preset time period before the appearance time of the message prompt sound and a preset time period after the appearance time of the message prompt sound multiple video frames in the video frame; find the target video frame in the multiple video frames obtained through interception.
  • a detection unit configured to detect a message prompt corresponding to a message pop-up window in the audio track of the video data
  • the search unit searches the video data for a target video frame, the specific execution is: from the video data, intercepting a plurality of video frames within a preset time period before the appearance time of the message prompt sound and a preset time period after the appearance time of the message prompt sound multiple video frames in the video frame; find the target video frame in the multiple video frames obtained through interception.
  • the processing unit is configured to perform: cutting the message pop-up window from the target video frame when obtaining a replacement video frame by processing the area where the message pop-up window is located in the target video frame. , to get the replacement video frame.
  • the processing unit processes the area where the message pop-up window is located in the target video frame, and when a replacement video frame is obtained, the processing unit is configured to perform: blurring the pixels in the area where the message pop-up window is located. Process to get the replacement video frame.
  • the processing unit includes: a size determination unit configured to perform determination of the size of the area where the message pop-up window is located; an occlusion image with the same size; the adding unit is configured to add the generated occlusion image in the area where the message pop-up window is located to obtain a replacement video frame.
  • the processing unit further includes: a template determination unit configured to perform: acquiring a user's selection instruction; selecting the candidate image template selected by the selection instruction from the preset multiple candidate image templates; It is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images; wherein, the generating unit generates a size equal to the area where the message pop-up window is located.
  • a template determination unit configured to perform: acquiring a user's selection instruction; selecting the candidate image template selected by the selection instruction from the preset multiple candidate image templates; It is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images; wherein, the generating unit generates a size equal to the area where the message pop-up window is located.
  • the generating unit when the generating unit generates an occlusion image whose size is consistent with the size of the area where the message pop-up window is located, it is configured to perform reading from the video data that the previous one of the target video frame does not contain the target video frame.
  • the video frame of the message pop-up window is intercepted; the image located in the same area as the message pop-up window in the previous video frame that does not contain the message pop-up window is intercepted to obtain an occlusion image.
  • an electronic device comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the following steps: Find the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window; the target video is obtained in response to the search in the video data frame, determine the area where the message pop-up window is located in the target video frame; process the area where the message pop-up window is located in the target video frame to obtain a replacement video frame, so that the replacement video frame does not contain the message The text in the pop-up window; wherein, the replacement video frame is used to replace the target video frame.
  • a storage medium is provided, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the video data provided by any one of the embodiments of the present disclosure processing method.
  • a computer program product is provided, which, when executed, is used to implement any one of the video data processing methods provided by the embodiments of the present disclosure.
  • this solution can prevent the text of the message pop-up window recorded during the screen recording process from being seen by the user watching the video. Users can not only protect their privacy during video recording, but also browse messages through the message push service normally.
  • FIG. 1 is a schematic diagram of a recording and transmission process of video data according to an exemplary embodiment
  • FIG. 2 is a flowchart of a method for processing video data according to an exemplary embodiment
  • FIG. 3 is a schematic diagram of a target video frame and a replacement video frame according to an exemplary embodiment
  • FIG. 4 is a schematic diagram of a method for finding a target video frame in video data according to an exemplary embodiment
  • FIG. 5 is a flowchart of another method for processing video data according to an exemplary embodiment
  • FIG. 6 is a flow chart of yet another method for processing video data according to an exemplary embodiment
  • FIG. 7 is a schematic diagram of a mosaic image added in a region where a message pop-up window is located, according to an exemplary embodiment
  • FIG. 8 is a schematic diagram of adding a captured image in a region where a message pop-up window is located, according to an exemplary embodiment
  • FIG. 9 is a schematic diagram of intercepting an occlusion image from a previous video frame that does not contain a message pop-up window, according to an exemplary embodiment
  • FIG. 10 is a schematic diagram of cutting a message pop-up window from a target video frame according to an exemplary embodiment
  • 11 is a schematic diagram of blurring the area where the message pop-up window of the target video frame is located according to an exemplary embodiment
  • FIG. 12 is a schematic structural diagram of an apparatus for processing video data according to an exemplary embodiment
  • FIG. 13 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
  • Screen recording refers to using a screen recording program to record the display screen of the first terminal in real time during the operation of the first terminal, and a video obtained in this way is called a screen recording video.
  • the first terminal refers to the terminal device to which the screen recorded in the screen recording video belongs, and the first terminal may be an electronic device such as a smart phone, a tablet computer, and a desktop computer.
  • the screen recording program is a program running on the first terminal, and the screen recording program may be a program on the first terminal specially used for screen recording, or may be a subprogram integrated in other programs.
  • FIG. 1 For the recording and transmission process of the screen recording video, reference may be made to FIG. 1 .
  • Each unit in FIG. 1 is used to refer to a computer program installed on a corresponding electronic device and used to implement corresponding functions.
  • the screen recording unit starts to record the screen of the first terminal in real time, and then records the obtained screen
  • the screen recording video is sent to the server via the Internet through the communication unit of the first terminal.
  • the server then sends the screen-recorded video sent by the first terminal to one or more second terminals that need to watch the screen-recorded video through the Internet
  • the second terminal is used to refer to an electronic device that plays the screen-recorded video
  • the second terminal is used to refer to the electronic device that plays the screen-recorded video.
  • the terminal and the first terminal may be electronic devices of the same type or different types), and the playback unit of the second terminal plays the screen-recorded video to users who watch the screen-recorded video (hereinafter referred to as video viewers).
  • the screen recording unit may record the sound played by the first terminal in real time while recording the screen of the first terminal, so as to obtain an audio track synchronized with the screen of the screen recording video.
  • the first terminal, the server and the second terminal may all cache the screen recording video in a local storage unit.
  • the playback of the screen recording video can be in any form of live broadcast and on-demand, or both forms can be used at the same time.
  • the first terminal will send the video data to the server in real time while recording the screen recording video, and at the same time, the server will forward the video data received by itself to the first terminal in real time.
  • the second terminal enables the second terminal to play the screen recording video in real time. Equivalently, every time the screen recording program of the first terminal obtains a video frame, it sends the video frame to the server, and then the server immediately forwards the newly received video frame to the second terminal, and the playback unit of the second terminal immediately forwards the video frame to the second terminal. Play on the display screen of the second terminal.
  • the first terminal can send the screen recording video in real time during the screen recording process, or can send the complete screen recording video to the server at one time after the screen recording, and the server will send the screen recording video to the server.
  • the complete screen recording video provided by the first terminal is stored in its own storage unit.
  • the server sends the screen recording video to the second terminal for playback by the second terminal.
  • the second terminal may first cache the screen-recording video, and then play the video after a period of time.
  • Screen recording video can be used in various fields such as games and online teaching.
  • a video author installs a screen recording program (equivalent to the screen recording unit in Figure 1) on his mobile phone (ie, the first terminal).
  • the screen recording program switches to the background. run, and start recording the screen of the first terminal.
  • the video author can start playing mobile games on the mobile phone. Therefore, the screen recording program can record the game screen on the screen of the first terminal to obtain the game video, which is then passed by the server. Real-time or non-real-time way to forward game video to video viewers interested in this mobile game.
  • the video author can also display teaching materials, such as courseware, e-books, etc., on the screen of the first terminal after the screen recording starts, so that the screen recording program can record a teaching video, which can be forwarded to the peer through the server.
  • teaching materials such as courseware, e-books, etc.
  • an embodiment of the present disclosure provides a method for processing screen recording video, please refer to FIG. 2 , the method may include The following steps:
  • the target video frame is used to refer to the video frame containing the message pop-up window. That is to say, when step S21 is performed, each video frame in the screen recording video can be detected one by one, and whenever a video frame is detected to contain a message pop-up window, the video frame is determined as the target video frame.
  • the above video data is video data obtained by recording the screen of the target device, and the target device is equivalent to the first terminal described above.
  • the obtained complete screen recording video can be processed to obtain the processed video.
  • the recorded video stream can also be processed in real time during the screen recording process to obtain the processed video stream.
  • the processed video stream can be played to the video viewers in real time, or stored in the corresponding in computer storage media. That is to say, the video data in step S21 may be a complete screen recording video, or may be a video stream generated during the recording process.
  • a buffer area can be set in the storage space of the electronic device executing the video data processing solution of the present disclosure, and the buffer area can be written in a recent period of time (eg, within the last 10 seconds) in real time.
  • the recorded video stream is written into the buffer area (equivalent to writing the video frames recorded in the last 10 seconds into the buffer area), and the program executing the video data processing solution of the present disclosure can read the data in the video stream one by one from the buffer area. For each video frame, it is determined whether each read video frame is a target video frame, and if it is a target video frame, the solution provided by the present disclosure is applied for processing.
  • the message push service of the first terminal may push a message pop-up window with the personal information of the video author on the screen of the first terminal, and the message pop-up window is recorded in the video data and viewed by the video viewers After that, the privacy of the video author will be leaked.
  • the message pop-up window contains the following message: "Your courier has been placed at the property of XX community, please go to pick it up in time”, if the message pop-up window is recorded in In the video data and seen by the video viewer, the residential address of the video author will be leaked.
  • the purpose of the processing method provided by the present disclosure is to find out the video frame containing the message pop-up window in the video data, and then "code" the area where the message pop-up window is located through the subsequent steps, so that the video data can be played during playback.
  • the message pop-up window on the screen is invisible to video viewers, so as to protect the privacy of video authors.
  • the "coding” here is not limited to adding mosaics in the area where the message pop-up window is located, but is used to refer to any image processing including adding mosaics that can prevent the text in the message pop-up window from being displayed in the replacement video frame. method.
  • the message pop-up window in the video data is coded, even if a message pop-up window containing privacy information is recorded from the screen of the first terminal during the recording of the video data, the message pop-up window will be displayed when the video data is being played. The information contained in the video will not be seen by the video viewer, so the video author can normally use the message push service of the first terminal during the screen recording process.
  • the target video frame found in step S21 includes, each of the video data contains a complete or partial message pop-up window. window video frame.
  • step S22 the position of the message pop-up window in the target video frame can be determined, so that an occlusion image can be added to the position in a subsequent step.
  • S23 Process the area where the message pop-up window is located in the target video frame to obtain a replacement video frame.
  • the replacement video frame does not display (or does not contain) the text in the message pop-up window, and the replacement video frame is used to replace the corresponding target video frame in the screen recording video.
  • the image processing method preset in step S23 can be any image processing method that can make the replacement video frame not display the text in the message pop-up window.
  • the image processing method in step S23 can be the following three kinds of images Either of the processing methods:
  • the area where the message pop-up window is located is blurred.
  • Figure 3 is a schematic diagram of adding an occlusion image.
  • the video viewer in the original target video frame, the video viewer can see the message pop-up window and its specific message in the screen, and in the replacement video frame with the occlusion image added , the message pop-up window is covered by the added occlusion image, and the video viewer will naturally not be able to see the message pop-up window and its specific message, thus avoiding the privacy leakage of the video author.
  • the above-mentioned occlusion image may be a mosaic image obtained after filling the area where the message pop-up window is located with repeated mosaic patterns using a specific mosaic style, or it may be a part of other complete images that does not contain the message pop-up window. image.
  • processing methods provided by the embodiments of the present disclosure may be executed by any one of the first terminal, the server, and the second terminal as shown in FIG. 1 , that is, the processing methods provided by the present disclosure
  • the execution body of the method may be the first terminal that records the video, the server that forwards the video, or the second terminal that plays the video.
  • the processing method provided by the present disclosure can be executed by the first terminal on the video stream in real time during the process of recording video data, or can be executed on the entire screen recording video after the recording ends, and the processed data can be obtained.
  • the first terminal sends the replacement video frame to the server to replace the original target video frame to be sent.
  • the method may be executed by a screen recording program of the first terminal.
  • the server can execute the processing method provided by the present disclosure before sending the video data to the second terminal.
  • the processing method provided by the present disclosure can be executed in real time while receiving the video stream, or it can be executed after receiving the video stream.
  • the processing method provided by the present disclosure is performed on the entire screen recording video, and after obtaining the processed image frame, the server sends the replacement video frame to the second terminal to replace the original target video frame to be forwarded.
  • the method can be executed by a video processing program in the server.
  • the second terminal can execute the method provided by the present disclosure before playing the video data received by the second terminal, and specifically can execute the processing method provided by the present disclosure in real time while receiving the video stream and play the video data in real time.
  • the processing method provided in this disclosure it is also possible to perform the processing method provided in this disclosure on the entire screen-recording video after receiving the complete screen-recording video. After each target video frame is replaced with the corresponding replacement video frame, the processed screen recording video is played.
  • the method may be executed by a video playing program used for playing video data in the second terminal.
  • the video author can set on the first terminal whether to apply the processing method provided by the present disclosure to process video data before starting screen recording. If the video author selects the option of not coding before the screen recording starts, the first terminal, the server and the second terminal may not execute the processing method provided by the present disclosure, but directly send or play the video data.
  • the processing method provided by the present disclosure can identify the target video frame containing the message pop-up window in the video data before the video data is played by the second terminal, and then process the area where the message pop-up window of the target video frame is located to obtain
  • the replacement video frame does not contain the text in the message pop-up window, and the replacement video frame is used to replace the target video frame of the original video, so that after the video data is played, the video viewers will not see the message content displayed in the message pop-up window when watching.
  • information concerning the privacy of the video author that may appear in the message pop-up window is prevented from being leaked to the video viewers.
  • the processing method provided by the present disclosure directly processes the recorded video frames, without involving restrictions on the screen of the first terminal and the message push service, and the video author can use the first terminal normally during the video recording process.
  • the message push service is provided, and the message content in the message pop-up window is browsed on the screen of the first terminal, and the message pop-up window in the target video frame recorded during the display of the message pop-up window can be performed by the processing method provided by the present disclosure. add mosaic. Therefore, while the processing method provided by the present disclosure protects the privacy of the video author, it does not affect the video author's normal use of the message push service of the first terminal to browse messages during the screen recording process.
  • the searching for the target video frame in the video data described in step S21 can be specifically implemented by any existing image recognition technology.
  • multiple video frames recorded on multiple first terminals in the past containing message pop-ups may be collected as positive samples, and multiple video frames recorded on multiple first terminals that do not contain message pop-ups may be collected as positive samples.
  • the video frames of the window are used as negative samples, and a pre-built image recognition model is trained by using these positive samples and negative samples, so as to train a message pop-up recognition model that can identify whether the video frame contains message pop-ups.
  • step S21 when step S21 is performed, it is only necessary to input the video frame that needs to be detected in the video data to the message pop-up window recognition model, and the message pop-up window recognition model will output the detection result of the video frame. If the input video frame does not contain a message pop-up window, the message pop-up window recognition model will output the same video frame as the input video frame. If the input video frame contains a message pop-up window, the message pop-up window recognition model will output the same video frame. The boundaries of the message popup are marked in the video frame.
  • the boundary of the message pop-up window is marked in the video frame output by the message pop-up window recognition model, it can be determined that the video frame input this time is the target video frame, and further, in step S22, it can be identified according to the message pop-up window.
  • the boundary marked by the model determines the area where the message pop-up window is located in the target video frame.
  • the message pop-up window recognition model After training with a large number of positive samples and negative samples, the message pop-up window recognition model can distinguish the image features of the message pop-up window from the video frame. Therefore, the message pop-up window recognition model can quickly determine the currently detected video frame. Whether there is an image feature of the message pop-up window, and after detecting the image feature of the message pop-up window, the corresponding pixels in the video frame of the image feature of the message pop-up window are further detected, and then the boundary of the message pop-up window is marked.
  • the style of the message pop-up window generally has certain differences, and accordingly, the image features of the message pop-up window also have certain differences. Therefore, when training the message pop-up window recognition model , you can not only train a message popup recognition model, but for each common operating system, use the video frames (negative samples) that do not contain message popups and videos that contain message popups recorded under the operating system. Frame (positive sample) training to obtain a message pop-up window recognition model corresponding to this operating system. That is to say, a plurality of corresponding message pop-up window recognition models can be finally obtained by training for a variety of common operating systems.
  • step S21 the operating system used by the first terminal may be determined first, and then the corresponding message pop-up window identification model is invoked to detect video frames in the video data.
  • the type of the operating system used by the first terminal may be sent by the first terminal to the server, and then forwarded by the server to the second terminal.
  • each message popup Compared with the scheme of using one message popup recognition model to detect all message popups in video frames recorded under all operating systems, when training the corresponding message popup recognition model for each operating system, each message popup
  • the window recognition model needs to learn fewer image features of the message pop-up window, so the training of the model can be completed faster than the previous scheme, and because of the types of image features of the message pop-up window that need to be detected during the detection process It is relatively simple, and the detection result of the message pop-up window recognition model for a specific operating system has higher accuracy than the detection result of the message pop-up window recognition model of the previous scheme.
  • the embodiment of the present disclosure provides another video data processing method, please refer to Figure 5, the method may include the following steps:
  • the processing method provided by the embodiment shown in FIG. 5 may be executed by the first terminal.
  • the target device is equivalent to the first terminal described above.
  • the message push service refers to the program running on the first terminal responsible for pushing messages.
  • the message push service can display the message on the screen in the form of a message pop-up window after receiving the message to be pushed sent by the message push server to the first terminal.
  • the message to be pushed that is, the message push service can be considered as a program in the first terminal for controlling the content of the message in the message pop-up window and the display time of the message pop-up window.
  • the message push service After the push time of the message to be pushed is reached, the message push service starts to pop up a message pop-up window displaying the message to be pushed on the screen of the first terminal.
  • S52 Search for a target video frame from the video frames included in the video data and located within a preset time period after the push time of the message to be pushed.
  • the target video frame may be searched for in the video data within the preset time period after the push time of the message to be pushed.
  • the preset duration here can be set as the sum of the estimated pop-up time of the message pop-up window and the stay time after the message pop-up window is completely displayed, or it can be increased on the basis of the sum of the two.
  • the pop-up time of the message pop-up window is 1s (seconds), that is, it takes 1s from the start of the pop-up to the complete display, and the stay time after the message pop-up window is completely displayed is 5s, then the above preset duration It can be set to 6s (or set to 7s, depending on the actual situation).
  • step S52 you can respond to 10:05:
  • the video frames recorded during the period from 20 to 10:05:27 are detected, and the target video frames containing the message pop-up window are found in these video frames.
  • the above search is not required.
  • the message push service only pushes the message at the push time of 10:05:20 during the screen recording process, it only needs to find the target video frame in the video frames recorded in the above time period. For The video frames recorded outside the above time period (including before and after the above time period) may not be searched.
  • step S53 and step S54 is the same as that of step S22 and step S23 in the embodiment corresponding to FIG. 2, and will not be described in detail here.
  • the message pop-up window is equivalent to a tool for the message push service to display the messages to be pushed to the user. Therefore, the corresponding message pop-up window will appear only when the message push service is to push messages. Before the push time determined by the service, and after the message push service completes the message push and the displayed message pop-up window disappears, it can be considered that no message will be displayed on the screen of the first terminal.
  • the video frame is detected to determine the target video frame, and the coding processing is performed, and the video frame located beyond the preset time period after the push time may not be detected using the aforementioned image recognition technology.
  • the above solution can reduce the number of video frames that need to be detected by the image recognition technology, thereby reducing the computing resources consumed by the device executing the corresponding processing method.
  • the method provided by the embodiment corresponding to FIG. 5 can also be applied to the server and the second terminal after the following adjustments:
  • the first terminal may monitor the message push service of the first terminal in real time during the process of recording the video data, and record the push time of the message to be pushed obtained by monitoring in the video data, that is, monitor the information obtained during the screen recording process.
  • Several push times and video data are sent to the server together, and the server can also forward the above data to the second terminal, so that both the server and the second terminal can determine the receipt according to the recorded push times of multiple messages to be pushed. Which time segments in the received video data may appear the target video frame, and then only the video frames within these time segments are searched when searching.
  • the program executing the processing method provided by the present disclosure may not have the right to monitor the message push service.
  • the embodiment of the present disclosure provides another video data processing method, which is used for When having the authority to monitor the message push service, the method for screening video data before searching for the target video frame, please refer to FIG. 6, the method may include the following steps:
  • the sound output by the first terminal may be recorded together as a sound track synchronized with the video data. Then, on the premise that the video author sets the first terminal to emit a message prompt sound when a message pop-up window appears, when a message pop-up window appears in the video data, a corresponding message prompt sound will also appear on the audio track of the video data.
  • the time when the message pop-up window is displayed on the screen may not be exactly the same as the time when the first terminal sends out the corresponding message prompt tone.
  • the message prompt tone may be issued first, and the message pop-up window may appear after a few seconds, or the message pop-up window may appear. After a few seconds, the first terminal outputs a corresponding message prompt tone.
  • the detection of the message prompt tone can be realized by any existing audio feature recognition method.
  • the audio features of a variety of common message prompt tones can be recorded, and then it is detected whether any one of the audio features of the message prompt sound appears in the audio track of the video data one by one. When the audio track is detected at a certain moment If the audio feature of any pre-recorded message prompt tone appears in the audio system, it is determined that the moment is the appearance time of the message prompt tone.
  • S62 Intercept, from the video data, a plurality of video frames within a preset time period before the appearance time of the message prompt sound, and multiple video frames within a preset time period after the appearance time of the message prompt sound.
  • step S62 multiple video frames in the preset duration before and after the appearance time of the message prompt sound need to be all displayed.
  • the intercepted video frames can be detected in the subsequent steps, and the target video frames containing the message pop-up window can be found therefrom.
  • the lengths of the preset duration before the occurrence time and the preset duration after the occurrence time may be determined by the first terminal according to the display time of the previous message pop-up window and the occurrence time of the corresponding message prompt sound.
  • the first terminal may determine the above-mentioned duration and send it to the server and the second terminal.
  • step S62 the video needs to be intercepted
  • step S63 the target video frame is searched out from the multiple video frames within the 20 seconds.
  • the processing methods provided by the embodiments of the present disclosure are generally applicable in the form of on-demand. If the video data is played to the video viewers of the second terminal in real time in the form of live broadcast, considering the display time of the message pop-up window and the length of the message prompt sound. If the time of occurrence is not synchronized, it is possible that after the message prompt tone is detected from the audio track, a message pop-up window has been continuously displayed for several seconds in the video played by the second terminal. Therefore, the method provided by the embodiment of the present disclosure is applied to the live broadcast less effective.
  • the second terminal can first cache it locally, and use the The method provided by the embodiment of the present disclosure processes the video data before playing.
  • the method provided by the embodiment of the present disclosure is only applicable when the first terminal enables the function of the message prompt tone. If the video author sets the first terminal to the silent mode, or disables the function of the first terminal's message prompt tone. , the processing method provided by the embodiment of the present disclosure is not applicable.
  • S65 Process the area where the message pop-up window of the target video frame is located to obtain a replacement video frame.
  • the program executing the method provided by the present disclosure does not have the authority to monitor the message push service, it is possible to preliminarily screen out a message pop-up window from a large number of video frames of the video data by detecting the message prompt sound in the audio track of the video data.
  • video frames and use image recognition technology to detect these screened video frames that may have message pop-up windows.
  • the data volume of audio data is generally smaller than that of video image data.
  • the audio feature complexity of detecting whether a message prompt sound occurs at the current moment in the audio track is relatively lower than that of using image recognition technology to detect the current moment. Therefore, the method provided by the embodiment of the present disclosure can appropriately reduce the computing resources consumed by the video processing method provided by the present disclosure without the authority to monitor the message push service.
  • the image processing method for the area where the message pop-up window of the target video frame is located may be to add an occlusion image to the area where the message pop-up window is located in the target video frame, wherein
  • the occlusion image of the area where the popup window is located can be obtained by any of the following schemes:
  • a processing program (referring to a program for executing the video data processing method provided by the present disclosure) can generate an occlusion image with the same size as that of a common message pop-up window in advance, and store the generated occlusion image in the local device of the device.
  • the storage medium each time an occlusion image is added to a target video frame, the previously generated occlusion image is directly read from the storage medium, and then the read occlusion image is added to the area where the message pop-up window is located.
  • the second solution is to first determine the size of the area where the message pop-up window to which the occlusion image is currently to be added is located before each occlusion image is added;
  • the occlusion image generated in the previous step is added to the area where the message pop-up window is located to obtain a replacement video frame.
  • a corresponding occlusion image needs to be generated based on the size of the area where the message pop-up window is located in the current target video frame, and then the generated occlusion image can be added to the message The area where the popup is located.
  • the first solution can directly use the existing occlusion image, and does not need to regenerate a new occlusion image every time the message pop-up window is coded, which can shorten the time required to process each target video frame and improve the processing efficiency.
  • the second solution can ensure that the size of the occlusion image added each time is the same as the size of the area where the message pop-up window is located.
  • the size is too large to interfere with the normal viewing of other areas in the video frame by the video viewer.
  • the style of the generated occlusion image can be defined by the user in the corresponding selection interface.
  • the processing program may obtain the user's selection instruction before starting to process the video data, and then determine the candidate image template selected by the selection instruction among the preset multiple candidate image templates as the target image template.
  • the above-mentioned multiple candidate image templates may include multiple candidate mosaic styles and multiple preset images.
  • the preset image here may include an image downloaded from the network by the processing program, or may include a user-defined image (for example, a photo taken by the user).
  • the corresponding occlusion image can be generated using the target image template.
  • the target image template can be used to generate an occlusion image of the size of a common message pop-up window.
  • the target image template can be used to generate a size equal to An occlusion image with the same size as the area where the message popup is located.
  • the above-mentioned obtaining the user's selection instruction may be, before starting to process the video (if it is applied to a live broadcast scenario, the processing and recording of the video data are synchronized, Then, before starting to process the video, it is actually equivalent to before starting the screen recording), a selection interface of an alternative image template is displayed on the screen of the first terminal, and a variety of alternative mosaic styles and multiple presets can be displayed in the selection interface. , plus the option to display custom images to support video authors using their own uploaded images as occlusion images.
  • the processing program may recognize the click of the video author as a selection instruction, and then determine the clicked candidate image template as the target image template.
  • the first terminal can obtain the user's selection instruction in the above manner, and then send the selection instruction to the server, so that the server determines the target image template.
  • the server can also display the above-mentioned selection interface to the administrator of the server on the local control terminal, and the administrator can input the selection instruction by clicking on the selection interface.
  • the above-mentioned user's selection instruction may be a click instruction of a video viewer currently using the second terminal.
  • the second terminal may also display the above-mentioned selection interface on the screen, The video viewer then selects one of a variety of alternative image templates as the target image template.
  • a mosaic can be understood as an image obtained by repeatedly filling a certain area with a simple geometric figure.
  • the various alternative mosaic styles displayed in the interface can be understood as a variety of geometric figures that can be used for filling (or called a mosaic pattern).
  • the user can also set the filling properties of the selected geometric figures in the selection interface, such as the filling color, the density of filling in a specific area, the size of each geometric figure, etc.
  • the process of generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located can refer to FIG. 7 .
  • Forming the mosaic pattern to generate the occlusion image is relatively simple in actual implementation, and the processing program only needs to save the data of the simple mosaic pattern and copy these patterns during filling. Therefore, by filling the mosaic pattern to generate the occlusion image, the processing can be reduced.
  • the process of generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located may refer to FIG. 8 .
  • the location of the screenshot may be determined randomly, or designated by the user (video author or video viewer), and may also be consistent with the location of the message pop-up window in the target video frame.
  • an embodiment of the present disclosure also provides a method for generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located.
  • the method may include:
  • the above steps can also be considered as reading a video frame that is located before the target video frame and is closest to the target video frame and does not contain a message pop-up window.
  • the target video frame to which the occlusion image needs to be added is the Nth video frame in the video data, and the first two video frames contain message pop-ups
  • the third video before the target video frame can be read. frame, that is, the N-3th video frame of the video data.
  • the previous video frame ie, the N-1th video frame
  • the previous video frame is read.
  • the Nth video frame is the target video frame containing the message pop-up window
  • the previous read video frame that does not contain the message pop-up window is the second previous video frame, that is, the N-2th video frame
  • a screenshot box of the same size is generated, and then in the area where the message pop-up window is located in the N-2th video frame, use the screenshot box to start from the Nth video frame.
  • the image processing method for the area where the message pop-up window is located in the embodiment of the present disclosure may also be to cut the message pop-up window from the target video frame.
  • the replacement video frame is the message The video frame after the popup is cut.
  • Figure 10 is a schematic diagram of cutting a message pop-up window from a target video frame.
  • the image cutting technology can be directly used to cut the message from the target video frame.
  • the message pop-up window is cut to obtain a replacement video frame.
  • the replacement video frame the area where the original message pop-up window is located is changed to a blank area.
  • the replacement video frame obtained in this way does not contain the text in the message pop-up window.
  • the pixels in the area where the message pop-up window is located may also be blurred to obtain a replacement video frame.
  • the replacement video frame is the video frame that contains the blurred message popup.
  • FIG. 11 is a schematic diagram of blurring the area where the message pop-up window is located.
  • an image can be applied to the pixels in the area where the message pop-up window is located.
  • the blurring technology blurs the text clearly displayed in the message pop-up window in the target video frame.
  • the text in the message pop-up window cannot be recognized, which is equivalent to that the replacement video frame does not contain the text in the message pop-up window, even if it is displayed to the video viewer on the terminal device
  • the replacement video frame shown in Figure 11 is displayed without revealing the privacy of the video author.
  • the two processing methods of cutting the message pop-up window from the target video frame and blurring the area where the message pop-up window is located do not require additional acquisition except to be processed. Image resources other than video only need to be cut or blurred for the processing target video frame itself. Therefore, compared with the processing method of adding occlusion images, the latter two processing methods can complete the processing of the target video frame in a shorter time, have higher processing efficiency, and consume less resources on electronic devices than adding occlusion images.
  • the processing scheme for occlusion images are used to complete the processing of the target video frame in a shorter time, have higher processing efficiency, and consume less resources on electronic devices than adding occlusion images.
  • an embodiment of the present disclosure also provides a video data processing apparatus.
  • the apparatus may include the following units:
  • the searching unit 1201 is configured to perform searching for a target video frame in the video data.
  • the video data is obtained by recording the screen of the target device, and the target video frame contains a message pop-up window.
  • the determining unit 1202 is configured to perform, in response to finding the target video frame in the video data, determining the area where the message pop-up window is located in the target video frame.
  • the processing unit 1203 is configured to perform processing on the area where the message pop-up window of the target video frame is located to obtain the replacement video frame.
  • the replacement video frame does not include the text in the message pop-up window of the target video frame, and the replacement video frame is used to replace the target video frame.
  • the above-mentioned processing device further includes:
  • the monitoring unit 1204 is configured to perform real-time monitoring of the message push service of the target device, and to obtain the push time of the message to be pushed of the message push service; wherein, the target device is the host device in the network live broadcast system, that is, the terminal device used by the host.
  • search unit 1201 specifically executes:
  • the above-mentioned processing device further includes:
  • the detection unit 1205 is configured to detect the message prompt sound corresponding to the message pop-up window in the audio track of the video data;
  • the processing unit 1203 specifically executes:
  • the processing unit 1203 specifically executes:
  • the pixels in the area where the message pop-up window is located are blurred to obtain the replacement video frame.
  • the processing unit 1203 may include:
  • a size determination unit configured to determine the size of the area where the message pop-up window is located
  • a generating unit configured to generate an occlusion image whose size is consistent with the size of the area where the message pop-up window is located;
  • the adding unit is configured to add the generated occlusion image in the area where the message pop-up window is located to obtain the replacement video frame.
  • the processing unit 1203 further includes:
  • Template determination unit configured to execute:
  • the candidate image template selected by the selection instruction is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images ;
  • the generating unit when the generating unit generates an occlusion image whose size is consistent with the size of the area where the message pop-up window is located, it specifically executes:
  • an occlusion image whose size is consistent with the size of the area where the message pop-up window is located is generated.
  • the generating unit specifically executes:
  • the occlusion image is obtained by intercepting the image in the same area as the message popup in the previous video frame that does not contain the message popup.
  • the present disclosure relates to an apparatus for processing video data, wherein the searching unit 1201 searches the video data for a target video frame containing a message pop-up window, and when the target video frame is obtained, the determining unit 1202 determines the location of the message pop-up window in the target video frame
  • the processing unit 1203 processes the area where the message pop-up window of the target video frame is located to obtain a replacement video frame that does not contain the text in the message pop-up window, wherein the replacement video frame is used to replace the target video frame in the video data.
  • the text in it will be deleted by the image processing method for the area where the message pop-up window is located in this solution, and will not be leaked to users who watch the video data.
  • the method for processing screen recording video provided by the embodiments of the present disclosure can be applied to the first terminal, the second terminal, and the server. Terminal and server.
  • Embodiments of the present disclosure further provide a storage medium for storing computer instructions, and when the computer instructions in the storage medium are executed by a processor of an electronic device, the electronic device can perform the following steps:
  • the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
  • a storage medium including instructions such as a memory including instructions, is also provided, and the above-mentioned instructions can be executed by the processor 1301 of the electronic device shown in FIG. 13 to complete the above-mentioned method.
  • the storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage equipment, etc.
  • An embodiment of the present disclosure provides a computer program product, including a computer program/instruction, when the computer program/instruction is executed, the following steps are implemented:
  • the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
  • An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions, and implement the following steps:
  • the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
  • the processor is further configured to implement the following steps:
  • the target device is an anchor device in a live webcast system
  • the searching for the target video frame in the video data includes:
  • the processor is further configured to implement the following steps:
  • the searching for the target video frame in the video data includes:
  • the target video frame is searched for among the plurality of video frames obtained through interception.
  • the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes:
  • the message pop-up window is cropped from the target video frame to obtain a replacement video frame.
  • the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes:
  • the pixels in the area where the message pop-up window is located are blurred to obtain a replacement video frame.
  • the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes:
  • the generated occlusion image is added to the area where the message pop-up window is located to obtain a replacement video frame.
  • the processor is further configured to implement the following steps:
  • the candidate image template selected by the selection instruction is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images;
  • the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located includes:
  • an occlusion image whose size is consistent with the size of the area where the message pop-up window is located is generated.
  • the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located includes:
  • the previous video frame of the target video frame that does not contain the message pop-up window is read from the video data
  • An image located in the same area as the message pop-up window in the previous video frame that does not contain the message pop-up window is intercepted to obtain an occlusion image.
  • Fig. 13 is a structural diagram of an electronic device according to an exemplary embodiment.
  • the electronic device 1300 may be a terminal device such as a mobile phone, a computer, and a tablet device, and may also be a server device.
  • an electronic device may include one or more of the following components: a processing component 1302, a memory 1304, a power supply component 1306, a multimedia component 1308, an audio component 1310, an input/output (I/O) interface 1312, a sensor component 1314, And the communication component 1316.
  • a processing component 1302 a memory 1304, a power supply component 1306, a multimedia component 1308, an audio component 1310, an input/output (I/O) interface 1312, a sensor component 1314, And the communication component 1316.
  • the processing component 1302 is generally used to perform overall operations of the electronic device 1300, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 1302 can include one or more processors 1320 to execute instructions to perform all or some of the steps of the methods described above.
  • processing component 1302 may include one or more modules that facilitate interaction between processing component 1302 and other components.
  • processing component 1302 may include a multimedia module to facilitate interaction between multimedia component 1308 and processing component 1302.
  • the memory 1304 is configured to store various types of data to support operation at the electronic device 1300 . Examples of such data include instructions for any application or method operating on electronic device 1300, contact data, phonebook data, messages, pictures, videos, and the like.
  • Memory 1304 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, 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 Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • Power supply assembly 1306 provides power to various components of electronic device 1300 .
  • Power supply components 1306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 1300 .
  • Multimedia component 1308 includes a screen that provides an output interface between electronic device 1300 and the user.
  • 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 input signals from a user.
  • the touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action.
  • the multimedia component 1308 includes a front-facing camera and/or a rear-facing camera. When the electronic device 1300 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
  • Audio component 1310 is configured to output and/or input audio signals.
  • audio component 1310 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 1300 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 1304 or transmitted via communication component 1316 .
  • audio component 1310 also includes a speaker for outputting audio signals.
  • the I/O interface 1312 provides an interface between the processing component 1302 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
  • Sensor assembly 1314 includes one or more sensors for providing status assessments of various aspects of electronic device 1300 .
  • the sensor assembly 1314 can detect the open/closed state of the electronic device 1300, the relative positioning of the components, such as the display and the keypad of the electronic device 1300, the sensor assembly 1314 can also detect the electronic device 1300 or one of the electronic device 1300 Changes in the positions of components, presence or absence of user contact with the electronic device 1300 , orientation or acceleration/deceleration of the electronic device 1300 and changes in the temperature of the electronic device 1300 .
  • Sensor assembly 1314 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 1314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications.
  • the sensor component 1314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 1316 is configured to facilitate wired or wireless communication between electronic device 1300 and other devices.
  • Electronic device 1300 may access wireless networks based on communication standards, such as WiFi, carrier networks (eg, 2G, 3G, 4G, or 5G), or a combination thereof.
  • the communication component 1316 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 1316 also includes a near field communication (NFC) module to facilitate short-range communication.
  • 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.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • electronic device 1300 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 A programming gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components are implemented for executing the video data processing method provided by any embodiment of the present disclosure.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programming gate array
  • controller a controller
  • microcontroller a microprocessor or other electronic components
  • the electronic device 1300 when the above-mentioned electronic device 1300 is a terminal device such as a mobile phone, a computer, a tablet device, etc., the electronic device may include each component shown in FIG. 13 , and when the above-mentioned electronic device is a server device, the electronic device may only include the components shown in FIG. 13 .
  • the memory 1304, the power component 1306, the processing component 1302 and the communication component 1316 when the above-mentioned electronic device 1300 is a terminal device such as a mobile phone, a computer, a tablet device, etc.
  • the electronic device may include each component shown in FIG. 13
  • the above-mentioned electronic device when the above-mentioned electronic device is a server device, the electronic device may only include the components shown in FIG. 13 .
  • the memory 1304, the power component 1306, the processing component 1302 and the communication component 1316 when the above-mentioned electronic device is a server device, the electronic device may only include the components shown in FIG. 13 .

Abstract

Disclosed in the present application are a video data processing method and apparatus, a computer storage medium, and an electronic device. The method comprises: searching video data for a target video frame comprising a message popup, and in response to finding the target video frame, determining an area where the message popup in the target video frame is located; and processing the area where the message popup in the target video frame is located, to obtain a replacement video frame, the replacement video frame not comprising text in the message popup, and the replacement video frame being used for replacing the target video frame.

Description

视频数据的处理方法、装置、计算机存储介质和电子设备Video data processing method, device, computer storage medium and electronic device
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开要求在2020年11月18日在中国提交的中国专利申请号No.202011292633.6优先权,其全部内容通过引用并入全文。The present disclosure claims priority to Chinese Patent Application No. 202011292633.6 filed in China on Nov. 18, 2020, the entire contents of which are incorporated by reference in their entirety.
技术领域technical field
本公开涉及视频技术领域,尤其涉及一种视频数据的处理方法及装置。The present disclosure relates to the field of video technology, and in particular, to a method and device for processing video data.
背景技术Background technique
录屏是目前各类终端设备上常见的功能。在一台终端设备上启用录屏功能后,录屏程序就会实时录制该终端设备的屏幕,从而得到一段录屏视频,录屏视频可以在本地播放,也可以提供给网络中的其他终端设备播放。Screen recording is a common function on various terminal devices. After the screen recording function is enabled on a terminal device, the screen recording program will record the screen of the terminal device in real time, thereby obtaining a screen recording video. The screen recording video can be played locally or provided to other terminal devices in the network. play.
为了保护用户的隐私,录屏程序在开始录制终端设备的屏幕时,会禁用终端设备的消息推送服务,以避免录制的视频中出现携带有用户隐私信息的消息弹窗。In order to protect the user's privacy, when the screen recording program starts to record the screen of the terminal device, it will disable the message push service of the terminal device, so as to avoid the message pop-up window with the user's private information appearing in the recorded video.
发明内容SUMMARY OF THE INVENTION
本公开提供一种视频数据的处理方法及装置。本公开的技术方案如下:The present disclosure provides a video data processing method and device. The technical solutions of the present disclosure are as follows:
根据本公开的一些实施例,提供一种视频数据的处理方法,包括:在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。According to some embodiments of the present disclosure, a method for processing video data is provided, comprising: searching for a target video frame in video data, wherein the video data is video data obtained by recording a screen of a target device; the target video The frame contains a message pop-up window; in response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame; process the area where the message pop-up window is located in the target video frame , to obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the replacement video frame is used to replace the target video frame.
一些实施例中,所述方法,还包括:实时监听所述目标设备的消息推送服务,得到所述消息推送服务的待推送消息的推送时刻;其中,所述目标设备是网络直播系统中的主播设备;其中,所述在视频数据中查找目标视频帧,包括:从所述视频数据包含的位于所述待推送消息的推送时刻之后预设时长内的视频帧中,查找所述目标视频帧。In some embodiments, the method further includes: monitoring the message push service of the target device in real time, and obtaining the push time of the message to be pushed of the message push service; wherein, the target device is a host in a webcast system The device; wherein the searching for the target video frame in the video data includes: searching for the target video frame from the video frames included in the video data and located within a preset time period after the push moment of the message to be pushed.
一些实施例中,所述方法,还包括:在所述视频数据的音轨中检测消息弹窗对应的消息提示音;其中,所述在视频数据中查找目标视频帧,包括:从所述视频数据中,截取位于所述消息提示音的出现时刻之前的预设时长内的多个视频帧、以及位于所述消息提示音的出现时刻之后的预设时长内的多个视频帧;在截取得到的多个视频帧中查找所述目标视频帧。In some embodiments, the method further includes: detecting a message prompt sound corresponding to a message pop-up window in the audio track of the video data; wherein, the searching for a target video frame in the video data includes: extracting from the video In the data, intercept a plurality of video frames within a preset duration before the appearance of the message prompt sound, and multiple video frames within a preset period after the appearance of the message prompt sound; Find the target video frame among the plurality of video frames.
一些实施例中,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:从所述目标视频帧中剪切所述消息弹窗,得到替换视频帧。In some embodiments, the processing the area where the message pop-up window is located in the target video frame to obtain the replacement video frame includes: cutting the message pop-up window from the target video frame to obtain the replacement video frame.
一些实施例中,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:对所述消息弹窗的所在区域内的像素进行模糊处理,得到替换视频帧。In some embodiments, the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes: performing a blurring process on pixels in the area where the message pop-up window is located to obtain a replacement video frame. .
一些实施例中,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:确定所述消息弹窗的所在区域的尺寸;生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像;在所述消息弹窗的所在区域添加生成的遮挡图像,得到替换视频帧。In some embodiments, the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes: determining the size of the area where the message pop-up window is located; generating a size equal to that of the message pop-up window. The occlusion image with the same size in the region where the message pop-up window is located; and the generated occlusion image is added to the region where the message pop-up window is located to obtain a replacement video frame.
一些实施例中,所述方法,还包括:获取用户的选择指令;将预设的多种备选图像模板中,被所述 选择指令选中的备选图像模板确定为目标图像模板;其中,所述多种备选图像模板,包括多种备选马赛克样式和多张预设的图像;其中,所述生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像,包括:根据所述目标图像模板,生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像。In some embodiments, the method further includes: acquiring a user's selection instruction; determining the candidate image template selected by the selection instruction among the preset multiple candidate image templates as the target image template; The multiple candidate image templates, including multiple candidate mosaic styles and multiple preset images; wherein the generating an occlusion image with a size consistent with the size of the area where the message pop-up window is located includes: according to the A target image template to generate an occlusion image whose size is consistent with the size of the area where the message pop-up window is located.
一些实施例中,所述生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像,包括:从所述视频数据读取所述目标视频帧的前一个不包含所述消息弹窗的视频帧;截取所述前一个不包含所述消息弹窗的视频帧中与所述消息弹窗位于同一区域的图像,得到遮挡图像。In some embodiments, the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located includes: reading, from the video data, a previous frame of the target video frame that does not include the message pop-up window. A video frame; intercepting an image located in the same area as the message pop-up window in the previous video frame that does not contain the message pop-up window to obtain an occlusion image.
根据本公开的一些实施例,提供一种视频数据的处理装置,包括:查找单元,被配置为执行在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;确定单元,被配置为执行响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;处理单元,被配置为执行处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。According to some embodiments of the present disclosure, there is provided an apparatus for processing video data, comprising: a searching unit configured to perform searching for a target video frame in video data, wherein the video data is obtained by recording a screen of a target device video data; the target video frame contains a message pop-up window; a determining unit is configured to perform a search in the video data to obtain the target video frame, and determine the area where the message pop-up window is located in the target video frame; processing a unit, configured to process the area where the message pop-up window is located in the target video frame to obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the The replacement video frame is used to replace the target video frame.
一些实施例中,所述装置还包括:监听单元,被配置为执行实时监听所述目标设备的消息推送服务,得到所述消息推送服务的待推送消息的推送时刻;其中,所述目标设备是网络直播系统中的主播设备;其中,所述查找单元被配置为执行:从所述视频数据包含的位于所述待推送消息的推送时刻之后预设时长内的视频帧中,查找所述目标视频帧。In some embodiments, the apparatus further includes: a monitoring unit configured to perform real-time monitoring of the message push service of the target device, and obtain the push time of the message to be pushed of the message push service; wherein the target device is An anchor device in a network live broadcast system; wherein the search unit is configured to perform: search for the target video from a video frame included in the video data and located within a preset time period after the push moment of the message to be pushed frame.
一些实施例中,所述装置还包括:检测单元,被配置为执行在所述视频数据的音轨中检测消息弹窗对应的消息提示音;其中,所述查找单元在视频数据中查找目标视频帧时,具体执行:从所述视频数据中,截取位于所述消息提示音的出现时刻之前的预设时长内的多个视频帧、以及位于所述消息提示音的出现时刻之后的预设时长内的多个视频帧;在截取得到的多个视频帧中查找所述目标视频帧。In some embodiments, the apparatus further includes: a detection unit configured to detect a message prompt corresponding to a message pop-up window in the audio track of the video data; wherein the search unit searches the video data for a target video frame, the specific execution is: from the video data, intercepting a plurality of video frames within a preset time period before the appearance time of the message prompt sound and a preset time period after the appearance time of the message prompt sound multiple video frames in the video frame; find the target video frame in the multiple video frames obtained through interception.
一些实施例中,所述处理单元处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧时,被配置为执行:从所述目标视频帧中剪切所述消息弹窗,得到替换视频帧。In some embodiments, the processing unit is configured to perform: cutting the message pop-up window from the target video frame when obtaining a replacement video frame by processing the area where the message pop-up window is located in the target video frame. , to get the replacement video frame.
一些实施例中,所述处理单元处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧时,被配置为执行:对所述消息弹窗的所在区域内的像素进行模糊处理,得到替换视频帧。In some embodiments, the processing unit processes the area where the message pop-up window is located in the target video frame, and when a replacement video frame is obtained, the processing unit is configured to perform: blurring the pixels in the area where the message pop-up window is located. Process to get the replacement video frame.
一些实施例中,所述处理单元包括:尺寸确定单元,被配置为执行确定所述消息弹窗的所在区域的尺寸;生成单元,被配置为执行生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像;添加单元,被配置为执行在所述消息弹窗的所在区域添加生成的遮挡图像,得到替换视频帧。In some embodiments, the processing unit includes: a size determination unit configured to perform determination of the size of the area where the message pop-up window is located; an occlusion image with the same size; the adding unit is configured to add the generated occlusion image in the area where the message pop-up window is located to obtain a replacement video frame.
一些实施例中,所述处理单元还包括:模板确定单元,被配置为执行:获取用户的选择指令;将预设的多种备选图像模板中,被所述选择指令选中的备选图像模板确定为目标图像模板;其中,所述多种备选图像模板,包括多种备选马赛克样式和多张预设的图像;其中,所述生成单元生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像时,被配置为执行:根据所述目标图像模板,生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像。In some embodiments, the processing unit further includes: a template determination unit configured to perform: acquiring a user's selection instruction; selecting the candidate image template selected by the selection instruction from the preset multiple candidate image templates; It is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images; wherein, the generating unit generates a size equal to the area where the message pop-up window is located. When the size of the occlusion image is the same, it is configured to execute: according to the target image template, generate an occlusion image whose size is consistent with the size of the area where the message pop-up window is located.
一些实施例中,所述生成单元生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像时,被配置为执行从所述视频数据读取所述目标视频帧的前一个不包含所述消息弹窗的视频帧;截取所述前一个不包含所述消息弹窗的视频帧中与所述消息弹窗位于同一区域的图像,得到遮挡图像。In some embodiments, when the generating unit generates an occlusion image whose size is consistent with the size of the area where the message pop-up window is located, it is configured to perform reading from the video data that the previous one of the target video frame does not contain the target video frame. The video frame of the message pop-up window is intercepted; the image located in the same area as the message pop-up window in the previous video frame that does not contain the message pop-up window is intercepted to obtain an occlusion image.
根据本公开的一些实施例,提供一种电子设备,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令,实现以下步骤:在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的 文本;其中,所述替换视频帧用于替换所述目标视频帧。According to some embodiments of the present disclosure, there is provided an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the following steps: Find the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window; the target video is obtained in response to the search in the video data frame, determine the area where the message pop-up window is located in the target video frame; process the area where the message pop-up window is located in the target video frame to obtain a replacement video frame, so that the replacement video frame does not contain the message The text in the pop-up window; wherein, the replacement video frame is used to replace the target video frame.
根据本公开的一些实施例,提供一种存储介质,当所述存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行本公开实施例的任意一项提供的视频数据的处理方法。According to some embodiments of the present disclosure, a storage medium is provided, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the video data provided by any one of the embodiments of the present disclosure processing method.
根据本公开的一些实施例,提供一种计算机程序产品,所述计算机程序产品被执行时,用于实现本公开实施例所提供的任意一项的视频数据的处理方法。According to some embodiments of the present disclosure, a computer program product is provided, which, when executed, is used to implement any one of the video data processing methods provided by the embodiments of the present disclosure.
在本公开中,通过对目标视频帧中消息弹窗的所在区域进行处理,本方案能够避免录屏过程中录制到的消息弹窗的文本被观看视频的用户看到,由此,录视频的用户在录制视频的过程中既能够保护自身隐私,也能够正常地通过消息推送服务浏览消息。In the present disclosure, by processing the area where the message pop-up window is located in the target video frame, this solution can prevent the text of the message pop-up window recorded during the screen recording process from being seen by the user watching the video. Users can not only protect their privacy during video recording, but also browse messages through the message push service normally.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理,并不构成对本公开的不当限定。The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the principles of the present disclosure and do not unduly limit the present disclosure.
图1是根据一示例性实施例示出的一种视频数据的录制和传输流程的示意图;1 is a schematic diagram of a recording and transmission process of video data according to an exemplary embodiment;
图2是根据一示例性实施例示出的一种视频数据的处理方法的流程图;2 is a flowchart of a method for processing video data according to an exemplary embodiment;
图3是根据一示例性实施例示出的一种目标视频帧和替换视频帧的示意图;3 is a schematic diagram of a target video frame and a replacement video frame according to an exemplary embodiment;
图4是根据一示例性实施例示出的一种在视频数据中查找目标视频帧的方法的示意图;4 is a schematic diagram of a method for finding a target video frame in video data according to an exemplary embodiment;
图5是根据一示例性实施例示出的另一种视频数据的处理方法的流程图;FIG. 5 is a flowchart of another method for processing video data according to an exemplary embodiment;
图6是根据一示例性实施例示出的再一种视频数据的处理方法的流程图;FIG. 6 is a flow chart of yet another method for processing video data according to an exemplary embodiment;
图7是根据一示例性实施例示出的一种在消息弹窗的所在区域添加的马赛克图像的示意图;7 is a schematic diagram of a mosaic image added in a region where a message pop-up window is located, according to an exemplary embodiment;
图8是根据一示例性实施例示出的一种在消息弹窗的所在区域添加截取的图像的示意图;8 is a schematic diagram of adding a captured image in a region where a message pop-up window is located, according to an exemplary embodiment;
图9是根据一示例性实施例示出的一种从前一个不包含消息弹窗的视频帧中截取遮挡图像的示意图;9 is a schematic diagram of intercepting an occlusion image from a previous video frame that does not contain a message pop-up window, according to an exemplary embodiment;
图10是根据一示例性实施例示出的一种从目标视频帧中剪切消息弹窗的示意图;10 is a schematic diagram of cutting a message pop-up window from a target video frame according to an exemplary embodiment;
图11是根据一示例性实施例示出的一种对目标视频帧的消息弹窗所在区域进行模糊处理的示意图;11 is a schematic diagram of blurring the area where the message pop-up window of the target video frame is located according to an exemplary embodiment;
图12是根据一示例性实施例示出的一种视频数据的处理装置的结构示意图;12 is a schematic structural diagram of an apparatus for processing video data according to an exemplary embodiment;
图13是根据一示例性实施例示出的一种电子设备的结构示意图。FIG. 13 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
具体实施方式Detailed ways
为了使本领域普通人员更好地理解本公开的技术方案,下面将结合附图,对本公开实施例中的技术方案进行清楚、完整地描述。In order to make those skilled in the art better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
录屏是指,在第一终端运行期间,利用录屏程序实时的录制第一终端的显示屏,通过这种方式获得的视频,称为录屏视频。Screen recording refers to using a screen recording program to record the display screen of the first terminal in real time during the operation of the first terminal, and a video obtained in this way is called a screen recording video.
在本公开中,用第一终端指代录屏视频中被录制的屏幕所属的终端设备,第一终端可以是智能手机,平板电脑,台式电脑等电子设备。一般的,录屏程序是运行于第一终端上的程序,录屏程序可以是第一终端上的一个专门用于录屏的程序,也可以是集成在其他程序中的一个子程序。In the present disclosure, the first terminal refers to the terminal device to which the screen recorded in the screen recording video belongs, and the first terminal may be an electronic device such as a smart phone, a tablet computer, and a desktop computer. Generally, the screen recording program is a program running on the first terminal, and the screen recording program may be a program on the first terminal specially used for screen recording, or may be a subprogram integrated in other programs.
录屏视频的录制和传输流程可以参考图1,图1中的各个单元用于指代安装在对应电子设备上,用于实现相应功能的计算机程序。For the recording and transmission process of the screen recording video, reference may be made to FIG. 1 . Each unit in FIG. 1 is used to refer to a computer program installed on a corresponding electronic device and used to implement corresponding functions.
如图1所示,在第一终端中,录制视频的用户(下文简称视频作者)启用录屏单元的录屏功能后,录屏单元开始实时的录制第一终端的屏幕,然后将录制得到的录屏视频通过第一终端的通信单元经由互 联网发送给服务器。服务器再将第一终端发送的录屏视频,通过互联网发送至需要观看录屏视频的一个或多个第二终端(本公开中第二终端用于指代播放录屏视频的电子设备,第二终端和第一终端可以是同类的或者不同类的电子设备),由第二终端的播放单元向观看录屏视频的用户(下文简称视频观众)播放录屏视频。As shown in FIG. 1, in the first terminal, after the user who records the video (hereinafter referred to as the video author) enables the screen recording function of the screen recording unit, the screen recording unit starts to record the screen of the first terminal in real time, and then records the obtained screen The screen recording video is sent to the server via the Internet through the communication unit of the first terminal. The server then sends the screen-recorded video sent by the first terminal to one or more second terminals that need to watch the screen-recorded video through the Internet (in this disclosure, the second terminal is used to refer to an electronic device that plays the screen-recorded video, and the second terminal is used to refer to the electronic device that plays the screen-recorded video. The terminal and the first terminal may be electronic devices of the same type or different types), and the playback unit of the second terminal plays the screen-recorded video to users who watch the screen-recorded video (hereinafter referred to as video viewers).
在一些实施例中,录屏单元可以在录制第一终端的屏幕的同时,实时录制第一终端播放的声音,得到和录屏视频的画面同步的音轨。In some embodiments, the screen recording unit may record the sound played by the first terminal in real time while recording the screen of the first terminal, so as to obtain an audio track synchronized with the screen of the screen recording video.
在一些实施例中,第一终端,服务器和第二终端均可以将录屏视频缓存在本地的存储单元中。In some embodiments, the first terminal, the server and the second terminal may all cache the screen recording video in a local storage unit.
需要说明的是,录屏视频的播放可以采用直播和点播中的任意一种形式,或者同时采用这两种形式。It should be noted that the playback of the screen recording video can be in any form of live broadcast and on-demand, or both forms can be used at the same time.
在直播形式中,如图1所示的流程具体实施时,第一终端会在录制录屏视频的同时实时的将视频数据发送给服务器,同时服务器实时地将自身收到的视频数据转发给第二终端,使第二终端实时播放录屏视频。相当于,第一终端的录屏程序每录制得到一个视频帧,就将该视频帧发送至服务器,然后服务器立即将最新收到的这个视频帧转发给第二终端,由第二终端的播放单元在第二终端的显示屏上播放。In the live broadcast mode, when the process shown in FIG. 1 is implemented, the first terminal will send the video data to the server in real time while recording the screen recording video, and at the same time, the server will forward the video data received by itself to the first terminal in real time. The second terminal enables the second terminal to play the screen recording video in real time. Equivalently, every time the screen recording program of the first terminal obtains a video frame, it sends the video frame to the server, and then the server immediately forwards the newly received video frame to the second terminal, and the playback unit of the second terminal immediately forwards the video frame to the second terminal. Play on the display screen of the second terminal.
在点播形式中,如图1所示的流程具体实施时,第一终端可以在录屏过程中实时发送录屏视频,也可以在录屏结束后一次性向服务器发送完整的录屏视频,服务器将第一终端提供的完整的录屏视频存储在自身的存储单元中,当任一第二终端向服务器请求该录屏视频时,服务器再将录屏视频发送至第二终端,由第二终端播放。当然,第二终端也可以在收到录屏视频后,先缓存录屏视频,一段时间后再播放该视频。In the on-demand form, when the process shown in Figure 1 is implemented, the first terminal can send the screen recording video in real time during the screen recording process, or can send the complete screen recording video to the server at one time after the screen recording, and the server will send the screen recording video to the server. The complete screen recording video provided by the first terminal is stored in its own storage unit. When any second terminal requests the screen recording video from the server, the server sends the screen recording video to the second terminal for playback by the second terminal. . Of course, after receiving the screen-recording video, the second terminal may first cache the screen-recording video, and then play the video after a period of time.
录屏视频可以用于游戏和在线教学等多种领域。例如,视频作者在自己的手机(即第一终端)上安装录屏程序(相当于图1的录屏单元),在视频作者打开录屏程序并启用录屏功能后,录屏程序切换至后台运行,并开始录制第一终端的屏幕,此时,视频作者可以手机上开始玩手机游戏,由此,录屏程序可以录制第一终端的屏幕上的游戏画面,得到游戏视频,然后由服务器通过实时的或者非实时的方式将游戏视频转发给对这款手机游戏感兴趣的视频观众。Screen recording video can be used in various fields such as games and online teaching. For example, a video author installs a screen recording program (equivalent to the screen recording unit in Figure 1) on his mobile phone (ie, the first terminal). After the video author opens the screen recording program and enables the screen recording function, the screen recording program switches to the background. run, and start recording the screen of the first terminal. At this time, the video author can start playing mobile games on the mobile phone. Therefore, the screen recording program can record the game screen on the screen of the first terminal to obtain the game video, which is then passed by the server. Real-time or non-real-time way to forward game video to video viewers interested in this mobile game.
另外,视频作者也可以在录屏开始后,在第一终端的屏幕上展示教学资料,如课件,电子书等,由此录屏程序可以录制得到一段教学视频,该视频可以经过服务器转发至对上述教学资料感兴趣的视频观众。In addition, the video author can also display teaching materials, such as courseware, e-books, etc., on the screen of the first terminal after the screen recording starts, so that the screen recording program can record a teaching video, which can be forwarded to the peer through the server. Video viewers interested in the above teaching materials.
为了保护视频作者的隐私,同时不影响视频作者在录屏的过程中使用第一终端的消息推送功能,本公开实施例提供一种录屏视频的处理方法,请参考图2,该方法可以包括以下步骤:In order to protect the privacy of the video author without affecting the video author's use of the message push function of the first terminal during the screen recording process, an embodiment of the present disclosure provides a method for processing screen recording video, please refer to FIG. 2 , the method may include The following steps:
S21、在视频数据中查找目标视频帧。S21. Search for the target video frame in the video data.
其中,目标视频帧用于指代包含消息弹窗的视频帧。也就是说,在执行步骤S21时,可以逐一检测录屏视频中的每一个视频帧,每当检测到一个视频帧中包含消息弹窗,就将这个视频帧确定为目标视频帧。Wherein, the target video frame is used to refer to the video frame containing the message pop-up window. That is to say, when step S21 is performed, each video frame in the screen recording video can be detected one by one, and whenever a video frame is detected to contain a message pop-up window, the video frame is determined as the target video frame.
上述视频数据是对目标设备的屏幕进行录制而得到的视频数据,目标设备相当于前文所述的第一终端。The above video data is video data obtained by recording the screen of the target device, and the target device is equivalent to the first terminal described above.
本公开所提供的视频数据处理方案,第一方面可以在录屏结束后,对得到的完整的录屏视频进行处理,得到处理后的视频。第二方面,也可以在录屏的过程中实时地对录制得到的视频流进行处理,得到处理后的视频流,处理后的视频流可以实时地向视频观众播放,也可以被存储在相应的计算机存储介质中。也就是说,步骤S21中的视频数据,可以是一段完整的录屏视频,也可以是录制过程中产生的视频流。In the video data processing solution provided by the present disclosure, in the first aspect, after the screen recording is completed, the obtained complete screen recording video can be processed to obtain the processed video. In the second aspect, the recorded video stream can also be processed in real time during the screen recording process to obtain the processed video stream. The processed video stream can be played to the video viewers in real time, or stored in the corresponding in computer storage media. That is to say, the video data in step S21 may be a complete screen recording video, or may be a video stream generated during the recording process.
在第二方面的应用场景中,可以在执行本公开的视频数据处理方案的电子设备的存储空间中设置一个缓存区,缓存区可以实时地被写入最近一段时间内(如最近10秒内)录制得到的视频流写入缓存区 (相当于将最近10秒内录制的视频帧写入缓存区),同时执行本公开的视频数据处理方案的程序可以逐一从缓存区内读取视频流中的每一个视频帧,并判断读取的每一视频帧是否为目标视频帧,若是目标视频帧则应用本公开提供的方案进行处理。In the application scenario of the second aspect, a buffer area can be set in the storage space of the electronic device executing the video data processing solution of the present disclosure, and the buffer area can be written in a recent period of time (eg, within the last 10 seconds) in real time. The recorded video stream is written into the buffer area (equivalent to writing the video frames recorded in the last 10 seconds into the buffer area), and the program executing the video data processing solution of the present disclosure can read the data in the video stream one by one from the buffer area. For each video frame, it is determined whether each read video frame is a target video frame, and if it is a target video frame, the solution provided by the present disclosure is applied for processing.
在录屏的过程中,第一终端的消息推送服务可能会在第一终端的屏幕上推送带有视频作者的个人信息的消息弹窗,消息弹窗被录制在视频数据中并被视频观众看到后,就会泄露视频作者的隐私。During the screen recording process, the message push service of the first terminal may push a message pop-up window with the personal information of the video author on the screen of the first terminal, and the message pop-up window is recorded in the video data and viewed by the video viewers After that, the privacy of the video author will be leaked.
例如,图3中所示的消息弹窗的显示界面中,消息弹窗内包含如下消息:“您的快递已放在XX小区物业处,请及时前往提取”,若该消息弹窗被录制在视频数据中并且被视频观众看到,视频作者的居住地址就会泄露。For example, in the display interface of the message pop-up window shown in Figure 3, the message pop-up window contains the following message: "Your courier has been placed at the property of XX community, please go to pick it up in time", if the message pop-up window is recorded in In the video data and seen by the video viewer, the residential address of the video author will be leaked.
本公开提供的处理方法,其目的就在于将视频数据中包含有消息弹窗的视频帧查找出来,然后通过后续的步骤对消息弹窗的所在区域进行“打码”,使得视频数据在播放时,画面中的消息弹窗对于视频观众而言不可见,达到保护视频作者隐私的目的。The purpose of the processing method provided by the present disclosure is to find out the video frame containing the message pop-up window in the video data, and then "code" the area where the message pop-up window is located through the subsequent steps, so that the video data can be played during playback. , the message pop-up window on the screen is invisible to video viewers, so as to protect the privacy of video authors.
这里的“打码”,并不限于在消息弹窗的所在区域添加马赛克,而是用于指代包括添加马赛克在内的任意一种能够让替换视频帧不显示消息弹窗内文本的图像处理方法。The "coding" here is not limited to adding mosaics in the area where the message pop-up window is located, but is used to refer to any image processing including adding mosaics that can prevent the text in the message pop-up window from being displayed in the replacement video frame. method.
同时,由于对视频数据中的消息弹窗进行打码,即使在录制视频数据的过程中从第一终端的屏幕上录下了包含隐私信息的消息弹窗,视频数据在播放时该消息弹窗中包含的信息也不会被视频观众看到,因此视频作者可以在录屏的过程中正常使用第一终端的消息推送服务。At the same time, since the message pop-up window in the video data is coded, even if a message pop-up window containing privacy information is recorded from the screen of the first terminal during the recording of the video data, the message pop-up window will be displayed when the video data is being played. The information contained in the video will not be seen by the video viewer, so the video author can normally use the message push service of the first terminal during the screen recording process.
如图3所示,从第一终端的消息推送服务开始弹出消息弹窗,到消息弹窗被完全显示在第一终端的屏幕上,需要一段时间,在这段时间内录制得到的视频帧中会包含一部分的消息弹窗,显然这些部分显示的消息弹窗也需要进行打码,因此,步骤S21中查找得到的目标视频帧,包括,视频数据中每一个包含有完整的或者部分的消息弹窗的视频帧。As shown in Figure 3, it takes a period of time from the start of the message push service of the first terminal to pop up the message pop-up window until the message pop-up window is completely displayed on the screen of the first terminal. It will contain a part of the message pop-up window. Obviously, the message pop-up window displayed in these parts also needs to be coded. Therefore, the target video frame found in step S21 includes, each of the video data contains a complete or partial message pop-up window. window video frame.
S22、响应于视频数据中查找得到目标视频帧,确定目标视频帧中消息弹窗的所在区域。S22. In response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame.
在步骤S22中,可以确定消息弹窗在目标视频帧中的位置,以便在后续步骤中向该位置添加遮挡图像。In step S22, the position of the message pop-up window in the target video frame can be determined, so that an occlusion image can be added to the position in a subsequent step.
S23、处理目标视频帧中消息弹窗的所在区域,得到替换视频帧。S23: Process the area where the message pop-up window is located in the target video frame to obtain a replacement video frame.
其中,替换视频帧不显示(或者说不包含)消息弹窗内的文本,替换视频帧用于代替录屏视频中对应的目标视频帧。The replacement video frame does not display (or does not contain) the text in the message pop-up window, and the replacement video frame is used to replace the corresponding target video frame in the screen recording video.
步骤S23中预设的图像处理方法,可以是任意一种能够让替换视频帧不显示消息弹窗内文本的图像处理方法,在本公开中,步骤S23的图像处理方法,可以是以下三种图像处理方法中的任意一种:The image processing method preset in step S23 can be any image processing method that can make the replacement video frame not display the text in the message pop-up window. In the present disclosure, the image processing method in step S23 can be the following three kinds of images Either of the processing methods:
第一,对目标视频帧中消息弹窗的所在区域添加遮挡图像;First, add an occlusion image to the area where the message pop-up window is located in the target video frame;
第二,从目标视频帧中剪切(或者说删除)消息弹窗的所在区域;Second, cut (or delete) the area where the message pop-up window is located from the target video frame;
第三,对消息弹窗的所在区域进行模糊处理。Third, the area where the message pop-up window is located is blurred.
图3为添加遮挡图像的示意图,如图3所示,在原本的目标视频帧中,视频观众可以看到画面中的消息弹窗及其具体的消息,而在添加了遮挡图像的替换视频帧中,消息弹窗被添加的遮挡图像覆盖,视频观众自然就看不到消息弹窗及其具体的消息,从而避免视频作者的隐私泄露。Figure 3 is a schematic diagram of adding an occlusion image. As shown in Figure 3, in the original target video frame, the video viewer can see the message pop-up window and its specific message in the screen, and in the replacement video frame with the occlusion image added , the message pop-up window is covered by the added occlusion image, and the video viewer will naturally not be able to see the message pop-up window and its specific message, thus avoiding the privacy leakage of the video author.
上述遮挡图像,可以是,采用特定的马赛克样式在消息弹窗的所在区域填充重复的马赛克图案后得到的马赛克图像,也可以是,在其他完整的图像中截取得到的一部分不包含消息弹窗的图像。The above-mentioned occlusion image may be a mosaic image obtained after filling the area where the message pop-up window is located with repeated mosaic patterns using a specific mosaic style, or it may be a part of other complete images that does not contain the message pop-up window. image.
需要说明的是,本公开实施例所提供的处理方法,可以由如图1所示的第一终端,服务器和第二终端三者中任意一种设备执行,也就是说,本公开提供的处理方法的执行主体可以是录制视频的第一终端,可以是转发视频的服务器,也可以是播放视频的第二终端。It should be noted that the processing methods provided by the embodiments of the present disclosure may be executed by any one of the first terminal, the server, and the second terminal as shown in FIG. 1 , that is, the processing methods provided by the present disclosure The execution body of the method may be the first terminal that records the video, the server that forwards the video, or the second terminal that plays the video.
第一终端作为执行主体时,本公开提供的处理方法可以由第一终端在录制视频数据的过程中实时地 对视频流执行,或者可以在录制结束后对整个录屏视频执行,获得处理后的图像帧后,第一终端向服务器发送替换视频帧,以代替原本要发送的目标视频帧。When the first terminal acts as the execution subject, the processing method provided by the present disclosure can be executed by the first terminal on the video stream in real time during the process of recording video data, or can be executed on the entire screen recording video after the recording ends, and the processed data can be obtained. After the image frame, the first terminal sends the replacement video frame to the server to replace the original target video frame to be sent.
本公开提供的方法应用于第一终端时,该方法可以由第一终端的录屏程序执行。When the method provided by the present disclosure is applied to the first terminal, the method may be executed by a screen recording program of the first terminal.
服务器作为执行主体时,服务器可以在向第二终端发送视频数据之前执行本公开提供的处理方法,具体可以在收到视频流的同时实时地执行本公开提供的处理方法,也可以是在收到完整的录屏视频之后对整个录屏视频执行本公开提供的处理方法,获得处理后的图像帧之后,服务器向第二终端发送替换视频帧,代替原本要转发的目标视频帧。When the server acts as the execution body, the server can execute the processing method provided by the present disclosure before sending the video data to the second terminal. Specifically, the processing method provided by the present disclosure can be executed in real time while receiving the video stream, or it can be executed after receiving the video stream. After the complete screen recording video, the processing method provided by the present disclosure is performed on the entire screen recording video, and after obtaining the processed image frame, the server sends the replacement video frame to the second terminal to replace the original target video frame to be forwarded.
本公开提供的方法应用于服务器时,该方法可以由服务器中的视频处理程序执行。When the method provided by the present disclosure is applied to a server, the method can be executed by a video processing program in the server.
第二终端作为执行主体时,第二终端可以在播放自身收到的视频数据之前执行本公开提供的方法,具体可以在收到视频流的同时实时地执行本公开提供的处理方法并实时的播放替换视频帧(以及其他不包含消息弹窗的视频帧),也可以在收到完整的录屏视频之后,对整个录屏视频执行本公开提供的处理方法,然后在将整个录屏视频中的每一个目标视频帧均替换为对应的替换视频帧之后,再播放处理后的录屏视频。When the second terminal acts as the execution subject, the second terminal can execute the method provided by the present disclosure before playing the video data received by the second terminal, and specifically can execute the processing method provided by the present disclosure in real time while receiving the video stream and play the video data in real time. To replace the video frame (and other video frames that do not contain the message pop-up window), it is also possible to perform the processing method provided in this disclosure on the entire screen-recording video after receiving the complete screen-recording video. After each target video frame is replaced with the corresponding replacement video frame, the processed screen recording video is played.
本公开提供的方法应用于第二终端时,该方法可以由第二终端中用于播放视频数据的视频播放程序执行。When the method provided by the present disclosure is applied to the second terminal, the method may be executed by a video playing program used for playing video data in the second terminal.
在一些实施例中,不论本公开提供的方法由上述哪种设备执行,视频作者均可以在开始录屏之前,在第一终端上设定是否应用本公开提供的处理方法对视频数据进行处理。若在录屏开始之前,视频作者选择了不进行打码的选项,则第一终端,服务器和第二终端局可以不执行本公开提供的处理方法,而是直接发送或者播放视频数据。In some embodiments, no matter which device described above is performed by the method provided by the present disclosure, the video author can set on the first terminal whether to apply the processing method provided by the present disclosure to process video data before starting screen recording. If the video author selects the option of not coding before the screen recording starts, the first terminal, the server and the second terminal may not execute the processing method provided by the present disclosure, but directly send or play the video data.
一方面,本公开提供的处理方法,可以在视频数据被第二终端播放之前,识别出视频数据中包含消息弹窗的目标视频帧,然后对目标视频帧的消息弹窗所在区域进行处理,得到不包含消息弹窗内的文本的替换视频帧,并用替换视频帧代替原视频的目标视频帧,这样,视频数据播放后,视频观众在观看时就不会看到消息弹窗显示的消息内容,从而避免消息弹窗中可能出现的涉及视频作者隐私的信息被泄露给视频观众。On the one hand, the processing method provided by the present disclosure can identify the target video frame containing the message pop-up window in the video data before the video data is played by the second terminal, and then process the area where the message pop-up window of the target video frame is located to obtain The replacement video frame does not contain the text in the message pop-up window, and the replacement video frame is used to replace the target video frame of the original video, so that after the video data is played, the video viewers will not see the message content displayed in the message pop-up window when watching. Thus, information concerning the privacy of the video author that may appear in the message pop-up window is prevented from being leaked to the video viewers.
另一方面,本公开提供的处理方法直接对录制完成的视频帧进行处理,而不涉及对第一终端的屏幕和消息推送服务的限制,视频作者在录制视频的过程中可以正常使用第一终端的消息推送服务,并在第一终端的屏幕上通过消息弹窗浏览其中的消息内容,而消息弹窗显示期间录制得到的目标视频帧中的消息弹窗,可以通过本公开提供的处理方法进行打码。因此,本公开提供的处理方法在保护视频作者的隐私的同时,也不影响视频作者在录屏的过程中正常使用第一终端的消息推送服务浏览消息。On the other hand, the processing method provided by the present disclosure directly processes the recorded video frames, without involving restrictions on the screen of the first terminal and the message push service, and the video author can use the first terminal normally during the video recording process. The message push service is provided, and the message content in the message pop-up window is browsed on the screen of the first terminal, and the message pop-up window in the target video frame recorded during the display of the message pop-up window can be performed by the processing method provided by the present disclosure. add mosaic. Therefore, while the processing method provided by the present disclosure protects the privacy of the video author, it does not affect the video author's normal use of the message push service of the first terminal to browse messages during the screen recording process.
在步骤S21中所述的在视频数据中查找目标视频帧,具体可以通过任意一种现有的图像识别技术实现。The searching for the target video frame in the video data described in step S21 can be specifically implemented by any existing image recognition technology.
在一些实施例中,可以收集过去在多个第一终端上录制得到的多个包含消息弹窗的视频帧作为正样本,并收集在多个第一终端上录制得到的多个不包含消息弹窗的视频帧作为负样本,利用这些正样本和负样本对一个预先构建的图像识别模型进行训练,从而训练出一个能够识别视频帧中是否包含消息弹窗的消息弹窗识别模型。In some embodiments, multiple video frames recorded on multiple first terminals in the past containing message pop-ups may be collected as positive samples, and multiple video frames recorded on multiple first terminals that do not contain message pop-ups may be collected as positive samples. The video frames of the window are used as negative samples, and a pre-built image recognition model is trained by using these positive samples and negative samples, so as to train a message pop-up recognition model that can identify whether the video frame contains message pop-ups.
如图4所示,在执行步骤S21时,只需要将需要视频数据中需要检测的视频帧输入到这个消息弹窗识别模型,消息弹窗识别模型就会输出对该视频帧的检测结果,若输入的视频帧中不包含消息弹窗,则消息弹窗识别模型会输出和输入的视频帧相同的视频帧,若输入的视频帧中包含消息弹窗,则消息弹窗识别模型会在输出的视频帧中标记出消息弹窗的边界。As shown in FIG. 4 , when step S21 is performed, it is only necessary to input the video frame that needs to be detected in the video data to the message pop-up window recognition model, and the message pop-up window recognition model will output the detection result of the video frame. If the input video frame does not contain a message pop-up window, the message pop-up window recognition model will output the same video frame as the input video frame. If the input video frame contains a message pop-up window, the message pop-up window recognition model will output the same video frame. The boundaries of the message popup are marked in the video frame.
因此,若消息弹窗识别模型输出的视频帧中标记出消息弹窗的边界,就可以确定本次输入的视频帧 为目标视频帧,进一步的,在步骤S22中,就可以根据消息弹窗识别模型所标记的边界,确定出目标视频帧中消息弹窗的所在区域。Therefore, if the boundary of the message pop-up window is marked in the video frame output by the message pop-up window recognition model, it can be determined that the video frame input this time is the target video frame, and further, in step S22, it can be identified according to the message pop-up window. The boundary marked by the model determines the area where the message pop-up window is located in the target video frame.
利用大量的正样本和负样本进行训练后,消息弹窗识别模型能够从视频帧中分辨出消息弹窗的图像特征,由此,通过消息弹窗识别模型可以快速的判断出当前检测的视频帧中是否有消息弹窗的图像特征,以及在检测出消息弹窗的图像特征后,进一步检测出消息弹窗的图像特征在视频帧中对应的像素,进而标记出消息弹窗的边界。After training with a large number of positive samples and negative samples, the message pop-up window recognition model can distinguish the image features of the message pop-up window from the video frame. Therefore, the message pop-up window recognition model can quickly determine the currently detected video frame. Whether there is an image feature of the message pop-up window, and after detecting the image feature of the message pop-up window, the corresponding pixels in the video frame of the image feature of the message pop-up window are further detected, and then the boundary of the message pop-up window is marked.
在一些实施例中,在不同的操作系统中,消息弹窗的样式一般会存在一定差异,相应的,消息弹窗的图像特征也会存在一定的区别,因此,在训练消息弹窗识别模型时,也可以不仅仅训练一个消息弹窗识别模型,而是针对每一种常见的操作系统,用该操作系统下录制的不包含消息弹窗的视频帧(负样本)和包含消息弹窗的视频帧(正样本)训练得到这种操作系统对应的一个消息弹窗识别模型。也就是说,最终可以针对多种常见的操作系统训练得到多个对应的消息弹窗识别模型。In some embodiments, in different operating systems, the style of the message pop-up window generally has certain differences, and accordingly, the image features of the message pop-up window also have certain differences. Therefore, when training the message pop-up window recognition model , you can not only train a message popup recognition model, but for each common operating system, use the video frames (negative samples) that do not contain message popups and videos that contain message popups recorded under the operating system. Frame (positive sample) training to obtain a message pop-up window recognition model corresponding to this operating system. That is to say, a plurality of corresponding message pop-up window recognition models can be finally obtained by training for a variety of common operating systems.
在执行步骤S21时,可以首先确定第一终端使用的操作系统,然后调用对应的消息弹窗识别模型对视频数据中的视频帧进行检测。其中,第一终端使用的操作系统的类型可以由第一终端发送给服务器,再由服务器转发给第二终端。When step S21 is performed, the operating system used by the first terminal may be determined first, and then the corresponding message pop-up window identification model is invoked to detect video frames in the video data. The type of the operating system used by the first terminal may be sent by the first terminal to the server, and then forwarded by the server to the second terminal.
相比于与使用一个消息弹窗识别模型检测所有操作系统下录制的视频帧中的所有消息弹窗的方案,针对每一种操作系统训练对应的消息弹窗识别模型时,每一种消息弹窗识别模型所需要学习的消息弹窗的图像特征较少,因此可以比前一种方案更快的完成模型的训练,并且,因为在检测的过程中需要检测的消息弹窗的图像特征的种类较为单一,针对于特定操作系统的消息弹窗识别模型的检测结果相对于前一种方案的消息弹窗识别模型的检测结果具有较高的准确度。Compared with the scheme of using one message popup recognition model to detect all message popups in video frames recorded under all operating systems, when training the corresponding message popup recognition model for each operating system, each message popup The window recognition model needs to learn fewer image features of the message pop-up window, so the training of the model can be completed faster than the previous scheme, and because of the types of image features of the message pop-up window that need to be detected during the detection process It is relatively simple, and the detection result of the message pop-up window recognition model for a specific operating system has higher accuracy than the detection result of the message pop-up window recognition model of the previous scheme.
利用图像识别技术逐一判断视频数据的每个视频帧是否包含消息弹窗,会消耗相应的电子设备较多的计算资源,因此,本公开实施例提供了另一种视频数据的处理方法,请参考图5,该方法可以包括如下步骤:Using image recognition technology to determine whether each video frame of video data contains a message pop-up window will consume more computing resources of the corresponding electronic device. Therefore, the embodiment of the present disclosure provides another video data processing method, please refer to Figure 5, the method may include the following steps:
如图5所示的实施例提供的处理方法可以由第一终端执行。The processing method provided by the embodiment shown in FIG. 5 may be executed by the first terminal.
S51、实时监听目标设备的消息推送服务,得到消息推送服务的待推送消息的推送时刻。S51. Monitor the message push service of the target device in real time, and obtain the push time of the message to be pushed of the message push service.
目标设备,相当于前文所述的第一终端。消息推送服务,指代在第一终端上运行的负责推送消息的程序,消息推送服务可以在收到消息推送服务器发送至第一终端的待推送消息后,以消息弹窗的形式在屏幕上显示待推送消息,也就是说,消息推送服务可以认为是第一终端中,用于控制消息弹窗中的消息内容以及消息弹窗的显示时间的程序。The target device is equivalent to the first terminal described above. The message push service refers to the program running on the first terminal responsible for pushing messages. The message push service can display the message on the screen in the form of a message pop-up window after receiving the message to be pushed sent by the message push server to the first terminal. The message to be pushed, that is, the message push service can be considered as a program in the first terminal for controlling the content of the message in the message pop-up window and the display time of the message pop-up window.
到达待推送消息的推送时刻之后,消息推送服务就开始在第一终端的屏幕上弹出显示有待推送消息的消息弹窗。After the push time of the message to be pushed is reached, the message push service starts to pop up a message pop-up window displaying the message to be pushed on the screen of the first terminal.
S52、从视频数据包含的位于待推送消息的推送时刻之后预设时长内的视频帧中,查找目标视频帧。S52: Search for a target video frame from the video frames included in the video data and located within a preset time period after the push time of the message to be pushed.
如图3所示,消息弹窗开始弹出后,需要经过一段弹出时间,才会在第一终端的屏幕上完全显示,同时,消息弹窗在屏幕上完全显示后,若用户不执行任何操作,消息弹窗会停留一段时间,然后自动消失。As shown in Figure 3, after the message pop-up window starts to pop up, it will take a period of time to fully display on the screen of the first terminal. At the same time, after the message pop-up window is completely displayed on the screen, if the user does not perform any operation, The message popup will stay for a while and then disappear automatically.
因此,在步骤S52中,可以对视频数据中,位于待推送消息的推送时刻之后的预设时长内的视频帧中查找目标视频帧。这里的预设时长可以设定为预估的消息弹窗的弹出时间,与消息弹窗完全显示后的停留时间之和,或者可以在两者之和的基础上上调。Therefore, in step S52, the target video frame may be searched for in the video data within the preset time period after the push time of the message to be pushed. The preset duration here can be set as the sum of the estimated pop-up time of the message pop-up window and the stay time after the message pop-up window is completely displayed, or it can be increased on the basis of the sum of the two.
例如,假设在一个第一终端中,消息弹窗的弹出时间为1s(秒),即从开始弹出到完全显示需要经过1s,消息弹窗完全显示后的停留时间为5s,那么上述预设时长可以设定为6s(或设定为7s,根据实 际情况决定)。For example, assuming that in a first terminal, the pop-up time of the message pop-up window is 1s (seconds), that is, it takes 1s from the start of the pop-up to the complete display, and the stay time after the message pop-up window is completely displayed is 5s, then the above preset duration It can be set to 6s (or set to 7s, depending on the actual situation).
若从消息推送服务监听到一条待推送消息预定的推送时刻为10:05:20,即10点零五分第20秒开始弹出消息弹窗,那么在步骤S52中,就可以对10:05:20到10:05:27这段时间内录制得到的视频帧进行检测,从而在这些视频帧中查找出包含消息弹窗的目标视频帧。If the scheduled push time of a message to be pushed is monitored from the message push service at 10:05:20, that is, the message pop-up window starts to pop up at the 20th second at 10:05, then in step S52, you can respond to 10:05: The video frames recorded during the period from 20 to 10:05:27 are detected, and the target video frames containing the message pop-up window are found in these video frames.
相应的,对于视频数据中,位于待推送消息的推送时刻之前的,以及位于待推送消息的推送时刻之后预设时长之外的视频帧,就不需要进行上述查找。Correspondingly, in the video data, for the video frames located before the push time of the message to be pushed and beyond the preset duration after the push time of the message to be pushed, the above search is not required.
例如,在上述例子中,若录屏的过程中,消息推送服务只在10:05:20这一个推送时刻推送消息,则只需要在上述时间段内录制的视频帧中查找目标视频帧,对于在上述时间外(包括在上述时间段之前和之后)录制得到的视频帧可以不进行查找。For example, in the above example, if the message push service only pushes the message at the push time of 10:05:20 during the screen recording process, it only needs to find the target video frame in the video frames recorded in the above time period. For The video frames recorded outside the above time period (including before and after the above time period) may not be searched.
S53、响应于视频数据中查找得到目标视频帧,确定目标视频帧中消息弹窗的所在区域。S53, in response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame.
S54、对目标视频帧的消息弹窗的所在区域进行处理,得到替换视频帧。S54. Process the area where the message pop-up window of the target video frame is located to obtain a replacement video frame.
步骤S53和步骤S54的执行过程过程,与前述图2对应的实施例中步骤S22和步骤S23一致,此处不再详述。The execution process of step S53 and step S54 is the same as that of step S22 and step S23 in the embodiment corresponding to FIG. 2, and will not be described in detail here.
本公开实施例中,消息弹窗相当于是消息推送服务向用户展示待推送消息的一种工具,因此,只有在消息推送服务有待推送消息时,才会出现相应的消息弹窗,而在消息推送服务确定的推送时刻之前,以及消息推送服务完成消息推送,且显示的消息弹窗消失之后,可以认为第一终端的屏幕上不会显示消息,因此,可以只对推送时刻之后预设时长内的视频帧进行检测,以确定出其中的目标视频帧,并进行打码处理,而对位于推送时刻之后预设时长之外的视频帧,可以不利用前述图像识别技术进行检测。In the embodiment of the present disclosure, the message pop-up window is equivalent to a tool for the message push service to display the messages to be pushed to the user. Therefore, the corresponding message pop-up window will appear only when the message push service is to push messages. Before the push time determined by the service, and after the message push service completes the message push and the displayed message pop-up window disappears, it can be considered that no message will be displayed on the screen of the first terminal. The video frame is detected to determine the target video frame, and the coding processing is performed, and the video frame located beyond the preset time period after the push time may not be detected using the aforementioned image recognition technology.
可见,上述方案可以减少需要用图像识别技术检测的视频帧的数量,从而减少执行相应的处理方法的设备所消耗的计算资源。It can be seen that the above solution can reduce the number of video frames that need to be detected by the image recognition technology, thereby reducing the computing resources consumed by the device executing the corresponding processing method.
在一些实施例中,图5对应的实施例提供的方法经过如下调整后,也可以适用于服务器和第二终端:In some embodiments, the method provided by the embodiment corresponding to FIG. 5 can also be applied to the server and the second terminal after the following adjustments:
第一终端可以在录制视频数据的过程中,实时的监听第一终端的消息推送服务,并将监听得到的待推送消息的推送时刻记录在视频数据中,也就是将录屏过程中监听得到的若干个推送时刻和视频数据一并发送至服务器,同时服务器也可以将上述数据一并转发给第二终端,这样服务器和第二终端均可以根据记录的多个待推送消息的推送时刻确定出收到的视频数据中哪些时间段可能出现目标视频帧,然后在查找时只对这些时间段内的视频帧进行查找。The first terminal may monitor the message push service of the first terminal in real time during the process of recording the video data, and record the push time of the message to be pushed obtained by monitoring in the video data, that is, monitor the information obtained during the screen recording process. Several push times and video data are sent to the server together, and the server can also forward the above data to the second terminal, so that both the server and the second terminal can determine the receipt according to the recorded push times of multiple messages to be pushed. Which time segments in the received video data may appear the target video frame, and then only the video frames within these time segments are searched when searching.
在一些实施例中,在某些设备中,执行本公开提供的处理方法的程序可能不具有监听消息推送服务的权限,本公开实施例提供了另一种视频数据的处理方法,用于在不具备监听消息推送服务的权限时,在查找目标视频帧之前对视频数据进行筛选的方法,请参考图6,该方法可以包括如下步骤:In some embodiments, in some devices, the program executing the processing method provided by the present disclosure may not have the right to monitor the message push service. The embodiment of the present disclosure provides another video data processing method, which is used for When having the authority to monitor the message push service, the method for screening video data before searching for the target video frame, please refer to FIG. 6, the method may include the following steps:
S61、在视频数据的音轨中检测消息弹窗对应的消息提示音。S61. Detect the message prompt sound corresponding to the message pop-up window in the audio track of the video data.
如前文所述,在录屏的过程中,可以一并录制第一终端输出的声音,作为和视频数据同步的音轨。那么,在视频作者设置出现消息弹窗时第一终端发出消息提示音的前提下,当视频数据中出现消息弹窗时,视频数据的音轨也会出现对应的消息提示音。As mentioned above, during the screen recording process, the sound output by the first terminal may be recorded together as a sound track synchronized with the video data. Then, on the premise that the video author sets the first terminal to emit a message prompt sound when a message pop-up window appears, when a message pop-up window appears in the video data, a corresponding message prompt sound will also appear on the audio track of the video data.
屏幕上显示消息弹窗的时间和第一终端发出对应的消息提示音的时间可能不完全一致,例如,可能先发出消息提示音,经过几秒后才出现消息弹窗,也可能消息弹窗出现几秒之后,第一终端才输出对应的消息提示音。The time when the message pop-up window is displayed on the screen may not be exactly the same as the time when the first terminal sends out the corresponding message prompt tone. For example, the message prompt tone may be issued first, and the message pop-up window may appear after a few seconds, or the message pop-up window may appear. After a few seconds, the first terminal outputs a corresponding message prompt tone.
对消息提示音的检测可以利用任意一种现有的音频特征识别方法实现。在一些实施例中,可以记录多种常见的消息提示音的音频特征,然后逐一检测视频数据的音轨中是否出现其中任意一种消息提示音的音频特征,当在某一时刻检测到音轨中出现预先记录的任意一种消息提示音的音频特征,就判断出该 时刻为消息提示音的出现时刻。The detection of the message prompt tone can be realized by any existing audio feature recognition method. In some embodiments, the audio features of a variety of common message prompt tones can be recorded, and then it is detected whether any one of the audio features of the message prompt sound appears in the audio track of the video data one by one. When the audio track is detected at a certain moment If the audio feature of any pre-recorded message prompt tone appears in the audio system, it is determined that the moment is the appearance time of the message prompt tone.
S62、从视频数据中,截取位于消息提示音的出现时刻之前预设时长内的多个视频帧、以及位于消息提示音的出现时刻之后预设时长内的多个视频帧。S62. Intercept, from the video data, a plurality of video frames within a preset time period before the appearance time of the message prompt sound, and multiple video frames within a preset time period after the appearance time of the message prompt sound.
考虑到第一终端显示消息弹窗的时间和输出对应的消息提示音的时间可能不一致,在步骤S62中需要将消息提示音出现时刻之前和出现时刻之后的预设时长内的多个视频帧均截取出来,以便在后续步骤中对截取的这些视频帧进行检测,从中找到包含消息弹窗的目标视频帧。Considering that the time when the first terminal displays the message pop-up window and the time when the corresponding message prompt sound is output may be inconsistent, in step S62, multiple video frames in the preset duration before and after the appearance time of the message prompt sound need to be all displayed. The intercepted video frames can be detected in the subsequent steps, and the target video frames containing the message pop-up window can be found therefrom.
其中,在出现时刻之前的预设时长和在出现时刻之后的预设时长的长短,可以由第一终端根据以往的消息弹窗的显示时间和对应消息提示音的出现时刻确定。当本公开实施例提供的方法有服务器或第二终端执行时,第一终端可以确定上述时长并发送给服务器和第二终端。The lengths of the preset duration before the occurrence time and the preset duration after the occurrence time may be determined by the first terminal according to the display time of the previous message pop-up window and the occurrence time of the corresponding message prompt sound. When the method provided by the embodiment of the present disclosure is executed by the server or the second terminal, the first terminal may determine the above-mentioned duration and send it to the server and the second terminal.
在一个具体的例子中,假设在音轨中检测到10:05:20出现了消息提示音,出现时刻之前和出现时刻之后的预设时长均为10s,那么在步骤S62中,就需要截取视频数据中10:05:10至10:05:30这段时间内录制的每一个视频帧,然后在步骤S63中从这20秒内的多个视频帧中查找出目标视频帧。In a specific example, it is assumed that a message prompt sound at 10:05:20 is detected in the audio track, and the preset durations before and after the occurrence time are both 10s, then in step S62, the video needs to be intercepted For each video frame recorded during the period from 10:05:10 to 10:05:30 in the data, in step S63, the target video frame is searched out from the multiple video frames within the 20 seconds.
可以理解的,本公开实施例提供的处理方法一般在点播形式下适用,若视频数据以直播的形式实时的向第二终端的视频观众播放,考虑到消息弹窗的显示时间和消息提示音的出现时刻不同步,有可能在从音轨中检测出消息提示音之后,第二终端播放的视频中已经持续显示了若干秒消息弹窗,因此,将本公开实施例提供的方法应用于直播中效果较差。It can be understood that the processing methods provided by the embodiments of the present disclosure are generally applicable in the form of on-demand. If the video data is played to the video viewers of the second terminal in real time in the form of live broadcast, considering the display time of the message pop-up window and the length of the message prompt sound. If the time of occurrence is not synchronized, it is possible that after the message prompt tone is detected from the audio track, a message pop-up window has been continuously displayed for several seconds in the video played by the second terminal. Therefore, the method provided by the embodiment of the present disclosure is applied to the live broadcast less effective.
相对于,在点播中,由于视频数据录制完成后会首先存储在服务器,而不会实时发送至第二终端进行播放,即使发送至第二终端,第二终端也可以先缓存在本地,在利用本公开实施例提供的方法对视频数据进行处理后再播放。In contrast, in VOD, since the video data will be stored on the server after the recording is completed, and will not be sent to the second terminal for playback in real time, even if it is sent to the second terminal, the second terminal can first cache it locally, and use the The method provided by the embodiment of the present disclosure processes the video data before playing.
因此,可以在检测到消息提示音之后再对消息提示音出现时刻之前的多个视频帧进行查找,并对其中出现的目标视频帧进行打码,从而确保在第二终端播放视频数据时,每一个目标视频帧中消息弹窗的所在区域均被添加的遮挡图像覆盖,即每一个目标视频帧中的消息弹窗均被打码。Therefore, after the message prompt sound is detected, it is possible to search for a plurality of video frames before the time when the message prompt sound appears, and code the target video frame that appears in it, so as to ensure that when the second terminal plays the video data, each The area where the message pop-up window is located in a target video frame is covered by the added occlusion image, that is, the message pop-up window in each target video frame is coded.
可以理解的,本公开实施例提供的方法在第一终端开启消息提示音功能的情况下才适用,若视频作者将第一终端设置于静音模式,或者关闭了第一终端的消息提示音的功能,则不适用本公开实施例提供的处理方法。It is understandable that the method provided by the embodiment of the present disclosure is only applicable when the first terminal enables the function of the message prompt tone. If the video author sets the first terminal to the silent mode, or disables the function of the first terminal's message prompt tone. , the processing method provided by the embodiment of the present disclosure is not applicable.
S63、在截取得到的多个视频帧中查找所述目标视频帧。S63. Search for the target video frame in the multiple video frames obtained through interception.
S64、响应于视频数据中查找得到目标视频帧,确定目标视频帧中消息弹窗的所在区域。S64, in response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame.
S65、对目标视频帧的消息弹窗的所在区域进行处理,得到替换视频帧。S65: Process the area where the message pop-up window of the target video frame is located to obtain a replacement video frame.
在执行本公开提供的方法的程序不具备监听消息推送服务的权限的情况下,通过检测视频数据的音轨中的消息提示音在视频数据的大量视频帧中初步筛选出有可能出现消息弹窗的视频帧,并利用图像识别技术对这些筛选得到的可能出现消息弹窗的视频帧进行检测。而同等时长下,音频数据的数据量一般小于视频的图像数据的数据量,相应的,检测音轨中当前时刻是否出现消息提示音的音频特征复杂度,相对低于利用图像识别技术检测当前时刻的视频帧是否包含消息弹窗的复杂度,因此,本公开实施例提供的方法可以在不具备监听消息推送服务的权限的情况下适当的减少本公开提供的视频处理方法所消耗的计算资源。In the case where the program executing the method provided by the present disclosure does not have the authority to monitor the message push service, it is possible to preliminarily screen out a message pop-up window from a large number of video frames of the video data by detecting the message prompt sound in the audio track of the video data. video frames, and use image recognition technology to detect these screened video frames that may have message pop-up windows. Under the same duration, the data volume of audio data is generally smaller than that of video image data. Correspondingly, the audio feature complexity of detecting whether a message prompt sound occurs at the current moment in the audio track is relatively lower than that of using image recognition technology to detect the current moment. Therefore, the method provided by the embodiment of the present disclosure can appropriately reduce the computing resources consumed by the video processing method provided by the present disclosure without the authority to monitor the message push service.
如前文所述,本公开实施例中,针对目标视频帧的消息弹窗所在区域的图像处理方法,可以是对目标视频帧中消息弹窗的所在区域添加遮挡图像,其中,用于添加至消息弹窗所在区域的遮挡图像,可以通过下述任意一种方案获得:As mentioned above, in this embodiment of the present disclosure, the image processing method for the area where the message pop-up window of the target video frame is located may be to add an occlusion image to the area where the message pop-up window is located in the target video frame, wherein The occlusion image of the area where the popup window is located can be obtained by any of the following schemes:
第一种方案中,处理程序(指执行本公开提供的视频数据的处理方法的程序)可以预先生成尺寸和 常见的消息弹窗的尺寸一致的遮挡图像,并将生成的遮挡图像存储设备本地的存储介质中,每次对一个目标视频帧添加遮挡图像时,直接从存储介质中读取之前生成的遮挡图像,然后将读取的遮挡图像添加至消息弹窗的所在区域即可。In the first solution, a processing program (referring to a program for executing the video data processing method provided by the present disclosure) can generate an occlusion image with the same size as that of a common message pop-up window in advance, and store the generated occlusion image in the local device of the device. In the storage medium, each time an occlusion image is added to a target video frame, the previously generated occlusion image is directly read from the storage medium, and then the read occlusion image is added to the area where the message pop-up window is located.
第二种方案是,每次要添加遮挡图像之前,首先确定当前要添加遮挡图像的这个消息弹窗的所在区域的尺寸;The second solution is to first determine the size of the area where the message pop-up window to which the occlusion image is currently to be added is located before each occlusion image is added;
然后生成尺寸与消息弹窗的所在区域的尺寸一致的遮挡图像;Then generate an occlusion image whose size is consistent with the size of the area where the message pop-up window is located;
最后在所述消息弹窗的所在区域添加前一步骤生成的遮挡图像,得到替换视频帧。Finally, the occlusion image generated in the previous step is added to the area where the message pop-up window is located to obtain a replacement video frame.
也就是说,在第二种方案中,每次添加遮挡图像之前均需要基于当前的这个目标视频帧中消息弹窗所在区域的尺寸生成相应的遮挡图像,然后才能将生成的遮挡图像添加至消息弹窗的所在区域。That is to say, in the second solution, each time before adding an occlusion image, a corresponding occlusion image needs to be generated based on the size of the area where the message pop-up window is located in the current target video frame, and then the generated occlusion image can be added to the message The area where the popup is located.
第一种方案可以直接利用已有的遮挡图像,不需要每次给消息弹窗打码时重新生成新的遮挡图像,可以缩短处理每一个目标视频帧所需要的时间,提高处理效率。The first solution can directly use the existing occlusion image, and does not need to regenerate a new occlusion image every time the message pop-up window is coded, which can shorten the time required to process each target video frame and improve the processing efficiency.
而第二种方案可以确保每次添加的遮挡图像的尺寸均和消息弹窗的所在区域的尺寸一致,既不会出现消息弹窗的某一部分未被遮挡的情况,同时也不会由于遮挡图像尺寸过大而影响视频观众正常观看视频帧中的其他区域。The second solution can ensure that the size of the occlusion image added each time is the same as the size of the area where the message pop-up window is located. The size is too large to interfere with the normal viewing of other areas in the video frame by the video viewer.
不论在第一种方案还是在第二种方案中,生成的遮挡图像的样式均可以由用户在相应的选择界面中定义。No matter in the first solution or the second solution, the style of the generated occlusion image can be defined by the user in the corresponding selection interface.
也就是说,处理程序可以在开始处理视频数据之前,获取用户的选择指令,然后将预设的多种备选图像模板中,被选择指令选中的备选图像模板确定为目标图像模板。That is, the processing program may obtain the user's selection instruction before starting to process the video data, and then determine the candidate image template selected by the selection instruction among the preset multiple candidate image templates as the target image template.
其中,上述多种备选图像模板,可以包括多种备选马赛克样式和多张预设的图像。这里的预设图像,可以包括处理程序从网络下载的图像,也可以包括用户自定义的图像(例如用户自己拍摄的照片)。Wherein, the above-mentioned multiple candidate image templates may include multiple candidate mosaic styles and multiple preset images. The preset image here may include an image downloaded from the network by the processing program, or may include a user-defined image (for example, a photo taken by the user).
随后,就可以利用目标图像模板生成对应的遮挡图像。具体在第一种方案中,可以利用目标图像模板生成常见的消息弹窗的尺寸的遮挡图像,在第二种方案中,可以在每次要添加遮挡图像之前,利用目标图像模板,生成尺寸与消息弹窗的所在区域的尺寸一致的遮挡图像。Then, the corresponding occlusion image can be generated using the target image template. Specifically, in the first scheme, the target image template can be used to generate an occlusion image of the size of a common message pop-up window. In the second scheme, the target image template can be used to generate a size equal to An occlusion image with the same size as the area where the message popup is located.
在一些实施例中,当本公开提供的处理方法由第一终端执行时,上述获取用户的选择指令,可以是,在开始处理视频之前(若应用于直播场景,视频数据的处理和录制同步,那么,开始处理视频之前其实就相当于在开始录屏之前),在第一终端的屏幕上显示一个备选图像模板的选择界面,选择界面中可以显示多种备选马赛克样式和多张预设的图像,另外还可以显示自定义图像的选项,以支持视频作者使用自己上传的图像作为遮挡图像。In some embodiments, when the processing method provided by the present disclosure is executed by the first terminal, the above-mentioned obtaining the user's selection instruction may be, before starting to process the video (if it is applied to a live broadcast scenario, the processing and recording of the video data are synchronized, Then, before starting to process the video, it is actually equivalent to before starting the screen recording), a selection interface of an alternative image template is displayed on the screen of the first terminal, and a variety of alternative mosaic styles and multiple presets can be displayed in the selection interface. , plus the option to display custom images to support video authors using their own uploaded images as occlusion images.
然后,在视频作者点击其中一种备选图像模板后,处理程序就可以将视频作者的点击识别为选择指令,然后将被点击的备选图像模板确定为目标图像模板。Then, after the video author clicks one of the candidate image templates, the processing program may recognize the click of the video author as a selection instruction, and then determine the clicked candidate image template as the target image template.
当本公开提供的处理方法由服务器执行时,第一终端可以通过上述方式获得用户的选择指令,然后将选择指令发送给服务器,使服务器确定目标图像模板。另外,服务器也可以在本地的控制终端上向服务器的管理人员显示上述选择界面,由管理人员通过在选择界面中点击的方式输入选择指令。When the processing method provided by the present disclosure is executed by the server, the first terminal can obtain the user's selection instruction in the above manner, and then send the selection instruction to the server, so that the server determines the target image template. In addition, the server can also display the above-mentioned selection interface to the administrator of the server on the local control terminal, and the administrator can input the selection instruction by clicking on the selection interface.
当本公开提供的处理方法由第二终端执行时,上述用户的选择指令,可以是当前使用第二终端的视频观众的点击指令,类似的,第二终端也可以在屏幕上显示上述选择界面,然后由视频观众在多种备选图像模板中选择一种作为目标图像模板。When the processing method provided by the present disclosure is executed by the second terminal, the above-mentioned user's selection instruction may be a click instruction of a video viewer currently using the second terminal. Similarly, the second terminal may also display the above-mentioned selection interface on the screen, The video viewer then selects one of a variety of alternative image templates as the target image template.
其中,马赛克可以理解为由简单的几何图形在一定区域内重复填充得到的图像,相应的,界面中显示的多种备选马赛克样式,就可以理解为多种可用于填充的几何图形(也可以称为马赛克图案)。另外,用户还可以在选择界面中设定选中的几何图形的填充属性,如填充颜色,在特定区域填充时的密度,每个几何图形的大小等。Among them, a mosaic can be understood as an image obtained by repeatedly filling a certain area with a simple geometric figure. Correspondingly, the various alternative mosaic styles displayed in the interface can be understood as a variety of geometric figures that can be used for filling (or called a mosaic pattern). In addition, the user can also set the filling properties of the selected geometric figures in the selection interface, such as the filling color, the density of filling in a specific area, the size of each geometric figure, etc.
在前述第二种方案中,当选择的目标图像模板是多种备选马赛克样式中的一种时,生成尺寸与消息弹窗的所在区域的尺寸一致的遮挡图像的过程可以参考图7。In the foregoing second solution, when the selected target image template is one of multiple alternative mosaic styles, the process of generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located can refer to FIG. 7 .
如图7所示,在确定目标视频帧中消息弹窗的所在区域后,可以读取被选中作为目标图像模板的几何图形,然后基于消息弹窗所在区域的尺寸生成一个对应的空白区域,并在这个生成的空白区域中按用户在选择界面设定的填充属性填充多个被选中的几何图形,直至满足一定的结束条件为止,其中,填充条件可以是,填充几何图形在消息弹窗所在区域中覆盖的面积和消息弹窗所在区域的总面积的比值大于一定的阈值,最后将这个填充得到的图像作为遮挡图像添加至(或者说覆盖于)目标视频帧的消息弹窗所在区域,得到替换视频帧。As shown in Figure 7, after determining the area where the message pop-up window is located in the target video frame, you can read the geometric figure selected as the target image template, and then generate a corresponding blank area based on the size of the area where the message pop-up window is located, and In this generated blank area, multiple selected geometric figures are filled according to the filling attribute set by the user in the selection interface until a certain end condition is satisfied, wherein the filling condition can be that the filling geometric figure is in the area where the message pop-up window is located The ratio of the area covered in the message pop-up window to the total area of the area where the message pop-up window is located is greater than a certain threshold, and finally the filled image is added as an occlusion image to (or covered) the area where the message pop-up window of the target video frame is located, and is replaced. video frame.
填充马赛克图案生成遮挡图像在实际实施时较为简单,并且处理程序只需要保存简单的马赛克图案的数据,在填充时将这些图案进行复制即可,因此,通过填充马赛克图案生成遮挡图像,可以减少处理程序在电子设备中占用的存储空间。Filling the mosaic pattern to generate the occlusion image is relatively simple in actual implementation, and the processing program only needs to save the data of the simple mosaic pattern and copy these patterns during filling. Therefore, by filling the mosaic pattern to generate the occlusion image, the processing can be reduced. The storage space that a program occupies in an electronic device.
当被选择的目标图像模板是预设的一张图像时,基于目标图像模板,生成尺寸与消息弹窗的所在区域的尺寸一致的遮挡图像的过程可以参考图8。When the selected target image template is a preset image, based on the target image template, the process of generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located may refer to FIG. 8 .
如图8所示,首先可以生成一个尺寸和消息弹窗所在区域的尺寸一致的截图框(如图8中的矩形框),然后用这个截图框在选中的预设图像中截取得到局部的图像,截取得到的这个图像,就是尺寸与消息弹窗的所在区域的尺寸一致的遮挡图像,最后将这个截取的图像添加至目标视频帧的消息弹窗所在区域即可。As shown in Figure 8, firstly, you can generate a screenshot box whose size is the same as the size of the area where the message pop-up window is located (the rectangular box in Figure 8), and then use this screenshot box to capture a partial image in the selected preset image , the captured image is an occlusion image with the same size as the area where the message pop-up window is located. Finally, the intercepted image can be added to the area where the message pop-up window of the target video frame is located.
其中,截图的位置可以随机确定,也可以由用户(视频作者或者视频观众)指定,还可以和目标视频帧中消息弹窗所在的位置保持一致。The location of the screenshot may be determined randomly, or designated by the user (video author or video viewer), and may also be consistent with the location of the message pop-up window in the target video frame.
可选的马赛克样式的一般较少,难以满足不同的用户的个性化需求,通过在预设的图像中截取遮挡图像,可以允许用户进行更多的个性化设置,例如,视频作者可以选择偏好的照片作为截取遮挡图像的对象。There are generally few optional mosaic styles, which are difficult to meet the personalized needs of different users. By intercepting occlusion images from the preset images, users can be allowed to make more personalized settings. For example, the video author can choose the preferred one. Photos are used as objects to capture occluded images.
从图7和图8的示意图中可以看出,不论是基于预设的备选马赛克样式填充得到遮挡图像,还是从预设的图像中截取得到遮挡图像,最后添加的遮挡图像往往和目标视频帧中原本显示的图像内容有较大差异,导致显示的替换视频帧中有一个较为突兀的区域,在实际播放时,视频观众的观看体验较差。It can be seen from the schematic diagrams in Figures 7 and 8 that whether the occlusion image is obtained based on the preset alternative mosaic style filling, or the occlusion image is intercepted from the preset image, the occlusion image added at the end is often the same as the target video frame. There is a big difference in the content of the images originally displayed in the video, resulting in a more obtrusive area in the displayed replacement video frame, and the viewing experience of the video viewers is poor during actual playback.
因此,本公开实施例还提供一种生成尺寸与消息弹窗的所在区域的尺寸一致的遮挡图像的方法,该方法可以包括:Therefore, an embodiment of the present disclosure also provides a method for generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located. The method may include:
首先从视频数据读取目标视频帧的前一个不包含消息弹窗的视频帧。First, read the previous video frame of the target video frame that does not contain the message pop-up window from the video data.
上述步骤也可以认为是,读取位于目标视频帧之前,且距离目标视频帧最近的一个不包含消息弹窗的视频帧。The above steps can also be considered as reading a video frame that is located before the target video frame and is closest to the target video frame and does not contain a message pop-up window.
例如,假设当前需要添加遮挡图像的这个目标视频帧是视频数据中的第N个视频帧,其前两个视频帧均包含消息弹窗,那么可以读取这个目标视频帧之前的第三个视频帧,也就是视频数据的第N-3个视频帧。For example, assuming that the target video frame to which the occlusion image needs to be added is the Nth video frame in the video data, and the first two video frames contain message pop-ups, then the third video before the target video frame can be read. frame, that is, the N-3th video frame of the video data.
或者,第N个视频帧包含消息弹窗,但是前一个视频帧(即第N-1个视频帧)不包含消息弹窗,则读取前一个视频帧。Or, if the Nth video frame contains a message popup window, but the previous video frame (ie, the N-1th video frame) does not contain a message popup window, the previous video frame is read.
然后,在读取的这个视频帧中截取与消息弹窗位于同一区域的图像,得到遮挡图像。Then, an image located in the same area as the message pop-up window is intercepted in the read video frame to obtain an occlusion image.
上述方法执行的过程可以参考图9。For the process performed by the above method, reference may be made to FIG. 9 .
如图9所示,假设第N个视频帧为包含消息弹窗的目标视频帧,读取到的前一个不包含消息弹窗的视频帧为之前的第二个视频帧,即第N-2个视频帧,然后,基于目标视频帧中消息弹窗所在区域的尺寸, 生成一个相同尺寸的截图框,然后在第N-2个视频帧中消息弹窗所在的区域,用截图框从第N-2个视频帧中截取得到遮挡图像,并将遮挡图像添加至目标视频帧(即第N个视频帧)的消息弹窗所在区域,得到替换视频帧。As shown in Figure 9, it is assumed that the Nth video frame is the target video frame containing the message pop-up window, and the previous read video frame that does not contain the message pop-up window is the second previous video frame, that is, the N-2th video frame Then, based on the size of the area where the message pop-up window is located in the target video frame, a screenshot box of the same size is generated, and then in the area where the message pop-up window is located in the N-2th video frame, use the screenshot box to start from the Nth video frame. - Capture the occlusion image from 2 video frames, and add the occlusion image to the area where the message pop-up window of the target video frame (ie, the Nth video frame) is located to obtain the replacement video frame.
从图9可以看出,在上述生成遮挡图像的方法中,由于临近的前几个视频帧和当前要处理的这个目标视频帧所显示的内容的区别较小,因此,添加的遮挡图像和替换视频帧中其他区域(除消息弹窗所在区域以外的区域)的图像内容相近,用替换视频帧代替原本的视频数据中的目标视频帧之后,视频数据的视频观众在观看时不易发现对应区域添加了其他图像,从而在保护视频作者的隐私的同时,改善视频观众的观看体验。As can be seen from FIG. 9, in the above-mentioned method for generating an occlusion image, since the difference between the content displayed by the adjacent first few video frames and the current target video frame to be processed is small, the added occlusion image and the replacement The image content of other areas in the video frame (except the area where the message pop-up window is located) is similar. After replacing the target video frame in the original video data with the replacement video frame, the video viewer of the video data is not easy to find the corresponding area. other images to improve the viewing experience of video viewers while protecting the privacy of video authors.
除了添加遮挡图像以外,本公开实施例中针对消息弹窗所在区域的图像处理方法,还可以是,从目标视频帧中剪切消息弹窗,在这种处理方法中,替换视频帧,就是消息弹窗被剪切之后的视频帧。In addition to adding the occlusion image, the image processing method for the area where the message pop-up window is located in the embodiment of the present disclosure may also be to cut the message pop-up window from the target video frame. In this processing method, the replacement video frame is the message The video frame after the popup is cut.
图10为从目标视频帧中剪切消息弹窗的示意图,如图10所示,确定出目标视频帧中消息弹窗的所在区域之后,可以直接利用图像剪切技术,从目标视频帧中将消息弹窗剪切,得到替换视频帧,通过这种处理方法,替换视频帧中,原本消息弹窗的所在区域变更为空白区域。显然,这样得到的替换视频帧中并不包含消息弹窗内的文本,替换视频帧在第二终端上向视频观众显示时,视频观众也就无法看到消息弹窗内的消息,达到保护视频作者隐私的效果。Figure 10 is a schematic diagram of cutting a message pop-up window from a target video frame. As shown in Figure 10, after determining the area where the message pop-up window is located in the target video frame, the image cutting technology can be directly used to cut the message from the target video frame. The message pop-up window is cut to obtain a replacement video frame. Through this processing method, in the replacement video frame, the area where the original message pop-up window is located is changed to a blank area. Obviously, the replacement video frame obtained in this way does not contain the text in the message pop-up window. When the replacement video frame is displayed to the video viewer on the second terminal, the video viewer cannot see the message in the message pop-up window, so as to protect the video. The effect of author privacy.
最后,本公开实施例中针对消息弹窗所在区域的图像处理方法,还可以是对消息弹窗的所在区域的像素进行模糊处理,得到替换视频帧。在这种处理方法中,替换视频帧,就是包含模糊的消息弹窗的视频帧。Finally, in the image processing method for the area where the message pop-up window is located in the embodiment of the present disclosure, the pixels in the area where the message pop-up window is located may also be blurred to obtain a replacement video frame. In this processing method, the replacement video frame is the video frame that contains the blurred message popup.
图11为对消息弹窗的所在区域进行模糊处理的示意图,如图11所示,在目标视频帧中确定出消息弹窗的所在区域后,可以针对消息弹窗的所在区域内的像素应用图像模糊技术,使得目标视频帧中,在消息弹窗内清晰显示的文本模糊化。从图11可以看出,在模糊处理之后得到的替换视频帧中,消息弹窗内的文本无法被识别,相当于替换视频帧不包含消息弹窗内的文本,即使在终端设备上向视频观众显示图11所示的替换视频帧,也不会泄露视频作者的隐私。FIG. 11 is a schematic diagram of blurring the area where the message pop-up window is located. As shown in FIG. 11 , after the area where the message pop-up window is located is determined in the target video frame, an image can be applied to the pixels in the area where the message pop-up window is located. The blurring technology blurs the text clearly displayed in the message pop-up window in the target video frame. As can be seen from Figure 11, in the replacement video frame obtained after blurring, the text in the message pop-up window cannot be recognized, which is equivalent to that the replacement video frame does not contain the text in the message pop-up window, even if it is displayed to the video viewer on the terminal device The replacement video frame shown in Figure 11 is displayed without revealing the privacy of the video author.
相比于在消息弹窗的所在区域添加遮挡图像的方法,从目标视频帧中剪切消息弹窗和对消息弹窗的所在区域进行模糊处理这两种处理方法,不需要额外获取除待处理视频以外的图像资源,只需要针对处理目标视频帧自身进行剪切或模糊。因此,相比于添加遮挡图像的处理方法,后两种处理方法能够在更短的时间内完成对目标视频帧的处理,具有更高的处理效率,并且对电子设备的资源消耗也少于添加遮挡图像的处理方案。Compared with the method of adding an occlusion image to the area where the message pop-up window is located, the two processing methods of cutting the message pop-up window from the target video frame and blurring the area where the message pop-up window is located do not require additional acquisition except to be processed. Image resources other than video only need to be cut or blurred for the processing target video frame itself. Therefore, compared with the processing method of adding occlusion images, the latter two processing methods can complete the processing of the target video frame in a shorter time, have higher processing efficiency, and consume less resources on electronic devices than adding occlusion images. The processing scheme for occlusion images.
结合本公开任一实施例提供的视频数据的处理方法,本公开实施例还提供一种视频数据的处理装置,如图12所示,该装置可以包括如下单元:In combination with the video data processing method provided by any embodiment of the present disclosure, an embodiment of the present disclosure also provides a video data processing apparatus. As shown in FIG. 12 , the apparatus may include the following units:
查找单元1201,被配置为执行在视频数据中查找目标视频帧。The searching unit 1201 is configured to perform searching for a target video frame in the video data.
其中,视频数据通过录制目标设备的屏幕得到,目标视频帧包含消息弹窗。The video data is obtained by recording the screen of the target device, and the target video frame contains a message pop-up window.
确定单元1202,被配置为执行响应于视频数据中查找得到目标视频帧时,确定目标视频帧中消息弹窗的所在区域。The determining unit 1202 is configured to perform, in response to finding the target video frame in the video data, determining the area where the message pop-up window is located in the target video frame.
处理单元1203,被配置为执行对目标视频帧的消息弹窗所在区域进行处理,得到替换视频帧。The processing unit 1203 is configured to perform processing on the area where the message pop-up window of the target video frame is located to obtain the replacement video frame.
其中,替换视频帧不包含目标视频帧的消息弹窗内的文本,替换视频帧用于替换目标视频帧。Wherein, the replacement video frame does not include the text in the message pop-up window of the target video frame, and the replacement video frame is used to replace the target video frame.
在一些实施例中,上述处理装置,还包括:In some embodiments, the above-mentioned processing device further includes:
监听单元1204,被配置为执行实时监听目标设备的消息推送服务,得到消息推送服务的待推送消息的推送时刻;其中,目标设备是网络直播系统中的主播设备,也就是主播使用的终端设备。The monitoring unit 1204 is configured to perform real-time monitoring of the message push service of the target device, and to obtain the push time of the message to be pushed of the message push service; wherein, the target device is the host device in the network live broadcast system, that is, the terminal device used by the host.
其中,查找单元1201,具体执行:Wherein, the search unit 1201 specifically executes:
从视频数据包含的位于待推送消息的推送时刻之后预设时长内的视频帧中,查找目标视频帧。Find the target video frame from the video frames included in the video data and located within the preset time period after the push time of the message to be pushed.
在一些实施例中,上述处理装置还包括:In some embodiments, the above-mentioned processing device further includes:
检测单元1205,被配置为执行在视频数据的音轨中检测消息弹窗对应的消息提示音;The detection unit 1205 is configured to detect the message prompt sound corresponding to the message pop-up window in the audio track of the video data;
其中,查找单元,具体执行:Among them, to find the unit, the specific implementation is as follows:
从视频数据中,截取位于消息提示音的出现时刻之前的预设时长内的多个视频帧、以及位于消息提示音的出现时刻之后的预设时长内的多个视频帧;From the video data, intercept a plurality of video frames within a preset time length before the appearance moment of the message prompt sound and a plurality of video frames within a preset time length after the appearance time of the message prompt sound;
在截取得到的多个视频帧中查找目标视频帧。Find the target video frame among multiple captured video frames.
在一些实施例中,处理单元1203,具体执行:In some embodiments, the processing unit 1203 specifically executes:
从目标视频帧中剪切消息弹窗,得到替换视频帧。Cut the message popup from the target video frame to get the replacement video frame.
在一些实施例中,处理单元1203,具体执行:In some embodiments, the processing unit 1203 specifically executes:
对消息弹窗的所在区域内的像素进行模糊处理,得到替换视频帧。The pixels in the area where the message pop-up window is located are blurred to obtain the replacement video frame.
在一些实施例中,处理单元1203可以包括:In some embodiments, the processing unit 1203 may include:
尺寸确定单元,被配置为执行确定消息弹窗的所在区域的尺寸;a size determination unit, configured to determine the size of the area where the message pop-up window is located;
生成单元,被配置为执行生成尺寸与消息弹窗的所在区域的尺寸一致的遮挡图像;a generating unit, configured to generate an occlusion image whose size is consistent with the size of the area where the message pop-up window is located;
添加单元,被配置为执行在消息弹窗的所在区域添加生成的遮挡图像,得到替换视频帧。The adding unit is configured to add the generated occlusion image in the area where the message pop-up window is located to obtain the replacement video frame.
在一些实施例中,处理单元1203还包括:In some embodiments, the processing unit 1203 further includes:
模板确定单元,被配置为执行:Template determination unit, configured to execute:
获取用户的选择指令;Get the user's selection instruction;
将预设的多种备选图像模板中,被选择指令选中的备选图像模板确定为目标图像模板;其中,多种备选图像模板,包括多种备选马赛克样式和多张预设的图像;Among the preset multiple candidate image templates, the candidate image template selected by the selection instruction is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images ;
其中,生成单元生成尺寸与消息弹窗的所在区域的尺寸一致的遮挡图像时,具体执行:Wherein, when the generating unit generates an occlusion image whose size is consistent with the size of the area where the message pop-up window is located, it specifically executes:
根据目标图像模板,生成尺寸与消息弹窗的所在区域的尺寸一致的遮挡图像。According to the target image template, an occlusion image whose size is consistent with the size of the area where the message pop-up window is located is generated.
在一些实施例中,生成单元,具体执行:In some embodiments, the generating unit specifically executes:
从视频数据读取目标视频帧的前一个不包含消息弹窗的视频帧;Read the previous video frame of the target video frame that does not contain the message pop-up window from the video data;
截取前一个不包含消息弹窗的视频帧中与消息弹窗位于同一区域的图像,得到遮挡图像。The occlusion image is obtained by intercepting the image in the same area as the message popup in the previous video frame that does not contain the message popup.
本公开任一实施例提供的视频数据的处理装置,其具体工作原理可以参考本公开任一实施例提供的视频数据的处理方法中的对应步骤,此处不再详述。For the specific working principle of the video data processing apparatus provided by any embodiment of the present disclosure, reference may be made to the corresponding steps in the video data processing method provided by any embodiment of the present disclosure, which will not be described in detail here.
本公开关于一种视频数据的处理装置,其中,查找单元1201在视频数据中查找包含消息弹窗的目标视频帧,查找得到目标视频帧时,确定单元1202确定目标视频帧中消息弹窗的所在区域;处理单元1203对目标视频帧的消息弹窗所在区域进行处理,得到不包含消息弹窗内的文本的替换视频帧,其中,替换视频帧用于替换视频数据中的目标视频帧。在录屏过程中录制到的消息弹窗,其中的文本会被本方案中针对消息弹窗所在区域的图像处理方法删除,而不会泄露给观看视频数据的用户,由此,录视频的用户在录制视频的过程中既能够保护自身隐私,也能够正常地通过消息推送服务浏览消息。The present disclosure relates to an apparatus for processing video data, wherein the searching unit 1201 searches the video data for a target video frame containing a message pop-up window, and when the target video frame is obtained, the determining unit 1202 determines the location of the message pop-up window in the target video frame The processing unit 1203 processes the area where the message pop-up window of the target video frame is located to obtain a replacement video frame that does not contain the text in the message pop-up window, wherein the replacement video frame is used to replace the target video frame in the video data. In the message pop-up window recorded during the screen recording process, the text in it will be deleted by the image processing method for the area where the message pop-up window is located in this solution, and will not be leaked to users who watch the video data. In the process of recording video, you can not only protect your privacy, but also browse messages through the message push service normally.
如前文所述,本公开实施例提供的录屏视频的处理方法可以应用于第一终端,第二终端和服务器,相应的,上述录屏视频的处理装置也可以适用于第一终端,第二终端和服务器。As described above, the method for processing screen recording video provided by the embodiments of the present disclosure can be applied to the first terminal, the second terminal, and the server. Terminal and server.
本公开实施例还提供一种存储介质,用于存储计算机指令,当存储介质中的计算机指令由电子设备的处理器执行时,使得电子设备能够执行以下步骤:Embodiments of the present disclosure further provide a storage medium for storing computer instructions, and when the computer instructions in the storage medium are executed by a processor of an electronic device, the electronic device can perform the following steps:
在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;Find the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;In response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame;
处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。Process the area where the message pop-up window is located in the target video frame, and obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the replacement video frame is used to replace the target video frame.
在示例性实施例中,还提供了一种包括指令的存储介质,例如包括指令的存储器,上述指令可由图13所示的电子设备的处理器1301执行以完成上述方法。可选地,存储介质可以是非临时性计算机可读存储介质,例如,所述非临时性计算机可读存储介质可以是ROM、随机存取存储器(RAM)、CD-ROM、磁带、软盘和光数据存储设备等。In an exemplary embodiment, a storage medium including instructions, such as a memory including instructions, is also provided, and the above-mentioned instructions can be executed by the processor 1301 of the electronic device shown in FIG. 13 to complete the above-mentioned method. Alternatively, the storage medium may be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium may be ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage equipment, etc.
本公开实施例提供一种计算机程序产品,包括计算机程序/指令,该计算机程序/指令被执行时,实现以下步骤:An embodiment of the present disclosure provides a computer program product, including a computer program/instruction, when the computer program/instruction is executed, the following steps are implemented:
在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;Find the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;In response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame;
处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。Process the area where the message pop-up window is located in the target video frame, and obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the replacement video frame is used to replace the target video frame.
本公开实施例还提供一种电子设备,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为执行所述指令,实现以下步骤:An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions, and implement the following steps:
在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;Find the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;In response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame;
处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。Process the area where the message pop-up window is located in the target video frame, and obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the replacement video frame is used to replace the target video frame.
在一些实施例中,所述处理器,还用于实现以下步骤:In some embodiments, the processor is further configured to implement the following steps:
实时监听所述目标设备的消息推送服务,得到所述消息推送服务的待推送消息的推送时刻;其中,所述目标设备是网络直播系统中的主播设备;Monitor the message push service of the target device in real time, and obtain the push time of the message to be pushed of the message push service; wherein, the target device is an anchor device in a live webcast system;
其中,所述在视频数据中查找目标视频帧,包括:Wherein, the searching for the target video frame in the video data includes:
从所述视频数据包含的位于所述待推送消息的推送时刻之后预设时长内的视频帧中,查找所述目标视频帧。Find the target video frame from the video frames included in the video data and located within a preset time period after the push moment of the message to be pushed.
在一些实施例中,所述处理器,还用于实现以下步骤:In some embodiments, the processor is further configured to implement the following steps:
在所述视频数据的音轨中检测消息弹窗对应的消息提示音;Detecting the message prompt sound corresponding to the message pop-up window in the audio track of the video data;
其中,所述在视频数据中查找目标视频帧,包括:Wherein, the searching for the target video frame in the video data includes:
从所述视频数据中,截取位于所述消息提示音的出现时刻之前的预设时长内的多个视频帧、以及位于所述消息提示音的出现时刻之后的预设时长内的多个视频帧;From the video data, intercept a plurality of video frames within a preset time period before the appearance time of the message prompt sound and a plurality of video frames within a preset time period after the appearance time of the message prompt sound ;
在截取得到的多个视频帧中查找所述目标视频帧。The target video frame is searched for among the plurality of video frames obtained through interception.
在一些实施例中,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:In some embodiments, the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes:
从所述目标视频帧中裁剪掉所述消息弹窗,得到替换视频帧。The message pop-up window is cropped from the target video frame to obtain a replacement video frame.
在一些实施例中,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:In some embodiments, the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes:
对所述消息弹窗的所在区域内的像素进行模糊处理,得到替换视频帧。The pixels in the area where the message pop-up window is located are blurred to obtain a replacement video frame.
在一些实施例中,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:In some embodiments, the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame includes:
确定所述消息弹窗的所在区域的尺寸;determining the size of the area where the message pop-up window is located;
生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像;generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located;
在所述消息弹窗的所在区域添加生成的遮挡图像,得到替换视频帧。The generated occlusion image is added to the area where the message pop-up window is located to obtain a replacement video frame.
在一些实施例中,所述处理器,还用于实现以下步骤:In some embodiments, the processor is further configured to implement the following steps:
获取用户的选择指令;Get the user's selection instruction;
将预设的多种备选图像模板中,被所述选择指令选中的备选图像模板确定为目标图像模板;其中,所述多种备选图像模板,包括多种备选马赛克样式和多张预设的图像;Among the preset multiple candidate image templates, the candidate image template selected by the selection instruction is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images;
其中,所述生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像,包括:Wherein, the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located includes:
根据所述目标图像模板,生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像。According to the target image template, an occlusion image whose size is consistent with the size of the area where the message pop-up window is located is generated.
在一些实施例中,所述生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像,包括:In some embodiments, the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located includes:
从所述视频数据读取所述目标视频帧的前一个不包含所述消息弹窗的视频帧;The previous video frame of the target video frame that does not contain the message pop-up window is read from the video data;
截取所述前一个不包含所述消息弹窗的视频帧中与所述消息弹窗位于同一区域的图像,得到遮挡图像。An image located in the same area as the message pop-up window in the previous video frame that does not contain the message pop-up window is intercepted to obtain an occlusion image.
图13是根据一示例性实施例示出的一种电子设备的结构图。参见图13,例如,该电子设备1300可以是移动电话,计算机,平板设备等终端设备,还可以是服务器设备。Fig. 13 is a structural diagram of an electronic device according to an exemplary embodiment. Referring to FIG. 13 , for example, the electronic device 1300 may be a terminal device such as a mobile phone, a computer, and a tablet device, and may also be a server device.
参照图1300,电子设备可以包括以下一个或多个组件:处理组件1302,存储器1304,电源组件1306,多媒体组件1308,音频组件1310,输入/输出(I/O)的接口1312,传感器组件1314,以及通信组件1316。Referring to diagram 1300, an electronic device may include one or more of the following components: a processing component 1302, a memory 1304, a power supply component 1306, a multimedia component 1308, an audio component 1310, an input/output (I/O) interface 1312, a sensor component 1314, And the communication component 1316.
处理组件1302通常用于执行电子设备1300的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件1302可以包括一个或多个处理器1320来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件1302可以包括一个或多个模块,便于处理组件1302和其他组件之间的交互。例如,处理组件1302可以包括多媒体模块,以方便多媒体组件1308和处理组件1302之间的交互。The processing component 1302 is generally used to perform overall operations of the electronic device 1300, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 1302 can include one or more processors 1320 to execute instructions to perform all or some of the steps of the methods described above. Additionally, processing component 1302 may include one or more modules that facilitate interaction between processing component 1302 and other components. For example, processing component 1302 may include a multimedia module to facilitate interaction between multimedia component 1308 and processing component 1302.
存储器1304被配置为存储各种类型的数据以支持在电子设备1300的操作。这些数据的示例包括用于在电子设备1300上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器1304可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。The memory 1304 is configured to store various types of data to support operation at the electronic device 1300 . Examples of such data include instructions for any application or method operating on electronic device 1300, contact data, phonebook data, messages, pictures, videos, and the like. Memory 1304 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, 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 Disk.
电源组件1306为电子设备1300的各种组件提供电力。电源组件1306可以包括电源管理系统,一个或多个电源,及其他与为电子设备1300生成、管理和分配电力相关联的组件。 Power supply assembly 1306 provides power to various components of electronic device 1300 . Power supply components 1306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 1300 .
多媒体组件1308包括在电子设备1300和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件1308包括一个前置摄像头和/或后置摄像头。当电子设备1300处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 1308 includes a screen that provides an output interface between electronic device 1300 and the 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 input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 1308 includes a front-facing camera and/or a rear-facing camera. When the electronic device 1300 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件1310被配置为输出和/或输入音频信号。例如,音频组件1310包括一个麦克风(MIC),当电子设备1300处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器1304或经由通信组件1316发送。在一些实施例中,音频组件1310还包括一个扬声器,用于输出音频信号。 Audio component 1310 is configured to output and/or input audio signals. For example, audio component 1310 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 1300 is in operating modes, such as call mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 1304 or transmitted via communication component 1316 . In some embodiments, audio component 1310 also includes a speaker for outputting audio signals.
I/O接口1312为处理组件1302和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 1312 provides an interface between the processing component 1302 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
传感器组件1314包括一个或多个传感器,用于为电子设备1300提供各个方面的状态评估。例如,传感器组件1314可以检测到电子设备1300的打开/关闭状态,组件的相对定位,例如所述组件为电子设备1300的显示器和小键盘,传感器组件1314还可以检测电子设备1300或电子设备1300一个组件的位置改变,用户与电子设备1300接触的存在或不存在,电子设备1300方位或加速/减速和电子设备1300的温度变化。传感器组件1314可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件1314还可以包括光传感器,如CMOS或CCD图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件1314还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 1314 includes one or more sensors for providing status assessments of various aspects of electronic device 1300 . For example, the sensor assembly 1314 can detect the open/closed state of the electronic device 1300, the relative positioning of the components, such as the display and the keypad of the electronic device 1300, the sensor assembly 1314 can also detect the electronic device 1300 or one of the electronic device 1300 Changes in the positions of components, presence or absence of user contact with the electronic device 1300 , orientation or acceleration/deceleration of the electronic device 1300 and changes in the temperature of the electronic device 1300 . Sensor assembly 1314 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 1314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor component 1314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件1316被配置为便于电子设备1300和其他设备之间有线或无线方式的通信。电子设备1300可以接入基于通信标准的无线网络,如WiFi,运营商网络(如2G、3G、4G或5G),或它们的组合。在一个示例性实施例中,通信组件1316经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,通信组件1316还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。 Communication component 1316 is configured to facilitate wired or wireless communication between electronic device 1300 and other devices. Electronic device 1300 may access wireless networks based on communication standards, such as WiFi, carrier networks (eg, 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, the communication component 1316 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, the communication component 1316 also includes a near field communication (NFC) module to facilitate short-range communication. 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.
在示例性实施例中,电子设备1300可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行本公开任一实施例提供的视频数据的处理方法。In an exemplary embodiment, electronic device 1300 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 A programming gate array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components are implemented for executing the video data processing method provided by any embodiment of the present disclosure.
其中,当上述电子设备1300是移动电话,计算机,平板设备等终端设备,该电子设备可以包括图13所示的每一个组件,当上述电子设备是服务器设备,该电子设备可以只包括图13中的存储器1304,电源组件1306,处理组件1302和通信组件1316。Wherein, when the above-mentioned electronic device 1300 is a terminal device such as a mobile phone, a computer, a tablet device, etc., the electronic device may include each component shown in FIG. 13 , and when the above-mentioned electronic device is a server device, the electronic device may only include the components shown in FIG. 13 . The memory 1304, the power component 1306, the processing component 1302 and the communication component 1316.
本公开所有实施例均可以单独被执行,也可以与其他实施例相结合被执行,均视为本公开要求的保护范围。All the embodiments of the present disclosure can be implemented independently or in combination with other embodiments, which are all regarded as the protection scope required by the present disclosure.

Claims (26)

  1. 一种视频数据的处理方法,其特征在于,包括:A method for processing video data, comprising:
    在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;Find the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
    响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;In response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame;
    处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。Process the area where the message pop-up window is located in the target video frame, and obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the replacement video frame is used to replace the target video frame.
  2. 根据权利要求1所述的方法,其特征在于,所述方法还包括:The method according to claim 1, wherein the method further comprises:
    实时监听所述目标设备的消息推送服务,得到所述消息推送服务的待推送消息的推送时刻;其中,所述目标设备是网络直播系统中的主播设备;Monitor the message push service of the target device in real time, and obtain the push time of the message to be pushed of the message push service; wherein, the target device is an anchor device in a live webcast system;
    其中,所述在视频数据中查找目标视频帧,包括:Wherein, the searching for the target video frame in the video data includes:
    从所述视频数据包含的位于所述待推送消息的推送时刻之后预设时长内的视频帧中,查找所述目标视频帧。Find the target video frame from the video frames included in the video data and located within a preset time period after the push moment of the message to be pushed.
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, wherein the method further comprises:
    在所述视频数据的音轨中检测消息弹窗对应的消息提示音;Detecting the message prompt sound corresponding to the message pop-up window in the audio track of the video data;
    其中,所述在视频数据中查找目标视频帧,包括:Wherein, the searching for the target video frame in the video data includes:
    从所述视频数据中,截取位于所述消息提示音的出现时刻之前的预设时长内的多个视频帧、以及位于所述消息提示音的出现时刻之后的预设时长内的多个视频帧;From the video data, intercept a plurality of video frames within a preset time period before the appearance time of the message prompt sound and a plurality of video frames within a preset time period after the appearance time of the message prompt sound ;
    在截取得到的多个视频帧中查找所述目标视频帧。The target video frame is searched for among the plurality of video frames obtained through interception.
  4. 根据权利要求1至3任意一项所述的方法,其特征在于,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:The method according to any one of claims 1 to 3, wherein the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame comprises:
    从所述目标视频帧中裁剪掉所述消息弹窗,得到替换视频帧。The message pop-up window is cropped from the target video frame to obtain a replacement video frame.
  5. 根据权利要求1至4任意一项所述的方法,其特征在于,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:The method according to any one of claims 1 to 4, wherein the processing of the region where the message pop-up window is located in the target video frame to obtain a replacement video frame comprises:
    对所述消息弹窗的所在区域内的像素进行模糊处理,得到替换视频帧。The pixels in the area where the message pop-up window is located are blurred to obtain a replacement video frame.
  6. 根据权利要求1至5任意一项所述的方法,其特征在于,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:The method according to any one of claims 1 to 5, wherein the processing of the area where the message pop-up window is located in the target video frame to obtain a replacement video frame comprises:
    确定所述消息弹窗的所在区域的尺寸;determining the size of the area where the message pop-up window is located;
    生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像;generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located;
    在所述消息弹窗的所在区域添加生成的遮挡图像,得到替换视频帧。The generated occlusion image is added to the area where the message pop-up window is located to obtain a replacement video frame.
  7. 根据权利要求6所述的方法,其特征在于,还包括:The method of claim 6, further comprising:
    获取用户的选择指令;Get the user's selection instruction;
    将预设的多种备选图像模板中,被所述选择指令选中的备选图像模板确定为目标图像模板;其中,所述多种备选图像模板,包括多种备选马赛克样式和多张预设的图像;Among the preset multiple candidate image templates, the candidate image template selected by the selection instruction is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images;
    其中,所述生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像,包括:Wherein, the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located includes:
    根据所述目标图像模板,生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像。According to the target image template, an occlusion image whose size is consistent with the size of the area where the message pop-up window is located is generated.
  8. 根据权利要求6或7所述的方法,其特征在于,所述生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像,包括:The method according to claim 6 or 7, wherein the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located comprises:
    从所述视频数据读取所述目标视频帧的前一个不包含所述消息弹窗的视频帧;The previous video frame of the target video frame that does not contain the message pop-up window is read from the video data;
    截取所述前一个不包含所述消息弹窗的视频帧中与所述消息弹窗位于同一区域的图像,得到遮挡图像。An image located in the same area as the message pop-up window in the previous video frame that does not contain the message pop-up window is intercepted to obtain an occlusion image.
  9. 一种视频数据的处理装置,其特征在于,包括:A device for processing video data, comprising:
    查找单元,被配置为执行在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;a search unit, configured to search for a target video frame in video data, wherein the video data is video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
    确定单元,被配置为执行响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;a determining unit, configured to perform a search in the video data to obtain the target video frame, and determine the area where the message pop-up window is located in the target video frame;
    处理单元,被配置为执行处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。a processing unit, configured to process the area where the message pop-up window is located in the target video frame to obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the The replacement video frame is used to replace the target video frame.
  10. 根据权利要求9所述的装置,其特征在于,还包括:The device of claim 9, further comprising:
    监听单元,被配置为执行实时监听所述目标设备的消息推送服务,得到所述消息推送服务的待推送消息的推送时刻;其中,所述目标设备是网络直播系统中的主播设备;a monitoring unit, configured to perform real-time monitoring of the message push service of the target device, and obtain the push time of the message to be pushed of the message push service; wherein, the target device is an anchor device in a live webcast system;
    其中,所述查找单元被配置为执行:wherein the lookup unit is configured to perform:
    从所述视频数据包含的位于所述待推送消息的推送时刻之后预设时长内的视频帧中,查找所述目标视频帧。Find the target video frame from the video frames included in the video data and located within a preset time period after the push moment of the message to be pushed.
  11. 根据权利要求9或10所述的装置,其特征在于,还包括:The device according to claim 9 or 10, further comprising:
    检测单元,被配置为执行在所述视频数据的音轨中检测消息弹窗对应的消息提示音;a detection unit, configured to detect the message prompt sound corresponding to the message pop-up window in the audio track of the video data;
    其中,所述查找单元被配置为执行:wherein the lookup unit is configured to perform:
    从所述视频数据中,截取位于所述消息提示音的出现时刻之前的预设时长内的多个视频帧、以及位于所述消息提示音的出现时刻之后的预设时长内的多个视频帧;From the video data, intercept a plurality of video frames within a preset time period before the appearance time of the message prompt sound and a plurality of video frames within a preset time period after the appearance time of the message prompt sound ;
    在截取得到的多个视频帧中查找所述目标视频帧。The target video frame is searched for among the plurality of video frames obtained through interception.
  12. 根据权利要求9至11任意一项所述的装置,其特征在于,所述处理单元被配置为执行:The apparatus according to any one of claims 9 to 11, wherein the processing unit is configured to execute:
    从所述目标视频帧中剪切所述消息弹窗,得到替换视频帧。Cut the message pop-up window from the target video frame to obtain a replacement video frame.
  13. 根据权利要求9至12任意一项所述的装置,其特征在于,所述处理单元被配置为执行:The apparatus according to any one of claims 9 to 12, wherein the processing unit is configured to execute:
    对所述消息弹窗的所在区域内的像素进行模糊处理,得到替换视频帧。The pixels in the area where the message pop-up window is located are blurred to obtain a replacement video frame.
  14. 根据权利要求9至13任意一项所述的装置,其特征在于,所述处理单元包括:The device according to any one of claims 9 to 13, wherein the processing unit comprises:
    尺寸确定单元,被配置为执行确定所述消息弹窗的所在区域的尺寸;a size determination unit, configured to perform determining the size of the area where the message pop-up window is located;
    生成单元,被配置为执行生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像;a generating unit, configured to generate an occlusion image whose size is consistent with the size of the area where the message pop-up window is located;
    添加单元,被配置为执行在所述消息弹窗的所在区域添加生成的遮挡图像,得到替换视频帧。The adding unit is configured to execute adding the generated occlusion image in the area where the message pop-up window is located to obtain a replacement video frame.
  15. 根据权利要求14所述的装置,其特征在于,所述处理单元还包括:The apparatus according to claim 14, wherein the processing unit further comprises:
    模板确定单元,被配置为执行:Template determination unit, configured to execute:
    获取用户的选择指令;Get the user's selection instruction;
    将预设的多种备选图像模板中,被所述选择指令选中的备选图像模板确定为目标图像模板;其中,所述多种备选图像模板,包括多种备选马赛克样式和多张预设的图像;Among the preset multiple candidate image templates, the candidate image template selected by the selection instruction is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images;
    其中,所述生成单元生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像时,具体执行:Wherein, when the generating unit generates an occlusion image whose size is consistent with the size of the area where the message pop-up window is located, it specifically executes:
    根据所述目标图像模板,生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像。According to the target image template, an occlusion image whose size is consistent with the size of the area where the message pop-up window is located is generated.
  16. 根据权利要求14或15所述的装置,其特征在于,所述生成单元被配置为执行:The apparatus according to claim 14 or 15, wherein the generating unit is configured to perform:
    从所述视频数据读取所述目标视频帧的前一个不包含所述消息弹窗的视频帧;The previous video frame of the target video frame that does not contain the message pop-up window is read from the video data;
    截取所述前一个不包含所述消息弹窗的视频帧中与所述消息弹窗位于同一区域的图像,得到遮挡图像。An image located in the same area as the message pop-up window in the previous video frame that does not contain the message pop-up window is intercepted to obtain an occlusion image.
  17. 一种电子设备,其特征在于,包括:An electronic device, comprising:
    处理器;processor;
    用于存储所述处理器可执行指令的存储器;a memory for storing the processor-executable instructions;
    其中,所述处理器被配置为执行所述指令,以实现以下步骤:wherein the processor is configured to execute the instructions to implement the following steps:
    在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;Find the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
    响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;In response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame;
    处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。Process the area where the message pop-up window is located in the target video frame, and obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the replacement video frame is used to replace the target video frame.
  18. 如权利要求17所述的电子设备,其特征在于,所述处理器,还用于实现以下步骤:The electronic device of claim 17, wherein the processor is further configured to implement the following steps:
    实时监听所述目标设备的消息推送服务,得到所述消息推送服务的待推送消息的推送时刻;其中,所述目标设备是网络直播系统中的主播设备;Monitor the message push service of the target device in real time, and obtain the push time of the message to be pushed of the message push service; wherein, the target device is an anchor device in a live webcast system;
    其中,所述在视频数据中查找目标视频帧,包括:Wherein, the searching for the target video frame in the video data includes:
    从所述视频数据包含的位于所述待推送消息的推送时刻之后预设时长内的视频帧中,查找所述目标视频帧。Find the target video frame from the video frames included in the video data and located within a preset time period after the push moment of the message to be pushed.
  19. 如权利要求17或18所述的电子设备,其特征在于,所述处理器,还用于实现以下步骤:The electronic device according to claim 17 or 18, wherein the processor is further configured to implement the following steps:
    在所述视频数据的音轨中检测消息弹窗对应的消息提示音;Detecting the message prompt sound corresponding to the message pop-up window in the audio track of the video data;
    其中,所述在视频数据中查找目标视频帧,包括:Wherein, the searching for the target video frame in the video data includes:
    从所述视频数据中,截取位于所述消息提示音的出现时刻之前的预设时长内的多个视频帧、以及位于所述消息提示音的出现时刻之后的预设时长内的多个视频帧;From the video data, intercept a plurality of video frames within a preset time period before the appearance time of the message prompt sound and a plurality of video frames within a preset time period after the appearance time of the message prompt sound ;
    在截取得到的多个视频帧中查找所述目标视频帧。The target video frame is searched for among the plurality of video frames obtained through interception.
  20. 如权利要求17至19任意一项所述的电子设备,其特征在于,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:The electronic device according to any one of claims 17 to 19, wherein the processing of the region where the message pop-up window is located in the target video frame to obtain a replacement video frame, comprises:
    从所述目标视频帧中裁剪掉所述消息弹窗,得到替换视频帧。The message pop-up window is cropped from the target video frame to obtain a replacement video frame.
  21. 如权利要求17至20任意一项所述的电子设备,其特征在于,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:The electronic device according to any one of claims 17 to 20, wherein the processing of the region where the message pop-up window is located in the target video frame to obtain a replacement video frame comprises:
    对所述消息弹窗的所在区域内的像素进行模糊处理,得到替换视频帧。The pixels in the area where the message pop-up window is located are blurred to obtain a replacement video frame.
  22. 如权利要求17至21任意一项所述的电子设备,其特征在于,所述处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,包括:The electronic device according to any one of claims 17 to 21, wherein the processing of the region where the message pop-up window is located in the target video frame to obtain a replacement video frame, comprises:
    确定所述消息弹窗的所在区域的尺寸;determining the size of the area where the message pop-up window is located;
    生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像;generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located;
    在所述消息弹窗的所在区域添加生成的遮挡图像,得到替换视频帧。The generated occlusion image is added to the area where the message pop-up window is located to obtain a replacement video frame.
  23. 如权利要求22所述的电子设备,其特征在于,所述处理器,还用于实现以下步骤:The electronic device of claim 22, wherein the processor is further configured to implement the following steps:
    获取用户的选择指令;Get the user's selection instruction;
    将预设的多种备选图像模板中,被所述选择指令选中的备选图像模板确定为目标图像模板;其中,所述多种备选图像模板,包括多种备选马赛克样式和多张预设的图像;Among the preset multiple candidate image templates, the candidate image template selected by the selection instruction is determined as the target image template; wherein, the multiple candidate image templates include multiple candidate mosaic styles and multiple preset images;
    其中,所述生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像,包括:Wherein, the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located includes:
    根据所述目标图像模板,生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像。According to the target image template, an occlusion image whose size is consistent with the size of the area where the message pop-up window is located is generated.
  24. 如权利要求22或23所述的电子设备,其特征在于,所述生成尺寸与所述消息弹窗的所在区域的尺寸一致的遮挡图像,包括:The electronic device according to claim 22 or 23, wherein the generating an occlusion image whose size is consistent with the size of the area where the message pop-up window is located comprises:
    从所述视频数据读取所述目标视频帧的前一个不包含所述消息弹窗的视频帧;The previous video frame of the target video frame that does not contain the message pop-up window is read from the video data;
    截取所述前一个不包含所述消息弹窗的视频帧中与所述消息弹窗位于同一区域的图像,得到遮挡图像。An image located in the same area as the message pop-up window in the previous video frame that does not contain the message pop-up window is intercepted to obtain an occlusion image.
  25. 一种存储介质,其特征在于,当所述存储介质中的指令由电子设备的处理器执行时,使得所述电子设备能够执行以下步骤:A storage medium, characterized in that, when the instructions in the storage medium are executed by a processor of an electronic device, the electronic device can perform the following steps:
    在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;Find the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
    响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;In response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame;
    处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。。Process the area where the message pop-up window is located in the target video frame, and obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the replacement video frame is used to replace the target video frame. .
  26. 一种计算机程序产品,包括计算机程序/指令,其特征在于,所述计算机程序/指令被处理器执行时实现以下步骤:A computer program product, comprising a computer program/instruction, characterized in that, when the computer program/instruction is executed by a processor, the following steps are implemented:
    在视频数据中查找目标视频帧,其中,所述视频数据是录制目标设备的屏幕而得到的视频数据;所述目标视频帧包含消息弹窗;Find the target video frame in the video data, wherein the video data is the video data obtained by recording the screen of the target device; the target video frame contains a message pop-up window;
    响应于所述视频数据中查找得到所述目标视频帧,确定所述目标视频帧中消息弹窗的所在区域;In response to finding the target video frame in the video data, determine the area where the message pop-up window is located in the target video frame;
    处理所述目标视频帧中所述消息弹窗的所在区域,得到替换视频帧,以使得所述替换视频帧中不包含所述消息弹窗内的文本;其中,所述替换视频帧用于替换所述目标视频帧。Process the area where the message pop-up window is located in the target video frame, and obtain a replacement video frame, so that the replacement video frame does not contain the text in the message pop-up window; wherein, the replacement video frame is used to replace the target video frame.
PCT/CN2021/114602 2020-11-18 2021-08-25 Video data processing method and apparatus, computer storage medium, and electronic device WO2022105341A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011292633.6 2020-11-18
CN202011292633.6A CN112511779B (en) 2020-11-18 2020-11-18 Video data processing method and device, computer storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
WO2022105341A1 true WO2022105341A1 (en) 2022-05-27

Family

ID=74956724

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/114602 WO2022105341A1 (en) 2020-11-18 2021-08-25 Video data processing method and apparatus, computer storage medium, and electronic device

Country Status (2)

Country Link
CN (1) CN112511779B (en)
WO (1) WO2022105341A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668762A (en) * 2022-11-10 2023-08-29 荣耀终端有限公司 Screen recording method and device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112511779B (en) * 2020-11-18 2023-10-31 北京达佳互联信息技术有限公司 Video data processing method and device, computer storage medium and electronic equipment

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160261927A1 (en) * 2013-10-09 2016-09-08 Disney Enterprises, Inc. Method and System for Providing and Displaying Optional Overlays
CN106650441A (en) * 2016-11-01 2017-05-10 宇龙计算机通信科技(深圳)有限公司 Screen recording method and device
CN107071321A (en) * 2017-04-14 2017-08-18 努比亚技术有限公司 A kind of processing method of video file, device and terminal
CN107479886A (en) * 2017-08-08 2017-12-15 维沃移动通信有限公司 A kind of method for information display and mobile terminal
CN107948666A (en) * 2017-11-28 2018-04-20 北京潘达互娱科技有限公司 Internet video live broadcasting method, device, electronic equipment and computer-readable storage medium
CN108965982A (en) * 2018-08-28 2018-12-07 百度在线网络技术(北京)有限公司 Video recording method, device, electronic equipment and readable storage medium storing program for executing
CN110211029A (en) * 2019-05-14 2019-09-06 努比亚技术有限公司 A kind of record screen protection maintaining method, mobile terminal and computer readable storage medium based on anticipation mode
CN111107385A (en) * 2019-12-27 2020-05-05 北京达佳互联信息技术有限公司 Live video processing method and device
CN111783175A (en) * 2020-07-10 2020-10-16 深圳传音控股股份有限公司 Display interface privacy protection method, terminal and computer readable storage medium
CN112511779A (en) * 2020-11-18 2021-03-16 北京达佳互联信息技术有限公司 Video data processing method and device, computer storage medium and electronic equipment

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111901667B (en) * 2020-07-31 2021-08-20 腾讯科技(深圳)有限公司 Screen recording method and related device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160261927A1 (en) * 2013-10-09 2016-09-08 Disney Enterprises, Inc. Method and System for Providing and Displaying Optional Overlays
CN106650441A (en) * 2016-11-01 2017-05-10 宇龙计算机通信科技(深圳)有限公司 Screen recording method and device
CN107071321A (en) * 2017-04-14 2017-08-18 努比亚技术有限公司 A kind of processing method of video file, device and terminal
CN107479886A (en) * 2017-08-08 2017-12-15 维沃移动通信有限公司 A kind of method for information display and mobile terminal
CN107948666A (en) * 2017-11-28 2018-04-20 北京潘达互娱科技有限公司 Internet video live broadcasting method, device, electronic equipment and computer-readable storage medium
CN108965982A (en) * 2018-08-28 2018-12-07 百度在线网络技术(北京)有限公司 Video recording method, device, electronic equipment and readable storage medium storing program for executing
CN110211029A (en) * 2019-05-14 2019-09-06 努比亚技术有限公司 A kind of record screen protection maintaining method, mobile terminal and computer readable storage medium based on anticipation mode
CN111107385A (en) * 2019-12-27 2020-05-05 北京达佳互联信息技术有限公司 Live video processing method and device
CN111783175A (en) * 2020-07-10 2020-10-16 深圳传音控股股份有限公司 Display interface privacy protection method, terminal and computer readable storage medium
CN112511779A (en) * 2020-11-18 2021-03-16 北京达佳互联信息技术有限公司 Video data processing method and device, computer storage medium and electronic equipment

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116668762A (en) * 2022-11-10 2023-08-29 荣耀终端有限公司 Screen recording method and device
CN116668762B (en) * 2022-11-10 2024-04-05 荣耀终端有限公司 Screen recording method and device

Also Published As

Publication number Publication date
CN112511779A (en) 2021-03-16
CN112511779B (en) 2023-10-31

Similar Documents

Publication Publication Date Title
CN107801096B (en) Video playing control method and device, terminal equipment and storage medium
EP3561691B1 (en) Method and apparatus for displaying webpage content
TWI784942B (en) Method and device for capturing video in playback
WO2022105341A1 (en) Video data processing method and apparatus, computer storage medium, and electronic device
US20200007944A1 (en) Method and apparatus for displaying interactive attributes during multimedia playback
CN109245997B (en) Voice message playing method and device
RU2663709C2 (en) Method and device for data processing
WO2019206243A1 (en) Material display method, terminal, and computer storage medium
US20220417417A1 (en) Content Operation Method and Device, Terminal, and Storage Medium
CN111147779B (en) Video production method, electronic device, and medium
WO2022142871A1 (en) Video recording method and apparatus
WO2018076309A1 (en) Photographing method and terminal
CN109005446A (en) A kind of screenshotss processing method and processing device, electronic equipment, storage medium
WO2022073389A1 (en) Video picture display method and electronic device
CN112153396B (en) Page display method, device, system and storage medium
WO2022037393A1 (en) Multimedia resource processing method and apparatus
CN112312217A (en) Image editing method and device, computer equipment and storage medium
KR20230061519A (en) Screen capture methods, devices and electronics
CN110868632B (en) Video processing method and device, storage medium and electronic equipment
US11600300B2 (en) Method and device for generating dynamic image
WO2021237744A1 (en) Photographing method and apparatus
CN113568551A (en) Picture saving method and device
CN112511857B (en) Method, device, storage medium and terminal for preventing terminal from sleeping based on browser
CN116132790B (en) Video recording method and related device
CN116112780B (en) Video recording method and related device

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21893493

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 04/09/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21893493

Country of ref document: EP

Kind code of ref document: A1