Dynamic graph generation processing method and device, equipment and medium
By cropping multiple video clips to make their proportions consistent with the target animation, the problem of poor animation display effect caused by inconsistent video frame ratios in the prior art is solved, and the improvement of animation display effect and the reduction of computing power consumption is achieved.
Patent Information
- Application Number
- CN202411790298.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-06
- Publication Date
- 2025-03-21
AI Technical Summary
In the prior art, when generating animation images, the proportions of video frames are inconsistent, resulting in poor display effects of animation images.
By acquiring multiple video clips, determine the position information of the target cropping box of each video clip, so that the proportion of the cropping box is consistent with the predetermined target animation ratio, and crop each video frame, and merge the cropped video clips to generate animations.
It ensures that the proportion of all video frames in the animation is consistent, improves the display effect of the animation is improved, and crops are performed before synthesis of the animation is reduced, and the computing power consumption is highlighted, and the expression object of the animation is highlighted.
Smart Images

Figure CN119676511A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of image processing technology, and in particular to a method, device, equipment and medium for generating and processing a dynamic image. Background Art
[0002] Currently, generating animated images based on videos is a common promotional material that is widely used in various promotional scenarios. For example, in movie promotion scenarios, generating animated images of wonderful clips is used to promote the movie.
[0003] In the related art, several clips of a video are selected and spliced together to generate a dynamic image. For example, several clips of a movie are selected and spliced together to generate a dynamic image.
[0004] However, in the above-mentioned method of generating the animated image, the video clips are directly spliced as a whole. If the video frame ratios of the multiple video clips are different, a sudden change in the size ratio will occur when the animated image is presented, which affects the display effect of the animated image. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present disclosure provides a method, device, equipment and medium for generating and processing a dynamic image, which solves the technical problem of poor dynamic image display effect caused by inconsistent ratios of video frames.
[0006] The disclosed embodiment provides a method for generating and processing a moving picture, the method comprising: obtaining a plurality of video clips corresponding to at least one video source; determining target cropping frame position information corresponding to each of the video clips, wherein a cropping frame ratio corresponding to each target cropping frame position information is the same as a predetermined target moving picture ratio; cropping each video frame in the corresponding video clip according to the target cropping frame position information to obtain a cropped video clip; and merging all the cropped video clips to generate a moving picture.
[0007] The disclosed embodiment also provides a dynamic image generation and processing device, which includes: an acquisition module, used to acquire multiple video clips corresponding to at least one video source; a determination module, used to determine the target cropping frame position information corresponding to each of the video clips, wherein the cropping frame ratio corresponding to each target cropping frame position information is the same as the predetermined target dynamic image ratio; a cropping module, used to crop each video frame in the corresponding video clip according to the target cropping frame position information to obtain a cropped video clip; a dynamic image generation module, used to merge all the cropped video clips to generate a dynamic image.
[0008] An embodiment of the present disclosure also provides an electronic device, which includes: a processor; a memory for storing executable instructions of the processor; the processor is used to read the executable instructions from the memory and execute the instructions to implement the dynamic image generation processing method provided in the embodiment of the present disclosure.
[0009] The embodiment of the present disclosure further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program is used to execute the dynamic image generation processing method provided by the embodiment of the present disclosure.
[0010] Compared with the prior art, the technical solution provided by the embodiments of the present disclosure has the following advantages:
[0011] The animated image generation processing scheme provided by the disclosed embodiment obtains multiple video clips corresponding to at least one video source, determines the target cropping frame position information corresponding to each video clip, wherein the cropping frame ratio corresponding to each target cropping frame position information is the same as the predetermined target animated image ratio, and then, each video frame in the corresponding video clip is cropped according to the target cropping frame position information to obtain the cropped video clip, and all the cropped video clips are merged to generate the animated image. In this technical scheme, the video frame ratios of all video frames included in the animated image are guaranteed to be consistent, which improves the animated image display effect, and the corresponding video frames are cropped before the animated image is synthesized, which reduces the computing power consumption of the animated image synthesis, and is conducive to highlighting the object expressed by the animated image. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0013] Figure 1 A schematic diagram of a flow chart of a method for generating and processing a dynamic image provided by an embodiment of the present disclosure;
[0014] Figure 2 A schematic diagram of dividing a video segment provided in an embodiment of the present disclosure;
[0015] Figure 3 A schematic diagram of a preset cropping interface provided in an embodiment of the present disclosure;
[0016] Figure 4 A schematic diagram of a cutting scene provided in an embodiment of the present disclosure;
[0017] Figure 5 A flowchart of another method for generating and processing a dynamic image provided by an embodiment of the present disclosure;
[0018] Figure 6 A schematic diagram of the structure of a dynamic image generation and processing device provided by an embodiment of the present disclosure;
[0019] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0021] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0022] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0023] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0024] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0025] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0026] In order to solve the above problems, the embodiments of the present disclosure provide a method for generating and processing a dynamic image, in which a plurality of video clips are cropped according to a preset dynamic image ratio to ensure that the video frame ratios of the cropped video clips are consistent. Thus, all the cropped video clips are merged to generate a dynamic image, which will not cause a sudden change in the video frame ratio, thereby improving the dynamic image display effect. Moreover, by cropping video clips to generate a dynamic image, not only the computing power consumption of the dynamic image generation is reduced, but also the video content contained in the dynamic image is streamlined, which is conducive to highlighting the expression object of the dynamic image.
[0027] The following describes the method for generating and processing a dynamic image in conjunction with a specific embodiment.
[0028] Figure 1 The present invention provides a flowchart of a method for generating and processing a dynamic image, which can be executed by a dynamic image generation and processing device, wherein the device can be implemented by software and / or hardware, and can generally be integrated in an electronic device. Figure 1 As shown, the method includes:
[0029] Step 101: Acquire multiple video clips corresponding to at least one video source.
[0030] When at least one video source is multiple, the multiple video sources may be from one video or multiple videos, etc. In this embodiment, multiple video clips corresponding to at least one video source are obtained, wherein the multiple video clips are multiple video clips required to generate a dynamic image.
[0031] It should be noted that in different application scenarios, the methods for obtaining multiple video clips corresponding to at least one video source are different, and examples are as follows:
[0032] In some possible examples, multiple video clips actively uploaded by the user may be obtained.
[0033] In some possible examples, in response to obtaining the intercepted time period corresponding to each video source, the intercepted time period may be one or more, and each intercepted time period corresponds to a video clip. The intercepted time period may be input by the user, or may be marked by the user when watching the video source. The video source may also be input into a pre-trained deep learning model, and the deep learning model may output the corresponding intercepted time period. The method of determining the video source may be different in different application scenarios. For example, the video source identifier input by the user may be obtained, and the video source may be determined by querying a preset video library based on the video source identifier. For example, a video retrieval keyword may be obtained, and the video source may be determined in a preset video library based on the video retrieval keyword.
[0034] In this example, after the capture time period is determined, a video segment matching the corresponding capture time period is cut out from each video source to obtain a plurality of video segments corresponding to at least one video source.
[0035] For example, Figure 2 As shown, if the video source includes video A and video B, if the interception time period of video A is 14s-16s, 44s-46s, then the video segment A1 corresponding to 14s-16s in video A and the video segment A2 corresponding to 44s-46s in video A are cut out, and if the interception time period of video B is 29s-31s, 89s-91s, then the video segment B1 corresponding to 29s-31s in video B and the video segment B2 corresponding to 89s-91s in video B are cut out. In this example, a moving picture is generated according to the video segments A1, A2, B1, and B2.
[0036] In the actual execution process, if the above-mentioned video source is an online resource, then in order to realize the cropping of the video source, the video source may not be downloaded as a whole, but the video source may be regarded as a combination of multiple video segments according to time periods. For example, for a video source C with a duration of 58 minutes, one video segment is formed every 6 minutes, which can be divided into 10 video segments, and the duration of the last video segment is 4 minutes. In one embodiment of the present disclosure, multiple segment time periods corresponding to the preset multiple video segments contained in each video source are obtained, and the intercepted time period is matched with the segmented time period of each video segment respectively to determine the successfully matched video segment. Taking the above example as an example, if the intercepted time period corresponding to the video source C is 60-65 seconds, the first video segment is hit; when the intercepted time period is 598 seconds-604 seconds, the first and second video segments are hit at the same time.
[0037] After determining the successfully matched video segments, the successfully matched video segments are downloaded, and the video segments matching the corresponding interception time period are intercepted from the successfully matched video segments. Thus, in this example, only the successfully matched video segments need to be downloaded, which reduces the consumption of download resources.
[0038] Step 102, determining target cropping frame position information corresponding to each video clip, wherein the cropping frame ratio corresponding to each target cropping frame position information is the same as the predetermined target animated image ratio.
[0039] The cropping frame ratio corresponding to the target cropping frame position information is the same as the predetermined target dynamic image ratio. For example, the cropping frame ratio corresponding to the target cropping frame position information is the same as the predetermined target dynamic image ratio, which is 16:9.
[0040] In one embodiment of the present disclosure, target cropping frame position information corresponding to each video clip is determined, wherein the target cropping frame position information is used to limit the cropping area of the target cropping frame in the video frame, etc. For example, if the target cropping frame position information is (30,30,640,360), then the cropping area corresponding to the target cropping frame position information is: an area with a size of 640*360 and a center point at the position (30,30) of the video frame.
[0041] Step 103 , cropping each video frame in the corresponding video segment according to the target cropping frame position information to obtain a cropped video segment.
[0042] After determining the target cropping frame position information, each video frame in the corresponding video segment is cropped according to the target cropping frame position information to obtain the cropped video segment. Therefore, the video frame ratio of each cropped video segment is the target dynamic image ratio, ensuring the consistency of the size ratio when the dynamic image is subsequently synthesized.
[0043] In some possible embodiments, a target cropping area that matches the target cropping frame position information can be determined in each video frame, and the video frames within the target cropping area can be cropped, that is, the area outside the target cropping area is discarded and only the area within the target cropping area is cropped.
[0044] In some possible embodiments, in order to further highlight the object of the animated image, the target video object contained in the first frame of each video segment can be determined based on the target cropping frame position information, and in subsequent video frames of the video segment, the area where the target video object is located in each video frame is identified, and the area where the target video object is located is cropped based on the size information of the target cropping frame corresponding to the target cropping frame position information.
[0045] Step 104: merge all the cropped video clips to generate a moving picture.
[0046] In this embodiment, all the cropped video clips are merged to generate a dynamic image, wherein the video frame ratios of the video frames included in the dynamic image are completely consistent, thereby improving the display effect of the dynamic image. In one embodiment of the present disclosure, a dynamic image format for generating a dynamic image can be obtained, and the dynamic image format can be any one of webp, gif, and avif, and the cropped video clips are used to generate a dynamic image according to the corresponding dynamic image format.
[0047] In some possible embodiments, in order to further improve the display effect of the animated image, the size of the animated image that matches the target animated image ratio can also be determined, that is, the video frame ratios of each video frame in the cropped video clip are consistent, but it is also possible that the sizes of different video frames are inconsistent. In this case, all the cropped video frames can be adjusted to the size of the animated image, and the adjusted video clips can be merged to generate the animated image. As a result, all the video frames included in the animated image not only have the same image ratio, but also the same size, which further improves the display effect of the animated image.
[0048] In different application scenarios, the methods for adjusting all cropped video clips to the size of animated images are different, as shown in the following examples:
[0049] In some possible examples, it can be identified whether the size of all cropped video clips is consistent with the size of the animated image. If not, the inconsistent cropped video clips are determined. If the inconsistent cropped video clips are smaller than the corresponding animated image size, the video frames in the inconsistent cropped video clips are filled, and the size of the filled video frames is consistent with the size of the animated image. The filling processing method can be filling pixel points with predetermined pixel values around the video frame, etc., wherein the predetermined pixel value can be the pixel value with the most pixel points in the current video frame to be filled, etc., thereby improving the display effect of the filled video frame; in this example, if the inconsistent cropped video clips are smaller than the corresponding animated image size, the video frames in the inconsistent cropped video clips are thumbnailed, and the corresponding video frames are downsampled to the size of the animated image, etc.
[0050] In summary, the method for generating and processing a dynamic image in the disclosed embodiment obtains multiple video clips corresponding to at least one video source, determines the target cropping frame position information corresponding to each video clip, wherein the cropping frame ratio corresponding to each target cropping frame position information is the same as the predetermined target dynamic image ratio, and then, each video frame in the corresponding video clip is cropped according to the target cropping frame position information to obtain a cropped video clip, and all cropped video clips are merged to generate a dynamic image. In this technical solution, the video frame ratios of all video frames contained in the dynamic image are guaranteed to be consistent, which improves the dynamic image display effect, and the corresponding video frames are cropped before the dynamic image is synthesized, which reduces the computing power consumption of the dynamic image synthesis, and is conducive to highlighting the object expressed by the dynamic image.
[0051] Based on the above embodiments, in order to further facilitate the dynamic image generation process, the dynamic image generation process of the embodiment of the present disclosure can also be performed in a visual manner. That is, in one embodiment of the present disclosure, a preset cropping interface can be pre-set to provide related functions of video frame cropping on the preset cropping interface.
[0052] Among them, the display function of the preset cropping interface can be set according to the scene requirements. As a possible implementation method, Figure 3 As shown, the preset cropping interface includes a video clip capture area, a dynamic image ratio setting area, a cropping effect preview area, etc.
[0053] The video clip capture area may provide functions related to capturing video clips. After capturing video clips, identification information of multiple captured video clips may be displayed in the video clip capture area (the corresponding identification information is represented in text form in the figure); the animation ratio setting area may include multiple cropping indicator boxes corresponding to multiple candidate animation ratios. The multiple candidate animation ratios in the figure include 16:9, 3:2, and 3:4. The cropping effect preview area may display cropping indicator boxes and cropped video frames, for example, Figure 4 As shown, when the cropped video frame is video frame Q, the video frame Q and the corresponding cropping frame can be displayed in the cropping effect preview area. In this example, in order to locate the position information of the cropping frame, rightward and downward are the positive directions of the X and Y axes respectively, with the upper left corner of Q as the origin, and the width and height W and H of the cropping frame, so that the specific position information of the cropped frame on Q can be identified.
[0054] In conjunction with the above-mentioned visualized preset cropping interface, the following specifically describes how to determine the target cropping frame position information corresponding to each video segment.
[0055] Reference Figure 5 , determining the target cropping frame position information corresponding to each video segment includes:
[0056] Step 501: Display multiple cropping indication boxes corresponding to multiple candidate animation ratios on a preset cropping interface, and display a reference video frame of the current video segment to be cropped on the preset cropping interface.
[0057] The reference video frame may be the first video frame of the video segment to be cropped, or any video frame selected by the user and belonging to the video segment to be cropped, etc. The reference video frame of the current video segment to be cropped is displayed on the preset cropping interface.
[0058] In this embodiment, a plurality of cropping indication boxes corresponding to a plurality of candidate animation ratios are displayed on the preset cropping interface, for example, Figure 3 As shown, cropping indicator frames corresponding to 16:9, 3:2 and 3:4 are displayed respectively. A reference video frame is displayed in the cropping effect preview area on the preset cropping interface.
[0059] Step 502 : in response to obtaining a selection operation of a target cropping indication frame corresponding to a target animation ratio among a plurality of candidate animation ratios, displaying the target cropping indication frame in a reference video frame.
[0060] In this embodiment, in response to obtaining a selection operation of a target cropping indication box corresponding to a target animation ratio among multiple candidate animation ratios, the target cropping indication box is displayed in a reference video frame, that is, the corresponding target cropping indication box is displayed in the reference video frame to facilitate the user to operate the target cropping indication box.
[0061] Step 503 : in response to acquiring a drag operation on the target cropping indication frame, determining a cropping area within the target cropping indication frame in the reference video frame.
[0062] In this embodiment, in response to acquiring a drag operation on the target cropping indication frame, a cropping area within the target cropping indication frame is determined in the reference video frame, that is, the user drags the target cropping indication frame to circle the cropping area.
[0063] Of course, in the actual implementation process, the user can also scale the target cropping indicator box when dragging the target cropping indicator box. For example, when the target cropping indicator box is 16:9, if the initial size is 1920*800, it can be reduced to 640*360 through scaling operations. If the user drags the reduced target cropping indicator box to the position (30,30) of the reference image frame, the target cropping indicator box position information corresponding to the target cropping indicator box is determined to be (30,30,640,360).
[0064] Step 504: determine the relative position information of the cropping area in the target cropping indication frame in the reference video frame, and determine the relative position information as the target cropping frame position information.
[0065] In this embodiment, the relative position information of the cropping area in the target cropping indication frame in the reference video frame is determined as the target cropping frame position information, which includes the relative coordinate position information of the target cropping frame in the reference video frame.
[0066] In some possible embodiments, a display parameter setting area for the video clip may also be displayed on the preset cropping interface, such as Figure 3 As shown, the display parameter setting area includes at least one display parameter setting control, and the user can set the corresponding reference display parameter based on a triggering operation on the display parameter setting control.
[0067] The reference display parameters that can be set include playback speed, contrast, brightness, etc. The playback speed can include a multiple speed value, etc.
[0068] In one embodiment of the present disclosure, in response to obtaining reference display parameters corresponding to the current video clip set on a preset cropping interface, image processing is performed on the cropped current video clip according to the reference display parameters, wherein the actual display parameters of the current video clip after image processing are consistent with the reference display parameters, that is, after synthesizing the animated image and before synthesizing the cropped video segment, it is also necessary to adjust display parameters such as contrast and brightness, and then, perform transcoding operations on the video segment to obtain the corresponding animated image.
[0069] In summary, the dynamic image generation processing method of the embodiment of the present disclosure can determine the position information of the target cropping frame in a visual manner, etc., thereby improving the intuitiveness of video segment cropping and the interactivity of dynamic image synthesis.
[0070] In order to implement the above embodiments, the present disclosure also proposes a dynamic image generation and processing device.
[0071] Figure 6 This is a schematic diagram of the structure of a motion picture generation and processing device provided by an embodiment of the present disclosure. The device can be implemented by software and / or hardware and can generally be integrated in an electronic device to perform motion picture generation and processing. Figure 6 As shown, the device includes: an acquisition module 610, a determination module 620, a cropping module 630 and a dynamic image generation module 640, wherein:
[0072] An acquisition module 610, configured to acquire a plurality of video clips corresponding to at least one video source;
[0073] A determination module 620 is used to determine target cropping frame position information corresponding to each video segment, wherein the cropping frame ratio corresponding to each target cropping frame position information is the same as the predetermined target animated image ratio;
[0074] A cropping module 630, configured to crop each video frame in the corresponding video segment according to the target cropping frame position information to obtain a cropped video segment;
[0075] The animated image generation module 640 is used to merge all the cropped video clips to generate an animated image.
[0076] In one embodiment of the present disclosure, the acquisition module 610 is specifically configured to:
[0077] In response to acquiring the intercepted time period corresponding to each video source;
[0078] A video segment matching a corresponding capture time period is captured in each video source to obtain a plurality of video segments corresponding to at least one video source.
[0079] In one embodiment of the present disclosure, the acquisition module 610 is specifically configured to:
[0080] Acquire multiple segment time periods corresponding to multiple preset video segments contained in each video source;
[0081] Matching the intercepted time period with the segmentation time period of each video segment respectively, and determining the video segment with successful matching;
[0082] The successfully matched video segments are downloaded, and the video segments matching the corresponding interception time period are intercepted from the successfully matched video segments.
[0083] In one embodiment of the present disclosure, the determination module 620 is specifically configured to:
[0084] Displaying a plurality of cropping indication frames corresponding to a plurality of candidate animated image ratios on a preset cropping interface, and displaying a reference video frame of a current video segment to be cropped on the preset cropping interface;
[0085] In response to obtaining a selection operation of a target cropping indication frame corresponding to a target animation ratio among a plurality of candidate animation ratios, displaying the target cropping indication frame in a reference video frame;
[0086] In response to acquiring a drag operation on a target cropping indication frame, determining a cropping area within the target cropping indication frame in a reference video frame;
[0087] Relative position information of the cropping area in the target cropping indication frame in the reference video frame is determined, and the relative position information is determined as the target cropping frame position information.
[0088] In one embodiment of the present disclosure, the device further includes: a display parameter processing module, configured to:
[0089] In response to obtaining a reference display parameter corresponding to the current video segment set on the preset cropping interface, wherein the reference display parameter includes at least one of a playback speed, a contrast, and a brightness,
[0090] The cropped current video segment is subjected to image processing according to the reference display parameters, wherein the actual display parameters of the current video segment after the image processing are consistent with the reference display parameters.
[0091] In one embodiment of the present disclosure, the cropping module 630 is specifically configured to:
[0092] Determine a target cropping area matching the position information of the target cropping frame in each video frame;
[0093] Crop the video frame within the target cropping area.
[0094] In one embodiment of the present disclosure, the animated image generation module 640 is specifically used to:
[0095] Determine the size of the GIF that matches the target GIF ratio;
[0096] Resize all cropped video clips to gif size;
[0097] All adjusted video clips are merged to generate the gif.
[0098] The dynamic image generation and processing device provided in the embodiments of the present disclosure can execute the dynamic image generation and processing method provided in any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
[0099] In order to implement the above embodiments, the present disclosure further proposes a computer program product, including a computer program / instruction, which implements the dynamic image generation processing method in the above embodiments when the computer program / instruction is executed by a processor.
[0100] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure.
[0101] The following specific reference Figure 7 , which shows a schematic diagram of the structure of an electronic device 700 suitable for implementing the embodiment of the present disclosure. The electronic device 700 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 7 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0102] like Figure 7 As shown, the electronic device 700 may include a processor (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a memory 708 to a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the electronic device 700 are also stored. The processor 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0103] Typically, the following devices may be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a memory 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 may allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 7 The electronic device 700 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0104] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 709, or installed from the memory 708, or installed from the ROM 702. When the computer program is executed by the processor 701, the above-mentioned functions defined in the dynamic image generation processing method of the embodiment of the present disclosure are executed.
[0105] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0106] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0107] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0108] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device:
[0109] Acquire multiple video clips corresponding to at least one video source, determine the target cropping frame position information corresponding to each video clip, wherein the cropping frame ratio corresponding to each target cropping frame position information is the same as the predetermined target animated image ratio, and then, crop each video frame in the corresponding video clip according to the target cropping frame position information to obtain the cropped video clip, and merge all the cropped video clips to generate the animated image. In this technical solution, the video frame ratios of all video frames included in the animated image are guaranteed to be consistent, which improves the animated image display effect, and the corresponding video frames are cropped before the animated image is synthesized, which reduces the computing power consumption of the animated image synthesis, and is conducive to highlighting the object expressed by the animated image.
[0110] The electronic device may be written in one or more programming languages or a combination thereof to write computer program code for performing the operations of the present disclosure, including but not limited to object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0111] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0112] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, constitute a limitation on the unit itself.
[0113] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0114] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0115] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned public concept. For example, a technical solution formed by the mutual replacement of the above-mentioned features with the technical features with similar functions disclosed in the present disclosure (but not limited to).
[0116] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0117] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A method for generating and processing a moving picture, characterized in that: The following steps are involved: Acquire a plurality of video clips corresponding to at least one video source; Determine target cropping frame position information corresponding to each of the video clips, wherein the cropping frame ratio corresponding to each target cropping frame position information is the same as the predetermined target animated image ratio; Cropping each video frame in the corresponding video segment according to the target cropping frame position information to obtain a cropped video segment; Merge all the cropped video segments to generate the gif.
2. The method according to claim 1, characterized in that The obtaining of a plurality of video clips corresponding to at least one video source comprises: In response to obtaining the interception time period corresponding to each of the video sources, a video segment matching the corresponding interception time period is intercepted in each of the video sources to obtain a plurality of video segments corresponding to the at least one video source.
3. The method according to claim 2, characterized in that The step of intercepting a video segment matching a corresponding interception time period in each of the video sources comprises: Acquire multiple segment time periods corresponding to multiple preset video segments contained in each of the video sources; Matching the intercepted time period with the segmentation time period of each of the video segments respectively, and determining the video segments with successful matching; The successfully matched video segments are downloaded, and video segments matching the corresponding interception time period are intercepted from the successfully matched video segments.
4. The method according to claim 1, characterized in that The determining the target cropping frame position information corresponding to each of the video clips includes: Displaying a plurality of cropping indication frames corresponding to a plurality of candidate animated image ratios on a preset cropping interface, and displaying a reference video frame of the current video segment to be cropped on the preset cropping interface; In response to obtaining a selection operation of a target cropping indication frame corresponding to a target animation ratio among the plurality of candidate animation ratios, displaying the target cropping indication frame in the reference video frame; In response to acquiring a drag operation on the target cropping indication frame, determining a cropping area within the target cropping indication frame in the reference video frame; Determine relative position information of the cropping area within the target cropping indication frame in the reference video frame, and determine the relative position information as the target cropping frame position information.
5. The method according to claim 4, characterized in that Before generating the animated image according to all the cropped video clips, the method further includes: In response to obtaining a reference display parameter corresponding to the current video segment set on the preset cropping interface, wherein the reference display parameter includes at least one of a playback speed, a contrast, and a brightness, The cropped current video segment is subjected to image processing according to the reference display parameters, wherein the actual display parameters of the current video segment after the image processing are consistent with the reference display parameters.
6. The method according to any one of claims 1 to 5, characterized in that: The step of cropping each video frame in the corresponding video segment according to the target cropping frame position information includes: Determining a target cropping area matching the target cropping frame position information in each video frame; The video frame within the target cropping area is cropped.
7. The method according to any one of claims 1 to 5, characterized in that: The step of merging all the cropped video clips to generate a moving picture includes: Determine a dynamic image size that matches the target dynamic image ratio; Adjusting all the cropped video clips to the size of the animated image; All adjusted video clips are merged to generate the gif.
8. A dynamic image generation and processing device, characterized in that: include: An acquisition module, used for acquiring a plurality of video clips corresponding to at least one video source; A determination module, configured to determine target cropping frame position information corresponding to each of the video clips, wherein the cropping frame ratio corresponding to each target cropping frame position information is the same as a predetermined target animated image ratio; A cropping module, used for cropping each video frame in the corresponding video segment according to the target cropping frame position information to obtain a cropped video segment; The animated image generation module is used to merge all the cropped video clips to generate animated images.
9. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the executable instructions to implement the dynamic image generation processing method described in any one of claims 1-7 above.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is used to execute the dynamic image generation processing method described in any one of claims 1 to 7.