Dynamic picture file processing method and device, equipment and storage medium

By processing the association between dynamic image tracks and static image data items according to different encoding characteristics and types in dynamic image file processing, the problems of low storage and processing efficiency and image quality degradation are solved, achieving more efficient dynamic image file processing and improved user experience.

CN121509660APending Publication Date: 2026-02-10MALANSHAN AUDIO & VIDEO LABORATORY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511708400.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-20
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

In the process of processing dynamic image files, existing technologies suffer from low storage and processing efficiency and a decline in the quality of the target image, especially when the user selects the target image multiple times, the file size increases dramatically and the image quality is compromised.

Method used

By acquiring dynamic image tracks and static image data items, the encoding characteristics and type of the target image frame are determined. Depending on the encoding characteristics and type, the media data of the target image frame is either retained in the dynamic image track or stored independently, and a correlation is established to optimize the storage location and correlation method to improve processing efficiency.

Benefits of technology

It improves the processing efficiency of dynamic image files, enhances the user experience, and avoids image quality degradation caused by multiple encodings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121509660A_ABST
    Figure CN121509660A_ABST
Patent Text Reader

Abstract

The invention discloses a dynamic picture file processing method and device, equipment and a storage medium, and relates to the technical field of image processing, and the method comprises the steps: obtaining a dynamic picture file containing a dynamic picture track and a static picture data item; and determining a target image frame in the dynamic picture track and coding characteristics and coding types of the target image frame. If the coding characteristic is intra-frame coding or inter-frame coding and the coding type is an intra-frame coding image, keeping the media data of the target frame in a dynamic picture track, setting metadata in a static picture data item, establishing an incidence relation and obtaining a first packaging result, and if the coding characteristic is inter-frame coding and the coding type is an inter-frame coding image, keeping the media data of the target frame in the dynamic picture track, and setting metadata in the static picture data item and establishing an incidence relation to obtain a second packaging result; and if not, recoding the target frame, and storing the media data into a file independent of the track to obtain a second packaging result. The target presentation picture and the packaging result type thereof are determined according to user requirements, and the picture is presented in a corresponding mode, so that the dynamic picture file processing efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, in particular to a dynamic picture file processing method, device, equipment and storage medium. BACKGROUND

[0002] At present, in the existing dynamic picture application scene, after shooting a dynamic picture, the dynamic picture file stores a video track corresponding to the dynamic picture and a data item corresponding to a target picture (usually the first frame picture when shooting the dynamic picture). At the same time, the user usually selects a frame as a better target picture in a series of image frames of the dynamic picture. With the user's multiple selections, multiple target pictures appear, and such a scene has the following potential problems:

[0003] 1. Storage and processing efficiency problem: if the user selects a target picture each time and stores the corresponding target picture in the file, the overall file size of the dynamic picture will increase dramatically; and if only one target picture is stored in the file, that is, the target picture selected by the user last time, with the user's comparison between different dynamic picture frames, it is necessary to repeatedly generate the target picture and encapsulate it in the file, causing waste of processing efficiency.

[0004] 2. Target picture quality problem: the target picture selected by the user is derived from the picture frame in the dynamic picture track, and if the picture frame of the dynamic picture is decoded and then encoded and encapsulated as a static picture, the quality of the target picture selected by the user will inevitably decrease relative to the initial target picture (the former has undergone 2 encoding compressions of acquisition and re-encoding, and the latter has only undergone 1 encoding compression of acquisition).

[0005] From the above, how to improve the efficiency of processing the dynamic picture file in the dynamic picture file processing process is a problem to be solved at present. SUMMARY

[0006] Therefore, the purpose of the present application is to provide a dynamic picture file processing method, device, equipment and storage medium, which can improve the efficiency of processing the dynamic picture file in the dynamic picture file processing process. The specific scheme is as follows:

[0007] In a first aspect, the present application provides a dynamic picture file processing method, comprising:

[0008] obtaining a dynamic picture file comprising a dynamic picture track and a static picture data item; the dynamic picture track is used for dynamic presentation of pictures; and the static picture data item is used for static presentation when the dynamic picture file cannot be dynamically presented;

[0009] determining a target image frame in the dynamic picture track, and determining the target image frame as a current target picture, and then determining an encoding characteristic corresponding to the dynamic picture track and an encoding type corresponding to the target image frame;

[0010] If the encoding characteristic is intra-frame encoding, or the encoding characteristic is inter-frame encoding and the encoding type is an intra-frame encoded image, setting media data corresponding to the target image frame as media data corresponding to a new current target picture, and retaining the media data in the dynamic picture track, and then setting metadata in a static picture data item corresponding to the media data, to establish an association between the target image frame and the static picture data item based on the metadata, to obtain a first encapsulation result;

[0011] If the encoding characteristic is inter-frame encoding and the encoding type is an inter-frame encoded image, re-encoding the target image frame, and then setting obtained picture data as media data corresponding to a new current target picture, to store the media data in a to-be-processed dynamic picture file independent of the dynamic picture track, to obtain a second encapsulation result;

[0012] determining a target presentation picture based on user demand, and determining an encapsulation result type corresponding to the target presentation picture, to present the target presentation picture based on the encapsulation result type; the encapsulation result type includes the first encapsulation result and the second encapsulation result.

[0013] Optionally, before the setting of the media data corresponding to the target image frame as media data corresponding to a new current target picture, the method further includes:

[0014] determining a track identifier, a sample identifier, and sample internal offset information corresponding to the dynamic picture file, to determine media data corresponding to the dynamic picture file by using the track identifier, the sample identifier, and the sample internal offset information;

[0015] Alternatively, a preset item location data box is improved, to obtain a media data location corresponding to the static picture data item by using the improved item location data box and a plurality of data reference indexes in the static picture data item, and when a quantity corresponding to each of the data reference indexes is greater than one, combining media data corresponding to each of the data reference indexes in a preset order, to obtain media data corresponding to the static picture data item.

[0016] Optionally, the preset item position data box is improved to utilize the improved item position data box and a plurality of data reference indexes in the static picture data item to obtain a media data position corresponding to the static picture data item, and when a quantity corresponding to each of the data reference indexes is greater than one, media data corresponding to each of the data reference indexes is combined in a preset order to obtain media data corresponding to the static picture data item, comprising:

[0017] The preset item position data box is improved to utilize the improved item position data box and a plurality of data reference indexes in the static picture data item to determine byte length configuration information for indicating a media data position description field; the byte length configuration information comprises a first byte length of an offset field, a second byte length of a length field, and a third byte length of a reference offset field;

[0018] It is judged whether the current version number satisfies a first preset condition, if the current version number satisfies the first preset condition, a fourth byte length corresponding to the data reference index is determined; if the current version number does not satisfy the first preset condition, it is judged whether the current version number satisfies a second preset condition, if the current version number satisfies the second preset condition, a resource is constructed based on the current version number, and a total number of resources corresponding to each of the resources and a data reference entry quantity are determined;

[0019] Based on the data reference entry quantity and the total number of resources, each of the data reference indexes and a corresponding reference offset value are read in sequence; wherein the data reference index is used to point to a data source recorded in a data information container; the reference offset value is a reference benchmark for determining whether data has deviated;

[0020] A quantity of fragments corresponding to each of the data reference indexes is determined, and position information of each fragment is traversed based on the quantity of fragments, if the fourth byte length is greater than zero, an item reference index corresponding to a current fragment is read, and a fragment offset value is determined based on the first byte length, the item reference index, and the reference benchmark, and then a fragment length value is determined based on the first byte length;

[0021] When the quantity corresponding to each of the data reference indexes is greater than one, media data corresponding to each of the data reference indexes is combined based on the fragment offset value and the fragment length value and in a preset order to obtain media data corresponding to the static picture data item.

[0022] Optionally, the target image frame in the dynamic picture track is determined, and the target image frame is determined as a current target picture, then an encoding characteristic corresponding to the dynamic picture track and an encoding type corresponding to the target image frame are determined, comprising:

[0023] determining a target image frame in the dynamic picture track based on a user demand, determining the target image frame as a current target picture, and then creating a group data structure for establishing a mapping relationship between each image frame sample in the dynamic picture track and the static picture data item; wherein the content of the static picture data item is consistent with the content of each image frame sample in the dynamic picture track;

[0024] an identifier field corresponding to the static picture data item is arranged in the group data structure, and a predictive coding flag field is arranged in the group data structure; the identifier field is used to indicate the identifier name corresponding to the static picture data item of each image frame sample; and the predictive coding flag field is used to represent the predictive coding attribute of each image frame sample;

[0025] if the predictive coding flag field is in a first state, it represents that the coding characteristics corresponding to each image frame sample in the group data structure are all in an intra-frame coding mode, and the coding types corresponding to each image frame sample are all intra-frame coded images; if the predictive coding flag field is in a second state, it represents that the coding characteristics corresponding to each image frame sample in the group data structure are all in an inter-frame coding mode, and the coding types corresponding to each image frame sample are all inter-frame coded images.

[0026] Optionally, the determination of the coding characteristics corresponding to the dynamic picture track and the coding type corresponding to the target image frame comprises:

[0027] parsing a preset synchronization sample data box to obtain a synchronization sample entry including each sample number; each sample number in the synchronization sample entry is an incremental number; and each synchronization sample in the synchronization sample entry is a sample using only intra-frame coding;

[0028] matching the sample numbers in the current sample group with the synchronization sample numbers in the synchronization sample data box to obtain a matching result, and determining that the sample is a synchronization sample using only intra-frame coding when the matching result represents that the synchronization sample data box has an entry matching the current sample group;

[0029] if the matching result represents that the synchronization sample data box does not have an entry matching the current sample group, it is determined that the sample is a non-synchronization sample using inter-frame coding, and if the preset synchronization sample data box does not exist, it is determined that each sample is a synchronization sample using only intra-frame coding.

[0030] Optionally, the determination of the target presentation picture based on the user demand and the determination of the packaging result type corresponding to the target presentation picture to present the target presentation picture based on the packaging result type comprise:

[0031] determining a target presentation picture in the dynamic picture file based on a user demand, and determining an encapsulation result type corresponding to the target presentation picture;

[0032] if the encapsulation result type is a first encapsulation result, determining each media data from the dynamic picture track based on the association relationship and the metadata of the target presentation picture, and merging each media data in a preset order to obtain a target presentation picture;

[0033] if the encapsulation result type is a second encapsulation result, determining whether the static picture data item is associated with preset enhancement information, if the static picture data item is not associated with the preset enhancement information, directly presenting the corresponding target presentation picture, if the static picture data item is associated with the preset enhancement information, decoding the target presentation picture to obtain a decoding result, superimposing the decoding result and the preset enhancement information, and presenting the superimposed result.

[0034] Optionally, the decoding of the target presentation picture to obtain a decoding result, the superimposition of the decoding result and the preset enhancement information, and the picture presentation of the superimposed result, comprise:

[0035] obtaining media data corresponding to the static picture data item, decoding the media data to obtain a corresponding decoding result, and obtaining an auxiliary image item having an auxiliary link association with the static picture data item; the auxiliary image item comprises an auxiliary type attribute; the auxiliary type attribute is used to identify the type of the auxiliary image item carrying enhancement information;

[0036] based on the auxiliary type attribute, analyzing the enhancement information data in the auxiliary image item, superimposing the analyzed enhancement information and the decoding result to obtain a superimposed result, and then presenting the superimposed result as a picture;

[0037] based on the encoding type corresponding to the dynamic picture track and the dynamic adjustment of the encoding type, adjusting the storage location and the association manner of the media data of the static picture data item, to optimize the storage efficiency and the picture quality of the picture based on the storage location and the association manner.

[0038] In a second aspect, the present application provides a dynamic picture file processing device, comprising:

[0039] a dynamic picture file obtaining module, configured to obtain a dynamic picture file comprising a dynamic picture track and a static picture data item; the dynamic picture track is used for dynamic presentation of a picture; the static picture data item is used for static presentation when the dynamic picture file cannot be dynamically presented;

[0040] a target image frame determination module, configured to determine a target image frame in the dynamic picture track, and determine the target image frame as a current target picture, and determine an encoding characteristic corresponding to the dynamic picture track and an encoding type corresponding to the target image frame;

[0041] a first encapsulation result determination module, configured to, if the encoding characteristic is intra-frame encoding, or the encoding characteristic is inter-frame encoding and the encoding type is intra-frame encoded image, set media data corresponding to the target image frame as media data corresponding to a new current target picture, and keep the media data in the dynamic picture track, and then set metadata in static picture data corresponding to the media data, to establish an association between the target image frame and the static picture data based on the metadata, to obtain a first encapsulation result;

[0042] a second encapsulation result determination module, configured to, if the encoding characteristic is inter-frame encoding and the encoding type is inter-frame encoded image, re-encode the target image frame, and then set obtained picture data as media data corresponding to a new current target picture, to store the media data in a to-be-processed dynamic picture file independent of the dynamic picture track, to obtain a second encapsulation result;

[0043] a picture presentation module, configured to determine a target presentation picture based on a user demand, determine an encapsulation result type corresponding to the target presentation picture, and present the target presentation picture based on the encapsulation result type; the encapsulation result type includes the first encapsulation result and the second encapsulation result.

[0044] In a third aspect, the present application provides an electronic device, comprising:

[0045] a memory, configured to save a computer program;

[0046] a processor, configured to execute the computer program to implement the dynamic picture file processing method.

[0047] In a fourth aspect, the present application provides a computer readable storage medium, configured to save a computer program, wherein the computer program is executed by a processor to implement the dynamic picture file processing method.

[0048] As can be seen, before processing the dynamic picture file, the dynamic picture file including a dynamic picture track and a static picture data item is acquired; the dynamic picture track is used for dynamic presentation of pictures; the static picture data item is used for static presentation when the dynamic picture file cannot be dynamically presented; a target image frame in the dynamic picture track is determined and the target image frame is determined as a current target picture, and then an encoding characteristic corresponding to the dynamic picture track and an encoding type corresponding to the target image frame are determined; if the encoding characteristic is intra-frame encoding or the encoding characteristic is inter-frame encoding and the encoding type is intra-frame encoded image, media data corresponding to the target image frame is set as media data corresponding to a new current target picture, the media data is retained in the dynamic picture track, then metadata is set in a static picture data item corresponding to the media data, an association between the target image frame and the static picture data item is established, and a first encapsulation result is obtained; if the encoding characteristic is inter-frame encoding and the encoding type is inter-frame encoded image, the target image frame is re-encoded, then obtained picture data is set as media data corresponding to a new current target picture, the media data is stored in a to-be-processed dynamic picture file independent of the dynamic picture track, a second encapsulation result is obtained; a target presentation picture is determined based on user demand, an encapsulation result type corresponding to the target presentation picture is determined, and the target presentation picture is presented based on the encapsulation result type; the encapsulation result type includes the first encapsulation result and the second encapsulation result.

[0049] Therefore, this application first needs to obtain a dynamic image file including a dynamic image track and static image data items; the dynamic image track is used to dynamically present the image; secondly, the target image frame in the dynamic image track is determined and designated as the current target image, and then the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame are determined; then, if the encoding characteristics are intra-frame encoding, or the encoding characteristics are inter-frame encoding and the encoding type is intra-frame encoded image, the media data corresponding to the target image frame is set to the new media data corresponding to the current target image, and the media data is retained in the dynamic image track, and then the static image data corresponding to the media data is... Metadata is set in the static image data item, and the association between the target image frame and the static image data item is established to obtain the first encapsulation result. If the encoding characteristic is inter-frame encoding and the encoding type is inter-frame encoded image, the target image frame is re-encoded, and then the obtained image data is set as the media data corresponding to the new current target image. The media data is stored in a dynamic image file to be processed, independent of the dynamic image track, to obtain the second encapsulation result. Finally, the target image to be presented is determined based on user needs, and the encapsulation result type corresponding to the target image to be presented is determined, so as to present the target image based on the encapsulation result type. The encapsulation result type includes the first encapsulation result and the second encapsulation result. In this way, the efficiency of processing dynamic image files is improved during the processing of dynamic image files, thereby enhancing the user experience. Attached Figure Description

[0050] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0051] Figure 1 This is a flowchart of a dynamic image file processing method disclosed in this application;

[0052] Figure 2 This is a schematic diagram of the structure of a dynamic image file processing device disclosed in this application;

[0053] Figure 3 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation

[0054] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0055] Currently, in existing animated GIF applications, after capturing an animated GIF, the file stores the corresponding video track and a data item for a target image. Users typically select one frame from a series of frames in the animated GIF as the optimal target image. With multiple selections by the user, multiple target images appear, leading to the following potential problems: storage and processing efficiency issues; and target image quality issues. Therefore, this application provides an animated image file processing method that can improve the efficiency of processing animated image files.

[0056] See Figure 1 As shown, this embodiment of the invention discloses a method for processing dynamic image files, including:

[0057] Step S11: Obtain a dynamic image file including a dynamic image track and static image data items; the dynamic image track is used to dynamically present the image; the static image data items are used to statically present the image when the dynamic image file cannot be dynamically presented.

[0058] In this embodiment, during the processing of the animated image file, the present application first obtains the animated image file through a client. The image file contains an animated image track and at least one set of static image data items. It is worth noting that the animated image track is used to dynamically present the image, while the static image data items are used for static presentation when dynamic presentation is not possible. Subsequently, the user can edit and select a frame from the animated image track to generate a new primary image, where the primary image refers to the image data item used for static presentation.

[0059] Step S12: Determine the target image frame in the dynamic image track and identify the target image frame as the current target image. Then, determine the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame.

[0060] In this embodiment, the process of determining the target image frame in the dynamic image track and designating it as the current target image, and then determining the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame, can include: determining the target image frame in the dynamic image track based on user requirements and designating it as the current target image; then creating a group data structure to establish the mapping relationship between each image frame sample in the dynamic image track and static image data items; wherein the content of the static image data items is consistent with the content of each image frame sample in the dynamic image track; setting an identifier field corresponding to the static image data item in the group data structure, and setting a prediction coding flag field in the group data structure; the identifier field is used to indicate the identifier name corresponding to the static image data item of each image frame sample; the prediction coding flag field is used to characterize the prediction coding attribute of each image frame sample; if the prediction coding flag field is in a first state, it indicates that the encoding characteristics corresponding to each image frame sample in the group data structure are all intra-frame coding methods, and the corresponding encoding type is all intra-frame coded image; if the prediction coding flag field is in a second state, it indicates that the encoding characteristics corresponding to each image frame sample in the group data structure are all inter-frame coding methods, and the corresponding encoding type is all inter-frame coded image.

[0061] In this embodiment, the file encapsulating the animated image includes a primary image data item, which can be identified using the 'pitm' data box defined in ISOBMFF. The media data corresponding to the primary image data item can be obtained in one of the following ways: obtaining the media data corresponding to the data item through the Item location box (existing technology); ignoring the Item location box and obtaining the media data through the associated track, sample identifier, and intra-sample offset information; or obtaining the media data corresponding to the data item through an improved Item location box.

[0062] In one specific implementation, when a data item contains a sample data index attribute, the media data corresponding to that data item is the media data contained in the media sample associated with sampleDataReferenceProperty. When the value of num_entry in sampleDataReferenceProperty is greater than 1, the sample data associated with each entry is combined in order to form the media data corresponding to that data item.

[0063] The data box type is 'sdrp'.

[0064] Container: ItemPropertyContainerBox;

[0065] Mandatory: Not mandatory;

[0066] Quantity: 0, 1 or more;

[0067] aligned(8) class sampleDataReferenceProperty extends ItemFullProperty('sdrp', version = 0, flags = 0) {

[0068] unsigned int(32) ref_track_ID;

[0069] unsigned int(16) num_entry;

[0070] for(i = 0; i < num_entry; i++){

[0071] unsigned int(32) ref_sample_number[i];

[0072] unsigned int(1) ref_data_offset_flag[i];

[0073] unsigned int(1) ref_data_length_flag[i];

[0074] bit(6) reserved;

[0075] if(ref_data_offset_flag[i] == 1){

[0076] unsigned int(32) ref_data_offset[i];}

[0077] if(ref_data_length_flag[i] == 1){

[0078] unsigned int(32) ref_data_length[i];}}}。

[0079] Wherein, `ref_track_ID` is the media track identifier where the media sample associated with the data item is located, `num_entry` is the number of subsequent associated information entries, and `ref_sample_number[i]` is the sample number of the associated media sample. When `ref_data_offset_flag[i]` is 1, it indicates `ref_data_offset[i]`; when it is 0, it does not indicate `ref_data_offset[i]`. When `ref_data_length_flag[i]` is 1, it indicates `ref_data_length[i]`; when it is 0, it does not indicate `ref_data_length[i]`. Wherein, `ref_data_offset[i]` is the starting offset value of the associated media data within the corresponding media sample. When `ref_data_offset[i]` is not indicated, it defaults to 0. `ref_data_length[i]` is the size of the associated media data in bytes. When `ref_data_length[i]` is not indicated, it defaults to the size of the corresponding media sample.

[0080] Furthermore, the existing ItemLocationBox, used to indicate the location of data items, is insufficient (data may reside in different locations corresponding to different data_reference_indexes). Therefore, the existing technology needs improvement, and the pseudocode is shown below:

[0081] aligned(8) class ItemLocationBox extends FullBox('iloc', version, 0){

[0082] unsigned int(4) offset_size;

[0083] unsigned int(4) length_size;

[0084] unsigned int(4) base_offset_size;

[0085] if ((version == 1) || (version == 2)) {

[0086] unsigned int(4) index_size;

[0087] } else {

[0088] unsigned int(4) reserved;

[0089] }

[0090] if (version < 2) {

[0091] unsigned int(16) item_count;

[0092] } else if (version == 2) {

[0093] unsigned int(32) item_count;

[0094] }

[0095] for (i=0; i<item_count; i++) {

[0096] if (version < 2) {

[0097] unsigned int(16) item_ID;

[0098] } else if (version == 2) {

[0099] unsigned int(32) item_ID;

[0100] }

[0101] if ((version == 1) || (version == 2)) {

[0102] unsigned int(4) reserved = 0;

[0103] unsigned int(4) construction_method;

[0104] unsigned int(8) num_data_ref_entry;

[0105] }

[0106] for(int j=0; i< num_data_ref_entry; j++){

[0107] unsigned int(16) data_reference_index[j];

[0108] unsigned int(base_offset_size*8) base_offset[j];

[0109] unsigned int(16) extent_count[j];

[0110] for (k=0; k<extent_count; k++) {

[0111] if (((version == 1) || (version == 2)) && (index_size > 0)){

[0112] unsigned int(index_size*8) item_reference_index[j];

[0113] }

[0114] unsigned int(offset_size*8) extent_offset[j];

[0115] unsigned int(length_size*8) extent_length[j];

[0116] }}

[0117] }}

[0118] In this array, `offset_size` takes the value {0, 4, 8} and represents the byte length of the offset field; `length_size` takes the value {0, 4, 8} and represents the byte length of the length field; `base_offset_size` takes the value {0, 4, 8} and represents the byte length of the base offset field; `index_size` takes the value {0, 4, 8} and represents the byte length of the item reference index field; `item_count` is used to count the number of resources in the subsequent array; `item_ID` is an arbitrary integer "identifier" for the resource, which can be used to reference the resource (e.g., in a Uniform Resource Locator URL); `construction_method` takes the value {0 (file method), 1 (idat method), or 2 (item method)}; and `num_data_ref_entry` indicates the number of subsequent `data_reference_index` values. When `num_data_ref_entry` is greater than 1, the media data associated with each `data_reference_index` is combined sequentially to form the media data corresponding to that data item. `data_reference_index` can be 0 (representing "current file") or an index value (1 indicates the first entry), used to index data references in the DataInformationBox. `base_offset` provides a base value for offset calculations within the referenced data. If `base_offset_size` is 0, then `base_offset` is 0, meaning this field is not used. `extent_count` represents the number of fragments after the resource is fragmented; its value must be greater than or equal to 1. `item_reference_index` provides an index value that conforms to the construction method definition. `extent_offset` represents the absolute offset (in bytes) of the fragment data relative to the starting position of the container data. If `offset_size` is 0, then `extent_offset` is 0, and `extent_length` represents the absolute length (in bytes) of the metadata item fragment. If length_size is 0, then extent_length will be 0.

[0119] Specifically, determining the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame can include: parsing a preset synchronization sample data box to obtain synchronization sample entries including each sample number; each sample number in the synchronization sample entry is an incrementing number; each synchronization sample in the synchronization sample entry is a sample that uses only intra-frame coding; matching the sample numbers in the current sample group with the synchronization sample numbers in the synchronization sample data box to obtain a matching result, and determining that the sample is a synchronization sample that uses only intra-frame coding when the matching result indicates that the synchronization sample data box has an entry that matches the current sample group; if the matching result indicates that the synchronization sample data box does not have an entry that matches the current sample group, then the sample is determined to be an asynchronous sample that uses inter-frame coding, and if the preset synchronization sample data box does not exist, then each sample is determined to be a synchronization sample that uses only intra-frame coding.

[0120] In this embodiment, the animated image association sample group is used to associate image frames in the animated image track with data items corresponding to static images, and the associated static image data items are consistent with the content of the image frames in the animated image track. The corresponding pseudocode is as follows:

[0121] aligned(8) class motionPhotoAssociationGroupEntry extendsVisualSampleGroupEntry('mpag') {

[0122] unsigned int(32) ref_item_ID;

[0123] unsigned int(1) all_intra_frame_flag;

[0124] bit(7) reserved;}

[0125] The ref_item_ID is used to indicate the identifier of the data item associated with the sample in the current sample group. When all_intra_frame_flag is 1, it means that the samples in the current sample group only use intra-frame predictive coding; when it is 0, it means that the samples in the current sample group use inter-frame predictive coding.

[0126] Furthermore, in this embodiment of the application, the sample number of the synchronized sample can be obtained through the SyncSampleBox data box. The synchronized sample is the sample using only intra-frame predictive coding, and the asynchronous sample is the sample using inter-frame predictive coding, and the corresponding pseudocode is shown below:

[0127] aligned(8) class SyncSampleBox extends FullBox('stss', version = 0,0) {

[0128] unsigned int(32) entry_count;

[0129] int i;

[0130] for (i=0; i < entry_count; i++) {

[0131] unsigned int(32) sample_number;

[0132] }}.

[0133] The aforementioned data boxes are used to compactly label synchronization samples in the bitstream. The tables are arranged in strictly ascending order of sample numbers. Furthermore, if a synchronization sample box (SyncSampleBox) does not exist, then all samples are synchronization samples. Here, `version` is an integer specifying the version number of the data box. `entry_count` is an integer indicating the number of entries in subsequent tables; if `entry_count` is 0, there are no synchronization samples in the bitstream, and subsequent tables are empty. `sample_number` is the sample number corresponding to each synchronization sample in the bitstream.

[0134] Step S13: If the encoding feature is intra-frame coding, or the encoding feature is inter-frame coding and the encoding type is intra-frame coded image, then the media data corresponding to the target image frame is set to the new media data corresponding to the current target image, and the media data is retained in the dynamic image track. Then, metadata is set in the static image data item corresponding to the media data to establish the association between the target image frame and the static image data item based on the metadata, and the first encapsulation result is obtained.

[0135] In this embodiment, before setting the media data corresponding to the target image frame as the new media data corresponding to the current target image, it may further include: determining the track identifier, sample identifier, and intra-sample offset information corresponding to the dynamic image file, so as to determine the media data corresponding to the dynamic image file using the track identifier, sample identifier, and intra-sample offset information; or, improving the preset item position data box, so as to obtain the media data position corresponding to the static image data item using the improved item position data box and several data reference indices in the static image data item, and when the number corresponding to each data reference index is greater than one, combining the media data corresponding to each data reference index in a preset order to obtain the media data corresponding to the static image data item.

[0136] Subsequently, embodiments of this application can repackage the dynamic image file according to user selection. In one specific implementation, if the encoding characteristic is intra-frame coding, or the encoding characteristic is inter-frame coding and the encoding type is intra-frame coded image, then the media data corresponding to the target image frame is set to the new media data corresponding to the current target image, and the media data is retained in the dynamic image track. The primary image media data is then obtained from the data item of the new primary image through metadata indication. Simultaneously, the selected video frame in the dynamic image track should be associated with the data item corresponding to the primary image.

[0137] Specifically, the preset project location data box is improved to obtain the media data location corresponding to the static image data item using the improved project location data box and several data reference indices in the static image data item. When the number of each data reference index is greater than one, the media data corresponding to each data reference index is combined in a preset order to obtain the media data corresponding to the static image data item. This can include: improving the preset project location data box to determine the byte length configuration information used to represent the media data location description field using the improved project location data box and several data reference indices in the static image data item; the byte length configuration information includes the first byte length of the offset field, the second byte length of the length field, and the third byte length of the base offset field; determining whether the current version number meets the first preset condition; if the current version number meets the first preset condition, determining the fourth byte length corresponding to the data reference index; if the current version number does not meet the first preset condition, determining the current version number... If the second preset condition is met, and the current version number meets the second preset condition, then resources are constructed based on the current version number, and the total number of resources and the number of data reference entries corresponding to each resource are determined. Based on the number of data reference entries and the total number of resources, each data reference index and its corresponding baseline offset value are read sequentially. The data reference index is used to point to the data source recorded in the data information container. The baseline offset value is used to determine whether the data has been offset. The number of fragments corresponding to each data reference index is determined, and the position information of each fragment is traversed based on the number of fragments. If the length of the fourth byte is greater than zero, the item reference index corresponding to the current fragment is read, and the fragment offset value is determined based on the length of the first byte, the item reference index and the reference baseline. Then, the fragment length value is determined based on the length of the first byte. When the number corresponding to each data reference index is greater than one, the media data corresponding to each data reference index is combined based on the fragment offset value and the fragment length value and in a preset order to obtain the media data corresponding to the static image data item.

[0138] In this embodiment, the enhancement information of the static image data item can be stored in a file as an auxiliary image data item for the corresponding static image. The auxiliary image data item should use a data item reference of type 'auxl', associated with the corresponding static image item from the enhancement information image item reference. The enhancement information image item should be associated with an AuxiliaryTypeProperty to indicate the type of enhancement information, as shown in the pseudocode below:

[0139] aligned(8) class AuxiliaryTypeProperty;

[0140] extends ItemFullProperty('auxC', version = 0, flags) {

[0141] string aux_type;

[0142] template unsigned int(8) aux_subtype[];

[0143] / / until the end of the box, the semantics depend on the aux_typevalue

[0144] }

[0145] Wherein, `aux_type` is a null-terminated UTF-8 string containing a Uniform Resource Identifier (URI) used to identify the type of the associated auxiliary image item. `aux_subtype` consists of zero or more bytes from the current position to the end of the box. The semantics of these bytes are determined by the value of `aux_type`. The `aux_type` of the enhanced information image item should be `urn:avs3:image:2025:enhance metadata`, and the meanings of the values ​​for `aux_subtype` are shown in Table 1.

[0146] Table 1. Meaning of the possible values ​​for aux_subtype

[0147]

[0148] Step S14: If the encoding feature is inter-frame coding and the encoding type is inter-frame coded image, then the target image frame is re-encoded, and the obtained image data is set as the media data corresponding to the new current target image, so as to store the media data in a dynamic image file to be processed that is independent of the dynamic image track, and obtain the second encapsulation result.

[0149] In another specific implementation, if the video frame selected in the dynamic picture track is an inter-frame coded image, this application embodiment needs to set the media data of the new primary image to image data re-encoded based on the selected video frame. This image data should be stored independently in a file, i.e., not in the dynamic picture track.

[0150] Step S15: Determine the target image to be presented based on user needs, and determine the encapsulation result type corresponding to the target image to present the target image based on the encapsulation result type; the encapsulation result type includes the first encapsulation result and the second encapsulation result.

[0151] In this embodiment, the application requires presenting either a dynamic image or a static image (i.e., the primary image) from a dynamic image file according to user needs. When presenting the primary image, if its media data is located in the dynamic image track, the corresponding media data content is retrieved from the dynamic image track based on the primary image's metadata, and then merged in order to obtain the complete primary image. If the media data of the primary image is stored independently in a file, and the data item corresponding to the primary image is not associated with enhancement information, the primary image is presented directly; if the data item corresponding to the primary image is associated with enhancement information, the enhancement information is overlaid and presented after decoding the primary image.

[0152] Specifically, determining the target image based on user needs and the corresponding encapsulation result type for the target image, and then presenting the target image based on the encapsulation result type, can include: determining the target image in the dynamic image file based on user needs and determining the encapsulation result type corresponding to the target image; if the encapsulation result type is a first encapsulation result, then determining each media data from the dynamic image track based on the association relationship and the metadata of the target image, and merging each media data in a preset order to obtain the target image; if the encapsulation result type is a second encapsulation result, then determining whether the static image data item is related to the preset enhancement information; if the static image data item is not related to the preset enhancement information, then directly presenting the corresponding target image; if the static image data item is related to the preset enhancement information, then decoding the target image to obtain the decoding result, overlaying the decoding result with the preset enhancement information, and presenting the overlaid result as an image.

[0153] Furthermore, this application embodiment requires decoding the target image to obtain a decoding result, overlaying the decoding result with preset enhancement information, and then presenting the overlay result as an image. Specifically, this includes: acquiring media data corresponding to a static image data item, decoding the media data to obtain a corresponding decoding result, and acquiring an auxiliary image item associated with the static image data item via an auxiliary link; the auxiliary image item includes an auxiliary type attribute; the auxiliary type attribute is used to identify the type of enhancement information carried by the auxiliary image item; parsing the enhancement information data in the auxiliary image item based on the auxiliary type attribute, and overlaying the parsed enhancement information with the decoding result to obtain an overlay result, and then presenting the overlay result as an image; dynamically adjusting the storage location and association method of the media data corresponding to the static image data item based on the encoding type and encoding type of the dynamic image track, so as to optimize the storage efficiency and image quality of the image based on the storage location and association method.

[0154] As can be seen from the above, the embodiments of this application first need to obtain a dynamic image file including a dynamic image track and static image data items; the dynamic image track is used to dynamically present the image; secondly, the target image frame in the dynamic image track is determined and the target image frame is determined as the current target image, and then the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame are determined; then, if the encoding characteristics are intra-frame encoding, or the encoding characteristics are inter-frame encoding and the encoding type is intra-frame encoded image, the media data corresponding to the target image frame is set to the new media data corresponding to the current target image, and the media data is retained in the dynamic image track, and then the media data corresponding to the target image frame is set to the new media data corresponding to the current target image. Metadata is set in the static image data item, and the association between the target image frame and the static image data item is established to obtain the first encapsulation result. If the encoding characteristic is inter-frame encoding and the encoding type is inter-frame encoded image, the target image frame is re-encoded, and then the obtained image data is set as the media data corresponding to the new current target image. The media data is stored in a dynamic image file to be processed, independent of the dynamic image track, to obtain the second encapsulation result. Finally, the target image to be presented is determined based on user needs, and the encapsulation result type corresponding to the target image to be presented is determined, so as to present the target image based on the encapsulation result type. The encapsulation result type includes the first encapsulation result and the second encapsulation result. In this way, the efficiency of processing dynamic image files is improved during the processing of dynamic image files, thereby enhancing the user experience.

[0155] Accordingly, see Figure 2 As shown, this application also provides a dynamic image file processing apparatus, including:

[0156] The dynamic image file acquisition module 11 is used to acquire dynamic image files including dynamic image tracks and static image data items; the dynamic image tracks are used to dynamically present the images; the static image data items are used to statically present the images when the dynamic image files cannot be dynamically presented.

[0157] The target image frame determination module 12 is used to determine the target image frame in the dynamic image track, determine the target image frame as the current target image, and then determine the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame;

[0158] The first encapsulation result determination module 13 is used to, if the encoding characteristic is intra-frame encoding, or the encoding characteristic is inter-frame encoding and the encoding type is intra-frame encoded image, set the media data corresponding to the target image frame to the new media data corresponding to the current target image, and retain the media data in the dynamic image track. Then, it sets metadata in the static image data item corresponding to the media data to establish the association between the target image frame and the static image data item based on the metadata, and obtains the first encapsulation result.

[0159] The second encapsulation result determination module 14 is used to re-encode the target image frame if the encoding characteristic is inter-frame encoding and the encoding type is inter-frame encoded image, and then set the obtained image data as the media data corresponding to the new current target image, so as to store the media data in a dynamic image file to be processed that is independent of the dynamic image track, and obtain the second encapsulation result.

[0160] Image presentation module 15 is used to determine a target image to be presented based on user needs, and to determine the encapsulation result type corresponding to the target image to present the target image based on the encapsulation result type; the encapsulation result type includes the first encapsulation result and the second encapsulation result.

[0161] In some specific embodiments, the dynamic image file processing device may further include:

[0162] The media data determination unit is used to determine the track identifier, sample identifier, and intra-sample offset information corresponding to the animated image file, so as to determine the media data corresponding to the animated image file using the track identifier, the sample identifier, and the intra-sample offset information;

[0163] The media data location determination unit is used to improve the preset project location data box, so as to obtain the media data location corresponding to the static image data item by using the improved project location data box and several data reference indices in the static image data item, and when the number corresponding to each data reference index is greater than one, the media data corresponding to each data reference index is combined in a preset order to obtain the media data corresponding to the static image data item.

[0164] In some specific embodiments, the dynamic image file processing device may further include:

[0165] The byte length configuration information determination unit is used to improve the preset project location data box, so as to determine the byte length configuration information for representing the media data location description field by using the improved project location data box and several data reference indices in the static image data item; the byte length configuration information includes the first byte length of the offset field, the second byte length of the length field, and the third byte length of the reference offset field;

[0166] The resource construction unit is used to determine whether the current version number meets the first preset condition. If the current version number meets the first preset condition, the length of the fourth byte corresponding to the data reference index is determined. If the current version number does not meet the first preset condition, the unit determines whether the current version number meets the second preset condition. If the current version number meets the second preset condition, the unit constructs resources based on the current version number and determines the total number of resources and the number of data reference entries corresponding to each resource.

[0167] The reference offset value determination unit is used to sequentially read each data reference index and its corresponding reference offset value based on the number of data reference entries and the total number of resources; wherein, the data reference index is used to point to the data source recorded in the data information container; and the reference offset value is used as a reference benchmark to determine whether the data has been offset.

[0168] The item reference index determination unit is used to determine the number of fragments corresponding to each data reference index, and to traverse the position information of each fragment based on the number of fragments. If the length of the fourth byte is greater than zero, the item reference index corresponding to the current fragment is read, and the fragment offset value is determined based on the length of the first byte, the item reference index and the reference base. Then, the fragment length value is determined based on the length of the first byte.

[0169] The media data combination unit is used to combine the media data corresponding to each data reference index according to the segment offset value and the segment length value and in a preset order when the number of each data reference index is greater than one, so as to obtain the media data corresponding to the static image data item.

[0170] In some specific embodiments, the target image frame determination module 12 may specifically include:

[0171] The group data structure determination unit is used to determine the target image frame in the dynamic image track based on user requirements, and to determine the target image frame as the current target image. Then, it creates a group data structure to establish the mapping relationship between each image frame sample in the dynamic image track and the static image data item. The content of the static image data item is consistent with the content of each image frame sample in the dynamic image track.

[0172] The identifier field setting unit is used to set an identifier field corresponding to the static image data item in the group data structure, and to set a prediction coding flag field in the group data structure; the identifier field is used to indicate the identifier name corresponding to the static image data item of each image frame sample; the prediction coding flag field is used to characterize the prediction coding attribute of each image frame sample.

[0173] The coding characteristic setting unit is configured to, if the predicted coding flag field is in a first state, indicate that the coding characteristics of each image frame sample in the group data structure are all intra-frame coding methods and the corresponding coding types are all intra-frame coded images; if the predicted coding flag field is in a second state, indicate that the coding characteristics of each image frame sample in the group data structure are all inter-frame coding methods and the corresponding coding types are all inter-frame coded images.

[0174] In some specific embodiments, the target image frame determination module 12 may specifically include:

[0175] A synchronization sample entry determination unit is used to parse a preset synchronization sample data box to obtain a synchronization sample entry including each sample number; each sample number in the synchronization sample entry is an incrementing number; each synchronization sample in the synchronization sample entry is a sample that uses only intra-frame coding.

[0176] The matching result determination unit is used to match the sample number in the current sample group with the synchronous sample number in the synchronous sample data box to obtain the matching result, and when the matching result indicates that there is an entry in the synchronous sample data box that matches the current sample group, it determines that the sample is a synchronous sample that only uses intra-frame coding.

[0177] The sample determination unit is configured to determine that if the matching result indicates that there is no entry in the synchronous sample data box that matches the current sample group, the sample is an asynchronous sample using inter-frame coding; and if the preset synchronous sample data box does not exist, each sample is a synchronous sample using only intra-frame coding.

[0178] In some specific embodiments, the image presentation module 15 may specifically include:

[0179] The encapsulation result type determination unit is used to determine the target image to be presented in the dynamic image file based on user requirements, and to determine the encapsulation result type corresponding to the target image to be presented;

[0180] The target presentation image determination unit is used to determine each media data from the dynamic image track based on the association relationship and the metadata of the target presentation image if the encapsulation result type is the first encapsulation result, and to merge each media data in a preset order to obtain the target presentation image;

[0181] The image presentation unit is configured to, if the encapsulation result type is a second encapsulation result, determine whether the static image data item is associated with preset enhancement information; if the static image data item is not associated with the preset enhancement information, directly present the corresponding target presentation image; if the static image data item is associated with the preset enhancement information, decode the target presentation image to obtain a decoding result, overlay the decoding result with the preset enhancement information, and present the overlay result as an image.

[0182] In some specific embodiments, the image presentation module 15 may specifically include:

[0183] The decoding result determination unit is used to acquire media data corresponding to the static image data item, decode the media data to obtain the corresponding decoding result, and acquire auxiliary image items that are associated with the static image data item through auxiliary links; the auxiliary image item includes an auxiliary type attribute; the auxiliary type attribute is used to identify the type of enhancement information carried by the auxiliary image item;

[0184] The overlay result determination unit is used to parse the enhancement information data in the auxiliary image item based on the auxiliary type attribute, and overlay the parsed enhancement information with the decoding result to obtain the overlay result, and then present the overlay result as an image;

[0185] The storage location adjustment unit is used to dynamically adjust the storage location and association method of the media data of the static image data item based on the encoding type and the encoding type corresponding to the dynamic image track, so as to optimize the storage efficiency and image quality of the image based on the storage location and the association method.

[0186] Furthermore, embodiments of this application also disclose an electronic device, Figure 3This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the dynamic image file processing method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0187] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0188] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0189] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the dynamic image file processing method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program capable of performing other specific tasks.

[0190] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned dynamic image file processing method. The specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0191] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0192] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0193] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0194] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0195] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for processing dynamic image files, characterized in that, include: Retrieves a dynamic image file that includes both dynamic image tracks and static image data items; The dynamic image track is used to dynamically present the images; The static image data item is used to present the image statically when the dynamic image file cannot be presented dynamically. The target image frame in the dynamic image track is determined and the target image frame is identified as the current target image. Then, the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame are determined. If the encoding feature is intra-frame encoding, or the encoding feature is inter-frame encoding and the encoding type is intra-frame encoded image, then the media data corresponding to the target image frame is set to the new media data corresponding to the current target image, and the media data is retained in the dynamic image track. Then, metadata is set in the static image data item corresponding to the media data to establish the association between the target image frame and the static image data item based on the metadata, and the first encapsulation result is obtained. If the encoding feature is inter-frame encoding and the encoding type is inter-frame encoded image, then the target image frame is re-encoded, and the obtained image data is set as the media data corresponding to the new current target image, so that the media data is stored in the unprocessed dynamic image file independent of the dynamic image track, and the second encapsulation result is obtained. The target image is determined based on user needs, and the encapsulation result type corresponding to the target image is determined, so as to present the target image based on the encapsulation result type; The encapsulation result type includes the first encapsulation result and the second encapsulation result.

2. The method for processing dynamic image files according to claim 1, characterized in that, Before setting the media data corresponding to the target image frame to the new media data corresponding to the current target image, the method further includes: The track identifier, sample identifier, and intra-sample offset information corresponding to the animated image file are determined, and the media data corresponding to the animated image file is determined using the track identifier, sample identifier, and intra-sample offset information. Alternatively, the preset project location data box can be improved to obtain the media data location corresponding to the static image data item by using the improved project location data box and several data reference indices in the static image data item. When the number of each data reference index is greater than one, the media data corresponding to each data reference index is combined in a preset order to obtain the media data corresponding to the static image data item.

3. The method for processing dynamic image files according to claim 2, characterized in that, The improvement of the preset project location data box involves using the improved project location data box and several data reference indices in the static image data item to obtain the media data location corresponding to the static image data item. When the number of values ​​corresponding to each data reference index is greater than one, the media data corresponding to each data reference index is combined in a preset order to obtain the media data corresponding to the static image data item, including: The preset project location data box is improved so that the improved project location data box and several data reference indices in the static image data item are used to determine the byte length configuration information used to represent the media data location description field; the byte length configuration information includes the first byte length of the offset field, the second byte length of the length field, and the third byte length of the reference offset field; Determine whether the current version number meets the first preset condition. If the current version number meets the first preset condition, determine the length of the fourth byte corresponding to the data reference index. If the current version number does not meet the first preset condition, determine whether the current version number meets the second preset condition. If the current version number meets the second preset condition, construct resources based on the current version number and determine the total number of resources and the number of data reference entries corresponding to each resource. Based on the number of data reference entries and the total number of resources, each data reference index and its corresponding baseline offset value are read sequentially; wherein, the data reference index is used to point to the data source recorded in the data information container; the baseline offset value is used as a reference benchmark to determine whether the data has been offset; The number of shards corresponding to each data reference index is determined, and the position information of each shard is traversed based on the number of shards. If the length of the fourth byte is greater than zero, the item reference index corresponding to the current shard is read, and the shard offset value is determined based on the length of the first byte, the item reference index and the reference base. Then, the shard length value is determined based on the length of the first byte. When the number of each data reference index is greater than one, the media data corresponding to each data reference index is combined according to the segment offset value and the segment length value in a preset order to obtain the media data corresponding to the static image data item.

4. The method for processing dynamic image files according to claim 1, characterized in that, The step of determining the target image frame in the dynamic image track, identifying the target image frame as the current target image, and then determining the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame includes: Based on user requirements, the target image frame in the dynamic image track is determined, and the target image frame is identified as the current target image. Then, a group data structure is created to establish the mapping relationship between each image frame sample in the dynamic image track and the static image data item; wherein, the content of the static image data item is consistent with the content of each image frame sample in the dynamic image track. An identifier field corresponding to the static image data item is set in the group data structure, and a prediction coding flag field is set in the group data structure; the identifier field is used to indicate the identifier name corresponding to the static image data item of each image frame sample; the prediction coding flag field is used to characterize the prediction coding attribute of each image frame sample. If the predictive coding flag field is in the first state, it indicates that the coding characteristics of each image frame sample in the group data structure are all intra-frame coding methods, and the corresponding coding type is intra-frame coded image; if the predictive coding flag field is in the second state, it indicates that the coding characteristics of each image frame sample in the group data structure are all inter-frame coding methods, and the corresponding coding type is inter-frame coded image.

5. The method for processing dynamic image files according to claim 1, characterized in that, The determination of the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame includes: Parse the preset synchronization sample data box to obtain a synchronization sample entry including each sample number; each sample number in the synchronization sample entry is an incrementing number; each synchronization sample in the synchronization sample entry is a sample that only uses intra-frame coding; The sample number in the current sample group is matched with the synchronous sample number in the synchronous sample data box to obtain a matching result. When the matching result indicates that there is an entry in the synchronous sample data box that matches the current sample group, the sample is determined to be a synchronous sample that only uses intra-frame coding. If the matching result indicates that there is no entry in the synchronization sample data box that matches the current sample group, then the sample is determined to be an asynchronous sample that uses inter-frame coding. If the preset synchronization sample data box does not exist, then each sample is determined to be a synchronization sample that uses only intra-frame coding.

6. The method for processing dynamic image files according to claim 1, characterized in that, The step of determining the target image to be presented based on user needs, and determining the encapsulation result type corresponding to the target image to be presented, and presenting the target image based on the encapsulation result type, includes: Based on user requirements, determine the target image to be presented in the dynamic image file, and determine the encapsulation result type corresponding to the target image to be presented; If the encapsulation result type is the first encapsulation result, then based on the association relationship and the metadata of the target image, each media data is determined from the dynamic image track, and each media data is merged in a preset order to obtain the target image. If the encapsulation result type is a second encapsulation result, then it is determined whether the static image data item is associated with the preset enhancement information. If the static image data item is not associated with the preset enhancement information, then the corresponding target presentation image is directly presented. If the static image data item is associated with the preset enhancement information, then the target presentation image is decoded to obtain a decoding result, and the decoding result is superimposed with the preset enhancement information, and the superimposed result is presented as an image.

7. The method for processing dynamic image files according to claim 6, characterized in that, The process of decoding the target image to obtain a decoding result, overlaying the decoding result with the preset enhancement information, and then presenting the overlaid result as an image includes: Obtain media data corresponding to the static image data item, decode the media data to obtain the corresponding decoding result, and obtain auxiliary image items that are associated with the static image data item through auxiliary links; the auxiliary image item includes an auxiliary type attribute; the auxiliary type attribute is used to identify the type of enhancement information carried by the auxiliary image item; The enhancement information data in the auxiliary image item is parsed based on the auxiliary type attribute, and the parsed enhancement information is superimposed with the decoding result to obtain the superimposed result. Then, the superimposed result is presented as an image. Based on the encoding type corresponding to the dynamic image track, the storage location and association method of the media data corresponding to the static image data item are dynamically adjusted to optimize the storage efficiency and image quality of the image based on the storage location and the association method.

8. A dynamic image file processing device, characterized in that, include: The dynamic image file acquisition module is used to acquire dynamic image files that include dynamic image tracks and static image data items; The dynamic image track is used to dynamically present the images; The static image data item is used to present the image statically when the dynamic image file cannot be presented dynamically. The target image frame determination module is used to determine the target image frame in the dynamic image track, determine the target image frame as the current target image, and then determine the encoding characteristics corresponding to the dynamic image track and the encoding type corresponding to the target image frame; The first encapsulation result determination module is used to, if the encoding characteristic is intra-frame encoding, or the encoding characteristic is inter-frame encoding and the encoding type is intra-frame encoded image, set the media data corresponding to the target image frame to the new media data corresponding to the current target image, and retain the media data in the dynamic image track. Then, metadata is set in the static image data item corresponding to the media data to establish the association between the target image frame and the static image data item based on the metadata, thereby obtaining the first encapsulation result. The second encapsulation result determination module is used to re-encode the target image frame if the encoding characteristic is inter-frame encoding and the encoding type is inter-frame encoded image, and then set the obtained image data as the media data corresponding to the new current target image, so as to store the media data in a dynamic image file to be processed that is independent of the dynamic image track, and obtain the second encapsulation result. The image presentation module is used to determine the target image to be presented based on user needs, and to determine the encapsulation result type corresponding to the target image to be presented, so as to present the target image based on the encapsulation result type. The encapsulation result type includes the first encapsulation result and the second encapsulation result.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the dynamic image file processing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the dynamic image file processing method as described in any one of claims 1 to 7.