Video screenshot method and device, medium and program product

Through the video screenshot method, video frames and subtitles are captured and combined according to the screenshot mode selected by the user, which solves the limitations of the screenshot function in the existing technology, realizes efficient video screenshots and image processing, and improves user experience and creative freedom.

CN118764666APending Publication Date: 2024-10-11MIGU DIGITAL MEDIA CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410864529.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-28
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

The existing screenshot function can only capture the current screen display, which results in the screenshot being inconsistent with the actual screen time required by the user. The clarity is insufficient, making it difficult to perform secondary editing and content extension, and it is impossible to capture and splice multiple pictures. It is impossible to generate user-defined full-scene images, which limits user experience and image processing requirements.

Method used

Provides a video screenshot method, which determines the screenshot mode by receiving the user's screenshot mode selection instruction, and selects the target picture according to the mode, including single picture screenshot, multi-picture screenshot and full scene screenshot mode. The user can select video frames, subtitles and other The elements are combined and spliced ​​to generate a new target image.

Benefits of technology

It improves the functional diversity and user experience of video screenshots, enhances creative freedom, and meets diverse application needs. Users can flexibly extract and process images from videos and customize screenshot modes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118764666A_ABST
    Figure CN118764666A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of picture processing, and provides a video screenshot method and device, a medium and a program product, and the method comprises the steps: receiving a screenshot mode selection instruction of a user for a currently played video; determining a screenshot mode based on the screenshot mode selection instruction; determining a target picture according to the screenshot mode and the currently played video; wherein if the screenshot mode is a full-scene screenshot mode, the target picture is a recombined picture of the target elements in the plurality of target video frames, and the target elements are elements selected by the user from the plurality of target video frames, so that the screenshot mode, such as the full-scene screenshot mode, can be determined according to user needs, and the image is flexibly extracted and processed from the video; the functional diversity of the video screenshot is improved, the interaction experience of the user is enhanced, and diversified application requirements can be met.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of image processing technology, and in particular to a video screenshot method, device, medium and program product. Background Art

[0002] At present, the screenshot function in the relevant technology can only capture the display screen of the current screen. It has certain limitations. First, it can only capture the picture displayed on the current screen, which may cause the screenshot to deviate from the picture actually needed by the user at the time point; secondly, the clarity of the video screenshot is often not enough, and it is difficult to perform secondary editing and content extension; in addition, most screenshot methods can only capture a single picture, and it is impossible to capture and stitch multiple pictures, nor can it generate user-defined full-scene pictures. These limitations make the user experience when using the screenshot function less than ideal, and it is difficult to meet complex image processing requirements. Summary of the invention

[0003] The embodiments of the present application provide a video screenshot method, device, medium and program product to solve the technical problem in the related art that the screenshot method is difficult to meet the complex and diverse image processing requirements and reduces the user experience.

[0004] To solve the above technical problems, the embodiments of the present application provide the following aspects:

[0005] In a first aspect, an embodiment of the present application provides a video screenshot method, the method comprising:

[0006] Receive a screenshot mode selection instruction from a user for a currently playing video;

[0007] Determining a screenshot mode based on the screenshot mode selection instruction;

[0008] The target image is determined according to the screenshot mode and the currently playing video; wherein, if the screenshot mode is the full-scene screenshot mode, the target image is a recombined image of target elements in multiple target video frames in the currently playing video, and the target element is an element selected by the user from the multiple target video frames.

[0009] Optionally, determining the target image according to the screenshot mode and the currently playing video includes:

[0010] If the screenshot mode is a single-image screenshot mode, receiving a single-image screenshot instruction from the user;

[0011] In the currently playing video, determining a reference video frame according to the single-image screenshot instruction, the reference video frame being the video frame played by the currently playing video when the single-image screenshot instruction is received;

[0012] Acquire all video frames within a first preset time period before the reference video frame and within a second preset time period after the reference video frame;

[0013] Arrange all the video frames according to the playback time to generate a video frame list;

[0014] Receive a target picture selection instruction from a user in the video frame list;

[0015] The target image is determined according to the target image selection instruction.

[0016] Optionally, determining the target image according to the screenshot mode and the currently playing video includes:

[0017] If the screenshot mode is a multi-image screenshot mode, receiving a multi-image screenshot instruction from a user; wherein the multi-image screenshot instruction includes a start screenshot instruction and an end screenshot instruction;

[0018] According to the start screenshot instruction and the end screenshot instruction, determining a screenshot start video frame and a screenshot end video frame in the currently playing video;

[0019] Acquire all video frames from the screenshot start video frame to the screenshot end video frame;

[0020] Determine a plurality of target video frames according to the subtitles in all the video frames; wherein the subtitles in the plurality of target video frames are different from each other;

[0021] In the plurality of target video frames, determining the target object;

[0022] The target picture is generated according to the target object and the subtitles corresponding to the target object in each target video frame.

[0023] Optionally, generating the target image according to the target object and a subtitle corresponding to the target object in each target video frame includes:

[0024] Arrange the multiple target video frames according to the play time, and determine the target video frame with the earliest play time as the display picture of the target picture;

[0025] intercepting subtitles corresponding to each target video frame except the target video frame with the earliest playback time;

[0026] splicing the subtitles according to the playback time of the corresponding target video frames;

[0027] The display image and the spliced ​​subtitles are synthesized to generate the target image.

[0028] Optionally, determining the target image according to the screenshot mode and the currently playing video includes:

[0029] If the screenshot mode is the full-scene screenshot mode, receiving a full-scene screenshot instruction from the user; wherein the full-scene screenshot instruction includes a full-scene start screenshot instruction and a full-scene stop screenshot instruction;

[0030] According to the full-scene start screenshot instruction and the full-scene end screenshot instruction, determining a screenshot start video frame and a screenshot end video frame in the currently playing video;

[0031] Acquire all video frames from the screenshot start video frame to the screenshot end video frame;

[0032] receiving a user's instruction to select a target video frame among all the video frames;

[0033] Determining at least one target video frame from among all the video frames according to the target video frame selection instruction;

[0034] Extracting the target element from the at least one target video frame according to a user operation;

[0035] The target elements are reassembled to obtain the target image.

[0036] Optionally, the recombining the target elements to obtain the target image includes:

[0037] Selecting incomplete target elements from among the target elements;

[0038] Selecting a complete element corresponding to the incomplete target element from all the video frames;

[0039] Expanding the incomplete target element according to the complete element to obtain a complete target element;

[0040] According to the complete target element, updating the target element;

[0041] The updated target elements are recombined to obtain the target image.

[0042] Optionally, the target element includes at least one of the following: a foreground, a background, and a subtitle in the target video frame.

[0043] In a second aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of a video screenshot method as described in the first aspect are implemented.

[0044] In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a video screenshot method as described in the first aspect are implemented.

[0045] In a fourth aspect, an embodiment of the present application provides a computer program product, comprising computer instructions, which, when executed by a processor, implement the steps of a video screenshot method as described in the first aspect.

[0046] Therefore, in the method shown in the embodiment of the present application, the user can determine the required screenshot mode according to his or her own needs. When the screenshot mode is the full-scene screenshot mode, the user can freely select elements in the video and combine these elements into a new image. In summary, the user can choose different screenshot modes according to his or her needs, and flexibly extract and process images from the video, which not only improves the functional diversity of video screenshots, but also enhances the user's interactive experience and creative freedom, and can meet diverse application needs. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Also, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:

[0048] Figure 1 A flowchart of a video screenshot method provided in an embodiment of the present application;

[0049] Figure 2 A flowchart of a video screenshot method provided in an embodiment of the present application;

[0050] Figure 3 A schematic diagram of a single-image screenshot mode provided in an embodiment of the present application;

[0051] Figure 4 A flowchart of a video screenshot method provided in an embodiment of the present application;

[0052] Figure 5 A schematic diagram of a multi-image screenshot mode provided in an embodiment of the present application;

[0053] Figure 6 A flowchart of a video screenshot method provided in an embodiment of the present application;

[0054] Figure 7 A schematic diagram of a full-scene screenshot mode provided in an embodiment of the present application;

[0055] Figure 8A schematic diagram of a picture editing method provided in an embodiment of the present application;

[0056] Fig. 9 A schematic diagram of a method for expanding image types provided in an embodiment of the present application;

[0057] Fig.10 A flowchart of a video capture device provided in an embodiment of the present application;

[0058] Fig.11 A structural block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0060] Figure 1 A video screenshot method provided according to an embodiment of the present application is shown, such as Figure 1 As shown, the method includes:

[0061] Step S101: receiving a user's instruction to select a screenshot mode for a currently playing video.

[0062] Step S102: determining a screenshot mode based on the screenshot mode selection instruction.

[0063] Step S103: determining a target image according to the screenshot mode and the currently playing video.

[0064] In step S101, when watching a video, the user often needs to capture the video screen as a material. Figure 1 In the method shown, first, the system needs to receive the user's input, i.e., the screenshot mode selection instruction, to determine the screenshot mode the user wants to use. The user can select the required screenshot mode through various interface elements (such as a drop-down menu, a button, a blink, or a voice command, etc.). In order to enhance the user experience, an intuitive interface can be set to allow the user to easily select the desired screenshot mode and intuitively feedback the user's selection results. In addition, the system can provide real-time help and feedback, such as explaining the characteristics and applicable scenarios of each screenshot mode.

[0065] In step S102 and step S103, the screenshot mode may be determined based on the screenshot mode selection instruction, and the target image may be determined according to the screenshot mode and the currently playing video.

[0066] If the screenshot mode is the full scene screenshot mode, the target image is a reassembled image of target elements in multiple target video frames in the currently playing video, and the target element is an element selected by the user from the multiple target video frames. The target element includes at least one of the following: foreground, background, and subtitles.

[0067] It should be noted that each screenshot mode corresponds to different purposes and results. The screenshot mode is not only a full-scene screenshot mode, but also a single-image screenshot mode or a multi-image screenshot mode. The single-image screenshot mode is suitable for capturing a single picture frame in a video, which is suitable for quickly recording or sharing moments in a video; the multi-image screenshot mode can capture multiple picture frames in a video, and display important picture frames and subtitle stitching pictures of multiple picture frames, which is suitable for occasions where video subtitles need to be displayed, such as lectures, etc. The full-scene screenshot mode allows users to create a composite image containing multiple elements in a video. This mode is suitable for creative editing and more complex visual presentations.

[0068] After the screenshot mode is determined, the system will process the currently playing video according to the selected screenshot mode and generate the target image. This involves extracting specific frames or sequences of frames from the video, or recombining elements in the video to create a new visual effect.

[0069] The three different screenshot modes are explained below.

[0070] In one possible implementation, Figure 2 As shown, step 103, determining the target image according to the screenshot mode and the currently playing video includes:

[0071] Step S201: If the screenshot mode is the single-image screenshot mode, a single-image screenshot instruction from the user is received.

[0072] Step S202: in the currently playing video, determine a reference video frame according to a single-picture screenshot instruction.

[0073] The reference video frame is the video frame of the currently playing video when the single-image screenshot instruction is received.

[0074] Step S203: Acquire all video frames within a first preset time period before the reference video frame and within a second preset time period after the reference video frame.

[0075] Step S204: Arrange all video frames according to the play time to generate a video frame list.

[0076] Step S205: receiving a target picture selection instruction from the user in the video frame list.

[0077] Step S206: Determine the target image according to the target image selection instruction.

[0078] In a specific application scenario, when a video is playing and the user turns on the single-image screenshot operation (single-image screenshot mode), the system will automatically search for images within 1 second, and then arrange the searched multiple frames in a list in chronological order. The user can select the image he really wants from the list. Figure 3 As shown, the intervals between the three points BCD are all 1 second. The user originally wanted to capture the image of Mario at point B, but after the system enabled the screenshot, the screenshot was taken at point C, which was the fire-breathing dragon.

[0079] The system processing flow is as follows:

[0080] First, the system will search for key frames with a threshold of 1 second (the threshold value can be set and adjusted) with point C as the center. At this time, the key frame images at the three points BCD are within the search range. The system processes the size of the image frame according to the distance between the image frame time point in the search range and the center point C. The closer the image is to point C, the larger the display size is, and the farther the image is from point C, the smaller the display size is. The formula for calculating the image display size is as follows:

[0081] Wi=W0×Si, Hi=H0×Si, Si=dTi / Tw(Si∈[0,1])

[0082] Among them, W0 and H0 are the original sizes of the picture, dTi is the time difference between the time when the i-th frame is located and the time of point C, Tw is the threshold size, Si is the scaling ratio, Wi and Hi are the sizes of the i-th frame of the picture, W represents the width of the picture, and H represents the height of the picture.

[0083] Secondly, the system generates a time cursor window corresponding to the 2-second length of the picture frame sequence. The number of picture frames contained in the time cursor window depends on the video frame rate. For example, if the video frame rate is 30 frames per second, the 2-second time window contains 60 pictures. The length of the cursor window is automatically adjusted according to the threshold value (such as 2 seconds, 4 seconds, 6 seconds, 8 seconds, etc.). The user can slide the picture list left and right in the picture collection list corresponding to the current cursor window to make a selection, or quickly change the picture collection range by moving the cursor window left and right, and then select the picture.

[0084] Optionally, in addition to the above-mentioned dynamic real-time screenshot, when the video is paused, if the user turns on the screenshot operation, the system will automatically obtain the video picture frame corresponding to the current moment while retaining the current screenshot and output the picture frame. The specific single-picture screenshot method can be flexibly selected according to actual needs.

[0085] In one possible implementation, Figure 4 As shown, step S103, determining the target image according to the screenshot mode and the currently playing video includes:

[0086] Step S301: If the screenshot mode is a multi-image screenshot mode, a multi-image screenshot instruction from a user is received.

[0087] The multi-image screenshot command includes a start screenshot command and an end screenshot command.

[0088] Step S302: Determine a screenshot start video frame and a screenshot stop video frame in the currently playing video according to the screenshot start instruction and the screenshot stop instruction.

[0089] Step S303: Acquire all video frames from the screenshot start video frame to the screenshot end video frame.

[0090] Step S304: Determine multiple target video frames according to the subtitles in all video frames.

[0091] The subtitles in the multiple target video frames are different from each other.

[0092] Step S305: Determine a target object in multiple target video frames.

[0093] Step S306: Generate a target picture according to the target object and the subtitles corresponding to the target object in each target video frame.

[0094] In a possible implementation, step S306, generating a target picture according to the target object and the subtitles corresponding to the target object in each target video frame, includes:

[0095] Arrange multiple target video frames according to playback time, and determine the target video frame with the earliest playback time as the display picture of the target picture; intercept the subtitles corresponding to each target video frame except the target video frame with the earliest playback time; splice the subtitles according to the playback time of the corresponding target video frames; synthesize the display picture and the spliced ​​subtitles to generate the target picture.

[0096] In a specific application scenario, after the user turns on multi-image capture, when the video plays the screen the user wants, the user clicks the screenshot button, and the system records the starting time of the screenshot. The video continues to play, and when it plays to the screen the user wants to end, the user clicks the screenshot button, and the system records the ending time of the screenshot. The system turns on two front and back adjustment picture frame tracks. The front track displays all the screens within 1 second from the starting time point, and the rear track displays all the screens within 1 second from the ending time point. (The threshold size can be set and adjusted by the user). Multi-image capture can be divided into the following two methods:

[0097] Multi-image capture when a single person is speaking: After the user selects the start screen (Ts) and the end screen (Te), the system automatically retrieves all images in the interval [Ts, Te]. Through the OCR (Optical Character Recognition) technology, the images with repeated subtitle content are removed, and the final number of images is calculated. Through the face image recognition technology, it is confirmed that the same person appears in different subtitle screens, and the display height h of the text area is calculated. Suppose the image height H, the final screenshot height is Ho = H + h*(N-1), where N is the number of remaining images after removing the images with repeated subtitle content.

[0098] like Figure 5 As shown in the left part of , the system first draws the content of the first picture onto the output screenshot canvas, with a drawing height of H. Then the system captures the image content of the bottom subtitle display area of ​​the second to Nth pictures, and draws these contents onto the output screenshot canvas. The starting ordinate for drawing the subtitle of the i+2th picture is Y=H+i*h(i∈[0,N-2]N>=2), and the final screenshot is output after synthesis is completed.

[0099] Multi-image capture during multi-person conversations: After the user selects the start screen (Ts) and the end screen (Te), the system automatically retrieves all images in the interval [Ts, Te]; through OCR technology, remove images with repeated subtitle content and calculate the final number of images N; use face image recognition technology to confirm that there are multiple people in different subtitle screens. Take a conversation between two people as an example, the image collection includes person L and person R. Assuming N is an even number, the number of images of person L is N / 2, and the number of images of person R is N / 2. Calculate the display height h of the text area, set the image width W, the image height H, the final screenshot width is Wo = W*2, and the screenshot height is Ho = H+h*(N / 2-1).

[0100] like Figure 5 As shown in the right part of , the system first draws the image content of the first character L onto the screenshot canvas, with the starting point coordinates (0,0). Then, the system draws the image content of the second character R onto the screenshot canvas, with the starting point coordinates (W,0). Then, the image content of the bottom subtitle display area of ​​the second to N / 2th images of the two characters is drawn in sequence, and these contents are drawn onto the output screenshot canvas. The starting vertical coordinate of the subtitle drawing of the i+2th image is Y=H+i*h(i∈[0,N / 2-2]N / 2>=2). When N is an odd number, the same can be obtained, and the final screenshot is output after synthesis is completed.

[0101] In one possible implementation, Figure 6 As shown, step S103, determining the target image according to the screenshot mode and the currently playing video includes:

[0102] Step S401: If the screenshot mode is the full-scene screenshot mode, receive the user's full-scene screenshot instruction.

[0103] Among them, the full-scene screenshot instruction includes a full-scene start screenshot instruction and a full-scene end screenshot instruction.

[0104] Step S402: According to the full-scene start screenshot instruction and the full-scene end screenshot instruction, determine the screenshot start video frame and the screenshot end video frame in the currently playing video.

[0105] Step S403: Acquire all video frames from the screenshot start video frame to the screenshot end video frame.

[0106] Step S404: receiving a target video frame selection instruction from a user among all video frames.

[0107] Step S405 : determining at least one target video frame from all video frames according to the target video frame selection instruction.

[0108] Step S406: extracting a target element from at least one target video frame according to the user's operation.

[0109] Step S407: Recombine the target elements to obtain a target image.

[0110] In one possible implementation, in step S407, the target elements are recombined to obtain a target image, including: selecting incomplete target elements from the target elements, selecting complete elements corresponding to the incomplete target elements from all video frames, expanding the incomplete target elements according to the complete elements to obtain complete target elements, updating the target elements according to the complete target elements, and recombining the updated target elements to obtain a target image.

[0111] In a specific application scenario, after the user turns on full-scene capture, when the video plays the screen the user wants, the user clicks the screenshot button, and the system records the starting time of the screenshot. The video continues to play, and when it plays to the screen the user wants to end, the user clicks the screenshot button, and the system records the ending time of the screenshot. The system turns on two front and back adjustment picture frame tracks. The front track displays all screens retrieved within 1 second from the starting time point, and the rear track displays all screens retrieved within 1 second from the ending time point. (The threshold size can be set and adjusted by the user). In full-scene screenshots, it can be divided into the following steps:

[0112] 1. After the user selects the starting picture (Ts) and the ending picture (Te), the system automatically retrieves all pictures in the interval [Ts,Te].

[0113] 2. After the system retrieves all the images in the [Ts,Te] interval, it navigates and displays them through the cursor window.

[0114] 3. If Figure 7 As shown in the figure, the user can select the required picture frame in the cursor window, and the system will perform default label processing based on the user's preference and the content of the picture key frame (for example, the system will set the user's captured picture frame to only retain the foreground character by default). After the system displays the default label, the user can manually adjust the label and set the picture frame with the label he likes (the character, background, and subtitle shown in the figure). In the figure, frame A means setting the character and subtitle, frame B means setting the background (including the character), frame C means setting the background (including the character), and frame D means setting the character and subtitle. The labels in the figure are in the logical relationship of "AND", and one more label means one more content. Among them, the background and foreground are mutually exclusive. If only one of the labels appears, the content corresponding to the other label will be removed (for example, if only the background label is included and there is no character label, the system will remove the character content in the frame and only retain the background content; vice versa); only when the foreground and background labels exist at the same time, the foreground content will be output as a whole background together with the background content.

[0115] 4. After the user completes the settings, the system processes the picture frame selected by the user. The specific process is as follows:

[0116] (1) The system pre-processes the image frame and retains certain graphic elements according to the label settings selected by the user: including removing the character and retaining the pure background; removing only the character and retaining the background + objects; removing only the objects and retaining the background + characters; removing only the background and retaining the character or the objects; the system can first identify the outline area of ​​the character (the area complementary to the outline is the background area), and then erase the character or erase the background through the AI ​​image algorithm according to the corresponding instructions.

[0117] (2) When the character image selected by the user is incomplete, the system can automatically expand and match it. Specifically, the user selects the method of completion (full body image, half body image, head portrait, etc.); the system searches the plot picture frame through graphic recognition technology, compares the character in it with the key frame selected by the user, finds the corresponding missing part, and then redraws the missing part through the image using the reference (comparison) method.

[0118] (3) When the background image selected by the user is not fully displayed, the system can also automatically expand and match it. Specifically, the user selects the completion method (horizontal completion, vertical completion, etc.); the system searches for the plot picture frame through graphic recognition technology, compares the background picture inside with the key frame selected by the user, finds the corresponding missing part, and then redraws the missing part through the image using the reference (comparison) method.

[0119] (4) The system generates a canvas and draws the preprocessed image frame content onto the canvas. The canvas is divided into three areas: background area, foreground area, and subtitle area. The background area is used to draw the background content in the preprocessing, the foreground area is used to draw pure character or object content, and the subtitle area is used to draw text content. The drawing order is to draw the background area content first, then the foreground area content, and finally the subtitle area content. The content of the background area and the foreground area are arranged in proportion according to the number. For example, if there are two foreground characters, the drawing area size is 1 / 2 of the width, and if there are three foreground characters, the area size is 1 / 3 of the width, and so on. Taking the conversation between two people as an example, the subtitle content is implemented in the same way as the text drawing logic after multi-image capture.

[0120] In addition, in a possible implementation, after obtaining the target image, the target image may be processed as follows:

[0121] Image editing: After the user selects a picture, they can edit it through AI (Artificial Intelligence). Figure 8 As shown, for example, if the user does not want the background of the picture, the system can automatically remove the background. The specific implementation process is as follows: the user clicks or paints on the person or object that he wants to keep, the system recognizes the finger coordinate point, determines that the finger coordinate point is inside the outline of the person or object, and then the system selects the person or object body; then the system uses the local redraw function to remove the background of the picture, such as Figure 8 As shown in ②——foreground 1 (character) and ③——foreground 2 (flame), if the user wants to keep the background, the system also uses the partial redrawing function to remove the main body of the character or object, such as Figure 4 In the figure ④, the background is shown; in addition to removing content, the system also supports adding content. For example, if the user wants to remove the background and replace it with a new custom background (the system can customize many background screen templates for users to choose from), the system will use the partial redraw function to draw the background of the picture according to the background style selected by the user (traditional Chinese style, impressionism, oil painting, etc.).

[0122] Content extension: After the image editing is completed, the user can choose to extend the content. The specific process is as follows: the system provides various large model styles (realistic type, comic version or two-dimensional type) for users to choose. After the user selects the style, the system receives the corresponding type parameters and then automatically maps them to the corresponding large model. For example, the realistic type corresponds to the realistic large model, and the two-dimensional type corresponds to the two-dimensional large model; the system uses the original image as the base image, and uses the image generation + ControlNet method to generate the corresponding type of image, and then replaces the original image with the generated image, such as Fig. 9As shown, the user can use the large model to transform the anime Mario on the left into the three-dimensional Mario on the right.

[0123] It should be noted that ControlNet is a plug-in for controlling AI image generation. It uses a technology called conditional generative adversarial network to generate images. Unlike traditional generative adversarial networks, ControlNet allows users to have fine control over the generated images.

[0124] HD restoration: After the image content is extended, the system also supports HD restoration. When users take screenshots and save videos while watching them, the images are often blurry. After the user selects the image they need, the system prompts the user whether HD restoration is needed. After the user confirms, the system enhances the image clarity by setting the ESRGAN4+ Upscaler.

[0125] Among them, ESRGAN4+ is an image upsampling method that uses deep learning technology. It is an improved version of ESRGAN (Enhanced Super-Resolution Generative Adversarial Networks). ESRGAN is a super-resolution technology that is mainly used to improve the resolution and clarity of images. It is trained through generative adversarial networks to generate clearer and more detailed images. "Upscaler" is an image processing term that refers to a technology or tool that improves image resolution. Upscaler increases the resolution of an image by adding more pixels, making the image look clearer and more detailed.

[0126] It should be noted that users can choose at least one of the three methods of image editing, content extension, and high-definition restoration according to actual needs. After the image processing is completed, users can choose to export single-frame images, or choose to export multiple frames of images in gif format or MP4 format after processing. The system uses the images selected by the user as a resource original image collection, and can directly export the resource original image collection into gif animation and MP4 video files through FFmpeg (FFmpeg is an open source program library and command line tool software specifically used to edit and process various audio, video or images) commands, thereby obtaining the images that users ultimately need.

[0127] In summary, the system achieves accurate acquisition of video frame images through the time expansion of video frames, adjustment tracks and cursor windows generated by picture sequences, acquires foreground, background and subtitles from picture frames through text and image recognition and other technologies, completes content through AI technology, calculates their position coordinates and sizes by area, and then performs proportional custom drawing on the canvas. This can achieve a custom screenshot that is different from the existing screenshot technology solutions, and can achieve accurate capture of video frames, quick output of character dialogue screenshots, and flexible output of a variety of screenshot solutions for full-scene multi-character custom screenshots. It can flexibly extract and process images from videos. These modes not only improve the functionality of video screenshots, but also enhance the user's interactive experience and creative freedom, and can meet diverse application needs.

[0128] Fig.10 A video capture device according to an embodiment of the present application is shown. Fig.10 As shown, the device 100 includes:

[0129] The receiving module 1001 is used to receive a screenshot mode selection instruction from a user for a currently playing video.

[0130] Execution module 1002 is used to determine the screenshot mode based on the screenshot mode selection instruction; determine the target image according to the screenshot mode and the currently playing video; wherein, if the screenshot mode is the full-scene screenshot mode, the target image is a recombined image of the target elements in multiple target video frames in the currently playing video, and the target element is an element selected by the user from the multiple target video frames.

[0131] In a possible implementation, the execution module 1002 is further configured to receive a single-image screenshot instruction from a user if the screenshot mode is a single-image screenshot mode;

[0132] In the currently playing video, a reference video frame is determined according to the single-image screenshot instruction, where the reference video frame is the video frame of the currently playing video when the single-image screenshot instruction is received;

[0133] Acquire all video frames within a first preset time period before the reference video frame and within a second preset time period after the reference video frame;

[0134] Arrange all video frames according to playback time and generate a video frame list;

[0135] Receive a target picture selection instruction from a user in a video frame list;

[0136] According to the target image selection instruction, the target image is determined.

[0137] In a possible implementation, the execution module 1002 is further configured to receive a multi-image screenshot instruction from a user if the screenshot mode is a multi-image screenshot mode; wherein the multi-image screenshot instruction includes a start screenshot instruction and an end screenshot instruction;

[0138] According to the start screenshot instruction and the end screenshot instruction, in the currently playing video, determine the screenshot start video frame and the screenshot end video frame;

[0139] Get all video frames from the screenshot start video frame to the screenshot end video frame;

[0140] Determine multiple target video frames according to the subtitles in all the video frames; wherein the subtitles in the multiple target video frames are different from each other;

[0141] In a plurality of target video frames, determining a target object;

[0142] A target image is generated according to the target object and the captions corresponding to the target object in each target video frame.

[0143] In a possible implementation, the execution module 1002 is further configured to arrange the multiple target video frames according to the play time, and determine the target video frame with the earliest play time as the display picture of the target picture;

[0144] intercepting the subtitles corresponding to each target video frame except the target video frame with the earliest playback time;

[0145] Splicing the subtitles according to the playback time of the corresponding target video frames;

[0146] The display image is synthesized with the spliced ​​subtitles to generate the target image.

[0147] In a possible implementation, the execution module 1002 is further used to receive a full-scene screenshot instruction from a user if the screenshot mode is a full-scene screenshot mode; wherein the full-scene screenshot instruction includes a full-scene start screenshot instruction and a full-scene stop screenshot instruction;

[0148] According to the full scene start screenshot instruction and the full scene end screenshot instruction, in the currently playing video, determine the screenshot start video frame and the screenshot end video frame;

[0149] Get all video frames from the screenshot start video frame to the screenshot end video frame;

[0150] Receive a target video frame selection instruction from a user among all video frames;

[0151] Determine at least one target video frame from all video frames according to the target video frame selection instruction;

[0152] extracting a target element from at least one target video frame according to a user operation;

[0153] Recombine the target elements to obtain the target image.

[0154] In a possible implementation, the execution module 1002 is further configured to select incomplete target elements from the target elements;

[0155] From all video frames, select the complete elements corresponding to the incomplete target elements;

[0156] Expand the incomplete target element according to the complete element to obtain the complete target element;

[0157] Update the target element according to the complete target element;

[0158] The updated target elements are recombined to obtain the target image.

[0159] In a possible implementation manner, the target element includes at least one of the following: a foreground, a background, and a subtitle in a target video frame.

[0160] Therefore, in the device shown in the embodiment of the present application, the user can simply and quickly capture a momentary picture of the current video; can capture multiple pictures of the video within a period of time, and automatically splice the subtitles of these pictures; can freely select elements in the video, and combine these elements into a new image. In summary, the user can choose different screenshot modes according to their needs, and flexibly extract and process images from the video. These modes not only improve the functionality of video screenshots, but also enhance the user's interactive experience and creative freedom, and can meet diverse application needs.

[0161] The present application embodiment also provides an electronic device 110, such as Fig.11 As shown, it includes: a processor 1101, a memory 1102, and a program stored in the memory 1102 and executable on the processor 1101. When the program is executed by the processor, the steps of a video screenshot method as shown in the above embodiment are implemented.

[0162] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of a video screenshot method shown in the above method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0163] An embodiment of the present application also provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of a video screenshot method shown in the above method embodiment and can achieve the same technical effect. To avoid repetition, they are not repeated here.

[0164] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including 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 "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0165] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0166] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A video screenshot method, characterized in that: The method comprises: Receive a screenshot mode selection instruction from a user for a currently playing video; Determining a screenshot mode based on the screenshot mode selection instruction; The target image is determined according to the screenshot mode and the currently playing video; wherein, if the screenshot mode is a full-scene screenshot mode, the target image is a recombined image of target elements in multiple target video frames in the currently playing video, and the target element is an element selected by the user from the multiple target video frames.

2. The method according to claim 1, characterized in that: The determining the target image according to the screenshot mode and the currently playing video includes: If the screenshot mode is a single-image screenshot mode, receiving a single-image screenshot instruction from the user; In the currently playing video, determining a reference video frame according to the single-image screenshot instruction, the reference video frame being the video frame played by the currently playing video when the single-image screenshot instruction is received; Acquire all video frames within a first preset time period before the reference video frame and within a second preset time period after the reference video frame; Arrange all the video frames according to the playback time to generate a video frame list; Receive a target picture selection instruction from a user in the video frame list; The target image is determined according to the target image selection instruction.

3. The method according to claim 1, characterized in that The determining the target image according to the screenshot mode and the currently playing video includes: If the screenshot mode is a multi-image screenshot mode, receiving a multi-image screenshot instruction from a user; wherein the multi-image screenshot instruction includes a start screenshot instruction and an end screenshot instruction; According to the start screenshot instruction and the end screenshot instruction, determining a screenshot start video frame and a screenshot end video frame in the currently playing video; Acquire all video frames from the screenshot start video frame to the screenshot end video frame; Determine a plurality of target video frames according to the subtitles in all the video frames; wherein the subtitles in the plurality of target video frames are different from each other; In the plurality of target video frames, determining a target object; The target picture is generated according to the target object and the subtitles corresponding to the target object in each target video frame.

4. The method according to claim 3, characterized in that The generating the target picture according to the target object and the subtitles corresponding to the target object in each target video frame includes: Arrange the multiple target video frames according to the play time, and determine the target video frame with the earliest play time as the display picture of the target picture; intercepting subtitles corresponding to each target video frame except the target video frame with the earliest playback time; splicing the subtitles according to the playback time of the corresponding target video frames; The display image and the spliced ​​subtitles are synthesized to generate the target image.

5. The method according to claim 1, characterized in that The determining the target image according to the screenshot mode and the currently playing video includes: If the screenshot mode is the full-scene screenshot mode, receiving a full-scene screenshot instruction from the user; wherein the full-scene screenshot instruction includes a full-scene start screenshot instruction and a full-scene stop screenshot instruction; According to the full-scene start screenshot instruction and the full-scene end screenshot instruction, determining a screenshot start video frame and a screenshot end video frame in the currently playing video; Acquire all video frames from the screenshot start video frame to the screenshot end video frame; receiving a user's instruction to select a target video frame among all the video frames; Determining at least one target video frame from among all the video frames according to the target video frame selection instruction; Extracting the target element from the at least one target video frame according to a user operation; The target elements are reassembled to obtain the target image.

6. The method according to claim 5, characterized in that The step of recombining the target elements to obtain the target image includes: Selecting incomplete target elements from among the target elements; Selecting a complete element corresponding to the incomplete target element from all the video frames; Expanding the incomplete target element according to the complete element to obtain a complete target element; According to the complete target element, updating the target element; The updated target elements are recombined to obtain the target image.

7. The method according to any one of claims 1 to 6, characterized in that The target element includes at least one of the following: a foreground, a background, and a subtitle in the target video frame.

8. An electronic device, characterized in that: include: A processor, a memory, and a program stored in the memory and executable on the processor, wherein when the program is executed by the processor, the steps of the video screenshot method according to any one of claims 1 to 7 are implemented.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the video screenshot method according to any one of claims 1 to 7 are implemented.

10. A computer program product, characterized in that It includes computer instructions, which, when executed by a processor, implement the steps of the video screenshot method as described in any one of claims 1 to 7.