Dynamic image playing method and device, equipment and storage medium
By obtaining and aligning the playback control information of dynamic images, determining similar dynamic image groups and aligning their update times, the problem of resource occupation and power consumption when playing a large number of GIF dynamic images in the video preview scene is solved, and more efficient image processing and Longer device battery life.
Patent Information
- Application Number
- CN202410619565.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-09-03
AI Technical Summary
When a large number of GIF dynamic images are played simultaneously in the video preview scene, it will occupy more system resources and consume more power.
By obtaining the playback control information of dynamic images, determine groups of similar dynamic images and align their update times to reduce the number of screen updates, image processing resource occupation and power consumption.
It effectively reduces the occupation of image processing resources, reduces the power consumption of electronic devices, and improves the battery life of electronic devices.
Smart Images

Figure CN118585250A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image playback, and in particular to a dynamic image playback method, device, equipment and storage medium. Background Art
[0002] GIF (Graphics Interchange Format in English and Image Interchange Format in Chinese) is a dynamic image file format. GIF files can be used to store multiple frames of image content and the duration of each frame during playback, thereby achieving dynamic effects of image playback.
[0003] When the image loading framework loads the GIF dynamic image to be played, it usually controls the duration of each frame in the GIF dynamic image, decodes and replaces it when the next frame needs to be updated, so that each frame can be updated and played correctly. However, in some specific scenarios, such as video preview scenarios, a large number of GIF dynamic images need to be played at the same time, which will occupy more system resources and consume more power. Summary of the invention
[0004] In view of this, the embodiments of the present application provide a dynamic image playback method, device, equipment and storage medium to solve the problem in the prior art that when a large number of GIF dynamic images are played simultaneously, more system resources will be occupied and more power will be consumed.
[0005] A first aspect of an embodiment of the present application provides a dynamic image playback method, the method comprising:
[0006] Acquire playback control information of two or more dynamic images, wherein the playback control information includes duration of pictures in the dynamic images;
[0007] Determining a similar dynamic image group according to the duration of the pictures in the dynamic image;
[0008] The update times of the dynamic images in the similar dynamic image group are aligned, and the dynamic images with the aligned update times are played.
[0009] In combination with the first aspect, in a first possible implementation manner of the first aspect, determining a group of dynamic images with similar rates according to the playback rates of two or more dynamic images includes:
[0010] Determine a uniform speed dynamic image in the dynamic image, wherein the update speed of the uniform speed dynamic image is a dynamic image of uniform speed;
[0011] Generate a group of similar dynamic images based on uniform dynamic images with the same speed.
[0012] In combination with the first aspect, in a second possible implementation manner of the first aspect, aligning the update time of the dynamic images in the similar dynamic image group includes:
[0013] When the dynamic image is the first dynamic image in the similar dynamic image group, playing the dynamic image according to the playing control information of the dynamic image;
[0014] When the dynamic image is a new dynamic image added after the first dynamic image in the similar dynamic image group, the update time of the new dynamic image is aligned with the update time of the first dynamic image.
[0015] In combination with the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, aligning the update time of the newly added dynamic image with the update time of the first dynamic image includes:
[0016] Determine the interval between a first picture and a second picture, where the first picture is the first frame of the newly added dynamic image, and the second picture is a frame of the first dynamic image that is located after the update time of the first picture and is closest to the update time of the first picture;
[0017] According to the size of the interval duration, the update time of the third picture is determined, and according to the update time of the third picture, other pictures after the third picture are aligned with the first dynamic image, and the third picture is the second frame picture of the newly added dynamic image.
[0018] In combination with the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, determining an update time of the third picture according to the length of the interval, and aligning other pictures after the third picture with the first dynamic image according to the update time of the third picture, includes:
[0019] When the interval duration is less than or equal to half of the update period of the pictures of the similar dynamic image group, aligning the update time of the third picture with the update time of the fourth picture, the fourth picture being the most recent frame picture after the second picture in the first dynamic image;
[0020] According to the alignment relationship between the update times of the third picture and the fourth picture, other pictures after the third picture are aligned.
[0021] In combination with the third possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, determining an update time of the third picture according to the length of the interval, and aligning other pictures after the third picture with the first dynamic image according to the update time of the third picture, includes:
[0022] When the interval duration is greater than half of the update period of the pictures of the similar dynamic image group, aligning the update time of the third picture with the update time of the second picture;
[0023] According to the alignment relationship between the update time of the third picture and the second picture, other pictures after the third picture are aligned.
[0024] In combination with the first aspect, in a sixth possible implementation manner of the first aspect, playing the dynamic image after the update time is aligned includes:
[0025] After updating any frame picture in the aligned similar dynamic image group, directly decode the next frame picture of the any frame picture.
[0026] A second aspect of an embodiment of the present application provides a dynamic image playback device, the device comprising:
[0027] A playback control information acquisition unit, used to acquire playback control information of two or more dynamic images, wherein the playback control information includes the duration of the pictures in the dynamic images;
[0028] a similar dynamic image group determining unit, configured to determine a similar dynamic image group according to the duration of the pictures in the dynamic image;
[0029] The alignment playback unit is used to align the update time of the dynamic images in the similar dynamic image group and play the dynamic images after the update time is aligned.
[0030] In combination with the second aspect, in a first possible implementation manner of the second aspect, the similar dynamic image group determining unit includes:
[0031] A uniform speed dynamic image determining subunit, used for determining a uniform speed dynamic image in the dynamic image, wherein the updating speed of the uniform speed dynamic image is a dynamic image of uniform speed;
[0032] The similar image group generating subunit generates a similar dynamic image group according to uniform speed dynamic images with the same speed.
[0033] In combination with the second aspect, in a second possible implementation manner of the second aspect, the aligned playback unit includes:
[0034] A first playing subunit, configured to play the dynamic image according to the playing control information of the dynamic image when the dynamic image is the first dynamic image in the similar dynamic image group;
[0035] The second playing subunit is used for aligning the update time of the newly added dynamic image with the update time of the first dynamic image when the dynamic image is a newly added dynamic image after the first dynamic image in the similar dynamic image group.
[0036] In combination with the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the second playing subunit includes:
[0037] An interval duration determination module is used to determine the interval duration between a first picture and a second picture, wherein the first picture is a first frame picture of the newly added dynamic image, and the second picture is a frame picture of the first dynamic image that is located after the update time of the first picture and is closest to the update time of the first picture;
[0038] An alignment module is used to determine the update time of the third picture according to the size of the interval time, and align other pictures after the third picture with the first dynamic image according to the update time of the third picture. The third picture is the second frame picture of the newly added dynamic image.
[0039] In combination with the third possible implementation manner of the second aspect, in a fourth possible implementation manner of the second aspect, the alignment module includes:
[0040] A first update time determination submodule, configured to align the update time of the third picture with the update time of the fourth picture when the interval duration is less than or equal to half of the update period of the pictures of the similar dynamic image group, wherein the fourth picture is the most recent frame picture after the second picture in the first dynamic image;
[0041] The first alignment submodule is used to align other pictures after the third picture according to the alignment relationship between the update time of the third picture and the fourth picture.
[0042] In combination with the third possible implementation manner of the second aspect, in a fifth possible implementation manner of the second aspect, the alignment module includes:
[0043] A second update time determination submodule, configured to align the update time of the third picture with the update time of the second picture when the interval duration is greater than half of the update period of the pictures of the similar dynamic image group;
[0044] The second alignment submodule is used to align other pictures after the third picture according to the alignment relationship between the update time of the third picture and the second picture.
[0045] In combination with the second aspect, in a sixth possible implementation manner of the second aspect, the aligned playback unit is used to:
[0046] After updating any frame picture in the aligned similar dynamic image group, directly decode the next frame picture of the any frame picture.
[0047] A third aspect of an embodiment of the present application provides a dynamic image playback device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any method described in the first aspect when executing the computer program.
[0048] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method described in any one of the first aspects are implemented.
[0049] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the embodiments of the present application obtain playback control information by decoding two or more dynamic images, determine similar dynamic image groups according to the duration of the images in the playback control information, and align the update times of the images in the similar dynamic image groups, so that when playing dynamic images in the similar dynamic image groups, the number of screen updates can be effectively reduced, thereby reducing the occupancy of image processing resources, reducing the power consumption of electronic devices, and improving the battery life of electronic devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0051] Figure 1 It is a schematic diagram of a dynamic image update in which a dynamic image is not aligned provided in an embodiment of the present application;
[0052] Figure 2 It is a schematic diagram of the implementation process of a dynamic image playback method provided in an embodiment of the present application;
[0053] Figure 3 is a schematic diagram of updating a dynamic image after alignment processing provided by an embodiment of the present application;
[0054] Figure 4 is a dynamic image alignment schematic diagram provided in an embodiment of the present application;
[0055] Figure 5 A schematic diagram of dynamic image alignment provided in an embodiment of the present application;
[0056] Figure 6 is a schematic diagram of a dynamic image playback device provided in an embodiment of the present application;
[0057] Figure 7 It is a schematic diagram of a dynamic image playback device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0059] In order to illustrate the technical solution described in this application, a specific embodiment is provided below for illustration.
[0060] GIF file is a dynamic image file format that can be used to store multiple frames of images and the duration of each frame, thereby achieving the effect of dynamic image playback.
[0061] At present, the mainstream loading frameworks for dynamic images in formats such as GIF include loading models such as Glide and Fresco of the Android system. When loading dynamic images, the mainstream loading framework usually independently controls each dynamic image to be played, and decodes and replaces it when the next frame needs to be updated, so that the update time of all dynamic images is correct. Different dynamic images may have different update times. When the dynamic image is updated, the image processing unit (GPU in English, the full name of which is Graphics Processing Unit) needs to be triggered. When multiple dynamic images are displayed at the same time, the image processing unit will be frequently triggered to update, occupying more system resources of the electronic device and consuming more power.
[0062] for example Figure 1 The figure shows the update schematic diagram of the unaligned dynamic images. The dynamic images that the electronic device needs to play include GIF1, GIF2, GIF3 and GIF4. When each GIF dynamic image is independently controlled by the mainstream loading framework, the update time in the image processing unit is the superposition of the update time of the four GIF dynamic images. The number of updates of the image processing unit (GPU) is the sum of the update times of the four GIF dynamic images, which will occupy more GPU resources and the system power consumption is higher.
[0063] To solve the above problems, the present application provides an image playing method, which can be performed by an electronic device for playing two or more dynamic images, namely, a dynamic image playing device. Figure 2 As shown, the method includes:
[0064] In S201, playback control information of two or more dynamic images is obtained, where the playback control information includes the duration of pictures in the dynamic images.
[0065] The dynamic image in the embodiment of the present application is a dynamic image to be played in the electronic device. The dynamic image can be a dynamic image to be played, or a dynamic image being played, or a dynamic image being played and a dynamic image to be played.
[0066] In general, the dynamic images are two or more dynamic images in the same page. For example, a video playback page includes a dynamic image for previewing multiple videos, or two or more dynamic images are displayed on a website page, or two or more dynamic images are displayed on an application page such as a game, or two or more dynamic images are displayed simultaneously in an album.
[0067] Alternatively, in a possible implementation, the two or more dynamic images may be dynamic images in different pages. For example, when multiple pages are displayed simultaneously on a display screen of an electronic device, and multiple pages include dynamic images, the image processing unit needs to update the pages according to the dynamic images in the multiple pages.
[0068] The playback control information of the dynamic image can be determined by acquiring the file header or control block of the dynamic image.
[0069] When decoding the dynamic image, a decoding tool may be used, including decoding tools such as GIMP, ffmpeg (both are image editing tools), etc., to decode and obtain the playback control information included in the dynamic image.
[0070] The playback control information may include the duration of each frame of the dynamic image. The duration is the delay time of the frame of the image. The longer the duration is, the longer the display time of the frame of the image is.
[0071] For example, a GIF dynamic image includes three frames of pictures, namely the first picture, the second picture and the third picture, wherein the duration of the first picture is the first duration, such as 200ms, the duration of the second picture is the second duration, such as 300ms, and the duration of the third picture is the third duration, such as 500ms.
[0072] When playing the GIF dynamic image, after the first image is displayed for the first duration (200ms), the image processing unit updates the screen content, the first image disappears, and the second image is displayed and maintained for the second duration (300ms). After the second image is displayed for the second duration, the image processing unit updates the screen content, the second image disappears, and the third image is displayed and maintained for the third duration (500ms). At this point, the dynamic image is displayed once. If the dynamic image is played in a loop, it will go to the step of playing the first image.
[0073] In S202, a similar dynamic image group is determined according to the duration of the pictures in the dynamic image.
[0074] In the embodiment of the present application, when determining a similar dynamic image group according to the duration of a dynamic image, it is possible to first determine whether the dynamic image is a uniform dynamic image according to the duration of the picture in the playback control information of the dynamic image, and then screen the dynamic images to obtain uniform dynamic images. Further, uniform dynamic images with the same speed are selected from the uniform dynamic images to generate a similar dynamic image group.
[0075] The similar dynamic image group refers to a dynamic image set consisting of two or more dynamic images with the same or related update speeds. Related dynamic images may include two dynamic images with update speeds that are integer multiples. The update speed may include a uniform update speed and a non-uniform update speed.
[0076] When the durations of the pictures in the two dynamic images are the same, it can be determined that the update speeds of the pictures in the two dynamic images are the same.
[0077] The update speed of the picture in the embodiment of the present application refers to the update speed of the picture on the display screen, that is, the playback speed of the picture in the dynamic image. The longer the duration of the picture, the slower the update speed of the picture. When the duration of the picture is T and the update speed is V, it can be expressed as: V = 1 / T.
[0078] In a possible implementation, when the dynamic images are uniform dynamic images and the update speeds of the uniform dynamic images are different, similar dynamic images can also be determined based on the multiple relationship between the update speeds of the uniform dynamic images. For example, when the update speeds of two uniform dynamic images are in an integer multiple relationship, such as the first update speed of the first uniform dynamic image is an integer multiple of the second update speed of the second uniform dynamic image, similar dynamic images can be generated based on the first uniform dynamic image and the second uniform dynamic image.
[0079] Since the update speeds of the first uniform-speed dynamic image and the second uniform-speed dynamic image are in a multiple relationship, after aligning the first uniform-speed dynamic image and the second uniform-speed dynamic image, some images can have the same update time, which can effectively reduce the number of updates of the image processing unit compared to the unaligned update method.
[0080] In addition, for non-uniform speed dynamic images, if the update time of all pictures of two or more non-uniform speed dynamic images is the same, a similar dynamic image group can be generated based on the two or more non-uniform speed dynamic images.
[0081] In S203, the update times of the dynamic images in the similar dynamic image group are aligned, and the dynamic images with the aligned update times are played.
[0082] After determining the dynamic images included in the similar dynamic image group, in order to reduce the update times of the image processing unit (ie, the times the image processing unit updates the displayed picture), the update times of the dynamic images in the same similar dynamic image group need to be aligned.
[0083] for example Figure 3 The figure shows a schematic diagram of updating a dynamic image after alignment processing provided by an embodiment of the present application. For a similar dynamic image group including four GIF dynamic images (GIF1, GIF2, GIF3 and GIF4) with the same update frequency (or the same update speed), after aligning the four dynamic images, the update time of each frame in the four dynamic images is the same, and the update frequency of the image processing unit (GPU) is the same as the update frequency of the dynamic image. Therefore, from Figure 3 It can be seen that the aligned dynamic image greatly reduces the update frequency of the image processing unit (and Figure 1 Compared to Figure 1 The update frequency is reduced by 1 / 4 of the original image), which reduces the GPU resource usage and helps reduce the power consumption of displaying multiple dynamic images.
[0084] In the embodiment of the present application, two or more dynamic images in a similar dynamic image group may all be dynamic images to be displayed. In this case, the update time of the first frame of all dynamic images in the dynamic image group may be aligned to complete the alignment of the update time of all images of the dynamic images in the similar dynamic image group. Figure 3 As shown, the similar dynamic image group includes four dynamic images with the same update speed. It only needs to align the first frame of the image, and the other frames of the image after the first frame of the image will be automatically aligned.
[0085] In a possible implementation, the dynamic images in the same similar dynamic image group may have a chronological relationship in terms of update time. For example, for the dynamic images in the same similar dynamic image group, some dynamic images are already being played, while some dynamic images have just received a trigger instruction and are in a waiting-to-play state. At this time, after determining the similar dynamic image group to which the dynamic image in the waiting-to-play state belongs, the dynamic image in the waiting-to-play state can be used as a newly added dynamic image and aligned with other dynamic images (in the playing state) in the similar dynamic image group.
[0086] If a certain undetermined dynamic image that has not yet been determined to belong to a similar dynamic image group does not belong to the same similar dynamic image group as other dynamic images, a similar dynamic image group can be generated based on the undetermined dynamic image, and the undetermined dynamic image is the first dynamic image in the similar dynamic image group. To facilitate the alignment of dynamic images in the similar dynamic image group, the update time of each frame of the first dynamic image can be played according to the update time determined by the playback control information of the dynamic image.
[0087] For the dynamic images after the first dynamic image in the similar dynamic image group, that is, the newly added dynamic images, the update time can be aligned with the update time of the first dynamic image.
[0088] When aligning the newly added dynamic image with the first dynamic image, the update time of the first frame of the newly added dynamic image, that is, the first image, can be determined according to the playback control information. Then, a second image in the first dynamic image that is closest to the update time of the first image and is located after the update time of the first image is determined. The interval time between the update time of the first image and the update time of the second image is calculated, and the interval time is compared with a predetermined time threshold.
[0089] If the interval duration is greater than the duration threshold (the duration threshold may be half the duration of the update period of the first image in the first dynamic image; when the dynamic image is a uniform dynamic image, the duration threshold may be half the update period of the first dynamic image), the update time of the third image is aligned with the update time of the second image, and the third image is the second frame of the newly added dynamic image; and according to the alignment relationship between the update time of the third image and the second image, the other images after the third image are aligned. The update time of the first image may be updated according to the update time parsed by the playback control information.
[0090] for example Figure 4In the dynamic image alignment schematic diagram shown, the similar dynamic image group includes the first dynamic image GIF1, the second dynamic image GIF2 and the newly added dynamic image GIF-NEW. The first frame of the newly added dynamic image GIF-NEW (i.e., the first picture) is between the kth frame and the k+1th frame in the first dynamic image, and the k+1th frame is determined to be the second picture. The interval between the first picture and the second picture is relatively long (the interval is greater than the duration threshold), and the update time of the first picture can be determined according to the playback control information, that is, the update time in the playback control information is directly used to play the first frame of the newly added dynamic image. For the second frame of the newly added dynamic image, that is, the third picture, it can be aligned with the second image. After the second frame is aligned with the second picture, since the update speed is the same, according to the alignment result of the third picture with the second picture, the other pictures after the third picture can be updated according to the time interval between the other pictures and the third picture, that is, no adjustment is required, and they can be aligned with the first dynamic image. By adjusting the duration between the first frame and the second frame in the newly added dynamic image, it is possible to quickly respond to the playback of the newly added dynamic image and quickly complete the dynamic image alignment.
[0091] If the interval duration is less than or equal to the duration threshold, the update time of the first picture can be modified to the update time of the second picture. Figure 5 In the dynamic image alignment schematic diagram shown, the similar dynamic image group includes the first dynamic image GIF1, the second dynamic image GIF2 and the newly added dynamic image GIF-NEW. The first frame image (i.e., the first image) of the newly added dynamic image GIF-NEW is between the kth frame image and the k+1th frame image in the first dynamic image (GIF1) (k is an arbitrary natural number), and the k+1th frame image is determined to be the second image. The interval duration between the first image and the second image is small (the interval duration is less than the duration threshold), and the second frame image of the newly added dynamic image, i.e., the third image, can be aligned with the update time of the first image after the second image in the first dynamic image, i.e., the fourth image. According to the alignment result of the update time of the third image and the fourth image, other images after the third image can be updated according to the time interval between other images and the third image, that is, no further adjustment is required, and they can be aligned with the first dynamic image.
[0092] In a possible implementation, the update time of the first picture may be modified to the update time of the second picture, that is, the first picture is updated at the update time of the second picture, that is, the update time of the first picture is aligned with the update time of the second picture. According to the alignment result of the update time of the first picture and the second picture, the newly added dynamic image can be aligned with the first dynamic image without modifying the time interval between the pictures of the newly added dynamic image.
[0093] In a possible implementation, the interval between the first picture and the second picture may not be calculated, and the update time of the first picture may be directly modified to the update time of the second picture to quickly complete the alignment of the newly added dynamic image.
[0094] In a possible implementation, in order to more reliably align the update time, after the dynamic image in the similar dynamic image group completes the image update of any frame, the next frame of the arbitrary frame can be directly decoded, so that all dynamic images in the same similar dynamic image group can complete the screen update within one frame.
[0095] The dynamic image playing method in the embodiment of the present application can be used for dynamic image playing under operating systems including Android, etc. It is understandable that the method can also be applied to operating systems such as Apple and WINDOWS.
[0096] In order to verify the difference between the playback method after the dynamic image is aligned and the playback method without alignment in the embodiment of the present application, the embodiment of the present application also includes a playback test of 14 GIF dynamic images with a duration of 500ms for each GIF dynamic image based on the same device and the same scene. Compared with the traditional framework Glide, the test results are as follows:
[0097] Alignment Test 1 Alignment Test 2 Glide 1 Glide 2 GPU Update Frequency 2.17 / s 2.01 / s 29.14 / s 28.57 / s Process CPU usage 25.78% 25.29% 35.60% 35.78% Average current 281.9mA 275.6mA 331.0mA 346.2mA
[0098] Among them, alignment test 1 and alignment test 2 are test data after aligning 14 GIF dynamic images according to the dynamic image playback method in the embodiment of the present application, and Glide1 and Glide2 are test data of the traditional Glide loading framework. According to the above test data, it can be seen that the dynamic image playback method in the embodiment of the present application reduces the occupancy of the GPU and CPU and reduces the average current of the electronic device, thereby being able to reduce the power consumption of the electronic device while improving the display performance of the dynamic image.
[0099] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0100] Figure 6 A schematic diagram of a dynamic image playback device provided in an embodiment of the present application, such as Figure 6 As shown, the device comprises:
[0101] The playback control information acquisition unit 601 is used to acquire playback control information of two or more dynamic images, where the playback control information includes the duration of pictures in the dynamic images.
[0102] The similar dynamic image group determining unit 602 is configured to determine a similar dynamic image group according to the duration of the pictures in the dynamic image.
[0103] The aligned playback unit 603 is configured to align the update time of the dynamic images in the similar dynamic image group, and play the dynamic images with the aligned update time.
[0104] Figure 6 The dynamic image playback device shown in Figure 2 The dynamic image playback method shown corresponds to this.
[0105] Figure 7 Schematic diagram of a dynamic image playback device provided in an embodiment of the present application. Figure 7 As shown, the dynamic image playback device 7 of this embodiment includes: a processor 70, a memory 71, and a computer program 72 stored in the memory 71 and executable on the processor 70, such as a dynamic image playback program. When the processor 70 executes the computer program 72, the steps in the above-mentioned dynamic image playback method embodiments are implemented. Alternatively, when the processor 70 executes the computer program 72, the functions of the modules / units in the above-mentioned device embodiments are implemented.
[0106] Exemplarily, the computer program 72 may be divided into one or more modules / units, which are stored in the memory 71 and executed by the processor 70 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program 72 in the dynamic image playback device 7.
[0107] The dynamic image playback device 7 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The dynamic image playback device may include, but is not limited to, a processor 70 and a memory 71. Those skilled in the art will appreciate that Figure 7 It is only an example of the dynamic image playback device 7 and does not constitute a limitation of the dynamic image playback device 7. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the dynamic image playback device may also include input and output devices, network access devices, buses, etc.
[0108] The processor 70 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0109] The memory 71 may be an internal storage unit of the dynamic image player 7, such as a hard disk or memory of the dynamic image player 7. The memory 71 may also be an external storage device of the dynamic image player 7, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the dynamic image player 7. Further, the memory 71 may also include both an internal storage unit and an external storage device of the dynamic image player 7. The memory 71 is used to store the computer program and other programs and data required by the dynamic image player. The memory 71 may also be used to temporarily store data that has been output or is to be output.
[0110] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0111] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0112] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0113] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0114] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0115] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0116] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the process in the above-mentioned embodiment method, and can also be completed by hardware related to computer program instructions. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0117] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for playing a dynamic image, characterized in that: The method comprises: Acquire playback control information of two or more dynamic images, wherein the playback control information includes duration of pictures in the dynamic images; Determining a similar dynamic image group according to the duration of the pictures in the dynamic image; The update times of the dynamic images in the similar dynamic image group are aligned, and the dynamic images with the aligned update times are played.
2. The method according to claim 1, characterized in that Determining a group of dynamic images with similar rates according to the playback rates of two or more dynamic images comprises: Determine a uniform speed dynamic image in the dynamic image, wherein the update speed of the uniform speed dynamic image is a dynamic image of uniform speed; Generate a group of similar dynamic images based on uniform dynamic images with the same speed.
3. The method according to claim 1, characterized in that Aligning the update time of the dynamic images in the similar dynamic image group includes: When the dynamic image is the first dynamic image in the similar dynamic image group, playing the dynamic image according to the playing control information of the dynamic image; When the dynamic image is a new dynamic image added after the first dynamic image in the similar dynamic image group, the update time of the new dynamic image is aligned with the update time of the first dynamic image.
4. The method according to claim 3, characterized in that Aligning the update time of the newly added dynamic image with the update time of the first dynamic image includes: Determine the interval between a first picture and a second picture, where the first picture is the first frame of the newly added dynamic image, and the second picture is a frame of the first dynamic image that is located after the update time of the first picture and is closest to the update time of the first picture; According to the size of the interval duration, the update time of the third picture is determined, and according to the update time of the third picture, other pictures after the third picture are aligned with the first dynamic image, and the third picture is the second frame picture of the newly added dynamic image.
5. The method according to claim 4, characterized in that Determining the update time of the third picture according to the length of the interval, and aligning other pictures after the third picture with the first dynamic image according to the update time of the third picture, including: When the interval duration is less than or equal to half of the update period of the pictures of the similar dynamic image group, aligning the update time of the third picture with the update time of the fourth picture, the fourth picture being the most recent frame picture after the second picture in the first dynamic image; According to the alignment relationship between the update times of the third picture and the fourth picture, other pictures after the third picture are aligned.
6. The method according to claim 4, characterized in that Determining the update time of the third picture according to the length of the interval, and aligning other pictures after the third picture with the first dynamic image according to the update time of the third picture, including: When the interval duration is greater than half of the update period of the pictures of the similar dynamic image group, aligning the update time of the third picture with the update time of the second picture; According to the alignment relationship between the update time of the third picture and the second picture, other pictures after the third picture are aligned.
7. The method according to claim 1, characterized in that Playing the dynamic image after the update time is aligned, comprising: After updating any frame picture in the aligned similar dynamic image group, directly decode the next frame picture of the any frame picture.
8. A dynamic image playback device, characterized in that: The device comprises: A playback control information acquisition unit, used to acquire playback control information of two or more dynamic images, wherein the playback control information includes the duration of the pictures in the dynamic images; a similar dynamic image group determining unit, configured to determine a similar dynamic image group according to the duration of the pictures in the dynamic image; The alignment playback unit is used to align the update time of the dynamic images in the similar dynamic image group and play the dynamic images after the update time is aligned.
9. A dynamic image playback device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
