WO2021012723A1 - 多媒体文件存储、读取方法 - Google Patents

多媒体文件存储、读取方法 Download PDF

Info

Publication number
WO2021012723A1
WO2021012723A1 PCT/CN2020/084518 CN2020084518W WO2021012723A1 WO 2021012723 A1 WO2021012723 A1 WO 2021012723A1 CN 2020084518 W CN2020084518 W CN 2020084518W WO 2021012723 A1 WO2021012723 A1 WO 2021012723A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
multimedia file
audio
video
encoding
Prior art date
Application number
PCT/CN2020/084518
Other languages
English (en)
French (fr)
Inventor
何钧
王一
Original Assignee
上海哔哩哔哩科技有限公司
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 上海哔哩哔哩科技有限公司 filed Critical 上海哔哩哔哩科技有限公司
Priority to EP20843920.8A priority Critical patent/EP3989082A4/en
Priority to US17/625,306 priority patent/US20220365959A1/en
Publication of WO2021012723A1 publication Critical patent/WO2021012723A1/zh

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/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • 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
    • 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/487Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using geographical or spatial information, e.g. location
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/85406Content authoring involving a specific file format, e.g. MP4 format

Definitions

  • This application relates to the field of multimedia data processing, and in particular to a method for storing and reading multimedia files.
  • the purpose of this application is to provide a method for storing and reading multimedia files to solve the problem of waste of storage space caused by the need to store multimedia files in multiple encapsulation formats required by different services in the prior art .
  • this application provides a multimedia file storage method, which includes the following steps:
  • the step of obtaining at least two multimedia files to be stored includes:
  • the multimedia source file in the original packaging format and the multimedia source file in the at least one target packaging format are multimedia files to be stored.
  • the step of performing format analysis on each of the multimedia files to obtain the audio encoding data, video encoding data, and encapsulation data in each multimedia file includes:
  • the encapsulated data in each of the multimedia files is generated.
  • the step of storing the encapsulated data in each multimedia file separately and storing a copy of the audio coded data and the video coded data includes:
  • a copy of the video encoding data is stored in a preset video encoding data storage.
  • the video encoding data storage is a local storage.
  • the step of establishing and storing the index data identifying the encoding position information and storage address information of the encapsulated data, audio encoding data, and video encoding data in each of the multimedia files includes:
  • Establishing the index data, and the index data identifies the encoding location information and storage address information of the packaged data, the audio encoding data, and the video encoding data in each of the multimedia files;
  • the index data is stored in a preset index data storage.
  • the storage method further includes:
  • the memory addresses of the packaged data memory, the audio coded data memory and the index data memory are stored in a preset first database.
  • this application provides a multimedia file storage device, including:
  • the file acquisition module is used to acquire at least two multimedia files to be stored, where the audio coding data and video coding data of each multimedia file are the same, but the encapsulation data is different;
  • the file analysis module is used to perform format analysis on each of the multimedia files to obtain audio coding data, video coding data, and encapsulation data in each multimedia file;
  • the file data storage module is used to store the packaged data in each multimedia file separately, and store a copy of the audio coded data and the video coded data;
  • the index establishment module is used to establish and store index data identifying the encoding location information and storage address information of the encapsulated data, audio encoding data, and video encoding data in each of the multimedia files.
  • the present application provides a computer device, including a memory, a processor, and computer readable instructions stored in the memory and capable of running on the processor.
  • the processor executes the computer readable instructions, the following is achieved step:
  • the present application provides a computer-readable storage medium having computer-readable instructions stored thereon, and the computer-readable instructions implement the following steps when executed by a processor:
  • this application also provides a multimedia file reading method for reading multimedia files stored based on the foregoing method, and the reading method includes the following steps:
  • the acquired index data acquiring storage address information and encoding location information of encapsulated data, audio encoded data, and video encoded data in the target multimedia file;
  • the obtained packaged data, audio coded data, and video coded data are assembled to obtain the target multimedia file.
  • the step of obtaining the index data corresponding to the target multimedia file according to the request information includes:
  • the index data corresponding to the target multimedia file is acquired according to the request information.
  • the packaged data, audio coded data, and video coded in the target multimedia file are acquired according to the storage address information of the packaged data, audio coded data, and video coded data in the target multimedia file
  • the data steps include:
  • a preset packaged data storage acquiring the packaged data in the target multimedia file according to the storage address information of the packaged data in the target multimedia file;
  • a preset audio encoding data storage acquiring the audio encoding data in the target multimedia file according to the storage address information of the audio encoding data in the target multimedia file;
  • the video encoding data in the target multimedia file is acquired according to the storage address information of the video encoding data in the target multimedia file.
  • the video encoding data storage is a local storage.
  • the packaged data, audio coded data, and video coded data obtained are performed on the obtained packaged data, audio coded data, and video coded data according to the coding position information of the packaged data, audio coded data, and video coded data in the target multimedia file.
  • Assemble to obtain the target multimedia file includes:
  • the step of downloading the obtained packaged data, audio coding data and index data to the local storage further includes:
  • the storage of the packaged data, audio encoding data, and video encoding data in the target multimedia file is acquired according to the acquired index data
  • the steps of address information and encoding location information include:
  • index data obtaining storage address information and data types corresponding to the encoding location range, where the data types include encapsulation data types, audio encoding data types, and video encoding data types;
  • the storage address information and the data type corresponding to the coding position range According to the storage address information and the data type corresponding to the coding position range, the storage address information and coding position information of the packaged data, audio coding data and video coding data in the target multimedia file are obtained.
  • a multimedia file reading device including:
  • the request receiving module is used to receive request information for reading the target multimedia file
  • An index data obtaining module configured to obtain the index data corresponding to the target multimedia file according to the request information
  • An index parsing module configured to obtain storage address information and coding location information of packaged data, audio coded data, and video coded data in the target multimedia file according to the obtained index data;
  • the file data acquisition module is used to acquire the packaged data, audio encoded data and video encoded data in the target multimedia file according to the storage address information of the packaged data, audio encoded data and video encoded data in the target multimedia file;
  • the assembling module is used to assemble the acquired packaged data, audio encoded data and video encoded data according to the encoding position information of the packaged data, audio encoded data and video encoded data in the target multimedia file to obtain the target multimedia file .
  • the present application provides a computer device, including a memory, a processor, and computer readable instructions stored in the memory and capable of running on the processor.
  • the processor executes the computer readable instructions, the following is achieved step:
  • the acquired index data acquiring storage address information and encoding location information of encapsulated data, audio encoded data, and video encoded data in the target multimedia file;
  • the obtained packaged data, audio coded data, and video coded data are assembled to obtain the target multimedia file.
  • the present application provides a computer-readable storage medium having computer-readable instructions stored thereon, and the computer-readable instructions implement the following steps when executed by a processor:
  • the acquired index data acquiring storage address information and encoding location information of encapsulated data, audio encoded data, and video encoded data in the target multimedia file;
  • the encoding position information of the packaged data, audio encoded data, and video encoded data in the target multimedia file assembling the acquired packaged data, audio encoded data, and video encoded data to obtain the target multimedia file.
  • this application stores only one copy of the same audio coded data and video coded data, stores different packaged data separately, and stores the coding position information of these data at the same time;
  • the audio coded data, video coded data, encapsulated data and coding position information of these data of the target multimedia file are obtained, and then the audio coding data, video coding data, and encapsulated data can be assembled according to the coding position information. Therefore, the present application can solve the problem that the prior art needs to store multimedia files in multiple encapsulation formats required for different services, which in turn leads to repeated storage of the same audio coded data and video coded data, which greatly wastes storage space.
  • Figure 1 is a schematic diagram of the application environment of the multimedia file storage and reading method of this application.
  • FIG. 2 is a flowchart of an embodiment of a multimedia file storage method according to this application.
  • FIG. 2A is a schematic diagram of the principle of an embodiment of a multimedia file storage method according to this application.
  • FIG. 3 is a flowchart of an embodiment of a method for reading a multimedia file according to this application
  • FIG. 4 is a swim lane diagram of an embodiment of a method for reading a multimedia file according to the present application.
  • FIG. 5 is a structural block diagram of an embodiment of a multimedia file storage device according to the present application.
  • Fig. 6 is a structural block diagram of an embodiment of a multimedia file reading device according to the present application.
  • FIG. 7 is a hardware architecture diagram of an embodiment of the computer device of this application.
  • FIG. 1 it is a schematic diagram of an application environment of an embodiment of the multimedia file storage and reading method of the present application.
  • the application environment diagram includes client M, N, L and server P.
  • the server P can exchange data with the clients M, N, and L through suitable technologies such as network and near field communication technology.
  • the client M, N, L include but are not limited to any kind of intelligent electronic products that can interact with the user through a keyboard, mouse, remote control, touch pad or voice control device, for example, personal computers, tablet computers, etc.
  • Mobile devices such as smart phones, personal digital assistants (PDAs), game consoles, smart wearable devices, navigation devices, etc., or fixed terminals such as digital TVs, desktop computers, notebooks, etc.
  • the server P can be a computer, a single network server, a server group composed of multiple network servers, or a cloud composed of a large number of hosts or network servers based on cloud computing.
  • Cloud computing is a type of distributed computing, consisting of a group of A super virtual computer composed of loosely coupled computer sets.
  • This embodiment provides a multimedia file storage method, which is suitable for the server. As shown in FIGS. 2 and 2A, the method includes the following steps:
  • the acquired multimedia files are movie A.mp4 and movie A.flv, where the audio and video content of movie A.mp4 and A.flv are exactly the same, and only the packaging format is different.
  • multimedia files refer to audio and video files, and the packaging format can be mp4, flv, rmvb, avi, mov, or wmv, etc.
  • This step is specifically implemented by the following steps: after the data source uploads the multimedia source file in the original packaging format, receiving the multimedia source file in the original packaging format uploaded by the data source; converting the multimedia source file into at least one type different from the original packaging
  • the target encapsulation format of the format; the multimedia source file in the original encapsulation format and the multimedia source file in at least one target encapsulation format are determined as the multimedia file to be stored.
  • the target packaging format can be preset according to needs.
  • the server receives a multimedia source file A.mp4 uploaded by the data source, and the format of the multimedia source file is different due to different types of business requirements (for example, the H5 sharing page needs to use the mp4 format, and the main site video playback The flv format is used, and the future adaptive playback needs the fmp4 format that requires audio and video separation. Therefore, the server needs to perform format conversion to obtain formats other than A.mp4, such as the flv format. It should be noted that the format conversion of the multimedia file is a technology known in the art, and the specific conversion process will not be repeated here.
  • S12 Perform format analysis on each multimedia file to obtain audio coding data, video coding data, and encapsulation data in each multimedia file.
  • the specific analysis process of this step is as follows: according to the packaging format of each multimedia file, the audio coding data in each multimedia file is parsed; according to the packaging format of each multimedia file, the video coding data in each multimedia file is parsed; according to each multimedia file The audio coded data and video coded data in the data other than the encoded data in each multimedia file are generated.
  • the audio encoding data V, video encoding data A, and encapsulation data mp4C of the mp4 file will be obtained, and flv will be obtained at the same time
  • the audio coded data V, video coded data A, and packaged data flvC of the file wherein the audio coded data V and the video coded data A of the two files are the same, and the packaged data mp4C and flvC of the two files are different.
  • the theoretical basis for analyzing the audio coded data, video coded data, and packaged data in this step is that the data protocol of each package format has a unified international standard. For example, suppose the data protocol of the mp4 format file with a file size of 100B is shown in Table 1 below, and the data protocol of the flv format file with a file size of 100B is shown in Table 2 below:
  • V represents an audio coded data block
  • A represents a video coded data block
  • C represents a encapsulated data block
  • the numbers in the table represent the coding length of the corresponding data block. It should be understood that according to the data protocol standard of the corresponding encapsulation format, the corresponding audio coding data, video coding data, and encapsulation data can be parsed from each multimedia file.
  • 0-34 bits are encoded as encapsulated data blocks
  • 35-49 bits are encoded as audio encoding data blocks
  • 50-59 bits are encoded as video encoding data blocks
  • 60-69 bits are encoded as Video encoding data block
  • 70-84 bits are encoded as audio encoding data blocks
  • 85-94 bits are encoded as video encoding data blocks
  • 95-99 bits are encoded as encapsulated data blocks.
  • the audio coding data in a multimedia file refers to the data in all audio coding data blocks contained in the file
  • the video coding data in the multimedia file refers to the data in all video coding data blocks contained in the file
  • the packaged data in the multimedia file refers to the data in all the packaged data blocks contained in the file.
  • S13 Store the packaged data in each multimedia file separately, and store a copy of the audio coded data and the video coded data. Specifically, storing the packaged data in each multimedia file in a preset packaged data storage; storing a copy of the audio coding data in a preset audio coding data storage; storing a copy of the video The encoded data is stored in a preset video encoding data storage.
  • the audio coding data V and video coding of the mp4 file are obtained.
  • Data A and packaged data mp4C at the same time get the audio coded data V, video coded data A and packaged data flvC of the flv file. Since the audio coded data V and video coded data A of the two are the same, only one copy is needed. , In order to save storage space; because the encapsulated data mp4C and flvC of the two are different, they need to be stored separately.
  • S14 Establishing and storing index data identifying the encoding location information and storage address information of the packaged data, audio encoding data, and video encoding data in each of the multimedia files. Specifically, the index data is first established, and the index data identifies the encoding position information and storage address information of the encapsulated data, audio encoding data, and video encoding data in each of the multimedia files; and then storing the established index data in the preview Set the index data memory.
  • index data is created with reference to the following format:
  • offset_ref indicates the starting storage address of the data block
  • flag indicates the data block type
  • flag is c indicates that the data block is an encapsulated data type
  • flag is v indicates that the data block is an audio encoding data type
  • flag is a indicates that the data block is video encoding Data type
  • size represents the size of the data block
  • offset represents the starting coding position of the data block in the corresponding multimedia file.
  • This embodiment provides a multimedia file reading method, which is used to read a multimedia file stored based on the method in the first embodiment, and is suitable for a server. As shown in FIG. 3, the reading method includes the following steps:
  • S21 Receive request information for reading the target multimedia file.
  • the request information includes the encapsulation format of the target multimedia file requested to be read.
  • S22 Obtain index data corresponding to the target multimedia file according to the request information. Specifically, in a preset index data storage, the index data corresponding to the target multimedia file is acquired according to the request information. For example, when the target multimedia file requested by the request information to be read is the movie A.mp4, the index data corresponding to the movie A.mp4 is obtained.
  • S23 Obtain storage address information and encoding location information of the packaged data, audio coded data, and video coded data in the target multimedia file according to the obtained index data.
  • the index data records the encoding location information of the packaged data, audio encoding data, and video encoding data in the target multimedia file, and the storage address information of the packaging data, audio encoding data, and video encoding data in the target multimedia file .
  • S24 Acquire the packaged data, audio encoded data, and video encoded data in the target multimedia file according to the storage address information of the packaged data, audio encoded data, and video encoded data in the target multimedia file.
  • the encapsulated data in the target multimedia file is acquired according to the storage address information of the encapsulated data in the target multimedia file; in the preset audio encoded data storage, the encapsulated data in the target multimedia file is acquired; The storage address information of the audio coded data in the target multimedia file is obtained, and the audio coded data in the target multimedia file is obtained; in a preset video coded data storage, the storage address information of the video coded data in the target multimedia file is obtained The video encoding data in the target multimedia file.
  • index data corresponding to the target multimedia file contains the following index content:
  • S25 Assemble the acquired packaged data, audio encoded data, and video encoded data according to the encoding position information of the packaged data, audio encoded data, and video encoded data in the target multimedia file to obtain the target multimedia file.
  • the index data contains the following index content:
  • the encapsulated data block composed of the 48-bit data read from the storage address 0 is assembled to the 48 encoding positions of the target multimedia file starting from the 0 bit, and so on, the target multimedia file can be assembled.
  • the request information input by the user is no longer a request to read a complete target multimedia file, and the request information includes the encoding position range corresponding to the position of the progress bar.
  • the step S22 includes: in the index data, obtaining storage address information and data types corresponding to the encoding position range, and the data types include encapsulation data type, audio coding Data type and video encoding data type; according to the storage address information and data type corresponding to the encoding location range, the storage address information and encoding location information of the packaged data, audio encoding data, and video encoding data in the target multimedia file are acquired.
  • the request information requests to read the multimedia file in Table 1, and the request information carries the code position range 30-60, firstly determine the storage address information and data corresponding to the 30-60 code position from the index data of the file Type (including packaged data, audio coded data, and video coded data type), and then obtain the corresponding type of data from the determined storage address information, that is, take 5 encapsulated data from the storage address corresponding to the code position 29-34, from the 35th
  • the storage address corresponding to the encoding position -49 takes 15 pieces of audio encoding data
  • the storage address corresponding to the encoding position 50-59 takes 10 pieces of video encoding data.
  • the packaged data storage, audio coding data storage, video coding data storage, and index data storage can be integrated in the same server, or two or three It is integrated in the same server, or can be arranged in different servers, depending on the needs of the amount of stored data.
  • the packaged data storage, the audio coding data storage, the video coding data storage and the index data storage are arranged on different servers respectively.
  • the video coded data storage is preferably a local storage, that is, it is preferable to store the video coded data locally to reduce data transmission overhead.
  • the memory addresses of the packaged data memory, the audio coded data memory and the index data memory are stored in a preset first database, and when data needs to be read, the addresses of the corresponding memory are obtained from the first database.
  • step S25 includes: downloading the obtained packaged data, audio coded data, and index data to the local storage; in the local storage, package according to the target multimedia file The encoding position information of the data, the audio encoding data, and the video encoding data is assembled, and the encapsulated data, the audio encoding data, and the video encoding data are assembled to obtain the target multimedia file.
  • the step of downloading the obtained packaged data, audio coding data and index data to the local storage further includes: buffering the packaged data, audio coding data and index data downloaded to the local storage; So that when the target multi-standard multimedia file is read again in a short period of time, there is no need to repeatedly download its package data, audio coding data and index data.
  • the SA and CDN layers upload file request information for reading the target multimedia file to the gateway server.
  • the gateway server forwards the file request information to the preset second database.
  • the relevant information of each multimedia file to be read is prestored in the second database, including the video encoding server address corresponding to each multimedia file.
  • the gateway server obtains the server address of the video encoding server corresponding to the target multimedia file from the second database.
  • the gateway server forwards the file request information to the corresponding server (ie, the video encoding server) according to the server address obtained from the second database.
  • the video encoding server sends a query request to the first database according to the request information to request the address of the server where the audio encoding data, package data, and index data of the target multimedia file are located.
  • the first database prestores the address of the server where the audio coding data, encapsulation data, and index data of each multimedia file to be read are located.
  • the video encoding server reads the address of the server where the audio encoding data, encapsulation data and index data of the target multimedia file are located from the first database.
  • the video encoding server sends index request information to the server where the index data of the target multimedia file is located (that is, the index data server) to request to read the index data of the target multimedia file.
  • the index data server returns the index data of the target multimedia file to the video encoding server.
  • the video encoding server obtains the storage address information and encoding location information of the encapsulated data, audio encoding data, and video encoding data in the target multimedia file from the index data, and sends it to the server where the audio encoding data of the target multimedia file is located (ie, audio encoding data).
  • the server sends audio request information to request to read audio coded data in the target multimedia file, where the audio request information carries storage address information of the audio coded data in the target multimedia file.
  • the audio encoding data server returns the audio encoding data in the target multimedia file to the video encoding server.
  • the video encoding server sends package data request information to the server where the package data of the target multimedia file is located (ie package data server) to request to read the package data in the target multimedia file, where the package data request information carries the target multimedia The storage address of the packaged data in the file.
  • the packaged data server returns the packaged data in the target multimedia file to the video encoding server.
  • the video encoding server obtains the video encoding data in the target multimedia file according to the storage address of the video encoding data in the target multimedia file, and then according to the encoding position information in the index data, it converts the video encoding data and audio encoding data in the target multimedia file Assemble the encapsulated data to obtain the target multimedia file, and then return the target multimedia file to the gateway server.
  • the gateway server returns the target multimedia file to the CDN layer, and the process ends.
  • the reading method in this embodiment takes only millimeters of time, which solves the problem that in the prior art, it takes a long time for the server to perform format conversion after receiving a client request (generally a dozen seconds to a few seconds). Minutes), a problem that has a great impact on the user experience.
  • This embodiment provides a multimedia file storage device 10, as shown in FIG. 5, including:
  • the file acquisition module 11 is configured to acquire at least two multimedia files to be stored, wherein the audio coding data and video coding data of each multimedia file are the same, but the encapsulation data is different;
  • the file analysis module 12 is used for format analysis of each of the multimedia files to obtain the audio encoding data, video encoding data, and encapsulation data in each multimedia file;
  • the file data storage module 13 is configured to store the encapsulated data in each multimedia file separately, and store a copy of the audio coded data and video coded data;
  • the index establishment module 14 is used to establish and store index data identifying the encoding location information and storage address information of the packaged data, audio encoding data, and video encoding data in each of the multimedia files.
  • the file acquisition module 11 includes:
  • the file receiving unit is used to receive the multimedia source file in the original packaging format
  • a conversion unit configured to convert the multimedia source file into at least one target packaging format different from the original packaging format
  • the file determining unit is configured to determine that the multimedia source file in the original packaging format and the multimedia source file in the at least one target packaging format are multimedia files to be stored.
  • the file analysis module 12 includes:
  • An audio coded data analysis unit configured to parse out the audio coded data in each multimedia file according to the packaging format of each multimedia file
  • the video encoding data analysis unit is configured to parse out the video encoding data in each multimedia file according to the packaging format of each multimedia file;
  • the packaged data parsing unit is used to generate packaged data in each multimedia file according to data other than the audio coded data and video coded data in each of the multimedia files.
  • the file data storage module 13 includes:
  • the packaged data storage unit is used to store the packaged data in each of the multimedia files in a preset packaged data memory
  • An audio coded data storage unit configured to store a copy of the audio coded data in a preset audio coded data memory
  • the video encoding data storage unit is configured to store a copy of the video encoding data in a preset video encoding data storage.
  • the video encoding data storage is preferably a local storage.
  • the index establishing module 14 includes:
  • An index establishing unit configured to establish the index data, and the index data identifies the encoding location information and storage address information of the encapsulated data, audio encoding data, and video encoding data in each of the multimedia files;
  • the index storage unit is used to store the index data in a preset index data storage.
  • the storage device 10 further includes:
  • the memory address storage module is used to store the memory addresses of the packaged data storage, the audio coding data storage and the index data storage in a preset first database.
  • This embodiment provides a multimedia file reading device 20 for reading multimedia files stored based on the aforementioned storage device.
  • the reading device 20 includes:
  • the request receiving module 21 is configured to receive request information for reading the target multimedia file
  • the index data obtaining module 22 is configured to obtain the index data corresponding to the target multimedia file according to the request information
  • the index analysis module 23 is configured to obtain storage address information and coding location information of the packaged data, audio coded data, and video coded data in the target multimedia file according to the obtained index data;
  • the file data obtaining module 24 is configured to obtain the encapsulated data, audio coded data, and video coded data in the target multimedia file according to the storage address information of the encapsulated data, audio coded data, and video coded data in the target multimedia file;
  • the assembling module 25 is used for assembling the acquired packaged data, audio encoding data, and video encoding data according to the encoding position information of the packaged data, audio encoding data, and video encoding data in the target multimedia file to obtain the target multimedia file.
  • the index data obtaining module 22 is specifically configured to:
  • the index data corresponding to the target multimedia file is acquired according to the request information.
  • the file data acquisition module 24 includes:
  • the packaged data acquisition unit is configured to acquire packaged data in the target multimedia file according to the storage address information of the packaged data in the target multimedia file in a preset packaged data storage;
  • An audio coded data obtaining unit configured to obtain the audio coded data in the target multimedia file according to the storage address information of the audio coded data in the target multimedia file in a preset audio coded data storage;
  • the video encoding data acquisition unit is configured to acquire the video encoding data in the target multimedia file according to the storage address information of the video encoding data in the target multimedia file in a preset video encoding data storage.
  • the video encoding data storage is preferably a local storage.
  • the assembling module 25 includes:
  • a data download unit configured to download the obtained package data, audio coding data, and index data to the local storage
  • the data assembling unit is used for assembling the encapsulated data, audio encoded data and video encoded data in the local storage according to the encoding position information of the encapsulated data, audio encoded data and video encoded data in the target multimedia file, Obtain the target multimedia file.
  • the data download unit is further used for:
  • the index analysis module 23 is specifically configured to:
  • index data obtaining storage address information and data types corresponding to the encoding location range, where the data types include encapsulation data types, audio encoding data types, and video encoding data types;
  • the storage address information and the data type corresponding to the coding position range According to the storage address information and the data type corresponding to the coding position range, the storage address information and coding position information of the packaged data, audio coding data and video coding data in the target multimedia file are obtained.
  • This application also provides a computer device, such as a smart phone, tablet computer, notebook computer, desktop computer, rack storage, blade storage, tower storage or cabinet storage (including independent storage, or more A memory cluster composed of two memories), etc.
  • the computer device 30 in this embodiment at least includes but is not limited to: a memory 31 and a processor 32 that can be communicatively connected to each other through a system bus, as shown in FIG. 7. It should be pointed out that FIG. 7 only shows the computer device 30 with components 31-32, but it should be understood that it is not required to implement all of the illustrated components, and more or fewer components may be implemented instead.
  • the memory 31 (ie, readable storage medium) includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), Read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk, etc.
  • the memory 31 may be an internal storage unit of the computer device 30, such as a hard disk or memory of the computer device 30.
  • the memory 31 may also be an external storage device of the computer device 30, such as a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital, SD card, Flash Card, etc.
  • the memory 31 may also include both the internal storage unit of the computer device 30 and its external storage device.
  • the memory 31 is generally used to store the operating system and various application software installed in the computer equipment 30, such as the program code of the multimedia file storage device 10 of the third embodiment or the multimedia file reading device 20 of the fourth embodiment Wait.
  • the memory 31 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 32 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 32 is generally used to control the overall operation of the computer device 30.
  • the processor 32 is used to run the program code or process data stored in the memory 31, for example, to run the multimedia file storage device 10 to implement the multimedia file storage method of the first embodiment, or to run the multimedia file reading device 20 , In order to achieve the second implementation of the multimedia file storage and reading method.
  • This application also provides a computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Programmable Read-Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, Memory, App Application Store, etc., on which a computer can be stored Read the instruction, the corresponding function is realized when the program is executed by the processor.
  • a computer-readable storage medium such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Programmable Read-Only Memory (PROM), Magnetic Memory, Magnetic Disk, Optical Disk, Memory, App Application Store, etc.
  • the computer-readable storage medium of this embodiment is used to store the multimedia file storage device 10, and when executed by a processor, the multimedia file storage method of the first embodiment is implemented, or the computer-readable storage medium of this embodiment is used to store multimedia files.
  • the device 20 realizes the multimedia file reading method of the second embodiment when executed by the processor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Databases & Information Systems (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Library & Information Science (AREA)
  • Software Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

一种多媒体文件存储、读取方法,该存储方法包括:获取至少待存储多媒体文件,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同(S11);对各所述多媒体文件进行解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据(S12);分别存储每一多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据(S13);建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据(S14)。可以解决现有技术需要存储不同业务所需的多种封装格式的多媒体文件,导致的相同音频编码数据和视频编码数据重复存储,极大地浪费存储空间的问题。

Description

多媒体文件存储、读取方法
本申请申明2019年07月23日递交的申请号为201910668459.1、名称为“多媒体文件存储、读取方法”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。
技术领域
本申请涉及多媒体数据处理领域,尤其涉及一种多媒体文件存储、读取方法。
背景技术
随着移动终端的快速发展,特别是智能手机移动终端的快速发展,很多用户喜欢通过网页或APP(应用程序)来播放多媒体文件,以丰富自己的精神娱乐生活。相应地,也衍生出多种用于封装多媒体文件的封装格式,如mp4、flv、rmvb、avi、mov、wmv等。通常,在不同的业务场景需求下,可能需要播放不同格式的多媒体文件。例如,某网站支持mp4格式,某APP支持flv格式。对于服务端来说,则需要存储不同业务所需的多种封装格式的多媒体文件,而不同封装格式的多媒体文件中的音频编码数据和视频编码数据是相同的,从而导致相同音频编码数据和视频编码数据重复存储,极大地浪费了存储空间。
发明内容
针对上述技术的不足,本申请的目的在于提供一种多媒体文件存储、读取方法,以解决现有技术需要存储不同业务所需的多种封装格式的多媒体文件,进而导致的存储空间浪费的问题。
为了实现上述目的,本申请提供一种多媒体文件存储方法,包括以下步骤:
获取至少两个待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同;
对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据;
分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据;
建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。
在本申请一个优选实施例中,所述获取至少两个待存储多媒体文件的步骤包括:
接收原始封装格式的多媒体源文件;
将所述多媒体源文件转换成至少一种不同于所述原始封装格式的目标封装格式;
确定所述原始封装格式的多媒体源文件、以及所述至少一种目标封装格式的多媒体源文件为待存储的多媒体文件。
在本申请一个优选实施例中,所述对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据的步骤包括:
根据各所述多媒体文件的封装格式,解析出各所述多媒体文件中的音频编码数据;
根据各所述多媒体文件的封装格式,解析出各所述多媒体文件中的视频编码数据;
根据各所述多媒体文件中的音频编码数据和视频编码数据以外的数据,生成各所述多媒体文件中的封装数据。
在本申请一个优选实施例中,所述分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据的步骤包括:
分别将每一所述多媒体文件中的封装数据存储于预设的封装数据存储器中;
将一份所述音频编码数据存储于预设的音频编码数据存储器中;
将一份所述视频编码数据存储于预设的视频编码数据存储器中。
在本申请一个优选实施例中,所述视频编码数据存储器为本地存储器。
在本申请一个优选实施例中,所述建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据的步骤包括:
建立所述索引数据,所述索引数据中标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息;
将所述索引数据存储于预设的索引数据存储器中。
在本申请一个优选实施例中,所述存储方法还包括:
将所述封装数据存储器、音频编码数据存储器和索引数据存储器的存储器地址存储于预设的第一数据库中。
为了实现上述目的,本申请提供一种多媒体文件存储装置,包括:
文件获取模块,用于获取至少两待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同;
文件解析模块,用于对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据;
文件数据存储模块,用于分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据;
索引建立模块,用于建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。
为了实现上述目的,本申请提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
获取至少两个待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同;
对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据;
分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据;
建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。
为了实现上述目的,本申请提供一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:
获取至少两个待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数 据相同、封装数据不同;
对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据;
分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据;
建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。
为了实现上述目的,本申请还提供一种多媒体文件读取方法,用于读取基于前述方法存储的多媒体文件,所述读取方法包括以下步骤:
接收读取目标多媒体文件的请求信息;
根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据;
根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息;
根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据;
根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。
在本申请一个优选实施例中,所述根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据的步骤包括:
在预设的索引数据存储器中,根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据。
在本申请一个优选实施例中,所述根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据的步骤包括:
在预设的封装数据存储器中,根据所述目标多媒体文件中封装数据的存储地址信息,获取所述目标多媒体文件中的封装数据;
在预设的音频编码数据存储器中,根据所述目标多媒体文件中音频编码数据的存储地址信息,获取所述目标多媒体文件中的音频编码数据;
在预设的视频编码数据存储器中,根据所述目标多媒体文件中视频编码数据的存储地址信息,获取所述目标多媒体文件中的视频编码数据。
在本申请一个优选实施例中,所述视频编码数据存储器为本地存储器。
在本申请一个优选实施例中,所述根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件的步骤包括:
将获取到的所述封装数据、音频编码数据和索引数据下载至所述本地存储器;在所述本地存储器,根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对所述封装数据、音频编码数据和视频编码数据进行拼装,得到所述目标多媒体文件。
在本申请一个优选实施例中,将获取到的所述封装数据、音频编码数据和索引数据下载至本地存储器的步骤还包括:
对下载至所述本地存储器的所述封装数据、音频编码数据和索引数据进行缓存。
在本申请一个优选实施例中,当所述请求信息包含编码位置范围时,所述根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息的步骤包括:
在所述索引数据中,获取所述编码位置范围对应的存储地址信息和数据类型,所述数据类型包含封装数据类型、音频编码数据类型和视频编码数据类型;
根据所述编码位置范围对应的存储地址信息和数据类型,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息。
为了实现上述目的,本申请提供一种多媒体文件读取装置,包括:
请求接收模块,用于接收读取目标多媒体文件的请求信息;
索引数据获取模块,用于根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据;
索引解析模块,用于根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息;
文件数据获取模块,用于根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据;
拼装模块,用于根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。
为了实现上述目的,本申请提供一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
接收读取目标多媒体文件的请求信息;
根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据;
根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息;
根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据;
根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。
为了实现上述目的,本申请提供一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:
接收读取目标多媒体文件的请求信息;
根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据;
根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息;
根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据;
根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息, 对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。
通过采用上述技术方案,本申请具有如下有益效果:
本申请对于多个内容相同、封装格式不同的多媒体文件,将相同的音频编码数据和视频编码数据仅存储一份,将不同的封装数据分别进行存储,同时存储这些数据的编码位置信息;在读取时,则获取目标多媒体文件的音频编码数据、视频编码数据、封装数据以及这些数据的编码位置信息,而后根据编码位置信息对音频编码数据、视频编码数据、封装数据进行拼装即可。从而,本申请可以解决现有技术需要存储不同业务所需的多种封装格式的多媒体文件,进而导致相同音频编码数据和视频编码数据重复存储,极大地浪费存储空间的问题。
附图说明
图1为本申请多媒体文件存储和读取方法的应用环境示意图;
图2为本申请多媒体文件存储方法的一个实施例的流程图;
图2A为本申请多媒体文件存储方法的一个实施例的原理示意图;
图3为本申请多媒体文件读取方法的一个实施例的流程图;
图4为本申请多媒体文件读取方法的一个实施例的泳道图;
图5为本申请多媒体文件存储装置的一个实施例的结构框图;
图6为本申请多媒体文件读取装置的一个实施例的结构框图;
图7为本申请计算机设备的一个实施例的硬件架构图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。
参阅图1所示,是本申请多媒体文件存储和读取方法一个实施例的应用环境示意图。该应用环境示意图包括客户端M、N、L及服务端P。服务端P可以通过网络、近场通信技术等适合的技术与客户端M、N、L进行数据交互。其中,客户端M、N、L包括但不限于任何一种可与用户通过键盘、鼠标、遥控器、触摸板或者声控设备等方式进行人机交互的智能电子产品,例如,个人计算机、平板电脑、智能手机、个人数字助理(PDA)、游戏机、智能式穿戴式设备、导航装置等等的可移动设备,或者诸如数字TV、台式计算机、笔记本等等的固定终端。服务端P可以是计算机、也可以是单个网络服务器、多个网络服务器组成的服务器组或者基于云计算的由大量主机或者网络服务器构成的云,其中云计算是分布式计算的一种,由一群松散耦合的计算机集组成的一个超级虚拟计算机。
实施例一
本实施例提供一种多媒体文件存储方法,适用于服务端,如图2和2A所示,该方法包括以下步骤:
S11,获取至少两个待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同,即,两个待存储多媒体文件的内容相同而封装格式不同。例如,获取的多媒体文件为影片A.mp4和影片A.flv,其中影片A.mp4和A.flv的音视频内容完全相同,仅封装格式不同。在本申请中,多媒体文件指的是音视频文件,封装格式可以是mp4、flv、rmvb、avi、mov、或wmv等。
本步骤具体通过如下步骤实现:当数据源端上传原始封装格式的多媒体源文件后,接收数据源端上传的原始封装格式的多媒体源文件;将该多媒体源文件转换成至少一种不同于原始封装格式的目标封装格式;确定原始封装格式的多媒体源文件、以及至少一种目标封装格式的多媒体源文件为待存储的多媒体文件。其中,目标封装格式可以根据需要预先设定。如,服务端接收到数据源端上传的一多媒体源文件A.mp4,由于不同类业务需求所需要使用的多媒体源文件格式是不同的(如,H5分享页面需要使用mp4格式,主站视频播放使用flv格式,未来主推的自适应播放需求音视频分离的fmp4格式),因此服务端需要进行格式转换,获取A.mp4以外的其它格式,如flv格式。需要说明的是,多媒体文件的格式转换为本领域已知的技术,此处对具体转换过程不再赘述。
S12,对各多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据。
本步骤的具体解析过程如下:根据各多媒体文件的封装格式,解析出各多媒体文件中的音频编码数据;根据各多媒体文件的封装格式,解析出各多媒体文件中的视频编码数据;根据各多媒体文件中的音频编码数据和视频编码数据以外的数据,生成各多媒体文件中的封装数据。例如,假设待存储的多媒体文件为内容相同的mp4文件和flv文件,经过解析后,如图2A所示,将得到mp4文件的音频编码数据V、视频编码数据A和封装数据mp4C,同时得到flv文件的音频编码数据V、视频编码数据A和封装数据flvC,其中,两个文件的音频编码数据V和视频编码数据A是相同的,两个文件的封装数据mp4C和flvC是不同的。
本步骤解析出音频编码数据、视频编码数据和封装数据的理论依据是:每一种封装格式的数据协议都具有统一的国际标准。例如,假设文件大小为100B的mp4格式文件的数据协议如下表1所示,文件大小为100B的flv格式文件的数据协议如下表2所示:
表1
Figure PCTCN2020084518-appb-000001
表2
Figure PCTCN2020084518-appb-000002
在表1和表2中,V表示音频编码数据块,A表示视频编码数据块,C表示封装数据 块,表中的数字表示对应数据块的编码长度。应该理解,根据对应封装格式的数据协议标准,即可从各多媒体文件中解析出对应的音频编码数据、视频编码数据和封装数据。例如,在表1所示的多媒体文件中,0-34位编码为封装数据块,35-49位编码为音频编码数据块,50-59位编码为视频编码数据块,60-69位编码为视频编码数据块,70-84位编码为音频编码数据块,85-94位编码为视频编码数据块,95-99位编码为封装数据块。
在本申请中,多媒体文件中的音频编码数据是指该文件所包含的所有音频编码数据块中的数据,多媒体文件中的视频编码数据是指该文件所包含的所有视频编码数据块中的数据,多媒体文件中的封装数据是指该文件所包含的所有封装数据块中的数据。
本步骤对表1所示的文件进行解析时,首先根据mp4格式的数据协议,解析其出音、频编码数据,而后将其音、视频编码数据以外的数据拼接生成其封装数据(见下表3);对表2所示的文件进行解析时,首先根据flv格式的数据协议,解析其出音、频编码数据,而后将其音、视频编码数据以外的数据拼接生成其封装数据(见下表4):
表3
C C
表4
C C C C C C
S13,分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据。具体地,分别将每一所述多媒体文件中的封装数据存储于预设的封装数据存储器中;将一份所述音频编码数据存储于预设的音频编码数据存储器中;将一份所述视频编码数据存储于预设的视频编码数据存储器中。
例如,如图2A所示,假设有两个内容相同、封装格式不同的待存储多媒体文件,分别为flv文件和mp4文件,经过步骤S12解析处理后,得到mp4文件的音频编码数据V、视频编码数据A和封装数据mp4C,同时得到flv文件的音频编码数据V、视频编码数据A和封装数据flvC,由于两者的音频编码数据V和视频编码数据A是相同的,所以仅存储一份即可,以节省存储空间;由于两者的封装数据mp4C和flvC是不同的,所以需要分别进行存储。
S14,建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。具体地,首先建立所述索引数据,该索引数据中标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息;而后将建立的索引数据存储于预设的索引数据存储器中。
在本实施例中,参考如下格式建立索引数据:
Figure PCTCN2020084518-appb-000003
其中,offset_ref表示数据块的起始存储地址,flag表示数据块类型,flag为c表示数据块为封装数据类型,flag为v表示数据块为音频编码数据类型,flag为a表示数据块为视频编码数据类型,size表示数据块大小,offset表示数据块在对应多媒体文件中的起始编码位置。
通过本实例的存储方法,多个多媒体文件中相同的音频编码数据和视频编码数据仅存储一份即可,可以解决现有技术需要存储不同业务所需的多种封装格式的多媒体文件,进而导致相同音频编码数据和视频编码数据重复存储,极大地浪费存储空间的问题。并且,本申请的存储方法,数据预先存储,避免了现有技术中服务端在接收到客户端请求后,再进行格式转换所消耗的时间较长(一般在十几秒到几分钟之间),服务器响应慢的问题。
实施例二
本实施例提供一种多媒体文件读取方法,用于读取基于实施例一的方法存储的多媒体文件,适用于服务端,如图3所示,该读取方法包括以下步骤:
S21,接收读取目标多媒体文件的请求信息。该请求信息包含有请求读取的目标多媒体文件的封装格式。
S22,根据请求信息,获取目标多媒体文件对应的索引数据。具体地,在预设的索引数据存储器中,根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据。例如,当请求信息请求读取的目标多媒体文件为影片A.mp4时,获取影片A.mp4对应的索引数据。
S23,根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息。
根据实施列一可知,索引数据中记载有目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,以及目标多媒体文件中的封装数据、音频编码数据和视频编码数据的存储地址信息。
S24,根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据。具体地,在预设的封装数据存储器中,根据所述目标多媒体文件中封装数据的存储地址信息,获取所述目标多媒体文件中的封装数据;在预设的音频编码数据存储器中,根据所述目标多媒体文件中音频编码数据的存储地址信息,获取所述目标多媒体文件中的音频编码数据;在预设的视频编码数据存储器中,根据所述目标多媒体文件中视频编码数据的存储地址信息,获取所述目标多媒体文件中的视频编码数据。
例如,假设目标多媒体文件对应的索引数据中包含如下索引内容:
Figure PCTCN2020084518-appb-000004
则从存储地址0开始读取48位数据作为封装数据块。
S25,根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。例如,假设索引数据中包含如下索引内容:
Figure PCTCN2020084518-appb-000005
则将从存储地址0开始读取的48位数据组成的封装数据块拼装到目标多媒体文件从0位开始的48个编码位置,以此类推,即可将目标多媒体文件拼装完成。
此外,用户有时会拖动视频进度条,此时,用户输入的请求信息不再是请求读取完整的目标多媒体文件,该取求信息中包含有进度条位置对应的编码位置范围。当所述请求信息包含编码位置范围时,所述步骤S22包括:在所述索引数据中,获取所述编码位置范围对应的存储地址信息和数据类型,所述数据类型包含封装数据类型、音频编码数据类型和视频编码数据类型;根据所述编码位置范围对应的存储地址信息和数据类型,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息。
例如,假设请求信息请求读取表1中的多媒体文件,且该请求信息中携带编码位置范围30-60,则首先从该文件的索引数据中确定30-60编码位置对应的存储地址信息和数据类型(包含封装数据、音频编码数据和视频编码数据类型),而后从确定的存储地址信息中获取相应类型的数据,即从29-34编码位置对应的存储地址取5个封装数据,从第35-49编码位置对应的存储地址取15个音频编码数据,从50-59编码位置对应的存储地址取10个视频编码数据。
需要说明的是,在本申请实施一和实施例二中,封装数据存储器、音频编码数据存储器、视频编码数据存储器和索引数据存储器可以集成于同一个服务器中,也可以某两个或某三个集成于同一个服务器中,也可以分别布置于不同的服务器中,具体根据存储数据量 的需要而定。
当存储的多媒体文件量很大时,优选将封装数据存储器、音频编码数据存储器、视频编码数据存储器和索引数据存储器分别布置于不同的服务器。另外,由于多媒体文件中的视频编码数据通常占80%左右,所以视频编码数据存储器优选为本地存储器中,即,优选将视频编码数据存储至本地,以减少数据传输开销。同时,将所述封装数据存储器、音频编码数据存储器和索引数据存储器的存储器地址存储于预设的第一数据库中,当需要读取数据时,从第一数据库中获取相应存储器的地址。
当视频编码数据存储于本地存储器时,步骤S25包括:将获取到的所述封装数据、音频编码数据和索引数据下载至所述本地存储器;在所述本地存储器,根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对所述封装数据、音频编码数据和视频编码数据进行拼装,得到所述目标多媒体文件。其中,将获取到的所述封装数据、音频编码数据和索引数据下载至所述本地存储器的步骤还包括:对下载至所述本地存储器的所述封装数据、音频编码数据和索引数据进行缓存,以便短期内再次读取目标多标多媒体文件时无需重复下载其封装数据、音频编码数据和索引数据。
下面以封装数据存储器、音频编码数据存储器、视频编码数据存储器和索引数据存储器分别布置于不同的服务器(记为封装数据服务器、音频编码数据服务器、视频编码服务器和索引数据服务器)中为例,对本申请的多媒体文件读取方法进一步说明,如图4所示,包括以下步骤:
SA,CDN层上传读取目标多媒体文件的文件请求信息至网关服务器。
SB,网关服务器向预设的第二数据库转发所述文件请求信息。其中,该第二数据库中预存有各个待读取的多媒体文件的相关信息,包括各多媒体文件对应的视频编码服务器地址。
SC,网关服务器从第二数据库获取目标多媒体文件对应的视频编码服务器的服务器地址。
SD,网关服务器根据从第二数据库获取的服务器地址,向对应的服务器(即视频编码服务器)转发所述文件请求信息。
SE,视频编码服务器根据所述请求信息,向第一数据库发送查询请求,以请求查询目标多媒体文件的音频编码数据、封装数据和索引数据所在的服务器地址。其中,第一数据库中预存有各个待读取的多媒体文件的音频编码数据、封装数据和索引数据所在的服务器地址。SF,视频编码服务器从第一数据库读取目标多媒体文件的音频编码数据、封装数据和索引数据所在的服务器地址。
SG,视频编码服务器向目标多媒体文件的索引数据所在的服务器(即索引数据服务器)发送索引请求信息,以请求读取目标多媒体文件的索引数据。
SH,索引数据服务器向视频编码服务器返回目标多媒体文件的索引数据。
SI,视频编码服务器从索引数据中获取目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息,并向目标多媒体文件的音频编码数据所在的服务器(即音频编码数据服务器)发送音频请求信息,以请求读取目标多媒体文件中的音频编码数据,其中,音频请求信息中携带有目标多媒体文件中音频编码数据的存储地址信息。
SJ,音频编码数据服务器向视频编码服务器返回目标多媒体文件中的音频编码数据。
SK,视频编码服务器向目标多媒体文件的封装数据所在的服务器(即封装数据服务器)发送封装数据请求信息,以请求读取目标多媒体文件中的封装数据,其中,封装数据请求信息中携带有目标多媒体文件中封装数据的存储地址。
SL,封装数据服务器向视频编码服务器返回目标多媒体文件中的封装数据。
SM,视频编码服务器根据目标多媒体文件中视频编码数据的存储地址,获取目标多媒体文件中的视频编码数据,而后根据索引数据中的编码位置信息,将目标多媒体文件中的视频编码数据、音频编码数据和封装数据进行拼装,即可得到目标多媒体文件,而后将目标多媒体文件返回至网关服务器。
SN,网关服务器将目标多媒体文件返回至CDN层,流程结束。
本实施例的读取方法,耗时仅为毫米级,解决了现有技术中,服务端在接收到客户端请求后,再进行格式转换所消耗的时间较长(一般在十几秒到几分钟之间),给用户体验造成很大影响的问题。
应该理解,对于实施例一和实施例二,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本申请所必须的。
实施例三
本实施例提供一种多媒体文件存储装置10,如图5所示,包括:
文件获取模块11,用于获取至少两待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同;
文件解析模块12,用于对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据;
文件数据存储模块13,用于分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据;
索引建立模块14,用于建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。
在本实施例中,所述文件获取模块11包括:
文件接收单元,用于接收原始封装格式的多媒体源文件;
转换单元,用于将所述多媒体源文件转换成至少一种不同于所述原始封装格式的目标封装格式;
文件确定单元,用于确定所述原始封装格式的多媒体源文件、以及所述至少一种目标封装格式的多媒体源文件为待存储的多媒体文件。
在本实施例中,所述文件解析模块12包括:
音频编码数据解析单元,用于根据各所述多媒体文件的封装格式,解析出各所述多媒体文件中的音频编码数据;
视频编码数据解析单元,用于根据各所述多媒体文件的封装格式,解析出各所述多媒体文件中的视频编码数据;
封装数据解析单元,用于根据各所述多媒体文件中的音频编码数据和视频编码数据以外的数据,生成各所述多媒体文件中的封装数据。
在本实施例中,所述文件数据存储模块13包括:
封装数据存储单元,用于分别将每一所述多媒体文件中的封装数据存储于预设的封装数据存储器中;
音频编码数据存储单元,用于将一份所述音频编码数据存储于预设的音频编码数据存储器中;
视频编码数据存储单元,用于将一份所述视频编码数据存储于预设的视频编码数据存储器中。
在本实施例中,所述视频编码数据存储器优选为本地存储器。
在本实施例中,所述索引建立模块14包括:
索引建立单元,用于建立所述索引数据,所述索引数据中标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息;
索引存储单元,用于将所述索引数据存储于预设的索引数据存储器中。
在本实施例中,所述存储装置10还包括:
存储器地址存储模块,用于将所述封装数据存储器、音频编码数据存储器和索引数据存储器的存储器地址存储于预设的第一数据库中。
实施例四
本实施例提供一种多媒体文件读取装置20,用于读取基于前述存储装置存储的多媒体文件,如图6所示,所述读取装置20包括:
请求接收模块21,用于接收读取目标多媒体文件的请求信息;
索引数据获取模块22,用于根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据;
索引解析模块23,用于根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息;
文件数据获取模块24,用于根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据;
拼装模块25,用于根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。
在本实施例中,所述索引数据获取模块22具体用于:
在预设的索引数据存储器中,根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据。
在本实施例中,所述文件数据获取模块24包括:
封装数据获取单元,用于在预设的封装数据存储器中,根据所述目标多媒体文件中封装数据的存储地址信息,获取所述目标多媒体文件中的封装数据;
音频编码数据获取单元,用于在预设的音频编码数据存储器中,根据所述目标多媒体文件中音频编码数据的存储地址信息,获取所述目标多媒体文件中的音频编码数据;
视频编码数据获取单元,用于在预设的视频编码数据存储器中,根据所述目标多媒体文件中视频编码数据的存储地址信息,获取所述目标多媒体文件中的视频编码数据。
在本实施例中,所述视频编码数据存储器优选为本地存储器。
在本实施例中,所述拼装模块25包括:
数据下载单元,用于将获取到的所述封装数据、音频编码数据和索引数据下载至所述本地存储器;
数据拼装单元,用于在所述本地存储器,根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对所述封装数据、音频编码数据和视频编码数据进行拼装,得到所述目标多媒体文件。
在本实施例中,所述数据下载单元还用于:
对下载至所述本地存储器的所述封装数据、音频编码数据和索引数据进行缓存。
在本实施例中,当所述请求信息包含编码位置范围时,所述索引解析模块23具体用于:
在所述索引数据中,获取所述编码位置范围对应的存储地址信息和数据类型,所述数据类型包含封装数据类型、音频编码数据类型和视频编码数据类型;
根据所述编码位置范围对应的存储地址信息和数据类型,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息。
实施例五
本申请还提供一种计算机设备,如可以执行程序的智能手机、平板电脑、笔记本电脑、台式计算机、机架式存储器、刀片式存储器、塔式存储器或机柜式存储器(包括独立的存储器,或者多个存储器所组成的存储器集群)等。本实施例的计算机设备30至少包括但不限于:可通过系统总线相互通信连接的存储器31、处理器32,如图7所示。需要指出的是,图7仅示出了具有组件31-32的计算机设备30,但是应理解的是,并不要求实施所有示出的组件,可以替代的实施更多或者更少的组件。
本实施例中,存储器31(即可读存储介质)包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器31可以是计算机设备30的内部存储单元,例如该计算机设备30的硬盘或内存。在另一些实施例中,存储器31也可以是计算机设备30的外部存储设备,例如该计算机设备30上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器31还可以既包括计算机设备30的内部存储单元也包括其外部存储设备。本实施例中,存储器31通常用于存储安装于计算机设备30的操作系统和各类应用程序软件,例如实施例三的多媒体文件存储装置10或者实施例四的多媒体文件读取装置20的程序代码等。此外,存储器31还可以用于暂时地存储已经输出或者将要输出的各类数据。
处理器32在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器32通常用于控制计算机设备30的总体操作。本实施例中,处理器32用于运行存储器31中存储的程序代码或者处理数据,例如运行多媒体文件存储装置10,以实现实施例一的多媒体文件存储装置方法,或者运行多媒体文件读取装置20,以实现实施二的多媒体文件存储读取方法。
实施例六
本申请还提供一种计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、 磁性存储器、磁盘、光盘、存储器、App应用程序程序商城等等,其上存储有计算机可读指令,程序被处理器执行时实现相应功能。本实施例的计算机可读存储介质用于存储多媒体文件存储装置10,被处理器执行时实现实施例一的多媒体文件存储方法,或者本施例的计算机可读存储介质用于存储多媒体文件读取装置20,被处理器执行时实现实施例二的多媒体文件读取方法。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种多媒体文件存储方法,包括以下步骤:
    获取至少两个待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同;
    对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据;
    分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据;
    建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。
  2. 根据权利要求1所述的多媒体文件存储方法,所述获取至少两个待存储多媒体文件的步骤包括:
    接收原始封装格式的多媒体源文件;
    将所述多媒体源文件转换成至少一种不同于所述原始封装格式的目标封装格式;
    确定所述原始封装格式的多媒体源文件、以及所述至少一种目标封装格式的多媒体源文件为待存储的多媒体文件。
  3. 根据权利要求1所述的多媒体文件存储方法,所述对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据的步骤包括:
    根据各所述多媒体文件的封装格式,解析出各所述多媒体文件中的音频编码数据;
    根据各所述多媒体文件的封装格式,解析出各所述多媒体文件中的视频编码数据;
    根据各所述多媒体文件中的音频编码数据和视频编码数据以外的数据,生成各所述多媒体文件中的封装数据。
  4. 根据权利要求1所述的多媒体文件存储方法,所述分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据的步骤包括:
    分别将每一所述多媒体文件中的封装数据存储于预设的封装数据存储器中;
    将一份所述音频编码数据存储于预设的音频编码数据存储器中;
    将一份所述视频编码数据存储于预设的视频编码数据存储器中。
  5. 根据权利要求4所述的多媒体文件存储方法,所述视频编码数据存储器为本地存储器。
  6. 根据权利要求4或5所述的多媒体文件存储方法,所述建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据的步骤包括:
    建立所述索引数据,所述索引数据中标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息;
    将所述索引数据存储于预设的索引数据存储器中。
  7. 根据权利要求6所述的多媒体文件存储方法,所述存储方法还包括:
    将所述封装数据存储器、音频编码数据存储器和索引数据存储器的存储器地址存储于预设的第一数据库中。
  8. 一种多媒体文件存储装置,包括:
    文件获取模块,用于获取至少两待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同;
    文件解析模块,用于对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据;
    文件数据存储模块,用于分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据;
    索引建立模块,用于建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。
  9. 一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
    获取至少两个待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同;
    对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据;
    分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据;
    建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。
  10. 一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:
    获取至少两个待存储多媒体文件,其中,各多媒体文件的音频编码数据和视频编码数据相同、封装数据不同;
    对各所述多媒体文件分别进行格式解析,以获取各多媒体文件中的音频编码数据、视频编码数据和封装数据;
    分别存储每一所述多媒体文件中的封装数据,存储一份所述音频编码数据和视频编码数据;
    建立并存储标识有各所述多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息及存储地址信息的索引数据。
  11. 一种多媒体文件读取方法,用于读取基于前述权利要求1所述方法存储的多媒体文件,所述读取方法包括以下步骤:
    接收读取目标多媒体文件的请求信息;
    根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据;
    根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息;
    根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据;
    根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。
  12. 根据权利要求11所述的多媒体文件读取方法,所述根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据的步骤包括:
    在预设的索引数据存储器中,根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据。
  13. 根据权利要求11所述的多媒体文件读取方法,所述根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据的步骤包括:
    在预设的封装数据存储器中,根据所述目标多媒体文件中封装数据的存储地址信息,获取所述目标多媒体文件中的封装数据;
    在预设的音频编码数据存储器中,根据所述目标多媒体文件中音频编码数据的存储地址信息,获取所述目标多媒体文件中的音频编码数据;
    在预设的视频编码数据存储器中,根据所述目标多媒体文件中视频编码数据的存储地址信息,获取所述目标多媒体文件中的视频编码数据。
  14. 根据权利要求13所述的多媒体文件读取方法,所述视频编码数据存储器为本地存储器。
  15. 根据权利要求14所述的多媒体文件读取方法,所述根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件的步骤包括:
    将获取到的所述封装数据、音频编码数据和索引数据下载至所述本地存储器;在所述本地存储器,根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对所述封装数据、音频编码数据和视频编码数据进行拼装,得到所述目标多媒体文件。
  16. 根据权利要求15所述的多媒体文件读取方法,将获取到的所述封装数据、音频编码数据和索引数据下载至本地存储器的步骤还包括:
    对下载至所述本地存储器的所述封装数据、音频编码数据和索引数据进行缓存。
  17. 根据权利要求11所述的多媒体文件读取方法,当所述请求信息包含编码位置范围时,所述根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息的步骤包括:
    在所述索引数据中,获取所述编码位置范围对应的存储地址信息和数据类型,所述数据类型包含封装数据类型、音频编码数据类型和视频编码数据类型;
    根据所述编码位置范围对应的存储地址信息和数据类型,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息。
  18. 一种多媒体文件读取装置,包括:
    请求接收模块,用于接收读取目标多媒体文件的请求信息;
    索引数据获取模块,用于根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据;
    索引解析模块,用于根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息;
    文件数据获取模块,用于根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据;
    拼装模块,用于根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据 的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。
  19. 一种计算机设备,包括存储器、处理器以及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
    接收读取目标多媒体文件的请求信息;
    根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据;
    根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息;
    根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据;
    根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。
  20. 一种计算机可读存储介质,其上存储有计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:
    接收读取目标多媒体文件的请求信息;
    根据所述请求信息,获取所述目标多媒体文件对应的所述索引数据;
    根据获取到的所述索引数据,获取所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息和编码位置信息;
    根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的存储地址信息,获取所述目标多媒体文件中的封装数据、音频编码数据和视频编码数据;
    根据所述目标多媒体文件中封装数据、音频编码数据和视频编码数据的编码位置信息,对获取到的所述封装数据、音频编码数据和视频编码数据进行拼装,得到目标多媒体文件。
PCT/CN2020/084518 2019-07-23 2020-04-13 多媒体文件存储、读取方法 WO2021012723A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP20843920.8A EP3989082A4 (en) 2019-07-23 2020-04-13 MULTIMEDIA FILE STORAGE AND ACCESS METHODS
US17/625,306 US20220365959A1 (en) 2019-07-23 2020-04-13 Multimedia file storage and access method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910668459.1A CN112287127B (zh) 2019-07-23 2019-07-23 多媒体文件存储、读取方法
CN201910668459.1 2019-07-23

Publications (1)

Publication Number Publication Date
WO2021012723A1 true WO2021012723A1 (zh) 2021-01-28

Family

ID=74193113

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/084518 WO2021012723A1 (zh) 2019-07-23 2020-04-13 多媒体文件存储、读取方法

Country Status (4)

Country Link
US (1) US20220365959A1 (zh)
EP (1) EP3989082A4 (zh)
CN (1) CN112287127B (zh)
WO (1) WO2021012723A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116610823B (zh) * 2023-04-28 2024-05-07 江苏传智播客教育科技股份有限公司 一种统一访问多媒体资源的方法和系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447673A (zh) * 2010-09-30 2012-05-09 突触计算机系统(上海)有限公司 一种用于解封装携有封装格式的多媒体文件的方法与设备
CN102769638A (zh) * 2011-05-05 2012-11-07 腾讯科技(深圳)有限公司 一种下载文件的方法、装置及系统
CN102802022A (zh) * 2012-08-28 2012-11-28 曙光信息产业(北京)有限公司 编解码系统和方法
CN103002353A (zh) * 2011-09-16 2013-03-27 杭州海康威视数字技术股份有限公司 对多媒体文件进行封装的方法及装置
CN103929478A (zh) * 2014-04-10 2014-07-16 中央电视台 一种视音频文件存储、下载的方法及系统
CN105072368A (zh) * 2015-08-25 2015-11-18 成都秋雷科技有限责任公司 一种视频解码数据存储方法

Family Cites Families (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7110664B2 (en) * 2001-04-20 2006-09-19 Front Porch Digital, Inc. Methods and apparatus for indexing and archiving encoded audio-video data
US8214516B2 (en) * 2006-01-06 2012-07-03 Google Inc. Dynamic media serving infrastructure
CN101261865B (zh) * 2007-04-20 2012-07-04 炬力集成电路设计有限公司 媒体电子文件的制作方法、装置及其播放设备及方法
CN101917581A (zh) * 2009-11-17 2010-12-15 新奥特(北京)视频技术有限公司 多媒体数据处理进度的展示方法及装置
CN102739417B (zh) * 2011-04-01 2014-08-20 华为技术有限公司 流媒体业务处理系统及故障检测方法
CN102256162B (zh) * 2011-07-22 2013-11-06 网宿科技股份有限公司 基于实时文件格式转换的优化流媒体点播的方法和系统
CN102510519A (zh) * 2011-10-11 2012-06-20 成都市华为赛门铁克科技有限公司 流媒体数据的处理方法、播放方法以及装置
US10761944B2 (en) * 2014-02-11 2020-09-01 Netapp, Inc. Techniques for deduplication of media content
WO2015196394A1 (en) * 2014-06-25 2015-12-30 SZ DJI Technology Co., Ltd. Multimedia file repair methods and apparatus
CN104883626A (zh) * 2015-05-22 2015-09-02 深圳市九洲电器有限公司 流媒体管理方法及系统
WO2017035787A1 (zh) * 2015-09-01 2017-03-09 深圳好视网络科技有限公司 一种流媒体文件的存储方法、装置和系统
CN105898551A (zh) * 2015-12-18 2016-08-24 乐视云计算有限公司 网络视频播放方法及装置
CN107622067B (zh) * 2016-07-13 2020-11-20 杭州海康威视数字技术股份有限公司 一种对多个多媒体文件的存储、读取和显示方法及装置
CN107302715A (zh) * 2017-08-10 2017-10-27 北京元心科技有限公司 多媒体文件的播放方法、封装方法以及相应的装置、终端
CN109743614A (zh) * 2019-01-03 2019-05-10 北京大米科技有限公司 一种数据存储的方法、装置及电子设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102447673A (zh) * 2010-09-30 2012-05-09 突触计算机系统(上海)有限公司 一种用于解封装携有封装格式的多媒体文件的方法与设备
CN102769638A (zh) * 2011-05-05 2012-11-07 腾讯科技(深圳)有限公司 一种下载文件的方法、装置及系统
CN103002353A (zh) * 2011-09-16 2013-03-27 杭州海康威视数字技术股份有限公司 对多媒体文件进行封装的方法及装置
CN102802022A (zh) * 2012-08-28 2012-11-28 曙光信息产业(北京)有限公司 编解码系统和方法
CN103929478A (zh) * 2014-04-10 2014-07-16 中央电视台 一种视音频文件存储、下载的方法及系统
CN105072368A (zh) * 2015-08-25 2015-11-18 成都秋雷科技有限责任公司 一种视频解码数据存储方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3989082A4 *

Also Published As

Publication number Publication date
EP3989082A4 (en) 2022-08-10
US20220365959A1 (en) 2022-11-17
CN112287127A (zh) 2021-01-29
EP3989082A1 (en) 2022-04-27
CN112287127B (zh) 2022-10-14

Similar Documents

Publication Publication Date Title
CN104380278B (zh) 用于客户端管理会话持续性的设备、系统和方法
CN111277869B (zh) 视频播放方法、装置、设备和存储介质
US9864538B1 (en) Data size reduction
JP5775523B2 (ja) メモリカードを有するクライアントデバイス用のクラウドコンピューティングサービス方法およびシステム
JP6258312B2 (ja) 複数の異なるビデオ圧縮技術に対応する単一のkvmクライアントに対するシステムおよび方法
CN105144121A (zh) 高速缓存内容可寻址数据块以供存储虚拟化
WO2015106692A1 (en) Webpage pushing method, client, server, and system
CN102368249B (zh) 一种ie内核浏览器的页面下载控制方法和系统
US11233838B2 (en) System and method of web streaming media content
US8499055B2 (en) File decoding system and method
CN102542858B (zh) 课程播放方法和系统
US8706803B1 (en) Client-side generation of preliminary version of network page
WO2021012723A1 (zh) 多媒体文件存储、读取方法
CN113742518A (zh) 存储和提供视频的方法、设备和计算机程序产品
JP2019517692A (ja) OpenFabricsにおけるスループットの改善
US11868819B2 (en) System and method for constructing filter graph-based media processing pipelines in a browser
US11243879B2 (en) Data storage optimization for non-volatile memory
CN110049133B (zh) 一种dns区文件全量下发的方法和装置
US10915270B2 (en) Random file I/O and chunked data upload
CN113726838B (zh) 文件传输方法、装置、设备及存储介质
CN103036929A (zh) 多媒体文件的处理方法及通信系统中的网络侧设备
US20070168352A1 (en) Middleware scalability with distributed caching
CN111030856B (zh) 一种基于云的数据接入方法、电子设备及计算机可读介质
US10880583B2 (en) Method, apparatus, terminal, and readable storage medium for offline caching
CN116257707B (zh) 一种应用发布方法、装置、电子设备及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20843920

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2020843920

Country of ref document: EP

Effective date: 20220119

NENP Non-entry into the national phase

Ref country code: DE