Video data processing method and device, storage medium and electronic device
By performing frame extraction and transparency processing on videos with H.264 or H.265 encoding standards, synthesizing images and rendering, the problem of lack of transparency in videos is solved and the user experience and flexibility of video display are improved.
Patent Information
- Application Number
- CN202210581162.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2042-05-26
AI Technical Summary
Videos with existing H.264 or H.265 encoding standards lack transparency effects during playback, resulting in extremely poor user experience.
By extracting frames of the video to be played, the video image is obtained, and the processed image of the transparency information is obtained for each image, the image with transparency is synthesized, and finally rendered in the browser to achieve the transparency effect.
It improves the quality and user experience of video playback, makes the video transparent, and enhances the flexibility and vividness of the visual display.
Smart Images

Figure CN115022713B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of video processing technology, and in particular to a video data processing method and device, a storage medium and an electronic device. Background Art
[0002] Videos with transparent effects can be widely used in video conferencing, live broadcasts and other scenarios, and can bring richer imagination to the content presentation of these scenarios. Using this type of video can greatly improve the flexibility of front-end display, bring more vivid visual effects to the video, and achieve the arbitrary replacement of background images, layered display of special effects and videos, and superposition of multiple videos. Moreover, the fusion after superposition is very natural without any sense of disobedience, making it easy to achieve lively and cool effects in scene presentation.
[0003] Currently, videos encoded using the H.264 or H.265 standard are widely used. These videos have no transparency effect when played, which brings a very poor user experience to users who use videos encoded using the H.264 or H.265 standard. Summary of the invention
[0004] In view of this, the present invention provides a video data processing method and device, a storage medium and an electronic device. By applying the method provided by the present invention, after processing a video without a transparent effect, a video with a transparent effect can be generated, and the video with a transparent effect can be displayed to a user, thereby providing the user with a better service and improving the user experience.
[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:
[0006] A first aspect of the present invention discloses a video data processing method, comprising:
[0007] Get the video to be played;
[0008] Performing frame extraction processing on the video to be played to obtain multiple video images;
[0009] For each of the video images, a processed image containing transparency information of the video image is obtained, and the video image and the processed image are synthesized to obtain a synthesized image, and the synthesized image is played.
[0010] In the above method, preferably, the step of extracting frames from the video to be played to obtain a plurality of video images includes:
[0011] Determining a frame extraction frequency based on a frame rate of the video to be played;
[0012] Based on the frame extraction frequency, extracting video frames from the video to be played to obtain each extracted video frame;
[0013] Determining whether there are unextracted key video frames in the video to be played;
[0014] If there are unextracted key video frames in the video to be played, then each extracted video frame and each unextracted key video frame in the video to be played are determined as video images;
[0015] If there are no unextracted key video frames in the video to be played, each extracted video frame is determined as a video image.
[0016] In the above method, preferably, the step of obtaining the processed image containing the transparency information of the video image comprises:
[0017] Acquiring a copy of the video image;
[0018] Extracting RGB information of each pixel in the copied image;
[0019] Processing the RGB information of each pixel in the copied image to obtain the transparency of each pixel;
[0020] Based on the transparency of each pixel in the replicated image, a processed image of the video image is obtained.
[0021] In the above method, preferably, synthesizing the video image and the processed image to obtain a synthesized image comprises:
[0022] For each pixel in the video image, a target pixel corresponding to the pixel is determined in the processed image, and the transparency of the target pixel is added to the RGB information of the pixel to obtain a composite image.
[0023] In the above method, preferably, the playing of the synthesized image comprises:
[0024] The composite image is rendered in a preset browser to play the composite image.
[0025] The second invention of the present invention discloses a video data processing device, comprising:
[0026] An acquisition unit, used to acquire the video to be played;
[0027] A frame extraction processing unit, used for performing frame extraction processing on the video to be played to obtain multiple video images;
[0028] The synthesis unit is used to obtain, for each of the video images, a processed image containing transparency information of the video image, synthesize the video image and the processed image to obtain a synthesized image, and play the synthesized image.
[0029] In the above device, optionally, the frame extraction processing unit includes:
[0030] A first determining subunit, configured to determine a frame extraction frequency based on a frame rate of the video to be played;
[0031] An extraction subunit, configured to extract video frames from the video to be played based on the frame extraction frequency to obtain each extracted video frame;
[0032] A second determining subunit is used to determine whether there is an unextracted key video frame in the video to be played;
[0033] A third determining subunit is used to determine each extracted video frame and each unextracted key video frame in the video to be played as a video image if there are unextracted key video frames in the video to be played;
[0034] The fourth determining subunit is used to determine each extracted video frame as a video image if there is no unextracted key video frame in the video to be played.
[0035] In the above device, optionally, the synthesis unit comprises:
[0036] An acquisition subunit, used for acquiring a copy image of the video image;
[0037] An extraction subunit, used to extract RGB information of each pixel in the copied image;
[0038] A first obtaining subunit is used to process the RGB information of each pixel in the copied image to obtain the transparency of each pixel;
[0039] The second obtaining subunit is used to obtain a processed image of the video image based on the transparency of each pixel in the copied image.
[0040] In the above device, optionally, the synthesis unit comprises:
[0041] The adding subunit is used to determine, for each pixel in the video image, a target pixel corresponding to the pixel in the processed image, and add the transparency of the target pixel to the RGB information of the pixel to obtain a composite image.
[0042] In the above device, optionally, the synthesis unit comprises:
[0043] The rendering subunit is used to render the composite image in a preset browser to play the composite image.
[0044] A third aspect of the present invention discloses a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the video data processing method as described above.
[0045] A fourth aspect of the present invention discloses an electronic device, comprising a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the video data processing method as described above.
[0046] Compared with the prior art, the present invention has the following advantages:
[0047] The present invention provides a video data processing method and device, a storage medium and an electronic device, the method comprising: obtaining a video to be played; performing frame extraction processing on the video to be played to obtain a plurality of video images; for each video image, obtaining a processed image containing transparency information of the video image, synthesizing the video image and the processed image to obtain a synthesized image, and playing the synthesized image. Multiple video images are obtained by extracting frames from the video to be played, and each video image is processed to obtain a processed image containing transparency information; each video image is synthesized with its corresponding processed image to obtain a plurality of synthesized images, the synthesized images being images with transparency information, and each synthesized image is rendered and displayed to play a video with a transparent effect, thereby providing users with high-quality video playback services and improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0049] Figure 1 A method flow chart of a video data processing method provided by an embodiment of the present invention;
[0050] Figure 2 A flow chart of a method for extracting frames from a video to be played to obtain multiple video images provided by an embodiment of the present invention;
[0051] Figure 3 A flow chart of a method for obtaining a processed image of a video image provided by an embodiment of the present invention;
[0052] Figure 4 An example diagram of a video image provided by an embodiment of the present invention;
[0053] Figure 5 An example diagram of a processed image of a video image provided by an embodiment of the present invention;
[0054] Figure 6 A schematic diagram of the structure of a video data processing device provided by an embodiment of the present invention;
[0055] Figure 7 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0057] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.
[0058] The technical terms that may be involved in the present invention are explained as follows:
[0059] YUV: It is a color encoding method and a type of true-color color space. "Y" represents brightness (Luminance or Luma), which is the grayscale value. "U" and "V" represent chrominance (Chrominance or Chroma). It is used to describe the color and saturation of the image and is used to specify the color of the pixel.
[0060] Alpha channel: refers to the transparency and translucency of an image.
[0061] HEVC: The abbreviation of high efficiency video coding, which is what we often call H265 encoding. On January 26, 2013, HEVC officially became an international standard.
[0062] SVAC: Security surveillance digital audio and video codec technology standard, jointly established by Vimicro and the First Research Institute of the Ministry of Public Security, with contributions from more than 40 scientific research institutes, universities and securities companies.
[0063] WebM: WebM was proposed by Google and is an open and free media file format. The WebM video format is actually a new container format developed based on the Matroska (MKV) container format, which includes VP8 video tracks and OggVorbis audio tracks.
[0064] Video tag: A built-in component provided by the browser for video playback.
[0065] Canvas tag: A built-in component provided by the browser that is used to dynamically generate images controlled by a program.
[0066] The present invention can be used in many general or special computing device environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor devices, distributed computing environments including any of the above devices or devices, etc. The execution subject of the present invention is a server or a processor, which is used to execute a video data processing method provided by an embodiment of the present invention.
[0067] Reference Figure 1 , is a method flow chart of a video data processing method provided by an embodiment of the present invention, and is specifically described as follows:
[0068] S101: Obtain the video to be played.
[0069] The video to be played is a video in a coding format such as H.264, H.265, etc., such as a video in a coding format such as VP8, VP9, etc.
[0070] When obtaining the video to be played, the user may input a video play instruction into the browser, thereby obtaining the video to be played according to the video play instruction. Preferably, the video play instruction includes but is not limited to video information, instruction generation time, browser information and other information.
[0071] S102: Extract frames from the video to be played to obtain multiple video images.
[0072] The video to be played is composed of multiple video frames, and the extracted video frames are used as video images. Furthermore, a screenshot operation can be performed on the video to be played, and the captured image is used as the video image.
[0073] In order to further illustrate the process of extracting frames from a video to be played and obtaining multiple video images, the present invention provides a flow chart of a method for extracting frames from a video to be played and obtaining multiple video images. Figure 2 , the specific instructions are as follows:
[0074] S201: Determine a frame extraction frequency based on a frame rate of a video to be played.
[0075] It should be noted that the frame rates of different videos to be played are different, such as 30 frames / second, 90 frames / second or 120 frames / second.
[0076] Different frame rates correspond to different frame extraction frequencies; for example, when the frame rate of the video to be played is 30 frames / second, the corresponding frame extraction frequency can be 24 frames / second; for example, when the frame rate of the video to be played is 90 frames / second, the corresponding frame extraction frequency can be 50 frames / second.
[0077] When determining the frame extraction frequency according to the frame rate of the video to be played, the frame rate of the video to be played can be traversed through each preset frame rate in the preset frame rate table, and the preset frame extraction frequency corresponding to the preset frame rate consistent with the frame rate of the video to be played is used as the frame extraction frequency.
[0078] The preset frame rate table includes multiple groups of data, each group of data includes a preset frame rate and a preset frame extraction frequency, and the preset frame extraction rate is less than or greater than the preset frame rate; it should be noted that the preset frame extraction frequencies of different preset frame rates may be the same.
[0079] S202: extracting video frames from the video to be played based on the frame extraction frequency to obtain each extracted video frame.
[0080] When extracting video frames from the video to be played based on the frame extraction frequency, the extraction can be performed according to a preset frame extraction rule. For example, when the frame extraction frequency is 24 frames / second, among the video frames per second, the first 24 video frames in the second can be used as the extracted video frames, or one frame can be extracted every other frame. The frame extraction rule here is only an example of the present invention, and the frame extraction rule of the present invention includes but is not limited to the specific rules described in the example.
[0081] S203: Determine whether there are unextracted key video frames in the video to be played; if there are unextracted key video frames in the video to be played, execute S204; if there are no unextracted key video frames in the video to be played, execute S205.
[0082] When extracting the back frames of the video from the video to be played based on the frame extraction frequency, it is also necessary to determine whether there are any unextracted key video frames in the video to be played. The specific process may be to obtain the frame type identifiers of the remaining video frames in the video to be played. If there are identifiers representing key frames in the frame type identifiers, it can be determined that there are unextracted key video frames in the video to be played. If there are no identifiers representing key frames in the frame type identifiers, it can be determined that there are no unextracted key video frames in the video to be played.
[0083] S204: Determine each extracted video frame and each key video frame that has not been extracted in the video to be played as a video image.
[0084] S205: Determine each extracted video frame as a video image.
[0085] In the method provided by the embodiment of the present invention, when multiple video images are obtained from the video to be played, the video to be played is subjected to frame extraction processing based on the frame extraction frequency to obtain each extracted video frame. When there are unextracted key video frames in the video to be played, the unextracted key video frames and the extracted video frames are both determined as video images. In this way, omission of key video frames of the video to be played can be avoided, thereby improving the subsequent display effect.
[0086] It should be noted that, in the process of extracting frames from the video to be played and obtaining multiple video images, a screenshot technology can also be used to obtain multiple video images, and images can be captured from the video to be played through a preset screenshot frequency, and each captured image is determined as a video image. Preferably, the screenshot frequency here can be set according to actual needs, usually set to 24 images per second. Further, when taking screenshots of the video to be played, the browser's native Canvas tag can be used to take screenshots.
[0087] S103: For each video image, a processed image including transparency information of the video image is obtained, and the video image and the processed image are synthesized to obtain a synthesized image, and the synthesized image is played.
[0088] In the method provided by the embodiment of the present invention, each acquired video image is processed to obtain a composite image of each video image.
[0089] Reference Figure 3 , is a flow chart of a method for obtaining a processed image of a video image provided by an embodiment of the present invention, and is specifically described as follows:
[0090] S301: Acquire a copy image of a video image.
[0091] The copied image is the image obtained by copying the video image. Figure 4 , is an example diagram of a video image provided by an embodiment of the present invention, in which each pixel point contains RGB information.
[0092] S302: Extract RGB information of each pixel in the copied image.
[0093] RBG information is the color information of the three channels of red, green, and blue of the pixel.
[0094] S303: Process the RGB information of each pixel in the copied image to obtain the transparency of each pixel.
[0095] It should be noted that the transparency of a pixel may be an Alpha value, and the Alpha value of each pixel is obtained after processing the RGB information of each pixel.
[0096] S304: Obtaining a processed image of the video image based on the transparency of each pixel in the copied image.
[0097] Furthermore, the processed image is composed of the transparency of each pixel in the copied image. At this time, the processed image contains the transparency information of the video image. Preferably, the transparency information is the transparency of each pixel. Figure 5 , is an example diagram of a processed image of a video image provided by an embodiment of the present invention, and each pixel point in the diagram corresponds one-to-one to each pixel point in the video image.
[0098] In the method provided by the embodiment of the present invention, after obtaining the processed image of the video image, for each pixel point in the video image, a target pixel point corresponding to the pixel point is determined in the processed image, and the transparency of the target pixel point is added to the RGB information of the pixel point to obtain a composite image. It should be noted that each pixel point in the video image can determine the target pixel point among the pixels in the processed image. Specifically, when the pixel point located in the first column and the second row in the video image determines the target pixel point in the processed image, the position of the target pixel point in the processed image is the first column and the second row.
[0099] By adding transparency to each pixel of a video image, a composite image containing transparency information can be obtained. In the method provided in the embodiment of the present invention, after obtaining the composite image, the composite image can be rendered in a browser to display the composite image. By continuously processing the video image and rendering and displaying the obtained composite image at a high frequency, the video playback is achieved, and the played video has a transparent effect.
[0100] In the method provided by the implementation of the present invention, a video to be played is obtained; the video to be played is subjected to frame extraction processing to obtain multiple video images; for each video image, a processed image containing transparency information of the video image is obtained, and the video image and the processed image are synthesized to obtain a synthesized image, and the synthesized image is played. Multiple video images are obtained by extracting frames from the video to be played, and each video image is processed to obtain a processed image containing transparency information; each video image is synthesized with its corresponding processed image to obtain multiple synthesized images, and the synthesized image is an image with transparency information, and each synthesized image is rendered and displayed to play a video with a transparent effect, thereby providing users with high-quality video playback services and improving user experience.
[0101] In order to further illustrate the implementation process of the present invention in practical applications, the present invention is illustrated by a scenario example. The overall implementation process of the present invention is not limited to the content of the example illustrated. The specific content of the example is as follows:
[0102] a) Use the browser's native Video tag to play a specifically encoded video, play the sound but not display the picture.
[0103] b) Use the browser's native Canvas tag to capture video images at a high frequency.
[0104] c) Process the captured video image to obtain two images, one of which is the original image of the video image. For details, please refer to Figure 4 ; The other picture contains Alpha information, that is, the processed image of the video image. For details, please refer to Figure 5 .
[0105] d) For the video image and the processed image, extract RGB information from each pixel in the video image, and based on the transparency of each pixel in the processed image, modify the Alpha value of each pixel in the video image to generate a composite image that achieves a transparent effect. It should be noted that the content of this part is essentially the synthesis of the video image and the processed image.
[0106] e) Draw continuously generated composite images at high frequency in a new Cavans of a browser to achieve video playback effect.
[0107] It should be noted that the method provided by the implementation of the present invention can be applied to a variety of different browsers, such as IE9, IE10, Chrome21, Chrome27 and other browsers, and the present invention will not give examples one by one. The present invention processes the video frames in the video that does not support transparent images, extracts RGB information and transparent (Alpha) information from the video frames, re-synthesizes the images that support transparency, and repeats this process at high speed, thereby realizing a browser-side transparent video playback method that is unconstrained by the video coding standard, so that transparent videos can be played in the browser under the commonly used mainstream coding standards such as H.264 and H.265. The method provided by the present invention can be applied to videos with coding standards such as H.264 and H.265, and can also be applied to various mainstream coding standards such as VP8, VP9, SVAC, thereby improving the universality of playing videos with transparent effects.
[0108] and Figure 1 Corresponding to the method shown in the figure, the embodiment of the present invention also provides a video data processing device, which is used to support Figure 1 The method shown is implemented in practical applications, and the device can be set in a smart device.
[0109] Reference Figure 6 , is a schematic diagram of the structure of a video data processing device provided by an embodiment of the present invention, and is specifically described as follows:
[0110] An acquisition unit 601 is used to acquire a video to be played;
[0111] A frame extraction processing unit 602 is used to perform frame extraction processing on the video to be played to obtain multiple video images;
[0112] The synthesis unit 603 is used to obtain, for each of the video images, a processed image containing transparency information of the video image, synthesize the video image and the processed image to obtain a synthesized image, and play the synthesized image.
[0113] In the device provided by the implementation of the present invention, a video to be played is obtained; the video to be played is subjected to frame extraction processing to obtain multiple video images; for each video image, a processed image containing transparency information of the video image is obtained, and the video image and the processed image are synthesized to obtain a synthesized image, and the synthesized image is played. Multiple video images are obtained by extracting frames from the video to be played, and each video image is processed to obtain a processed image containing transparency information; each video image is synthesized with its corresponding processed image to obtain multiple synthesized images, and the synthesized image is an image with transparency information, and each synthesized image is rendered and displayed to play a video with a transparent effect, thereby providing users with high-quality video playback services and improving user experience.
[0114] In the device provided by the embodiment of the present invention, the frame extraction processing unit 602 may be configured as follows:
[0115] A first determining subunit, configured to determine a frame extraction frequency based on a frame rate of the video to be played;
[0116] An extraction subunit, configured to extract video frames from the video to be played based on the frame extraction frequency to obtain each extracted video frame;
[0117] A second determining subunit is used to determine whether there is an unextracted key video frame in the video to be played;
[0118] A third determining subunit is used to determine each extracted video frame and each unextracted key video frame in the video to be played as a video image if there are unextracted key video frames in the video to be played;
[0119] The fourth determining subunit is used to determine each extracted video frame as a video image if there is no unextracted key video frame in the video to be played.
[0120] In the device provided in the embodiment of the present invention, the synthesis unit 603 may be configured as follows:
[0121] An acquisition subunit, used for acquiring a copy image of the video image;
[0122] An extraction subunit, used to extract RGB information of each pixel in the copied image;
[0123] A first obtaining subunit is used to process the RGB information of each pixel in the copied image to obtain the transparency of each pixel;
[0124] The second obtaining subunit is used to obtain a processed image of the video image based on the transparency of each pixel in the copied image.
[0125] In the device provided in the embodiment of the present invention, the synthesis unit 603 may be configured as follows:
[0126] The adding subunit is used to determine, for each pixel in the video image, a target pixel corresponding to the pixel in the processed image, and add the transparency of the target pixel to the RGB information of the pixel to obtain a composite image.
[0127] In the device provided in the embodiment of the present invention, the synthesis unit 603 may be configured as follows:
[0128] The rendering subunit is used to render the composite image in a preset browser to play the composite image.
[0129] An embodiment of the present invention further provides a storage medium, which includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the above-mentioned video data processing method.
[0130] The embodiment of the present invention further provides an electronic device, the structural diagram of which is shown in FIG. Figure 7 As shown, it specifically includes a memory 701 and one or more instructions 702, wherein the one or more instructions 702 are stored in the memory 701 and are configured to be executed by one or more processors 703 to execute the one or more instructions 702 to process the video data.
[0131] The specific implementation processes and derivative methods of the above-mentioned embodiments are all within the protection scope of the present invention.
[0132] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.
[0133] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0134] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A video data processing method, characterized in that: include: Get the video to be played; Performing frame extraction processing on the video to be played to obtain multiple video images; For each of the video images, obtaining a processed image containing transparency information of the video image, synthesizing the video image and the processed image to obtain a synthesized image, and playing the synthesized image; The obtaining of the processed image containing the transparency information of the video image comprises: obtaining a copy image of the video image; extracting RGB information of each pixel in the copy image; processing the RGB information of each pixel in the copy image to obtain the transparency of each pixel; and obtaining the processed image of the video image based on the transparency of each pixel in the copy image; The synthesizing the video image and the processed image to obtain a synthesized image includes: for each pixel point in the video image, determining a target pixel point corresponding to the pixel point in the processed image, and adding the transparency of the target pixel point to the RGB information of the pixel point to obtain a synthesized image.
2. The method according to claim 1, characterized in that The step of performing frame extraction processing on the video to be played to obtain a plurality of video images includes: Determining a frame extraction frequency based on a frame rate of the video to be played; Based on the frame extraction frequency, extracting video frames from the video to be played to obtain each extracted video frame; Determining whether there are unextracted key video frames in the video to be played; If there are unextracted key video frames in the video to be played, then each extracted video frame and each unextracted key video frame in the video to be played are determined as video images; If there are no unextracted key video frames in the video to be played, each extracted video frame is determined as a video image.
3. The method according to claim 1, characterized in that The playing of the synthesized image comprises: The composite image is rendered in a preset browser to play the composite image.
4. A video data processing device, characterized in that: include: An acquisition unit, used to acquire the video to be played; A frame extraction processing unit, used for performing frame extraction processing on the video to be played to obtain multiple video images; a synthesis unit, configured to obtain, for each of the video images, a processed image containing transparency information of the video image, synthesize the video image and the processed image to obtain a synthesized image, and play the synthesized image; The synthesis unit includes: an acquisition subunit, an extraction subunit, a first acquisition subunit, a second acquisition subunit and an addition subunit; The acquisition subunit is used to acquire a copy image of the video image; The extraction subunit is used to extract RGB information of each pixel in the copied image; The first obtaining subunit is used to process the RGB information of each pixel in the copied image to obtain the transparency of each pixel; The second obtaining subunit is used to obtain a processed image of the video image based on the transparency of each pixel in the copied image; The adding subunit is used to determine, for each pixel in the video image, a target pixel corresponding to the pixel in the processed image, and add the transparency of the target pixel to the RGB information of the pixel to obtain a composite image.
5. The device according to claim 4, characterized in that The frame extraction processing unit comprises: A first determining subunit, configured to determine a frame extraction frequency based on a frame rate of the video to be played; An extraction subunit, configured to extract video frames from the video to be played based on the frame extraction frequency to obtain each extracted video frame; A second determining subunit is used to determine whether there is an unextracted key video frame in the video to be played; A third determining subunit is used to determine each extracted video frame and each unextracted key video frame in the video to be played as a video image if there are unextracted key video frames in the video to be played; The fourth determining subunit is used to determine each extracted video frame as a video image if there is no unextracted key video frame in the video to be played.
6. A storage medium, characterized in that: The storage medium includes stored instructions, wherein when the instructions are executed, the device where the storage medium is located is controlled to execute the video data processing method according to any one of claims 1 to 3.
7. An electronic device, characterized in that: The device comprises a memory and one or more instructions, wherein the one or more instructions are stored in the memory and configured to be executed by one or more processors to perform the video data processing method according to any one of claims 1 to 3.
