[go: up one dir, main page]

CN116304122A - Media file generation method, device, electronic equipment and storage medium - Google Patents

Media file generation method, device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116304122A
CN116304122A CN202310266459.5A CN202310266459A CN116304122A CN 116304122 A CN116304122 A CN 116304122A CN 202310266459 A CN202310266459 A CN 202310266459A CN 116304122 A CN116304122 A CN 116304122A
Authority
CN
China
Prior art keywords
format
file
media data
media file
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310266459.5A
Other languages
Chinese (zh)
Inventor
潘立祥
王继成
李育博
宋志文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Douyin Vision Co Ltd
Lemon Inc Cayman Island
Original Assignee
Douyin Vision Co Ltd
Lemon Inc Cayman Island
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Douyin Vision Co Ltd, Lemon Inc Cayman Island filed Critical Douyin Vision Co Ltd
Priority to CN202310266459.5A priority Critical patent/CN116304122A/en
Publication of CN116304122A publication Critical patent/CN116304122A/en
Priority to PCT/CN2024/081251 priority patent/WO2024188248A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/41Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/215Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/40Information retrieval; Database structures therefor; File system structures therefor of multimedia data, e.g. slideshows comprising image and additional audio data
    • G06F16/48Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/483Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0608Saving storage space on storage systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Library & Information Science (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the disclosure provides a media file generation method, a device, electronic equipment and a storage medium. Wherein the method comprises the following steps: determining a first format media file and a second format media file; determining preset file index information from a first format media file; and regenerating the first format media file by adopting second target media data in the second format media file according to the preset file index information. By executing the scheme, the problem that multiple packaging formats contain redundant data can be solved, and the storage space can be saved.

Description

Media file generation method, device, electronic equipment and storage medium
Technical Field
The embodiment of the disclosure relates to a data processing technology, in particular to a media file generation method, a device, electronic equipment and a storage medium.
Background
Because of the diversity of the end side and the requirement of playing media files with different encapsulation formats in different scenes, media files with various encapsulation formats can be generated simultaneously when the server side transcodes.
The encoding parameters of the media files with different encapsulation formats are consistent, and only the encapsulation with different formats is carried out during encapsulation, so that the transcoding stream data contained in the media files with different encapsulation formats are the same. If media files with different packaging formats are respectively prepared for media data with the same content for storage and use, larger storage space is occupied, so that the storage space is wasted, and the problem of redundancy of the data is caused.
Disclosure of Invention
The present disclosure provides a method, an apparatus, an electronic device, and a storage medium for generating a media file, which can solve the problem that multiple package formats contain redundant data, and can save storage space.
In a first aspect, an embodiment of the present disclosure provides a method for generating a media file, including:
determining a first format media file and a second format media file, wherein the first format media file is obtained by converting a preset packaging format of the second format media file;
determining preset file index information from a first format media file, wherein the preset file index information records a mapping corresponding relation between first target media data and second target media data, the first target media data comprises deleted target media data in the first format media file, and the second target media data comprises target media data with the same data content as the first target media data in the second format media file;
and regenerating the first format media file by adopting second target media data in the second format media file according to preset file index information.
In a second aspect, an embodiment of the present disclosure further provides a media file generating apparatus, including:
the media file determining module is used for determining a first format media file and a second format media file, wherein the first format media file is obtained by converting a preset packaging format of the second format media file;
a preset file index information determining module, configured to determine preset file index information from a first format media file, where the preset file index information records a mapping correspondence between first target media data and second target media data, where the first target media data includes target media data deleted in the first format media file, and the second target media data includes target media data having the same data content as the first target media data in the second format media file;
and the media data generation module is used for regenerating the first format media file by adopting second target media data in the second format media file according to preset file index information.
In a third aspect, embodiments of the present disclosure further provide an electronic device, including:
One or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the media file generation method of any of the embodiments of the present disclosure.
In a fourth aspect, the presently disclosed embodiments also provide a storage medium containing computer-executable instructions for performing a media file generation method according to any of the embodiments of the present disclosure when executed by a computer processor.
In the embodiment of the disclosure, a first format media file and a second format media file are determined, wherein the first format media file is obtained by converting a preset packaging format of the second format media file; determining preset file index information from a first format media file, wherein the preset file index information records a mapping corresponding relation between first target media data and second target media data, the first target media data comprises deleted target media data in the first format media file, and the second target media data comprises target media data with the same data content as the first target media data in the second format media file; and regenerating the first format media file by adopting second target media data in the second format media file according to the preset file index information. According to the scheme, the preset file index information is determined from the first format media file, and the first format media file is regenerated by adopting the second target media data in the second format media file according to the preset file index information, so that the problems of waste of the storage space and redundancy of the data are solved, the storage space can be saved, and the effective utilization rate of the storage space is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1a is a flowchart of a method for generating a media file according to an embodiment of the present disclosure;
FIG. 1b is a schematic diagram of an MP4 file structure according to an embodiment of the present disclosure;
FIG. 2a is a flowchart of another method for generating a media file according to an embodiment of the present disclosure;
FIG. 2b is a schematic diagram illustrating the distribution of media data of MP4 files and media data of dash files according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a media file generation device according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
It will be appreciated that prior to using the technical solutions disclosed in the embodiments of the present disclosure, the user should be informed and authorized of the type, usage range, usage scenario, etc. of the personal information related to the present disclosure in an appropriate manner according to the relevant legal regulations.
For example, in response to receiving an active request from a user, a prompt is sent to the user to explicitly prompt the user that the operation it is requesting to perform will require personal information to be obtained and used with the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server or a storage medium for executing the operation of the technical scheme of the present disclosure according to the prompt information.
As an alternative but non-limiting implementation, in response to receiving an active request from a user, the manner in which the prompt information is sent to the user may be, for example, a popup, in which the prompt information may be presented in a text manner. In addition, a selection control for the user to select to provide personal information to the electronic device in a 'consent' or 'disagreement' manner can be carried in the popup window.
It will be appreciated that the above-described notification and user authorization process is merely illustrative and not limiting of the implementations of the present disclosure, and that other ways of satisfying relevant legal regulations may be applied to the implementations of the present disclosure.
It will be appreciated that the data (including but not limited to the data itself, the acquisition or use of the data) involved in the present technical solution should comply with the corresponding legal regulations and the requirements of the relevant regulations.
Fig. 1a is a schematic flow chart of a media file generation method provided by an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to a case of fast playback of a media file, and the method may be performed by a media file generation device, where the device may be implemented in software and/or hardware, and optionally, implemented by an electronic device, where the electronic device may be a mobile terminal, a PC side, a server, or the like. As shown in fig. 1a, the method comprises:
s110, determining the first format media file and the second format media file.
The first format media file is obtained by converting the second format media file into a preset packaging format.
The first format media file is a file with media data deleted. The second format media file is a file that retains media data. The encoding parameters of the first format media file are the same as the encoding parameters of the second format media file, the transcoding stream data of the first format media file is the same as the transcoding stream data of the second format media file, but the packaging formats of the first format media file and the second format media file are different. Taking the first format media file as an MP4 file as an example, the second format media file may be a dash file or an HLS file other than the MP4 file. In the scheme, the first format media file is an MP4 file, and the second format media file is a dash file for explanation.
S120, determining preset file index information from the first format media file.
The mapping correspondence between first target media data and second target media data is recorded by the preset file index information, the first target media data comprises deleted target media data in the first format media file, and the second target media data comprises target media data with the same data content as the first target media data in the second format media file.
The first target media data and the second target media data record the same data content, the first target media data belongs to a first format media file, and the second target media data is stored in a second format media file. The first format media file also contains preset file index information. The mapping correspondence between the deleted first target media data in the first format media file and the second target media data with the same data content in the second format media file can be determined through the preset file index information, the second target media data corresponding to the first target media data in the second format media file can be obtained as a guide when a user searches the first target media data, and the first format media file is regenerated according to the second target media data. It is understood that the media data may be audio data or video data.
S130, regenerating the first format media file by adopting second target media data in the second format media file according to preset file index information.
When the first target media data is accessed, the first target media data deleted in the first format media file can be determined according to the preset file index information and the second format media file, so that the memory space can be saved, and redundant data can be reduced.
As an alternative but non-limiting implementation manner, the generation manner of the first format media file includes but is not limited to steps A1-A3:
step A1: and carrying out encapsulation format conversion on the second format media file to obtain a reference media file, and deleting first target media data in the reference media file.
For example, taking the first format media file as an MP4 file and the second format media file as a dash file as an example, the scheme can perform encapsulation format conversion on the dash file to obtain a reference media file, and then delete the first target media data in the reference media file. As shown in fig. 1b, the reference media file may be a complete MP4 file including header data as well as media data.
Step A2: and analyzing metadata information in the reference media file to obtain the preset file index information, wherein the metadata information comprises preset description information of all media data in the reference media file.
Wherein, as shown in fig. 1b, the metadata information may be information in stco box in the reference media file, and the metadata information may include an offset value in the mdat data of the MP4 file before each media data block of the deleted first target media data is deleted. According to the scheme, the offset value of each deleted media data block in the reference media file in MP4 file mdat data before deletion can be obtained by analyzing the metadata information in the reference media file, and then the file index information is preset according to each offset value.
Step A3: and adding the preset file index information to the reference media file from which the first target media data is deleted to obtain the first format media file.
The method and the device can obtain the first format media file by adding the preset file index information into the reference media file of the deleted first target media data, and can provide a reliable data basis for regenerating the deleted media data in the first format media file.
Obtaining a reference media file by carrying out encapsulation format conversion on the second format media file, and deleting first target media data in the reference media file; analyzing metadata information in the reference media file to obtain preset file index information, wherein the metadata information comprises preset description information of all media data in the reference media file; and adding the preset file index information to the reference media file from which the first target media data is deleted to obtain a first format media file. The method can realize the mutual conversion between the media files with different formats and can improve the reliable data base for the determination of the subsequent media data.
In the embodiment of the disclosure, a first format media file and a second format media file are determined, wherein the first format media file is obtained by converting a preset packaging format of the second format media file; determining preset file index information from a first format media file, wherein the preset file index information records a mapping corresponding relation between first target media data and second target media data, the first target media data comprises deleted target media data in the first format media file, and the second target media data comprises target media data with the same data content as the first target media data in the second format media file; and regenerating the first format media file by adopting second target media data in the second format media file according to the preset file index information. According to the scheme, the preset file index information is determined from the first format media file, and the first format media file is regenerated by adopting the second target media data in the second format media file according to the preset file index information, so that the problems of waste of the storage space and redundancy of the data are solved, the storage space can be saved, and the effective utilization rate of the storage space is improved.
Fig. 2a is a flow chart of another media file generation method provided in an embodiment of the present disclosure. The foregoing embodiments are further optimized based on the disclosed embodiments, which may be combined with various alternatives of one or more of the embodiments described above. As shown in fig. 2a, the method for generating a media file provided in an embodiment of the present disclosure may include the following steps:
s210, receiving a media data packet, wherein the media data packet comprises media files with different encapsulation formats.
Wherein media files having different encapsulation formats but having the same encoding parameters and transcoded stream data may be included in the media data package, e.g. a first format media file and a second format media file may be included in the media data package.
S220, responding to the access request of the first format media file, and analyzing the associated stored first format media file and second format media file from the received media data packet.
And deleting the second target media data with the same data content as the first target media data in the second format media file, wherein the audio and video coding parameters adopted in the first format media file and the second format media file are the same.
Specifically, the scheme may determine, according to an access request of the first format media file, the first format media file and the second format media file from the received media data packet, where the first format media file has the first target media data deleted, and the second format media file includes the second target media data having the same data content as the first target media data. The audio and video coding parameters and the transcoding stream data adopted in the first format media file and the second format media file are the same, so that the regeneration of the first target media data through the second format media file can be realized.
S230, determining preset file index information from the first format media file.
As an optional but non-limiting implementation manner, the preset file index information includes a mapping correspondence of first offset information to second offset information, where the first offset information describes a first offset position of the first target media data relative to the first format media file before deletion, and the second offset information describes a second offset position of the second target media data relative to the second format media file.
For example, assuming that a first offset position of deleted first target media data in a first format media file with respect to the first format media file is denoted by offset n before deletion, a second offset position of second target media data having the same data content as the first target media data in a second format media file with respect to the second format media file is denoted by reference n, a mapping correspondence relationship between first offset information and second offset information in preset file index information may be expressed as follows: ("offset n", "reference n"). By determining the mapping corresponding relation between the first offset information and the second offset information in the preset file index information, the regeneration of the media data in the media files with one packaging format according to the media files with the other packaging format can be realized.
As an optional but non-limiting implementation manner, the preset file index information further includes media type information, where the media type information describes a media type of the same target media data corresponding to the mapping from the first offset information to the second offset information, and the media type information is represented by a numerical value.
Illustratively, assuming that the first offset information is represented by offset n, the second offset information is represented by reference n, the media type information is represented by type x, the preset file index information may be further represented as follows: ("offset n", "type x", "reference n"). Wherein, type x describes the media type of the same target media data corresponding to the mapping from the first offset information to the second offset information, and the media type information is represented by a numerical value. For example, when x takes 1, type 1 indicates that the media data type is video data. When x takes 2, type 2 indicates that the media data type is audio data. By determining the preset file index information containing the media type information, the regeneration of the media data in the media file with one packaging format according to the media file with another packaging format can be realized.
As an optional but non-limiting implementation manner, the generation manner of the preset file index information includes but is not limited to steps B1-B2:
step B1: a first offset location of the first target media data relative to the first format media file prior to deletion is determined.
Wherein the first target media data may be any segment of media data deleted in the first format media file. According to the scheme, the first offset position of the deleted first target media data in the first format media file relative to the first format media file before deletion can be determined according to the header data in the first format media file, so that a reliable data base can be provided for construction of preset file index information.
Step B2: a second offset location of the second target media data relative to the second format media file is determined from the second format media file.
The second target media data with the same data content as the first target media data can be determined from the second format media file according to the first target media data, and further, a second offset position of the second target media data relative to the second format media file is determined according to offset positions of media data blocks stored in the second format media file relative to the second format media file.
Step B3: and constructing the preset file index information by mapping and corresponding the first offset position pointing to the same target media data with the second offset position.
Specifically, the method may map the first offset position and the second offset position, which are determined in the previous step and point to the same data, to the offset position, so as to obtain the preset file index information. Regeneration of media data in one encapsulated format media file from another encapsulated format media file may be implemented.
As an alternative but non-limiting implementation, determining a first offset position of the first target media data relative to the first format media file prior to deletion includes, but is not limited to, steps C1-C2:
step C1: and interleaving and sequencing the deleted first target media data according to the media types of the first target media data according to the size of the deleted first target media data in the first format media file.
Taking the first format media file as an MP4 file as an example, the scheme may interleave and sort the deleted first target media data according to the media types of the first target media data according to the size of the deleted first target media data in the MP4 file. As shown in fig. 2b, the audio data segments and the video data segments in the MP4 file are sequentially arranged in a cross manner.
Step C2: recording a first offset position of each first target media data which is arranged in an interleaving way relative to the first format media file before deleting and the media types of the first target media data, wherein at least part of the media types of two adjacent first target media data which are arranged in the interleaving way are different.
Specifically, the scheme may record a first offset position of each first target media data, which is interleaved and ordered, relative to the first format media file before deletion, and a media type of the first target media data. For example, the present scheme may record the offset position of the interleaved segments of audio data relative to the MP4 file prior to deletion. The scheme can also record the offset position of each section of video data which is arranged by interleaving relative to the MP4 file before deleting. The media types of two adjacent first target media data are different.
Therefore, the deleted first target media data are subjected to interleaving sorting according to the media type of the first target media data according to the size of the deleted first target media data in the first format media file; recording a first offset position of each first target media data which is subjected to interleaving sequencing relative to the first format media file before deleting and the media types of the first target media data, wherein at least part of the media types of two adjacent first target media data which are subjected to interleaving sequencing are different. The method can be used for providing a reliable data basis for generating the index information of the preset file.
As an alternative, but not limiting of, determining a second offset position of the second target media data relative to the second format media file from the second format media file may further include, but is not limited to, the following:
when the deleted current first target media data in the first format media file is first target media data, searching first target media data from second target media data of the second format media file according to the media type of the current first target media data, determining the first target media data as second target media data identical to the current first target media data, wherein the searched first target media data and the current first target media data have identical media types; and determining a second offset position of the second target media data relative to the second format media file.
For example, taking a first format media file as an MP4 file, a second format media file as a dash file, and a media type as video data as an example, when the current first target media data deleted in the MP4 file is the video type and is the first target media data of the MP4 file, the scheme may search the dash file for the first target media data of the video type, determine the first target media data as the second target media data identical to the current first target media data, and determine the second offset position of the second target media data relative to the dash file. The method can determine the second offset position of the second target media data relative to the second format media file, and can provide a reliable data basis for generating the preset file index information.
As an alternative but non-limiting implementation, determining a second offset position of the second target media data relative to the second format media file from the second format media file includes, but is not limited to, steps D1-D2:
step D1: when the deleted current first target media data in the first format media file is non-first target media data, determining a last offset position and a current offset position, and determining the size of the last first target media data according to the last offset position and the current offset position; the current offset position is a first offset position of the deleted current first target media data in the first format media file relative to the first format media file before deletion, and the last offset position is a first offset position of the last target media data before the deleted current first target media data in the first format media file relative to the first format media file before deletion.
In an exemplary embodiment, when the deleted current first target media data in the first format media file is non-first target media data, the present scheme may determine a first offset position of the deleted current first target media data in the first format media file with respect to the first format media file before deletion, and may determine a first offset position of the previous target media data before the deleted current first target media data in the first format media file with respect to the first format media file before deletion, and determine a previous first target media data size according to the previous offset position and the current offset position.
For example, taking a first format media file as an MP4 file as an example, when the current first target media data deleted in the MP4 file is non-first target media data, the present scheme may determine a last offset position offset m-1 and a current offset position offset m associated with the current first target media data from the MP4 file, and then determine a last first target media data size according to a difference between the offset m and the offset m-1. The last offset position offset m-1 is the first offset position of the previous first target media data of the current first target media data deleted in the MP4 file with respect to the MP4 file before deletion. A reliable data basis may be provided for determining an offset position of second target media data having the same data content as the first target media data to which the first offset position points with respect to the second format media file.
Step D2: searching second target media data which is the same as the current first target media data from the second format media file according to the size of the last first target media data, the media type of the current first target media data and the reference offset position; and determining a second offset position of a second target media data, which is identical to the current first target media data, relative to the second format media file.
The reference offset position is a second offset position of the second target media data, which is the same as the previous first target media data, of the second format media file, relative to the second format media file.
Taking the media type of the current first target media data as the video type, offset n represents a first offset position, reference n represents a second offset position, for example, because the first offset position of each deleted video data segment in the MP4 file relative to the MP4 file before deleting the video data can be determined, and the second offset position of the first video data segment in the second format media file can also be determined, the present scheme can search and determine the second offset position reference m of the second format media file relative to the second target media data identical to the current first target media data from the second format media file according to the difference between the last first target media data size offset m and offset m-1, and the video type and the reference offset position reference m-1. The reference offset position may be a second offset position of the second target media data having the same data content as the previous first target media data in the second format media file with respect to the second format media file. The method can determine the second offset position of the second target media data relative to the second format media file, and can provide a reliable data basis for generating the preset file index information.
S240, regenerating the first format media file by adopting second target media data in the second format media file according to preset file index information.
As an optional but non-limiting implementation manner, the regenerating the first format media file by using the second target media data in the second format media file according to the preset file index information includes but is not limited to steps E1-E3:
step E1: when the first format media file is accessed, pre-reserved file header data is read from the first format media file, wherein the pre-reserved file header data records the first offset information.
Taking the first format media file as an MP4 file as an example, the present solution may access a stco box file in which header data of the file is pre-reserved in the MP4 file, where first offset information of the deleted first target media data with respect to the MP4 file is recorded in the stco box file.
Step E2: first offset information required for the deleted first target media data is read from the pre-reserved file header data.
The first offset information required by the deleted first target media data can be read from the stco box file of the pre-reserved file header data.
Step E3: and regenerating the first format media file by adopting second target media data in the second format media file according to the first offset information required by the deleted first target media data and the preset file index information.
According to the scheme, the deleted first target media data in the first format media file can be determined according to the second format media file according to the first offset information and the preset file index information required by the deleted first target media data, and therefore regeneration of the media data is achieved. The method can realize regeneration of media data in media files with one packaging format according to preset file index information and the media files with the other packaging format, so that storage space can be saved.
As an optional but non-limiting implementation manner, the step of regenerating the first format media file by using the second target media data in the second format media file according to the first offset information required by the deleted first target media data and the preset file index information includes but is not limited to steps F1-F2:
step F1: and matching the first offset information required by the deleted first target media data with the preset file index information to obtain an offset information matching result, wherein the offset information matching result comprises second offset information associated with the first offset information mapping required by the deleted first target media data.
The first offset information required by the deleted first target media data is denoted as offset 3, and the second offset information of the second target media data having the same data content as the first target media data is denoted as reference 3, and the offset 3 may be matched with mapping information ("offset 3", "type 1", "reference 3") in the preset file index information to obtain the second offset information reference 3 associated with the mapping of the first offset information required by the deleted first target media data.
Step F2: and reading media data at a corresponding offset position from second target media data of the second format media file according to the offset information matching result, and adding the read media data into the first format media file to reassemble the first format media file.
Specifically, the scheme can determine the second offset information reference 3 associated with the first offset information mapping according to the first offset information required by the deleted first target media data, then read video data at the corresponding offset position from the second target media data of the second format media file storage media data according to the second offset information reference 3, and add the read video data to the first format media file to reassemble the first format media file. The method can realize regeneration of media data in media files with one packaging format according to preset file index information and the media files with the other packaging format, so that storage space can be saved.
In the embodiment of the disclosure, a media data packet is received, wherein the media data packet comprises media files with different encapsulation formats; responding to an access request for the first format media file, and analyzing the associated stored first format media file and second format media file from the received media data packet; the second target media data with the same data content as the first target media data are not deleted in the second format media file, and the audio and video coding parameters adopted in the first format media file and the second format media file are the same; determining preset file index information from the first format media file, wherein the preset file index information records the mapping corresponding relation between the deleted first target media data in the first format media file and second target media data with the same data content in the second format media file; and regenerating the first format media file by adopting second target media data in the second format media file according to the preset file index information. According to the scheme, the preset file index information is determined from the first format media file, and the first format media file is regenerated by adopting the second target media data in the second format media file according to the preset file index information, so that the problems of waste of the storage space and redundancy of the data are solved, the storage space can be saved, and the data redundancy is reduced.
Fig. 3 is a schematic structural diagram of a media file generating apparatus according to an embodiment of the present disclosure, where, as shown in fig. 3, the apparatus includes:
a media file determining module 310, configured to determine a first format media file and a second format media file, where the first format media file is obtained by converting a preset package format of the second format media file;
a preset file index information determining module 320, configured to determine preset file index information from a first format media file, where the preset file index information records a mapping correspondence between first target media data and second target media data, where the first target media data includes target media data deleted from the first format media file, and the second target media data includes target media data having the same data content as the first target media data in the second format media file;
the media data generating module 330 is configured to regenerate the first format media file by using the second target media data in the second format media file according to the preset file index information.
In an alternative of the embodiment of the present disclosure, optionally, the media file determining module 310 includes a reference media file determining unit, configured to perform encapsulation format conversion on the second format media file to obtain a reference media file, and delete the first target media data in the reference media file; the file index information determining unit is used for obtaining the file index information by analyzing metadata information in a reference media file, wherein the metadata information comprises preset description information of all media data in the reference media file; and the first format media file determining unit is used for adding the preset file index information to the reference media file from which the first target media data is deleted to obtain the first format media file.
In an alternative of the embodiment of the present disclosure, optionally, the media file determining module 310 includes a media data packet receiving unit, configured to receive a media data packet, where the media data packet includes media files in different encapsulation formats; a media file determining unit, configured to parse, in response to an access request for the first format media file, the associated stored first format media file and second format media file from the received media data packet; and deleting the second target media data with the same data content as the first target media data in the second format media file, wherein the audio and video coding parameters adopted in the first format media file and the second format media file are the same.
In an alternative of the embodiment of the present disclosure, optionally, the preset file index information includes a mapping correspondence between first offset information and second offset information, where the first offset information describes a first offset position of the first target media data with respect to the first format media file before deletion, and the second offset information describes a second offset position of the second target media data with respect to the second format media file.
In an optional solution of the embodiment of the present disclosure, optionally, the preset file index information further includes media type information, where the media type information describes a media type of the same target media data corresponding to the mapping from the first offset information to the second offset information, and the media type information is represented by a numerical value.
In an alternative of the embodiment of the present disclosure, optionally, the preset file index information determining module 320 includes a first offset position determining unit, configured to determine a first offset position of the first target media data with respect to the first format media file before deletion; a second offset position determining unit, configured to determine a second offset position of the second target media data relative to the second format media file from the second format media file; and the preset file index information determining unit is used for constructing the preset file index information by mapping and corresponding the first offset position and the second offset position which point to the same target media data.
In an optional implementation manner of the embodiment of the present disclosure, optionally, a first offset location determining unit is specifically configured to interleave and sort the deleted first target media data according to media types of the first target media data according to a size of the deleted first target media data in the first format media file; recording a first offset position of each first target media data which is arranged in an interleaving way relative to the first format media file before deleting and the media types of the first target media data, wherein at least part of the media types of two adjacent first target media data which are arranged in the interleaving way are different.
In an optional solution of the embodiment of the present disclosure, an optional second offset location determining unit is specifically configured to search, when the current first target media data deleted in the first format media file is the first target media data, for the first target media data from the second target media data of the second format media file according to the media type of the current first target media data, and determine that the first target media data has the same media type as the current first target media data; and determining a second offset position of the second target media data relative to the second format media file.
In an optional implementation manner of the embodiment of the present disclosure, an optional second offset location determining unit is specifically configured to determine, when the current first target media data deleted in the first format media file is non-first target media data, a previous offset location and a current offset location, and determine, according to the previous offset location and the current offset location, a size of the previous first target media data; the current offset position is a first offset position of the deleted current first target media data in the first format media file relative to the first format media file before deletion, and the previous offset position is a first offset position of the previous target media data before the deleted current first target media data in the first format media file relative to the first format media file before deletion; searching second target media data which is the same as the current first target media data from the second format media file according to the size of the last first target media data, the media type of the current first target media data and the reference offset position; and determining a second offset location of a second target media data, which is identical to the current first target media data, relative to the second format media file; the reference offset position is a second offset position of the second target media data, which is the same as the previous first target media data, in the second format media file, relative to the second format media file.
In an alternative of the embodiment of the present disclosure, optionally, the media data generating module 330 includes a pre-reserved file header data reading unit, configured to read pre-reserved file header data from the first format media file when accessing the first format media file, where the pre-reserved file header data records the first offset information; a first offset information determining unit for reading first offset information required for the deleted first target media data from the pre-reserved file header data; and the media data regeneration unit is used for regenerating the first format media file by adopting the second target media data in the second format media file according to the first offset information required by the deleted first target media data and the preset file index information.
In an optional solution of the embodiment of the present disclosure, optionally, a media data regeneration unit is specifically configured to match first offset information required by the deleted first target media data with the preset file index information to obtain an offset information matching result, where the offset information matching result includes second offset information associated with first offset information mapping required by the deleted first target media data; and reading media data at a corresponding offset position from second target media data of the second format media file according to the offset information matching result, and adding the read media data into the first format media file to reassemble the first format media file.
The media file generating device provided by the embodiment of the disclosure can execute the media file generating method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the executing method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. Referring now to fig. 4, a schematic diagram of an electronic device (e.g., a terminal device or server in fig. 4) 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 4, the electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 501.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The electronic device provided by the embodiment of the present disclosure and the method for generating a media file provided by the foregoing embodiment belong to the same inventive concept, and technical details not described in detail in the present embodiment may be referred to the foregoing embodiment, and the present embodiment has the same beneficial effects as the foregoing embodiment.
The present disclosure provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the media file generation method provided by the above embodiments.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: determining a first format media file and a second format media file, wherein the first format media file is obtained by converting a preset packaging format of the second format media file;
determining preset file index information from a first format media file, wherein the preset file index information records a mapping corresponding relation between first target media data and second target media data, the first target media data comprises deleted target media data in the first format media file, and the second target media data comprises target media data with the same data content as the first target media data in the second format media file;
And regenerating the first format media file by adopting second target media data in the second format media file according to preset file index information.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
In accordance with one or more embodiments of the present disclosure, example 1 provides a media file generation method, the method comprising: determining a first format media file and a second format media file, wherein the first format media file is obtained by converting a preset packaging format of the second format media file;
determining preset file index information from a first format media file, wherein the preset file index information records a mapping corresponding relation between first target media data and second target media data, the first target media data comprises deleted target media data in the first format media file, and the second target media data comprises target media data with the same data content as the first target media data in the second format media file;
and regenerating the first format media file by adopting second target media data in the second format media file according to preset file index information.
Example 2 the method of example 1, the first format media file generated by:
performing encapsulation format conversion on the second format media file to obtain a reference media file, and deleting first target media data in the reference media file;
Analyzing metadata information in a reference media file to obtain the preset file index information, wherein the metadata information comprises preset description information of all media data in the reference media file;
and adding the preset file index information to the reference media file from which the first target media data is deleted to obtain the first format media file.
Example 3 the method of example 1, determining a first format media file and a second format media file, comprises:
receiving a media data packet, wherein the media data packet comprises media files with different encapsulation formats;
responding to an access request for the first format media file, and analyzing the associated stored first format media file and second format media file from the received media data packet;
and deleting the second target media data with the same data content as the first target media data in the second format media file, wherein the audio and video coding parameters adopted in the first format media file and the second format media file are the same.
Example 4 the method of example 1, the preset file index information includes a mapping correspondence of first offset information describing a first offset position of the first target media data with respect to the first format media file before deletion to second offset information describing a second offset position of the second target media data with respect to the second format media file.
Example 5 the method of example 4, wherein the preset file index information further includes media type information, the media type information describing a media type of the same target media data corresponding to a mapping from the first offset information to the second offset information, the media type information being represented by a numerical value.
Example 6 the method of example 4, determining the preset file index information is generated by:
determining a first offset position of the first target media data relative to the first format media file prior to deletion;
determining a second offset position of the second target media data relative to the second format media file from the second format media file;
and constructing the preset file index information by mapping and corresponding the first offset position pointing to the same target media data with the second offset position.
Example 7 the method of example 6, determining a first offset location of the first target media data relative to the first format media file prior to deletion, comprising:
according to the size of each first target media data deleted in the first format media file, interleaving and sequencing each first target media data deleted according to the media type of the first target media data;
Recording a first offset position of each first target media data which is arranged in an interleaving way relative to the first format media file before deleting and the media types of the first target media data, wherein at least part of the media types of two adjacent first target media data which are arranged in the interleaving way are different.
Example 8 the method of example 6, determining a second offset location of the second target media data from the second format media file relative to the second format media file, comprising:
when the deleted current first target media data in the first format media file is first target media data, searching first target media data from second target media data of the second format media file according to the media type of the current first target media data, determining the first target media data as second target media data identical to the current first target media data, wherein the searched first target media data and the current first target media data have identical media types;
a second offset location of the second target media data relative to the second format media file is determined.
Example 9 the method of example 6, determining a second offset location of the second target media data from the second format media file relative to the second format media file, comprising:
When the deleted current first target media data in the first format media file is non-first target media data, determining a last offset position and a current offset position, and determining the size of the last first target media data according to the last offset position and the current offset position; the current offset position is a first offset position of the deleted current first target media data in the first format media file relative to the first format media file before deletion, and the previous offset position is a first offset position of the previous target media data before the deleted current first target media data in the first format media file relative to the first format media file before deletion;
searching second target media data which is the same as the current first target media data from the second format media file according to the size of the last first target media data, the media type of the current first target media data and the reference offset position; and determining a second offset location of a second target media data, which is identical to the current first target media data, relative to the second format media file;
The reference offset position is a second offset position of the second target media data, which is the same as the previous first target media data, in the second format media file, relative to the second format media file.
Example 10 the method of example 4, according to preset file index information, the regenerating the first format media file with the second target media data in the second format media file includes:
reading pre-reserved file header data from a first format media file when the first format media file is accessed, wherein the first offset information is recorded in the pre-reserved file header data;
reading first offset information required for deleted first target media data from pre-reserved file header data;
and regenerating the first format media file by adopting the second target media data in the second format media file according to the first offset information required by the deleted first target media data and the preset file index information.
Example 11 the method of example 10, according to the first offset information and the preset file index information required for the deleted first target media data, the regenerating the first format media file with the second target media data in the second format media file includes:
Matching the first offset information required by the deleted first target media data with the preset file index information to obtain an offset information matching result, wherein the offset information matching result comprises second offset information associated with the first offset information mapping required by the deleted first target media data;
and reading media data at a corresponding offset position from second target media data of the second format media file according to the offset information matching result, and adding the read media data into the first format media file to reassemble the first format media file.
Example 12 also provides, in accordance with one or more embodiments of the present disclosure, a media file generation apparatus comprising:
the media file determining module is used for determining a first format media file and a second format media file, wherein the first format media file is obtained by converting a preset packaging format of the second format media file;
a preset file index information determining module, configured to determine preset file index information from a first format media file, where the preset file index information records a mapping correspondence between first target media data and second target media data, where the first target media data includes target media data deleted in the first format media file, and the second target media data includes target media data having the same data content as the first target media data in the second format media file;
And the media data generation module is used for regenerating the first format media file by adopting second target media data in the second format media file according to preset file index information.
Example 13 also provides, in accordance with one or more embodiments of the present disclosure, an electronic device comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the media file generation method as described in any of examples 1-11.
Example 14 also provides a storage medium containing computer-executable instructions for performing the media file generation method of any of examples 1-11 when executed by a computer processor, according to one or more embodiments of the present disclosure.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (14)

1. A method of generating a media file, comprising:
determining a first format media file and a second format media file, wherein the first format media file is obtained by converting a preset packaging format of the second format media file;
Determining preset file index information from a first format media file, wherein the preset file index information records a mapping corresponding relation between first target media data and second target media data, the first target media data comprises deleted target media data in the first format media file, and the second target media data comprises target media data with the same data content as the first target media data in the second format media file;
and regenerating the first format media file by adopting second target media data in the second format media file according to preset file index information.
2. The method of claim 1, wherein the first format media file is generated by:
performing encapsulation format conversion on the second format media file to obtain a reference media file, and deleting first target media data in the reference media file;
analyzing metadata information in a reference media file to obtain the preset file index information, wherein the metadata information comprises preset description information of all media data in the reference media file;
And adding the preset file index information to the reference media file from which the first target media data is deleted to obtain the first format media file.
3. The method of claim 1, wherein determining the first format media file and the second format media file comprises:
receiving a media data packet, wherein the media data packet comprises media files with different encapsulation formats;
responding to an access request for the first format media file, and analyzing the associated stored first format media file and second format media file from the received media data packet;
and deleting the second target media data with the same data content as the first target media data in the second format media file, wherein the audio and video coding parameters adopted in the first format media file and the second format media file are the same.
4. The method of claim 1, wherein the preset file index information includes a mapping correspondence of first offset information describing a first offset position of the first target media data with respect to the first format media file before deletion to second offset information describing a second offset position of the second target media data with respect to the second format media file.
5. The method of claim 4, wherein the preset file index information further includes media type information, the media type information describing a media type of the same target media data corresponding to the mapping from the first offset information to the second offset information, and the media type information being represented by a numerical value.
6. The method of claim 4, wherein the preset file index information is generated by:
determining a first offset position of the first target media data relative to the first format media file prior to deletion;
determining a second offset position of the second target media data relative to the second format media file from the second format media file;
and constructing the preset file index information by mapping and corresponding the first offset position pointing to the same target media data with the second offset position.
7. The method of claim 6, wherein determining a first offset position of the first target media data relative to the first format media file prior to deletion comprises:
according to the size of each first target media data deleted in the first format media file, interleaving and sequencing each first target media data deleted according to the media type of the first target media data;
Recording a first offset position of each first target media data which is arranged in an interleaving way relative to the first format media file before deleting and the media types of the first target media data, wherein at least part of the media types of two adjacent first target media data which are arranged in the interleaving way are different.
8. The method of claim 6, wherein determining a second offset position of the second target media data from the second format media file relative to the second format media file comprises:
when the deleted current first target media data in the first format media file is first target media data, searching first target media data from second target media data of the second format media file according to the media type of the current first target media data, determining the first target media data as second target media data identical to the current first target media data, wherein the searched first target media data and the current first target media data have identical media types;
a second offset location of the second target media data relative to the second format media file is determined.
9. The method of claim 6, wherein determining a second offset position of the second target media data from the second format media file relative to the second format media file comprises:
when the deleted current first target media data in the first format media file is non-first target media data, determining a last offset position and a current offset position, and determining the size of the last first target media data according to the last offset position and the current offset position; the current offset position is a first offset position of the deleted current first target media data in the first format media file relative to the first format media file before deletion, and the previous offset position is a first offset position of the previous target media data before the deleted current first target media data in the first format media file relative to the first format media file before deletion;
searching second target media data which is the same as the current first target media data from the second format media file according to the size of the last first target media data, the media type of the current first target media data and the reference offset position; and determining a second offset location of a second target media data, which is identical to the current first target media data, relative to the second format media file;
The reference offset position is a second offset position of the second target media data, which is the same as the previous first target media data, in the second format media file, relative to the second format media file.
10. The method of claim 4, wherein regenerating the first format media file with the second target media data in the second format media file according to the preset file index information comprises:
reading pre-reserved file header data from a first format media file when the first format media file is accessed, wherein the first offset information is recorded in the pre-reserved file header data;
reading first offset information required for deleted first target media data from pre-reserved file header data;
and regenerating the first format media file by adopting second target media data in the second format media file according to the first offset information required by the deleted first target media data and the preset file index information.
11. The method of claim 10, wherein regenerating the first format media file with the second target media data in the second format media file based on the first offset information and the preset file index information required for the deleted first target media data comprises:
Matching the first offset information required by the deleted first target media data with the preset file index information to obtain an offset information matching result, wherein the offset information matching result comprises second offset information associated with the first offset information mapping required by the deleted first target media data;
and reading media data at a corresponding offset position from second target media data of the second format media file according to the offset information matching result, and adding the read media data into the first format media file to reassemble the first format media file.
12. A media file generation apparatus, comprising:
the media file determining module is used for determining a first format media file and a second format media file, wherein the first format media file is obtained by converting a preset packaging format of the second format media file;
a preset file index information determining module, configured to determine preset file index information from a first format media file, where the preset file index information records a mapping correspondence between first target media data and second target media data, where the first target media data includes target media data deleted in the first format media file, and the second target media data includes target media data having the same data content as the first target media data in the second format media file;
And the media data generation module is used for regenerating the first format media file by adopting second target media data in the second format media file according to preset file index information.
13. An electronic device, the electronic device comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the media file generation method of any of claims 1-11.
14. A storage medium containing computer executable instructions for performing the media file generation method of any of claims 1-11 when executed by a computer processor.
CN202310266459.5A 2023-03-14 2023-03-14 Media file generation method, device, electronic equipment and storage medium Pending CN116304122A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202310266459.5A CN116304122A (en) 2023-03-14 2023-03-14 Media file generation method, device, electronic equipment and storage medium
PCT/CN2024/081251 WO2024188248A1 (en) 2023-03-14 2024-03-12 Media file generation method and apparatus, electronic device, and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310266459.5A CN116304122A (en) 2023-03-14 2023-03-14 Media file generation method, device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116304122A true CN116304122A (en) 2023-06-23

Family

ID=86799120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310266459.5A Pending CN116304122A (en) 2023-03-14 2023-03-14 Media file generation method, device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN116304122A (en)
WO (1) WO2024188248A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116846979A (en) * 2023-08-29 2023-10-03 云南昇顺科技有限公司 Scheduling method and scheduling system for resources in cloud computing environment
WO2024188248A1 (en) * 2023-03-14 2024-09-19 抖音视界有限公司 Media file generation method and apparatus, electronic device, and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8489760B2 (en) * 2011-03-31 2013-07-16 Juniper Networks, Inc. Media file storage format and adaptive delivery system
US10567502B2 (en) * 2017-04-06 2020-02-18 Avid Technology, Inc. Format-independent media file indexing
CN112287127B (en) * 2019-07-23 2022-10-14 上海哔哩哔哩科技有限公司 Multimedia file storage and reading method
GB2605965A (en) * 2021-04-16 2022-10-26 Canon Kk Methods and devices for improving storage and transmission of uncompressed data while using a standard format
CN116304122A (en) * 2023-03-14 2023-06-23 抖音视界有限公司 Media file generation method, device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2024188248A1 (en) * 2023-03-14 2024-09-19 抖音视界有限公司 Media file generation method and apparatus, electronic device, and storage medium
CN116846979A (en) * 2023-08-29 2023-10-03 云南昇顺科技有限公司 Scheduling method and scheduling system for resources in cloud computing environment
CN116846979B (en) * 2023-08-29 2024-03-15 江苏睿鸿网络技术股份有限公司 Scheduling method and scheduling system for resources in cloud computing environment

Also Published As

Publication number Publication date
WO2024188248A1 (en) 2024-09-19

Similar Documents

Publication Publication Date Title
CN111581563B (en) Page response method and device, storage medium and electronic equipment
CN116304122A (en) Media file generation method, device, electronic equipment and storage medium
CN110545313B (en) Message push control method and device and electronic equipment
CN111400625B (en) Page processing method and device, electronic equipment and computer readable storage medium
CN111813465B (en) Information acquisition method, device, medium and equipment
CN114637703B (en) Data access device, method, readable medium and electronic equipment
CN112035529A (en) Caching method and device, electronic equipment and computer readable storage medium
CN111273986A (en) Page jump method and device of application program, electronic equipment and storage medium
CN110545472B (en) Video data processing method and device, electronic equipment and computer readable medium
CN111198861A (en) Logic log processing method and device and electronic equipment
CN111240738B (en) File processing method, device, equipment and medium
CN111143355B (en) Data processing method and device
CN117992204A (en) Memory detection method, device, equipment and storage medium
CN112559394A (en) System library access method and device and electronic equipment
CN111008178A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN112668033B (en) Data processing method and device and electronic equipment
CN112732269B (en) Access method and device applied to physical address of AVS2 hardware encoder
CN114428941B (en) Copyright overlap detection method, device, computing equipment and medium
US20240330016A1 (en) Class file processing method and apparatus, device, medium, and product
US20250086035A1 (en) Application data processing method, apparatus, electronic device and storage medium
CN111385643B (en) Method and device for storing data, electronic equipment and storage medium
CN117113116A (en) Clustering method, device, equipment and storage medium
CN119721003A (en) Data processing method, device, medium, electronic device and program product
CN117113046A (en) Event processing system and method
CN118445495A (en) Data processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination