Media file processing methods, devices and electronic devices

By parsing only the media files used for playback during the startup phase, generating streaming media information, and supporting on-demand display and switching of media resources, the problem of startup delay in multimedia playback is solved, enabling fast startup and flexible switching of media content, thus improving the user experience.

CN116112473BActive Publication Date: 2025-10-31TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111326215.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-10
Publication Date
2025-10-31
Estimated Expiration
2041-11-10

AI Technical Summary

Technical Problem

The long playback delay caused by parsing a large number of files during multimedia playback affects the user experience.

Method used

During the initial playback phase, only the media files used for playback are parsed, streaming media information is generated, and target data is transmitted to the data processing component, reducing the parsing of other media files and supporting on-demand display and switching of media resources.

Benefits of technology

Significantly reduces the amount of data processing during the launch phase, increases launch speed, supports rapid switching of media content, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116112473B_ABST
    Figure CN116112473B_ABST
Patent Text Reader

Abstract

This application discloses a media file processing method, apparatus, and electronic device. The method is applied to a media file processing component and a data processing component, including: the media file processing component determining first descriptive information in a first file, wherein the media file corresponding to the first descriptive information is a media file for playback; accessing a third file based on the first descriptive information, parsing the corresponding media file, and generating streaming media information, wherein the third file is a second file corresponding to the first descriptive information; and generating target data based on the streaming media information and the second descriptive information, wherein the second descriptive information represents other descriptive information in the first file besides the first descriptive information. The media file processing component transmits the target data to the data processing component to trigger the data processing component to play the media content corresponding to the target data. This application embodiment can improve the startup speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of multimedia technology, and in particular to media file processing methods, apparatus and electronic devices. Background Technology

[0002] In multimedia playback scenarios, related technologies require parsing and processing a large amount of information involved in the multimedia, and playback can only be started after obtaining the parsing results. This results in a long playback delay, and the slow playback startup speed significantly affects the user experience. Summary of the Invention

[0003] In order to reduce startup delay, achieve rapid startup, and optimize user experience, embodiments of this application provide a media file processing method, apparatus, and electronic device.

[0004] On one hand, embodiments of this application provide a media file processing method applied to an application, the application including a media file processing component and a data processing component, the method including:

[0005] The media file processing component processes the first file to obtain target data. The first file is used to record at least one descriptive information. Each descriptive information points to a corresponding second file. The second file is used to record at least one media file associated with the descriptive information. The media file is used to record media content.

[0006] The media file processing component transmits the target data to the data processing component to trigger the data processing component to play the media content corresponding to the target data;

[0007] The media file processing component processes the first file to obtain target data, including:

[0008] First description information is determined in the first file, and the media file corresponding to the first description information is a media file for playback;

[0009] Based on the first description information, access the third file and parse the media file corresponding to the third file to generate streaming media information, wherein the third file is the second file corresponding to the first description information;

[0010] The target data is generated based on the streaming media information and the second description information, wherein the second description information represents other description information in the first file besides the first description information.

[0011] On the other hand, embodiments of this application provide a media file processing apparatus for use in an application, the application including a media file processing component and a data processing component, the apparatus including:

[0012] The media file processing component is used to process based on a first file to obtain target data. The first file is used to record at least one descriptive information, each descriptive information points to a corresponding second file, and the second file is used to record at least one media file associated with the descriptive information. The media file is used to record media content.

[0013] The media file processing component is also used to transmit the target data to the data processing component to trigger the data processing component to play the media content corresponding to the target data;

[0014] The media file processing component includes:

[0015] The first description information determination module is used to determine first description information in the first file, wherein the media file corresponding to the first description information is a media file for playback;

[0016] The streaming media information generation module is used to access a third file based on the first description information, and to parse the media file corresponding to the third file to generate streaming media information, wherein the third file is the second file corresponding to the first description information;

[0017] The target data generation module is used to generate the target data based on the streaming media information and the second description information, wherein the second description information represents other description information in the first file besides the first description information.

[0018] On the other hand, embodiments of this application provide a computer-readable storage medium storing at least one instruction or at least one program, wherein the at least one instruction or at least one program is loaded and executed by a processor to implement the media file processing method described above.

[0019] On the other hand, embodiments of this application provide an electronic device, including at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements the aforementioned media file processing method by executing the instructions stored in the memory.

[0020] On the other hand, embodiments of this application provide a computer program product, including a computer program or instructions, which, when executed by a processor, implement the aforementioned media file processing method.

[0021] This application provides a media file processing method, apparatus, and electronic device. During the playback phase, streaming media information is generated by parsing the media file used for playback, thereby meeting media playback requirements. For other media resources that do not require immediate playback, only the relevant descriptive files can be accessed to provide descriptive information to the user. Compared to related technologies, this method eliminates the need to parse every single media file. On-demand parsing of media files significantly reduces the number of descriptive files and media files that need to be parsed, reduces the amount of data processed during the playback phase, and improves playback speed. Furthermore, it can display parameters of available media resources to the user and support media switching based on the user's selection of media resources, thereby significantly improving the user experience. Further, this application can support rapid switching of video data carrying audio and rapid switching of audio, video, and subtitles, thereby comprehensively improving the user experience. Attached Figure Description

[0022] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a schematic diagram of the media file organization structure in the related technologies provided in the embodiments of this application;

[0024] Figure 2 This is a schematic diagram of the data structure of the first file provided in the embodiments of this application;

[0025] Figure 3 This is a schematic diagram of a feasible implementation framework for the media file processing method provided in the embodiments of this application;

[0026] Figure 4 This is a schematic flowchart of a media file processing method provided in an embodiment of this application;

[0027] Figure 5 This is a schematic diagram of the file corresponding to the first description information provided in the embodiments of this application;

[0028] Figure 6 This is a media file processing interaction diagram in a scenario provided by an embodiment of this application;

[0029] Figure 7 This is a block diagram of the media file processing apparatus provided in the embodiments of this application;

[0030] Figure 8 This is a block diagram of the media file processing component provided in the embodiments of this application;

[0031] Figure 9 This is a schematic diagram of the hardware structure of a device for implementing the method provided in the embodiments of this application. Detailed Implementation

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

[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the present application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.

[0034] To make the objectives, technical solutions, and advantages disclosed in the embodiments of this application clearer, the embodiments of this application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of this application and are not intended to limit the embodiments of this application.

[0035] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this embodiment, unless otherwise stated, "multiple" means two or more. To facilitate understanding of the above-described technical solutions and their resulting technical effects in the embodiments of this application, the embodiments of this application first explain the relevant technical terms:

[0036] HLS: HTTP Live Streaming, is an adaptive bitrate streaming media transmission protocol based on HTTP. HLS is a dynamic bitrate adaptive technology primarily used for audio and video services, including m3u8 media description files, media segment files, and encrypted string files. The segmentation method of the HLS protocol generates a large number of files, and storing or processing these files results in significant resource waste, thus impacting request speed. Therefore, the HLS protocol has strict requirements for storage I / O. Some optimization techniques allow segment files to be stored in memory instead of disk. This technique reduces file fragmentation on the server's disk, significantly decreasing disk I / O operations, extending the server's disk lifespan, and improving server stability. Simultaneously, this technology allows terminal data requests to be retrieved directly from the server's memory, improving response speed to terminal data requests and optimizing the video viewing experience.

[0037] HTTP: Hypertext Transfer Protocol. It is a simple request-response protocol that specifies the data format of messages that a client may send to a server and the data format of the responses it receives, making development and deployment straightforward.

[0038] FFmpeg: Fast Forward MPEG, an open-source software community. FFmpeg is a suite of open-source computer programs used to record, convert, and stream digital audio and video. It provides a complete solution for recording, converting, and streaming audio and video. It includes advanced audio / video codec libraries, can be compiled and run on various operating system environments, and has powerful features such as video capture, video format conversion, video screenshotting, and adding watermarks to videos.

[0039] MPEG: Moving Picture Experts Group. It is an organization established in 1988 by ISO (International Organization for Standardization) and IEC (International Electrotechnical Commission) specifically for developing international standards for motion picture and audio compression.

[0040] m3u8 is a media description file format, essentially a plain text file format. A media player can play the corresponding media file based on the description information recorded in the m3u8 file. This format can store media playlists, meaning it can provide an index pointing to media files in other locations.

[0041] Please refer to Figure 1 It shows a schematic diagram of the media file organization structure in related technologies. Figure 1 The structure includes three levels: a master playlist, a media playlist, and a media file. Both the master playlist and the media playlist can be recorded using m3u8 format files. In this embodiment, the file containing the master playlist can be referred to as the first file. The first file records at least one descriptive information, each descriptive information corresponding to a media playlist. Each media playlist corresponds to a second file, and both the first and second files are in m3u8 format. The descriptive information in the first file includes the address of each second file and the relevant descriptive parameters of the media files within that second file. Each second file includes the address of a media file under the corresponding media playlist, thus allowing the corresponding media file to be obtained based on the second file. The media file stores the actual media content data; only the parsed result obtained from parsing the media file can be played by the player. In this embodiment, the data in the media file is organized in the form of slices.

[0042] Please refer to Figure 2 The diagram illustrates the data structure of the first file. This first file includes 5 subtitle descriptions, 2 audio track descriptions, and 7 video descriptions. The descriptions can be in the form of links. Each subtitle, audio track, or video description points to a second file address and also includes description parameters for the media file within that second file. Taking the first subtitle description as an example, it can be seen that the subtitle in its corresponding media file is in English.

[0043] Before playback, the relevant technology needs to parse and process the first file, each second file, and the corresponding media file for each second file before playback can begin. Figure 1 For example, the first file records seven descriptive information entries, each pointing to one of the seven second files. The media files corresponding to these seven second files are a video file with a resolution of 1920*1080, a video file with a resolution of 1280*720, a video file with a resolution of 640*480, an English audio file, a Chinese audio file, an English subtitle file, and a Chinese subtitle file. Playback can only begin after all the segments in the media files corresponding to these seven second files have been parsed. Obviously, this process takes a lot of time, resulting in a long delay in starting playback and affecting the user experience.

[0044] This application embodiment believes that the large number of files that need to be parsed and the large amount of data that need to be processed before playback are important reasons for the long playback delay in related technologies. In order to reduce the playback delay and achieve the goal of fast playback, this application embodiment provides a media file processing method.

[0045] This application's embodiments may involve cloud technology. Cloud technology refers to a hosting technology that unifies hardware, software, network, and other resources within a wide area network (WAN) or local area network (LAN) to achieve data computation, storage, processing, and sharing. Cloud technology is a general term for network technology, information technology, integration technology, management platform technology, and application technology applied based on the cloud computing business model. It can form resource pools, be used on demand, and is flexible and convenient. Cloud computing technology will become an important support. The backend services of technical network systems require a large amount of computing and storage resources, such as video websites, image websites, and many portal websites. With the rapid development and application of the internet industry, in the future, every item may have its own identification mark, which will need to be transmitted to the backend system for logical processing. Data of different levels will be processed separately, and various industry data will all require strong system support, which can only be achieved through cloud computing.

[0046] The methods provided in this application embodiment can also involve blockchain, meaning that the methods provided in this application embodiment can be implemented based on blockchain, or the data involved in the methods provided in this application embodiment can be stored based on blockchain, or the executing entity of the methods provided in this application embodiment can be located in blockchain. Blockchain is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Essentially, a blockchain is a decentralized database, a chain of data blocks linked using cryptographic methods. Each data block contains information about a batch of network transactions, used to verify the validity of the information (anti-counterfeiting) and generate the next block. A blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer.

[0047] The underlying blockchain platform can include processing modules such as user management, basic services, smart contracts, and operational monitoring. The user management module is responsible for managing the identity information of all blockchain participants, including maintaining public and private key generation (account management), key management, and maintaining the correspondence between user real identities and blockchain addresses (access management). Furthermore, under authorization, it monitors and audits transactions of certain real identities and provides risk control rule configuration (risk control audit). The basic services module is deployed on all blockchain node devices to verify the validity of business requests. After consensus is reached on valid requests, they are recorded in storage. For a new business request, the basic services first perform interface adaptation parsing and authentication (interface adaptation), and then encrypt the business information through a consensus algorithm (consensus management). After encryption, the data is transmitted completely and consistently to the shared ledger (network communication) and recorded and stored. The smart contract module is responsible for contract registration, issuance, triggering, and execution. Developers can define contract logic using a programming language and publish it to the blockchain (contract registration). According to the contract terms, the key or other events are invoked to trigger execution and complete the contract logic. It also provides functions for contract upgrades and cancellations. The operation monitoring module is mainly responsible for deployment, configuration modification, contract settings, cloud adaptation, and real-time status visualization output during product release, such as alarms, monitoring network conditions, and monitoring the health status of node devices.

[0048] The platform's product service layer provides the basic capabilities and implementation frameworks for typical applications. Developers can leverage these basic capabilities, along with the specific characteristics of their business needs, to implement blockchain-based business logic. The application service layer provides blockchain-based application services to business stakeholders.

[0049] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating a feasible implementation framework for the media file processing method provided in the embodiments of this specification, such as... Figure 1 As shown, the implementation framework may include at least a terminal device 01 and a server 02. The server 02 can respond to a request from the terminal device 01 by sending a first file, a second file, and a media file to the terminal device 01. The terminal device 01 then performs playback processing based on the first file, the second file, and the media file. Specifically, the terminal device 01 may include, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, and in-vehicle terminals. This invention can be applied to various scenarios related to media playback, such as video playback and audio playback. This application embodiment can also be combined with technologies in other fields to expand application scenarios. These other fields include, but are not limited to, cloud technology, artificial intelligence, smart transportation, assisted driving, video media, instant messaging, data processing, and network interaction.

[0050] The application in terminal device 01 can play media data. Specifically, the application may include a media file processing component 011 and a data processing component 012. The data processing component 012 includes a player 012A and an application component 012B. The media file processing component 011 processes a first file to obtain target data. The first file records at least one descriptive information, each descriptive information pointing to a corresponding second file. The second file records at least one media file associated with the descriptive information, and the media file records media content. The media file processing component 011 transmits the target data to the data processing component 012 to trigger the data processing component 012 to play the media content corresponding to the target data. The aforementioned media file processing component 011 processes a first file to obtain target data, including: determining first descriptive information in the first file, wherein the media file corresponding to the first descriptive information is a media file for playback; accessing a third file based on the first descriptive information, and parsing the media file corresponding to the third file to generate streaming media information, wherein the third file is a second file corresponding to the first descriptive information; and generating the target data based on the streaming media information and the second descriptive information, wherein the second descriptive information represents other descriptive information in the first file besides the first descriptive information. The player 012A in the aforementioned data processing component 012 can play media content, and the application component 012B can present descriptive information and provide visual-based interaction.

[0051] The following describes a media file processing method according to an embodiment of this application, which can be applied to... Figure 1 The application of the terminal device 01 includes a media file processing component and a data processing component. Figure 4 This illustration shows a flowchart of a media file processing method according to an embodiment of this application. The embodiment provides the method operation steps described in the embodiments or flowchart, but based on conventional or non-inventive methods, more or fewer operation steps may be included. The order of steps listed in the embodiments is merely one possible execution order among many and does not represent the only possible execution order. In actual systems, terminal devices, or server products, the method can be executed sequentially according to the embodiments or drawings, or in parallel (e.g., in a parallel processor or multi-threaded processing environment). The above method may include:

[0052] S101. The media file processing component above processes the first file to obtain target data. The first file is used to record at least one descriptive information. Each of the descriptive information points to a corresponding second file. The second file is used to record at least one media file associated with the descriptive information. The media file is used to record media content.

[0053] Please refer to Figure 1 The file containing the master playlist can be called the first file. The first file records at least one descriptive information, with each descriptive information corresponding to a media playlist. Each media playlist corresponds to a second file. The descriptive information in the first file includes the address of each second file and the relevant descriptive parameters of the media files within that second file. Each second file includes the addresses of the media files under its corresponding media playlist. Only media files contain media content; that is, parsing the media files is necessary to obtain valid data that can be played by the player.

[0054] The aforementioned media file processing component processes the first file to obtain target data, including:

[0055] S1011. First description information is determined in the first file mentioned above, and the media file corresponding to the first description information is a media file for playback.

[0056] To improve playback speed, this embodiment only parses the media file currently used for playback during the playback phase, while omitting other media files and related second files. This application does not limit the method for selecting the media file currently used for playback.

[0057] In one embodiment, target parameters can be preset according to actual conditions, and the description information matched by the target parameters is the first description information. For example, the preset target parameters are as follows: resolution: 1080*1280, subtitles: English. Then, the description information carrying the resolution parameter pointing to 1080*1280 and the description information carrying the subtitle parameter pointing to English are the first description information.

[0058] In another embodiment, the first file may include multiple types of descriptive information. Specifically, the descriptive information can be divided into subtitle descriptive information, audio track descriptive information, and video descriptive information. All types of descriptive information are recorded in the first file. The first file can be traversed, and for each type of descriptive information, the first descriptive information extracted from that type is taken as the first descriptive information. Figure 2 For example, the three descriptive information pieces covered by the box are all the first descriptive information.

[0059] S1012. Access the third file based on the first description information above, and parse the media file corresponding to the third file above to generate streaming media information, wherein the third file above is the second file corresponding to the first description information above.

[0060] Please refer to Figure 5It shows a schematic diagram of the file corresponding to the first description information, which is similar to... Figure 1 The files in this application are identical; the difference lies in that only the media files corresponding to the three selected second files are accessed in this embodiment. In other words, all three selected second files are third files. By selecting only the media files corresponding to three of the many second files for parsing and generating corresponding streaming media information, the amount of data processing is significantly reduced compared to related technologies that parse all second files and their corresponding media files.

[0061] In this application embodiment, streaming media information can be represented as stream info. This application does not limit the data structure of stream info; stream info only needs to be parsed and applied by the player component.

[0062] S1013. Generate the target data based on the streaming media information and the second description information, wherein the second description information represents other description information in the first file besides the first description information.

[0063] For the second description information, the media content in the corresponding media file of the second file does not need to be parsed for the time being; only the second description information needs to be obtained and transmitted to the upper-layer data processing component. The purpose of transmitting the second description information to the upper-layer data processing component is to enable the upper-layer data processing component to display the second description information, so that the user is aware that other media files can be selected for playback. This allows for playback switching when the user wishes to select the media file related to the second description information. In this way, both quick start-up and playback switching functionality are achieved, significantly improving the user experience.

[0064] This application can employ different data processing methods for different media content to generate corresponding target data. In one embodiment, the media content cannot distinguish between different audio tracks and subtitles, but is directly composed of video frames carrying audio content. In this case, the description information in the first file mentioned above includes a first parameter, which includes parameters corresponding to the video media carrying audio information, such as resolution parameters, bitrate parameters, etc. Generating the target data based on the streaming media information and the second description information includes: generating first information based on the second description information, wherein the first information is used to record the correspondence between the second information and the second file corresponding to the second information, and the second information is characterized by the first parameter pointed to by the second description information. The target data is generated based on the first information and the streaming media information.

[0065] In one embodiment, the target data can be represented using a private data structure, which only needs to be agreed upon with the application component and the player component. However, the private data structure is not compatible with the FFmpeg component. In many cases, the media file processing component can be developed based on FFmpeg, and the private data structure may have problems with poor scalability. In another embodiment, a data structure compatible with the FFmpeg component can be used, and in this case, the scalability can be better.

[0066] In one embodiment, media content can be distinguished into video, audio, subtitles, or audio tracks. Single video data, audio data, subtitle data, and audio track data can each independently generate corresponding media content and obtain corresponding media files. In this case, the description information in the above first file includes a second parameter, and the second parameter includes at least one of video parameters, audio parameters, subtitle parameters, and audio track parameters. Generating the above target data according to the above streaming media information and the second description information includes: generating a third information according to the above second description information, where the third information is used to record the correspondence between the fourth information and the second file corresponding to the fourth information, and the fourth information is characterized by the above second parameter pointed to by the above second description information. Generating the above target data according to the above third information and the above streaming media information. For example, Figure 1 、 Figure 2 is obviously the media file organization method corresponding to this case.

[0067] In the embodiments of the present application, the above first information or third information can both be information compatible with the above streaming media information, so that both the first information and the third information can be represented by stream info. stream info can be recognized by the player component and is also compatible with the FFmpeg component, which can fully ensure the scalability of the solution.

[0068] S102. The above media file processing component transmits the above target data to the above data processing component to trigger the above data processing component to play the media content corresponding to the above target data.

[0069] The above data processing component includes a player component and an application component. The above media file processing component transmits the above target data to the above data processing component to trigger the above data processing component to play the media content corresponding to the above target data, including: the above media file processing component generates a fifth information according to the above target data, the fifth information includes the description information in the above streaming media information, and the fifth information further includes the above first information or the above third information, and transmits the fifth information to the above application component via the above player component.

[0070] For example, the first file includes nine descriptive information items, of which the first, third, and fifth descriptive information items are the first descriptive information items and are recorded in the streaming media information. The other descriptive information items are recorded in the first information or the third information. It can be seen that the target data also includes the content corresponding to these nine descriptive information items. In one embodiment, the descriptive information items in the target data can be sequentially matched with the descriptive information items in the first file. Taking the nine descriptive information items in the first file stored in array A[9] as an example, the fifth information can be stored in B[9]. Obviously, the elements with the same index in A[9] and B[9] have a descriptive information correspondence relationship. This correspondence relationship helps to strengthen the connection between data and quickly switch playback. This application does not limit the data structure of the fifth information. In the embodiments of this application, it is represented in the form of track info. The specific structure of track info can be set according to the actual situation. This application embodiment will not elaborate on this.

[0071] After transmitting the fifth information to the application component via the player component, the method further includes: the player component playing the streaming media information and obtaining the second file corresponding to the description information in the streaming media information within the fifth information; parsing the media file corresponding to the second file to generate first streaming media data; and playing the first streaming media data. Figure 5 For example, the media files corresponding to the 1st, 4th, and 6th second files are parsed to generate the first streaming media data, which is then played through the player component. In other words, the media files corresponding to the second files pointed to by the description information of B[0], B[3], and B[5] are parsed and played.

[0072] In one embodiment, after transmitting the fifth information to the application component via the player component, the method further includes: the application component displaying the first information or the third information from the fifth information. Still using... Figure 5 For example, the second, third, fifth, and seventh files do not need to be parsed; only the relevant descriptive information needs to be displayed. That is, the descriptive information corresponding to B[1], B[2], B[4], and B[6] can be directly displayed, i.e., the resolution options are 1280*720 and 640*460, the subtitle option is Chinese, and the audio option is Chinese.

[0073] After the application component displays the first or third information in the fifth information, the method further includes: determining target information, where the target information is the descriptive information in the first or third information; switching the currently playing streaming media data from the first streaming media data to the second streaming media data, where the second streaming media data is obtained by parsing the media file corresponding to the second file corresponding to the target information.

[0074] Following the previous example, if the user selects the resolution option 1280*720, the stream obtained by parsing the media file corresponding to the second file corresponding to B[0] can be closed, and the stream obtained by parsing the media file corresponding to the second file corresponding to B[1] can be opened. Obviously, the correspondence between A[9] and B[9] can speed up the stream switching speed and quickly locate the closed stream and the opened stream.

[0075] Please refer to Figure 6 This diagram illustrates the interaction process of media file processing in a given scenario. The interaction process includes:

[0076] S301. In response to the open command, the application downloads and parses the first file (masterplaylist) from the server.

[0077] In one embodiment, the master playlist of the first file can be displayed in the application interface.

[0078] S302. Determine the first description information in the master playlist, download and parse the second file corresponding to the first description information, and obtain the mediaplaylist corresponding to the second file.

[0079] S303. Based on reading the media file (mediafile) in the mediaplaylist, the streaming media information (streaminfo) required for playback is parsed.

[0080] S304. Generate second description information for other description information in masterplaylist.

[0081] S305. Generate fifth information track info based on streaming media information and second description information, and send the fifth information track info to the application component via the player component.

[0082] S306. When it is necessary to switch playback, select at least one description information from the fifth information.

[0083] Specifically, the application can use the encapsulated getTrackinfo function to obtain the description information in the fifth message, and use the selectTrack function to select a specific description information in the fifth message.

[0084] S307. Download and parse the second file corresponding to the selected description information to obtain the corresponding mediaplaylist.

[0085] S308. Parse the media files in the mediaplaylist to obtain streaming media data.

[0086] S309. Transfer the newly acquired media data to the player component, discard the stream currently being played that was replaced by the media data, close the second file and media file corresponding to the stream, and complete the playback switch.

[0087] This application provides a media file processing method that eliminates the need to parse large amounts of descriptive and media files during the playback phase, significantly reducing the amount of data processed and improving playback speed. Furthermore, it displays parameters of available media resources to the user and supports media switching based on user selection, thereby significantly enhancing the user experience. The design of the relevant data structures also considers scalability and rapid location of descriptive information, ensuring that the technical solution in this application not only significantly improves media playback speed but also possesses good scalability.

[0088] Furthermore, embodiments of this application can support rapid switching of video data carrying audio, as well as rapid switching of audio, video, and subtitles, thereby comprehensively improving the user experience.

[0089] Please refer to Figure 7 This diagram illustrates a block diagram of a media file processing apparatus according to this embodiment, applied to an application program that includes a media file processing component 101 and a data processing component 102. The apparatus includes:

[0090] The aforementioned media file processing component 101 is used to process based on a first file to obtain target data. The first file is used to record at least one descriptive information, each of the aforementioned descriptive information points to a corresponding second file, and the second file is used to record at least one media file associated with the aforementioned descriptive information. The media file is used to record media content.

[0091] The aforementioned media file processing component 101 is also used to transmit the aforementioned target data to the aforementioned data processing component, so as to trigger the aforementioned data processing component to play the media content corresponding to the aforementioned target data.

[0092] The aforementioned media file processing component 101, such as Figure 8 As shown, it includes:

[0093] The first description information determination module 1011 is used to determine first description information in the first file, wherein the media file corresponding to the first description information is a media file for playback.

[0094] The streaming media information generation module 1012 is used to access a third file based on the first description information and parse the media file corresponding to the third file to generate streaming media information, wherein the third file is the second file corresponding to the first description information.

[0095] The target data generation module 1013 is used to generate the target data based on the streaming media information and the second description information, wherein the second description information represents other description information in the first file besides the first description information.

[0096] In one embodiment, the description information in the first file includes a first parameter, which includes parameters corresponding to the video media carrying audio information. The target data generation module 1013 is used to perform the following operations:

[0097] First information is generated based on the second description information. The first information is used to record the correspondence between the second information and the second file corresponding to the second information. The second information is characterized by the first parameter pointed to by the second description information.

[0098] Based on the aforementioned first information and the aforementioned streaming media information, the aforementioned target data is generated.

[0099] In one embodiment, the description information in the first file includes a second parameter, which includes at least one of video parameters, audio parameters, subtitle parameters, and audio track parameters. The target data generation module 1013 is configured to perform the following operations:

[0100] The third information is generated based on the second description information. The third information is used to record the fourth information and the correspondence between the fourth information and the second file. The fourth information is characterized by the second parameter pointed to by the second description information.

[0101] Based on the aforementioned third information and the aforementioned streaming media information, the aforementioned target data is generated.

[0102] In one embodiment, the first information or the third information described above is information compatible with the streaming media information described above.

[0103] In one embodiment, the data processing component 102 includes a player component 1021 and an application component 1022. The media file processing component 101 is further configured to generate fifth information based on the target data. The fifth information includes descriptive information in the streaming media information and also includes the first information or the third information. The fifth information is then transmitted to the application component 1022 via the player component 1021.

[0104] In one embodiment, the player component 1021 is further configured to perform the following operations:

[0105] Play the aforementioned streaming media information, and obtain the second file corresponding to the description information in the aforementioned streaming media information in the fifth piece of information;

[0106] The media file corresponding to the second file is parsed to generate the first streaming media data, which is then played.

[0107] In one embodiment, the application component 1022 is further configured to perform the following operations:

[0108] The aforementioned application component displays either the first or third information in the fifth information.

[0109] In one embodiment, the application component 1022 is further configured to perform the following operation: determine target information, wherein the target information is the description information in the first information or the third information.

[0110] Accordingly, the aforementioned player component 1021 is also used to perform the following operation: switching the currently playing streaming media data from the aforementioned first streaming media data to second streaming media data, wherein the aforementioned second streaming media data is obtained by parsing the media file corresponding to the second file corresponding to the aforementioned target information.

[0111] Specifically, the media file processing apparatus disclosed in this application and the corresponding method embodiments described above are both based on the same inventive concept. For details, please refer to the method embodiments, which will not be repeated here.

[0112] This application also provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the aforementioned media file processing method.

[0113] This application also provides a computer-readable storage medium that can store multiple instructions. These instructions are adaptable for a processor to load and execute the media file processing method described in this application.

[0114] In one embodiment, the media file processing method described above is applied to an application, the application including a media file processing component and a data processing component, and the method includes:

[0115] The aforementioned media file processing component processes the first file to obtain target data. The first file is used to record at least one descriptive information, and each of the aforementioned descriptive information points to a corresponding second file. The second file is used to record at least one media file associated with the aforementioned descriptive information, and the media file is used to record media content.

[0116] The aforementioned media file processing component transmits the aforementioned target data to the aforementioned data processing component, thereby triggering the aforementioned data processing component to play the media content corresponding to the aforementioned target data;

[0117] The aforementioned media file processing component processes the first file to obtain target data, including:

[0118] The first description information is determined in the first file mentioned above, and the media file corresponding to the first description information is a media file used for playback;

[0119] Based on the first description information above, access the third file and parse the media file corresponding to the third file to generate streaming media information. The third file is the second file corresponding to the first description information above.

[0120] Based on the aforementioned streaming media information and the second description information, the aforementioned target data is generated, wherein the aforementioned second description information represents other description information in the aforementioned first file besides the aforementioned first description information.

[0121] In another embodiment, the description information in the first file includes a first parameter, which includes parameters corresponding to the video media carrying audio information. Generating the target data based on the streaming media information and the second description information includes:

[0122] First information is generated based on the second description information. The first information is used to record the correspondence between the second information and the second file corresponding to the second information. The second information is characterized by the first parameter pointed to by the second description information.

[0123] Based on the aforementioned first information and the aforementioned streaming media information, the aforementioned target data is generated.

[0124] In another embodiment, the description information in the first file includes a second parameter, which includes at least one of video parameters, audio parameters, subtitle parameters, and audio track parameters. Generating the target data based on the streaming media information and the second description information includes:

[0125] The third information is generated based on the second description information. The third information is used to record the fourth information and the correspondence between the fourth information and the second file. The fourth information is characterized by the second parameter pointed to by the second description information.

[0126] Based on the aforementioned third information and the aforementioned streaming media information, the aforementioned target data is generated.

[0127] In another embodiment, the first information or the third information described above is information compatible with the streaming media information described above.

[0128] In another embodiment, the data processing component includes a player component and an application component. The media file processing component transmits the target data to the data processing component to trigger the data processing component to play the media content corresponding to the target data, including:

[0129] The media file processing component generates fifth information based on the target data. The fifth information includes the descriptive information in the streaming media information and also includes the first information or the third information. The fifth information is then transmitted to the application component via the player component.

[0130] In another embodiment, after transmitting the fifth information to the application component via the player component, the method further includes:

[0131] The aforementioned player component plays the aforementioned streaming media information and obtains the second file corresponding to the description information in the aforementioned streaming media information in the aforementioned fifth information;

[0132] The media file corresponding to the second file is parsed to generate the first streaming media data, which is then played.

[0133] In another embodiment, after transmitting the fifth information to the application component via the player component, the method further includes:

[0134] The aforementioned application component displays either the first or third information in the fifth information.

[0135] In another embodiment, after the application component displays the first or third information in the fifth information, the method further includes:

[0136] Determine the target information, which is the descriptive information in the first information or the third information mentioned above;

[0137] The currently playing streaming media data is switched from the first streaming media data to the second streaming media data, which is obtained by parsing the media file corresponding to the second file corresponding to the target information.

[0138] Furthermore, Figure 9 A schematic diagram of a hardware structure for implementing the method provided in the embodiments of this application is shown. This device can participate in or include the apparatus or system provided in the embodiments of this application. Figure 9 As shown, device 10 may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 9 The structure shown is for illustrative purposes only and does not limit the structure of the electronic device described above. For example, device 10 may also include a... Figure 9 The more or fewer components shown, or having the same Figure 9 The different configurations shown.

[0139] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the device 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0140] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the method described in the embodiments of this application. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the media file processing method described above. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the device 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0141] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of device 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a radio frequency (RF) module used for wireless communication with the Internet.

[0142] The display may be, for example, a touchscreen liquid crystal display (LCD) that allows a user to interact with the user interface of device 10 (or a mobile device).

[0143] The server is used to implement the server-side media file processing method provided in the above embodiments. Specifically, the server structure may include the test data processing device described above. The server 800 may vary considerably due to different configurations or performance, and may include one or more central processing units (CPUs) 822 (e.g., one or more processors) and memory 832, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 842 or data 844. The memory 832 and storage media 830 may be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown in the figures), each module may include a series of instruction operations on the server. Furthermore, the CPU 822 may be configured to communicate with the storage media 830 and execute a series of instruction operations in the storage media 830 on the server 800. Server 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input / output interfaces 858, and / or one or more operating systems 841, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc. The steps performed in the above method embodiments may be based on this server architecture.

[0144] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, the above description focuses on specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims can be performed in a different order than that shown in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some implementations, multitasking and parallel processing are also possible or may be advantageous.

[0145] The embodiments in this application are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device and server embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0146] Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by hardware or by a program instructing related hardware. The program can be stored in a computer-readable storage medium, such as a read-only memory, a disk, or an optical disk.

[0147] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present application should be included within the protection scope of the present application.

Claims

1. A media file processing method, characterized in that, Applied to an application, the application including a media file processing component and a data processing component, the method includes: The media file processing component processes the first file to obtain target data. The first file is used to record at least one descriptive information. Each descriptive information points to a corresponding second file. The second file is used to record at least one media file associated with the descriptive information. The media file is used to record media content. The media file processing component transmits the target data to the data processing component to trigger the data processing component to play the media content corresponding to the target data; The media file processing component processes the first file to obtain target data, including: First description information is determined in the first file, and the media file corresponding to the first description information is a media file for playback; Based on the first description information, access the third file and parse the media file corresponding to the third file to generate streaming media information, wherein the third file is the second file corresponding to the first description information; The target data is generated based on the streaming media information and the second description information, wherein the second description information represents other description information in the first file besides the first description information.

2. The method according to claim 1, characterized in that, The description information in the first file includes a first parameter, which includes parameters corresponding to the video media carrying audio information. Generating the target data based on the streaming media information and the second description information includes: First information is generated based on the second description information. The first information is used to record the correspondence between the second information and the second file corresponding to the second information. The second information is characterized by the first parameter pointed to by the second description information. The target data is generated based on the first information and the streaming media information.

3. The method according to claim 1, characterized in that, The description information in the first file includes a second parameter, which includes at least one of video parameters, audio parameters, subtitle parameters, and audio track parameters. Generating the target data based on the streaming media information and the second description information includes: The third information is generated based on the second description information. The third information is used to record the fourth information and the correspondence between the fourth information and the second file. The fourth information is characterized by the second parameter pointed to by the second description information. The target data is generated based on the third information and the streaming media information.

4. The method according to claim 2 or 3, characterized in that, The first information or the third information is information compatible with the streaming media information.

5. The method according to claim 4, characterized in that, The data processing component includes a player component and an application component. The media file processing component transmits the target data to the data processing component to trigger the data processing component to play the media content corresponding to the target data, including: The media file processing component generates fifth information based on the target data. The fifth information includes descriptive information from the streaming media information and also includes the first information or the third information. The fifth information is then transmitted to the application component via the player component.

6. The method according to claim 5, characterized in that, After transmitting the fifth information to the application component via the player component, the method further includes: The player component plays the streaming media information and obtains the second file corresponding to the description information in the streaming media information in the fifth information; The media file corresponding to the second file is parsed to generate the first streaming media data, and the first streaming media data is played.

7. The method according to claim 5 or 6, characterized in that, After transmitting the fifth information to the application component via the player component, the method further includes: The application component displays either the first information or the third information in the fifth information.

8. The method according to claim 7, characterized in that, After the application component displays the first or third information in the fifth information, the method further includes: Determine the target information, which is the descriptive information in the first information or the third information; The currently playing streaming media data is switched from the first streaming media data to the second streaming media data, which is obtained by parsing the media file corresponding to the second file corresponding to the target information.

9. A media file processing device, characterized in that, Applied to an application, the application including a media file processing component and a data processing component, the device includes: The media file processing component is used to process based on a first file to obtain target data. The first file is used to record at least one descriptive information, each descriptive information points to a corresponding second file, and the second file is used to record at least one media file associated with the descriptive information. The media file is used to record media content. The media file processing component is also used to transmit the target data to the data processing component to trigger the data processing component to play the media content corresponding to the target data; The media file processing component includes: The first description information determination module is used to determine first description information in the first file, wherein the media file corresponding to the first description information is a media file for playback; The streaming media information generation module is used to access a third file based on the first description information, and to parse the media file corresponding to the third file to generate streaming media information, wherein the third file is the second file corresponding to the first description information; The target data generation module is used to generate the target data based on the streaming media information and the second description information, wherein the second description information represents other description information in the first file besides the first description information.

10. An electronic device, characterized in that, The method includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the at least one processor implements a media file processing method as described in any one of claims 1 to 8 by executing the instructions stored in the memory.

Citation Information

Patent Citations

  • Method, device and system for streaming media transmission

    CN105049873A

  • Fast playback starting method and device of media file

    CN105704515A