Media file switching method and apparatus
Patent Information
- Application Number
- PCT/CN2025/097718
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-05
- Filing Date
- 2025-05-28
- Publication Date
- 2026-01-08
Smart Images

Figure CN2025097718_08012026_PF_FP_ABST
Abstract
Description
Switching method and device of media file
[0001] The present application claims priority to the Chinese patent application No.CN202410904736.5, filed on July 5, 2024, and entitled "Switching method and device of media file", the whole content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] Embodiments of the present application relate to the technical field of Internet, and in particular, to a switching method and device of media file, computer device, computer readable storage medium, computer program product. BACKGROUND
[0003] Although multi-track media is an industry standard, it is currently only used in the scene of local playback because only a small number of browsers support it. When playing multimedia video in a browser, although the media files of multiple tracks can be preprocessed into multiple media files on a server to realize playback and track switching, there is a big difference between preprocessing and playback logic and ordinary media playback logic, which is reflected in that only one media file needs to be downloaded before playing the media, but after using this scheme, at least two media files need to be downloaded, thus increasing the use cost and making it difficult to reuse the existing server and client system.
[0004] It should be noted that the above content is not necessarily prior art, nor is it used to limit the patent protection scope of the present application. SUMMARY
[0005] Embodiments of the present application provide a switching method and device of media file, computer device, computer readable storage medium, computer program product, to solve or alleviate one or more technical problems raised above.
[0006] One aspect of embodiments of the present application provides a switching method of media file, the method comprising:
[0007] obtaining track basic information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information contains a mark bit indicating a main track currently needed to be played;
[0008] in response to a switching event for the played media file, determining a first media file needed to be played from the plurality of media files of different tracks, and adjusting the track basic information so that the main track in the mark bit points to the first media file;
[0009] According to the adjusted track base information, the media file played in the embedded player of the webpage is controlled to be switched.
[0010] Optionally, the adjusting the track base information so that the main track in the flag bit points to the first media file comprises:
[0011] Determining first track information corresponding to the first media file from the track base information, wherein the first track information contains a track number;
[0012] Adjusting the track number in the first track information according to the main track in the flag bit so that the main track in the flag bit points to the first media file.
[0013] Optionally, the adjusting the mapping relationship so that the main track in the flag bit points to the first media file comprises:
[0014] Determining first track information corresponding to the first media file from the track base information, wherein the first track information contains a data mapping address;
[0015] Adjusting the data mapping address in the first track information according to the main track in the flag bit so that the main track in the flag bit points to the first media file.
[0016] Optionally, the adjusting the track base information so that the main track in the flag bit points to the first media file comprises:
[0017] Determining a second media file other than the first media file among the media files of the plurality of different tracks;
[0018] Determining second track information corresponding to the second media file from the track base information, and deleting the track information corresponding to the second media file so that the main track in the flag bit points to the first media file.
[0019] Optionally, the adjusting the track base information so that the main track in the flag bit points to the first media file comprises:
[0020] Determining a second media file other than the first media file among the media files of the plurality of different tracks;
[0021] Determining second track information corresponding to the second media file from the track base information, wherein the second track information contains a Box type;
[0022] adjust a Box type in the second track information based on a preset type, so that a main track in the mark bit points to the first media file.
[0023] Optionally, the second media file comprises one or more media files.
[0024] Optionally, after the step of adjusting the track basic information so that the main track in the mark bit points to the first media file, the method further comprises:
[0025] in a case where a media format of a media file played first in an embedded player of the webpage is different from a media format of the first media file;
[0026] prompting the embedded player of the webpage to adjust a MIME Type type according to the media format of the first media file.
[0027] Another aspect of the embodiments of the present application provides a switching device of a media file, the device comprising:
[0028] a track basic information acquisition module, configured to acquire track basic information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information comprises a mark bit used for indicating a main track currently required to be played;
[0029] a track basic information adjustment module, configured to, in response to a switching event for a played media file, determine a first media file required to be played from the plurality of media files of different tracks, and adjust the track basic information so that the main track in the mark bit points to the first media file;
[0030] a media file switching module, configured to control a switching of a played media file in an embedded player of a webpage according to the adjusted track basic information.
[0031] Another aspect of the embodiments of the present application provides a computer device, comprising:
[0032] at least one processor; and
[0033] a memory connected in communication with the at least one processor;
[0034] wherein: the memory stores computer readable instructions executable by the at least one processor, and the computer readable instructions are executed by the at least one processor to enable the at least one processor to perform the following steps:
[0035] obtaining track basic information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information contains a mark bit indicating a main track to be played currently;
[0036] in response to a switching event for the played media file, determining a first media file to be played from the plurality of media files of different tracks, and adjusting the track basic information so that the main track in the mark bit points to the first media file;
[0037] controlling the media file played in the embedded player of the switching webpage according to the adjusted track basic information.
[0038] Another aspect of the embodiment of the present application provides a computer readable storage medium, which stores computer readable instructions, and the computer readable instructions are executed by a processor to implement the following steps:
[0039] obtaining track basic information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information contains a mark bit indicating a main track to be played currently;
[0040] in response to a switching event for the played media file, determining a first media file to be played from the plurality of media files of different tracks, and adjusting the track basic information so that the main track in the mark bit points to the first media file;
[0041] controlling the media file played in the embedded player of the switching webpage according to the adjusted track basic information.
[0042] Another aspect of the embodiment of the present application provides a computer program product, which includes computer readable instructions, and the computer readable instructions are executed by a processor to implement the following steps:
[0043] obtaining track basic information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information contains a mark bit indicating a main track to be played currently;
[0044] in response to a switching event for the played media file, determining a first media file to be played from the plurality of media files of different tracks, and adjusting the track basic information so that the main track in the mark bit points to the first media file;
[0045] controlling the media file played in the embedded player of the switching webpage according to the adjusted track basic information.
[0046] The embodiment of the present application can have the following advantages: by determining the first media file to be played when the played media file needs to be switched, and modifying the track base information so that the main track in the mark bit points to the first media file, the switching of the media file can be realized in real time before playing the multimedia file by adjusting the track base information, without preprocessing the media file, and the multi-track media can be played and switched on the web-embedded player that does not support multi-track media, and the same seamless switching of the audio or video track as the local player can be realized in the browser, without the problems such as lag, black screen, and jump in playing time. BRIEF DESCRIPTION OF DRAWINGS
[0047] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain exemplary embodiments of the application. The illustrated embodiments are illustrative only and not limiting of the scope of the claims. In all the drawings, like reference numerals refer to like parts throughout the several views.
[0048] Fig. 1 schematically shows a running environment diagram of a media file switching method according to an embodiment of the present application;
[0049] Fig. 2 schematically shows a flowchart of a media file switching method according to an embodiment of the present application;
[0050] Fig. 3 schematically shows a module block diagram of switching of a media file in MP4 format;
[0051] Fig. 4 schematically shows a block diagram of a media file switching device according to an embodiment of the present application; and
[0052] Fig. 5 schematically shows a hardware architecture diagram of a computer device according to an embodiment of the present application. Embodiments of the present application
[0053] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of the present application.
[0054] It should be noted that the terms "first", "second", and the like in the embodiments of the present application are only used for the purpose of description and should not be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features defined with "first", "second" can explicitly or implicitly include at least one of the features. In addition, the technical solutions of various embodiments can be combined with each other, but it must be based on the realization of ordinary skilled in the art, when the combination of technical solutions appears contradictory or unachievable, it should be considered that the combination of technical solutions does not exist, nor within the scope of protection claimed by the present application.
[0055] In the description of the present application, it should be understood that the numerical reference number before the step does not indicate the order of execution of the steps before and after the step, but only for the convenience of describing the present application and distinguishing each step, therefore it should not be understood as a limitation of the present application.
[0056] First, the explanation of the terms involved in the present application is provided:
[0057] Encapsulation format: generally called encapsulation format or container format, is a format used to store audio and video data.
[0058] MP4: MP4 or called MPEG-4 Part 14 is a standard digital multimedia container format. The extension of MPEG-4 Part 14 is.mp4, mainly used to store digital audio and digital video, but also can store subtitles and still images. Because it can accommodate video streams that support bit streams (such as advanced video encoding), it is a streaming media. The format of MP4 stores various data in units of Box, and a Box can contain another Box.
[0059] Track: Common media files contain audio and video, and the audio and video are generally called audio track and video track. Generally, a media file contains only one audio track and one video track, but many encapsulation formats support multiple tracks.
[0060] MediaSource: Media Source Extensions API or MSE, is a media playback interface provided by the browser to the developer, which allows playing audio and video files generated by program code, instead of only playing audio and video from files or network addresses.
[0061] MIME Type: Multipurpose Internet Mail Extensions (MIME) is an Internet standard. Browsers usually use MIME types (not file extensions) to determine how to handle URLs, so it is important for web servers to add the correct MIME type in the response header. If the configuration is not correct, the browser may not be able to parse the file content, the website will not work properly, and the downloaded file will be misprocessed. In MediaSource, the MIME Type is needed to tell the browser the current playing audio and video format.
[0062] Secondly, in order to facilitate the understanding of the technical personnel in the art, the related art is explained as follows:
[0063] The MP4 format container supports storing multiple audio and video tracks. Most local players support switching the currently playing track at any time when playing multi-track media files.
[0064] In the web browser standard, track switching can be performed by controlling the enabled attribute of audioTracks and videoTracks, but the new version and most browser kernels on the market do not support this function.
[0065] In view of the poor support of browsers for multi-track media format, most solutions store tracks in multiple media files, so that each media file has only one audio or video track. Each time the video track file and the audio track file to be played are downloaded, and then played through the MediaSource interface provided by the browser.
[0066] Although multi-track media is an industry standard, it is only supported by a small number of browsers, so it is currently only used in the scene of local playback. When playing multimedia video in the browser, although multiple track media files can be preprocessed into multiple media files on the server to realize playback and track switching, there is a big difference between the preprocessing and playback logic and the ordinary media playback logic. The difference is that the previous playback media only needs to download one media file, and after using this scheme, at least two media files need to be downloaded, so the use cost is increased, and it is difficult to reuse the existing server and client system.
[0067] To this end, the embodiment of the present application provides a technical solution of switching of a media file. In the technical solution, track basic information corresponding to a multimedia file is acquired; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information contains a mark bit used for indicating a main track currently required to be played; in response to a switching event of the played media file, a first media file required to be played is determined from the plurality of media files of different tracks, and the track basic information is adjusted so that the main track in the mark bit points to the first media file; and the played media file in the embedded player of the switching webpage is controlled according to the adjusted track basic information. When the played media file needs to be switched, the first media file required to be played is determined, and the track basic information is modified so that the main track in the mark bit points to the first media file. It can be understood that the track basic information contains track information corresponding to each media file, and each track information always points to the position of the media file corresponding to the track, therefore, modifying the track basic information means changing the mapping relationship between the track and the media file, for example, modifying the track number or data mapping address corresponding to the first media file can change the mapping relationship between the track and the media file, so that the switching of the media file can be realized by adjusting the track basic information in real time before playing the multimedia file, without preprocessing the media file, without supporting playing and switching of the multi-track media on the embedded player of the webpage supporting the multi-track media, and realizing the same seamless switching of the audio or video track as the local player in the browser, without the situations such as lag, black screen, and jump of the playing time. Details are shown below.
[0068] Finally, for the convenience of understanding, an example running environment is provided below.
[0069] FIG. 1 schematically shows an environment application diagram according to the embodiment of the present application.
[0070] The environment diagram can include a service platform 2, one or more clients 4, and a network 6.
[0071] The service platform 2 and the one or more clients 4 can be connected through the network 6, so as to realize information transmission interaction.
[0072] The service platform 2, the client 4, and the network 6 are described in detail below.
[0073] The service platform 2 can be made up of a single or multiple computing devices. The one or more computing devices can include virtualized computing instances. The virtualized computing instances can include virtual machines, such as emulations of computer systems, operating systems, servers, and the like. The computing devices can load the virtual machines based on virtual images and / or other data defining particular software (e.g., operating systems, specialized applications, servers) for the emulation. Different virtual machines can be loaded and / or terminated on the one or more computing devices as demand for different types of processing services changes. A hypervisor can be implemented to manage the use of different virtual machines on the same computing device. The service platform 2 can run one or more services or software applications that enable the performance of the methods described in accordance with the present application. The service platform 2 can also provide other services or software applications, which can include non-virtualized and virtualized environments. In certain embodiments, these services can be provided as web-based services or cloud services, for example, under a software as a service (SaaS) model to users of the client 4.
[0074] The service platform 2 can include one or more components that implement the functionality performed by the service platform 2. These components can include software components, hardware components, or a combination thereof, executable by one or more processors. In some embodiments, the service platform 2 can provide storage, read, write, query, delete, and the like services, such as a switching service for media files provided to a client. In other embodiments, a user operating the client 4 can in turn utilize one or more client applications to interact with the service platform 2 to utilize the services provided by these components.
[0075] The client 4 can include various types of computer devices, such as portable handheld devices, general purpose computers (such as personal computers and laptop computers), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other electronic devices, etc. These computer devices can run various types and versions of software applications and operating systems, such as MICROSOFT Windows, APPLE iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as GOOGLE Chrome OS); or include various mobile operating systems, such as MICROSOFT Windows, Mobile OS, iOS, Windows Phone, Android. The portable handheld devices can include cellular phones, smart phones, tablet computers, personal digital assistants, etc. The wearable devices can include head-mounted displays (such as smart glasses), etc. The gaming systems can include various handheld gaming devices, Internet-enabled gaming devices, etc. The client devices are capable of executing various different applications, such as various Internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.
[0076] Based on the operating system described above, the client 4 can also be installed with one or more applications, such as a handler for switching of media files.
[0077] The client 4 can include input / output interfaces. The input interfaces can include touchpads, touchscreens, mice, keyboards, or other sensing elements. The input interfaces can be configured to receive user instructions, which can cause the client 4 to perform various operations, such as switching of media files, etc. The output interfaces are used to output information, such as display information, to the user.
[0078] The network 6 can be used as a transmission medium between the service platform 2 and the client 4. The network 6 includes various network devices, such as routers, switches, multiplexers, hubs, modems, bridges, repeaters, firewalls, proxy devices, and / or the like. The network can include physical links, such as coaxial cable links, twisted-pair cable links, fiber-optic links, combinations thereof, etc., or wireless links, such as cellular links, satellite links, Wi-Fi links, etc.
[0079] It is noted that the above-described devices are exemplary, and the number and types of devices can be adjusted in different scenarios or according to different needs.
[0080] Embodiment One
[0081] FIG. 2 schematically shows a flowchart of a switching method of a media file according to Embodiment One of the present application.
[0082] As shown in FIG. 2, the switching method of the media file can include steps S202-S206, wherein:
[0083] In step S202, track basic information corresponding to a multimedia file is acquired; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information contains a mark bit for indicating a main track currently required to be played;
[0084] In step S204, in response to a switching event of the played media file, a first media file required to be played is determined from the plurality of media files of different tracks, and the track basic information is adjusted so that the main track in the mark bit points to the first media file;
[0085] In step S206, the played media file in the embedded player of the switching webpage is controlled according to the adjusted track basic information.
[0086] The switching method of the media file provided by the present embodiment can be understood as follows: when the played media file needs to be switched, a first media file required to be played is determined, and the track basic information is modified so that the main track in the mark bit points to the first media file. It can be understood that the track basic information contains track information corresponding to each media file, and each track information always points to the position of the media file corresponding to the track. Therefore, modifying the track basic information means changing the mapping relationship between the track and the media file. For example, modifying the track number or data mapping address corresponding to the first media file can change the mapping relationship between the track and the media file. Thus, the switching of the media file can be realized by adjusting the track basic information in real time before playing the multimedia file, without preprocessing the media file. The switching of the multi-track media can be realized on the embedded player of the webpage without supporting the multi-track media, and the seamless switching of the audio or video track in the browser can be realized as in the local player, without the situations such as lag, black screen, and jump of the playing time.
[0087] The steps S202-S206 and optional other steps will be described in detail below in combination with FIG. 2.
[0088] In step S202, track basic information corresponding to a multimedia file is acquired; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information contains a mark bit for indicating a main track currently required to be played;
[0089] The multimedia file corresponds to a plurality of different track media files, such as two video tracks and two audio tracks, which can be packaged in a multimedia file and played in the embedded player of the webpage.
[0090] In the embodiment, the track basic information can be parsed from the track header of the multimedia file, and the track basic information includes the track information corresponding to each media file. The track information of the media file always points to the position of the data area corresponding to the track. In addition, the track basic information can also include a flag bit, which is used to indicate the main track currently required to be played. The main track is the track used by default by the player.
[0091] Specifically, a processing program for switching media files is deployed in the embedded player of the webpage. The processing program can parse the encapsulation format of the multimedia file. Different encapsulation formats have different storage structures for multi-track files, but most formats include a "track information area" and a "data area". For example, FIG. 3 shows a module block diagram for switching media files in MP4 format. In FIG. 3, the multimedia file in MP4 format is taken as an example. Each area is called a Box in this format. The track basic information is stored through TKHD and TFHD Boxes. MDAT is an audio and video data block. The track and data can be associated through TKHD and TFHD Boxes. It should be noted that the multimedia file in MP4 format also includes other types of Boxes, which are omitted in FIG. 3. TKHD includes a flag bit, which is used to indicate whether the current track is the main track. At the same time, if TFHD exists, TKHD will associate the track number (track_id) with the TFHD of the same track number.
[0092] In step S204, in response to the switching event of the played media file, a first media file required to be played is determined from the plurality of different track media files, and the track basic information is adjusted so that the main track in the flag bit points to the first media file.
[0093] Specifically, by deploying a processing program for implementing switching of media files in the embedded player of the webpage, when the embedded player of the webpage receives a switching event for the played media file, the processing program determines a first media file to be played from the plurality of media files of different tracks in response to the switching event for the played media file, and adjusts the track base information so that the main track in the mark bit points to the first media file. For example, the main track in the mark bit is directed to the first media file by modifying the track number in the track base information or the mapping address of the track information and the data area. The main track in the mark bit can also be directed to the first media file by deleting the non-main information (the track information corresponding to the media file of the track other than the first media file) or replacing the Box type with a Box type ignored by the player, such as the FREE Box type. In this way, even if the media file of the track still exists in the data area, the player does not know the existence of the track. At this time, the MIME Type type of the MediaSource can be set like a normal single-tone video, so that the embedded player of the webpage can directly play the first media file.
[0094] In step S206, the played media file in the embedded player of the webpage is controlled according to the adjusted track base information.
[0095] In the embodiment, the embedded player of the webpage reads the main track recorded in the mark bit field and acquires the multimedia file corresponding to the main track to play the multimedia file each time the multimedia file is played. Specifically, after the embedded player of the webpage completes the playing of the media file, the mark bit in the track base information is re-read, and then the key frame of the media file corresponding to the main track is acquired according to the mark bit. The key frame is sent to the MediaSource interface of the embedded player of the webpage, and the media file corresponding to the main track is played by using the MediaSource interface.
[0096] Specifically, adjusting the track base information includes two cases. One is to modify the mapping relationship between the track and the data area in the track information so that the main track in the mark bit points to the first media file. The other is to shield the non-main information. In this case, since the player can only read the first media file for playing, the main track in the mark bit will also point to the first media file. When the multimedia file is played, the first media file can be acquired according to the adjusted track base information to control the played media file in the embedded player of the webpage.
[0097] In an optional embodiment of the present application, the adjusting the track base information so that the main track in the mark bit points to the first media file comprises:
[0098] determining first track information corresponding to the first media file from the track base information, wherein the first track information comprises a track number; and adjusting the track number in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
[0099] In the embodiment, when switching the media file is needed, a processing program for switching the media file is deployed in the embedded player of the webpage, the processing program determines first track information corresponding to the first media file from the track base information, wherein the first track information comprises a track number, and the track number is a unique identification code of the track, and then adjusts the track number in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
[0100] In an optional embodiment of the present application, the adjusting of the mapping relationship so that the main track in the mark bit points to the first media file comprises:
[0101] determining first track information corresponding to the first media file from the track base information, wherein the first track information comprises a data mapping address; and adjusting the data mapping address in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
[0102] In the embodiment, when switching the media file is needed, a processing program for switching the media file is deployed in the embedded player of the webpage, the processing program determines first track information corresponding to the first media file from the track base information, wherein the first track information comprises a track number, and the track number is a unique identification code of the track, and then adjusts the track number in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
[0103] In an optional embodiment of the present application, the adjusting of the track base information so that the main track in the mark bit points to the first media file comprises:
[0104] determining a second media file other than the first media file from the plurality of media files of different tracks; determining second track information corresponding to the second media file from the track base information, and deleting the track information corresponding to the second media file, so that the main track in the mark bit points to the first media file.
[0105] In the embodiment, when it is needed to switch media files, a second media file other than the first media file in the plurality of media files with different tracks is determined by a processing program, wherein the second media file contains one or more media files; then, second track information corresponding to the second media file is determined from track basic information, and the track information corresponding to the second media file is deleted, so that the main track in the mark bit points to the first media file. Since the embedded player of the webpage performs a reading operation on data according to the track information, after the track information corresponding to the second media file is deleted, even if the data of the track still exists in the data area, the embedded player of the webpage does not know the existence of the track, and the MIME Type type of the MediaSource can be set like a normal single-tone video.
[0106] In an optional embodiment of the present application, the adjusting the track basic information so that the main track in the mark bit points to the first media file comprises:
[0107] determining a second media file other than the first media file in the plurality of media files with different tracks; determining second track information corresponding to the second media file from the track basic information, wherein the second track information contains a Box type; and adjusting the Box type in the second track information based on a preset type, so that the main track in the mark bit points to the first media file.
[0108] The Box type refers to the data type of a basic unit of a media encapsulation format. The preset type refers to some data encapsulation structures that are ignored / not supported by the embedded player of the webpage, for example, a FREE Box type.
[0109] In the embodiment, when it is needed to switch media files, a second media file other than the first media file in the plurality of media files with different tracks is determined by a processing program, wherein the second media file contains one or more media files; then, second track information corresponding to the second media file is determined from track basic information, and the track information corresponding to the second media file is deleted, so that the main track in the mark bit points to the first media file. Since the embedded player of the webpage performs a reading operation on data according to the track information, after the track information corresponding to the second media file is deleted, even if the data of the track still exists in the data area, the embedded player of the webpage does not know the existence of the track, and the MIME Type type of the MediaSource can be set like a normal single-tone video.
[0110] In an alternative embodiment of the present application, after the step of adjusting the track base information so that the main track in the mark bit points to the first media file, the method further comprises:
[0111] In the case that the media format of the previously played media file in the embedded player of the webpage is different from the media format of the first media file; prompting the embedded player of the webpage to adjust the MIME Type according to the media format of the first media file.
[0112] In the embodiment, after the track base information is adjusted, the processing program can further determine whether the media format of the previously played media file in the embedded player of the webpage is the same as the media format of the first media file, and in the case that the media format of the previously played media file in the embedded player of the webpage is different from the media format of the first media file; prompting the embedded player of the webpage to adjust the MIME Type according to the media format of the first media file.
[0113] Embodiment Two
[0114] Fig. 4 schematically shows a block diagram of a media file switching device according to Embodiment Two of the present application, which can be divided into one or more program modules stored in a storage medium and executed by one or more processors to complete the embodiments of the present application. The program modules referred to in the embodiments of the present application are a series of computer readable instruction segments capable of completing a specific function, and the functions of the program modules in the embodiments will be described in detail below. As shown in Fig. 4, the media file switching device 400 can include a track base information acquisition module 410, a track base information adjustment module 420 and a media file switching module 430, wherein:
[0115] The track base information acquisition module 410 is configured to acquire track base information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track base information includes a mark bit for indicating a main track currently needed to be played;
[0116] The track base information adjustment module 420 is configured to, in response to a switching event for a played media file, determine a first media file needed to be played from the plurality of media files of different tracks, and adjust the track base information so that the main track in the mark bit points to the first media file;
[0117] The media file switching module 430 is configured to control switching of a played media file in an embedded player of a webpage according to the adjusted track base information.
[0118] In an alternative embodiment of the present application, the track base information adjustment module 420 comprises:
[0119] a first track information determining submodule, configured to determine first track information corresponding to the first media file from the track basic information, wherein the first track information comprises a track number;
[0120] a track number adjusting submodule, configured to adjust the track number in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
[0121] In an optional embodiment of the present application, the track basic information adjusting module 420 comprises:
[0122] a first track information determining submodule, configured to determine first track information corresponding to the first media file from the track basic information, wherein the first track information comprises a data mapping address;
[0123] a data mapping address adjusting submodule, configured to adjust the data mapping address in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
[0124] In an optional embodiment of the present application, the track basic information adjusting module 420 comprises:
[0125] a second media file determining submodule, configured to determine a second media file from the media files of the plurality of different tracks other than the first media file;
[0126] a track information deleting submodule, configured to determine second track information corresponding to the second media file from the track basic information, and delete the second track information corresponding to the second media file, so that the main track in the mark bit points to the first media file.
[0127] In an optional embodiment of the present application, the track basic information adjusting module 420 comprises:
[0128] a second media file determining submodule, configured to determine a second media file from the media files of the plurality of different tracks other than the first media file;
[0129] a Box type adjusting submodule, configured to determine second track information corresponding to the second media file from the track basic information, wherein the second track information comprises a Box type; and adjust the Box type in the second track information based on a preset type, so that the main track in the mark bit points to the first media file.
[0130] In an alternative embodiment of the present application, the second media file comprises one or more media files.
[0131] In an alternative embodiment of the present application, the apparatus further comprises:
[0132] a MIME Type type adjusting module, configured to, in the case that the media format of the media file played first in the embedded player of the webpage is different from the media format of the first media file, prompt the embedded player of the webpage to adjust the MIME Type type according to the media format of the first media file.
[0133] Embodiment Three
[0134] Fig. 5 schematically shows a hardware architecture diagram of a computer device 10000 suitable for implementing the media file switching method according to Embodiment Three of the present application. In some embodiments, the computer device 10000 can be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle terminal, a game console, a virtual device, a workstation, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 can be a rack-mounted server, a blade server, a tower server, or a cabinet server (including a standalone server, or a server cluster composed of multiple servers), etc. As shown in Fig. 5, the computer device 10000 comprises, but is not limited to, a memory 10010, a processor 10020, and a network interface 10030 which are communicatively linked through a system bus. Among them:
[0135] The memory 10010 includes at least one type of computer-readable storage media, such as a flash memory, a hard disk, a multimedia card (e.g., SD or DX memory), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 10010 can be an internal memory module of the computer device 10000, such as a hard disk or a memory of the computer device 10000. In other embodiments, the memory 10010 can also be an external memory device of the computer device 10000, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like. Of course, the memory 10010 can include both an internal memory module and an external memory device of the computer device 10000. In this embodiment, the memory 10010 is generally used to store an operating system and various application programs installed in the computer device 10000, such as program codes of the media file switching method, and the like. In addition, the memory 10010 can also be used to temporarily store various data that have been output or will be output.
[0136] The processor 10020 can be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips in some embodiments. The processor 10020 is generally used to control the overall operation of the computer device 10000, such as performing control and processing related to data interaction or communication of the computer device 10000, and the like. In this embodiment, the processor 10020 is used to run program codes or process data stored in the memory 10010.
[0137] The network interface 10030 can include a wireless network interface or a wired network interface, which is generally used to establish a communication link between the computer device 10000 and other computer devices. For example, the network interface 10030 is used to connect the computer device 10000 with an external terminal through a network, establish a data transmission channel and a communication link between the computer device 10000 and the external terminal, and the like. The network can be an Intranet, the Internet, a Global System of Mobile communication (GSM), a Wideband Code Division Multiple Access (WCDMA), a 4G network, a 5G network, Bluetooth, Wi-Fi, and the like wireless or wired network.
[0138] It should be noted that FIG. 5 only shows the computer device with components 10010-10030, but it should be understood that all the shown components are not required to be implemented, and more or less components can be alternatively implemented.
[0139] In the embodiment, the switching method of the media file stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as the processor 10020) to complete the embodiments of the present application.
[0140] Embodiment Four
[0141] The embodiments of the present application also provide a computer readable storage medium, and the computer readable storage medium stores computer readable instructions, wherein the computer readable instructions are executed by a processor to implement the following steps:
[0142] Obtaining track basic information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information contains a mark bit indicating a main track to be played currently;
[0143] In response to a switching event for the played media file, determining a first media file to be played from the plurality of media files of different tracks, and adjusting the track basic information so that the main track in the mark bit points to the first media file;
[0144] According to the adjusted track basic information, controlling the media file played in the embedded player of the switching webpage.
[0145] In this embodiment, the computer readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the computer readable storage medium can be an internal storage unit of the computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. Of course, the computer readable storage medium can also include both the internal storage unit and the external storage device of the computer device. In this embodiment, the computer readable storage medium is usually used to store an operating system and various application software installed on the computer device, such as program codes of the media file switching method in the embodiments, etc. In addition, the computer readable storage medium can also be used to temporarily store various data that have been output or will be output.
[0146] Embodiment five
[0147] The embodiments of the present application also provide a computer program product, comprising computer readable instructions which, when executed by a processor, implement the following steps:
[0148] obtaining track basic information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information contains a mark bit used to indicate a main track currently required to be played;
[0149] in response to a switching event for the played media file, determining a first media file required to be played from the plurality of media files of different tracks, and adjusting the track basic information so that the main track in the mark bit points to the first media file;
[0150] controlling the media file played in the embedded player of the switching webpage according to the adjusted track basic information.
[0151] Obviously, those skilled in the art should understand that each module or each step of the above-mentioned embodiments of the present application can be realized by a general computer device, which can be concentrated on a single computer device or distributed on a network composed of multiple computer devices, and optionally, each module or each step can be realized by computer device executable program code, so that each module or each step can be stored in a storage device and executed by a computer device, and in some cases, the steps shown or described can be executed in different order, or each module or each step can be manufactured into an individual integrated circuit module, or multiple modules or steps can be manufactured into a single integrated circuit module. Therefore, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0152] It should be noted that the above is only the preferred embodiment of the present application, and does not limit the patent protection scope of the present application, and any equivalent structure or equivalent process transformation using the content of the present application specification and drawings, or direct or indirect application in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A switching method of a media file, the method comprising: obtaining track base information corresponding to a multimedia file, wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track base information contains a mark bit indicating a main track currently needed to be played; in response to a switching event of a played media file, determining a first media file needed to be played from the plurality of media files of different tracks, and adjusting the track base information so that the main track in the mark bit points to the first media file; controlling a media file played in an embedded player of a switching webpage according to the adjusted track base information. 2.The switching method of a media file according to claim 1, wherein the adjusting the track base information so that the main track in the mark bit points to the first media file comprises: determining first track information corresponding to the first media file from the track base information, wherein the first track information contains a track number; and adjusting the track number in the first track information according to the main track in the mark bit so that the main track in the mark bit points to the first media file. 3.The switching method of a media file according to claim 1, wherein the adjusting the mapping relationship so that the main track in the mark bit points to the first media file comprises: determining first track information corresponding to the first media file from the track base information, wherein the first track information contains a data mapping address; and adjusting the data mapping address in the first track information according to the main track in the mark bit so that the main track in the mark bit points to the first media file. 4.The switching method of a media file according to claim 1, wherein the adjusting the track base information so that the main track in the mark bit points to the first media file comprises: determining a second media file other than the first media file from the plurality of media files of different tracks; and determining second track information corresponding to the second media file from the track base information, and deleting the track information corresponding to the second media file so that the main track in the mark bit points to the first media file. 5.The switching method of a media file according to claim 1, wherein the adjusting the track base information so that the main track in the mark bit points to the first media file comprises: determining a second media file other than the first media file from the plurality of media files of different tracks; and determining second track information corresponding to the second media file from the track base information, wherein the second track information contains a Box type; and adjusting the Box type in the second track information based on a preset type so that the main track in the mark bit points to the first media file. 6.The switching method of a media file according to claim 4 or 5, wherein the second media file contains one or more media files. 7.The switching method of claim 1, after the step of adjusting the track base information so that the main track in the mark bit points to the first media file, the method further comprises: in the case that the media format of the media file played first in the embedded player of the webpage is different from the media format of the first media file; prompting the embedded player of the webpage to adjust the MIME Type according to the media format of the first media file. 8.A switching apparatus of media files, the apparatus comprising: a track base information obtaining module, configured to obtain track base information corresponding to a multimedia file, wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track base information contains a mark bit used to indicate a main track currently needed to be played; a track base information adjusting module, configured to, in response to a switching event of a played media file, determine a first media file needed to be played from the plurality of media files of different tracks, and adjust the track base information so that the main track in the mark bit points to the first media file; a media file switching module, configured to control switching of a played media file in an embedded player of a webpage according to the adjusted track base information. 9.The switching apparatus of claim 8, the track base information adjusting module comprises: a first track information determining submodule, configured to determine first track information corresponding to the first media file from the track base information, wherein the first track information contains a track number; a track number adjusting submodule, configured to adjust the track number in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file. 10.The switching apparatus of claim 8, the track base information adjusting module comprises: a first track information determining submodule, configured to determine first track information corresponding to the first media file from the track base information, wherein the first track information contains a data mapping address; a data mapping address adjusting submodule, configured to adjust the data mapping address in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file. 11.The switching apparatus of claim 8, the track base information adjusting module comprises: a second media file determining submodule, configured to determine a second media file other than the first media file from the plurality of media files of different tracks; a track information deleting submodule, configured to determine second track information corresponding to the second media file from the track base information, and delete the second track information corresponding to the second media file, so that the main track in the mark bit points to the first media file. 12.The switching apparatus of claim 8, the track base information adjusting module comprises: a second media file determination submodule configured to determine a second media file from the plurality of media files with different tracks, except for the first media file; a Box type adjustment submodule configured to determine second track information corresponding to the second media file from the track basic information, wherein the second track information contains a Box type; and adjust the Box type in the second track information based on a preset type, so that the main track in the mark bit points to the first media file.
13. The media file switching device according to claim 11 or 12, wherein the second media file comprises one or more media files.
14. The media file switching device according to claim 8, further comprising: a MIME Type adjustment module configured to, in the case that the media format of the media file played first in the embedded player of the webpage is different from the media format of the first media file, prompt the embedded player of the webpage to adjust the MIME Type according to the media format of the first media file.
15. A computer device, comprising: at least one processor; and a memory in communication connection with the at least one processor; wherein: the memory stores computer readable instructions executable by the at least one processor, and the computer readable instructions are executed by the at least one processor to enable the at least one processor to perform the following steps: obtain track basic information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files with different tracks, and the track basic information contains a mark bit for indicating a main track currently required to be played; in response to a switching event for the played media file, determine a first media file required to be played from the plurality of media files with different tracks, and adjust the track basic information so that the main track in the mark bit points to the first media file; control the media file played in the embedded player of the webpage according to the adjusted track basic information.
16. The computer device according to claim 15, wherein the adjustment of the track basic information so that the main track in the mark bit points to the first media file comprises: determine first track information corresponding to the first media file from the track basic information, wherein the first track information contains a track number; adjust the track number in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
17. The computer device according to claim 15, wherein the adjustment of the mapping relationship so that the main track in the mark bit points to the first media file comprises: determine first track information corresponding to the first media file from the track basic information, wherein the first track information contains a data mapping address; adjust the data mapping address in the first track information according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
18. The computer device of claim 15, wherein the adjusting the track base information to make the primary track in the flag point to the first media file comprises: determining a second media file in the plurality of media files in different tracks other than the first media file; determining second track information corresponding to the second media file from the track base information, and deleting the track information corresponding to the second media file to make the primary track in the flag point to the first media file.
19. The computer device of claim 15, wherein the adjusting the track base information to make the primary track in the flag point to the first media file comprises: determining a second media file in the plurality of media files in different tracks other than the first media file; determining second track information corresponding to the second media file from the track base information, wherein the second track information comprises a Box type; and adjusting the Box type in the second track information based on a preset type to make the primary track in the flag point to the first media file.
20. The computer device of claim 18 or 19, wherein the second media file comprises one or more media files.
21. The computer device of claim 15, wherein the method further comprises, after the adjusting the track base information to make the primary track in the flag point to the first media file: in a case that a media format of the first media file is different from a media format of a previously played media file in an embedded player of the webpage; prompting the embedded player of the webpage to adjust a MIME Type based on the media format of the first media file. The computer readable storage medium stores computer readable instructions, which, when executed by a processor, implement the following steps: obtaining track base information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files in different tracks, and the track base information comprises a flag indicating a primary track currently needed to be played; in response to a switching event for a played media file, determining a first media file needed to be played from the plurality of media files in different tracks, and adjusting the track base information to make the primary track in the flag point to the first media file; controlling a switching of a played media file in an embedded player of a webpage based on the adjusted track base information.
23. The computer readable storage medium of claim 22, wherein the adjusting the track base information to make the primary track in the flag point to the first media file comprises: determining first track information corresponding to the first media file from the track base information, wherein the first track information comprises a track number; and adjusting the track number in the first track information based on the primary track in the flag to make the primary track in the flag point to the first media file. 22. A computer-readable storage medium, characterized in that, 24. The computer readable storage medium of claim 22, wherein the adjusting the mapping relationship to make the primary track in the mark bit point to the first media file comprises: determining first track information corresponding to the first media file from the track base information, wherein the first track information contains a data mapping address; adjusting the data mapping address in the first track information according to the primary track in the mark bit to make the primary track in the mark bit point to the first media file.
25. The computer readable storage medium of claim 22, wherein the adjusting the track base information to make the primary track in the mark bit point to the first media file comprises: determining a second media file other than the first media file from the plurality of media files of different tracks; determining second track information corresponding to the second media file from the track base information, and deleting the track information corresponding to the second media file to make the primary track in the mark bit point to the first media file.
26. The computer readable storage medium of claim 22, wherein the adjusting the track base information to make the primary track in the mark bit point to the first media file comprises: determining a second media file other than the first media file from the plurality of media files of different tracks; determining second track information corresponding to the second media file from the track base information, wherein the second track information contains a Box type; adjusting the Box type in the second track information based on a preset type to make the primary track in the mark bit point to the first media file.
27. The computer readable storage medium of claim 25 or 26, wherein the second media file contains one or more media files.
28. The computer readable storage medium of claim 22, wherein after the step of adjusting the track base information to make the primary track in the mark bit point to the first media file, the method further comprises: in the case that the media format of the first media file is different from the media format of the previously played media file in the embedded player of the webpage; prompting the embedded player of the webpage to adjust the MIME Type type according to the media format of the first media file.
29. A computer program product comprising computer readable instructions, characterized in that, The computer readable instructions are executed by the processor to implement the following steps: obtaining track base information corresponding to a multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track base information contains a mark bit used to indicate a primary track currently needed to be played; in response to a switching event for the played media file, determining a first media file needed to be played from the plurality of media files of different tracks, and adjusting the track base information to make the primary track in the mark bit point to the first media file; controlling the switching of the played media file in the embedded player of the webpage according to the adjusted track base information.
30. The computer program product of claim 29, wherein the adjusting the track base information to make the primary track in the marker point to the first media file comprises: determining first track information corresponding to the first media file from the track base information, wherein the first track information includes a track number; adjusting the track number in the first track information according to the primary track in the marker to make the primary track in the marker point to the first media file.
31. The computer program product of claim 29, wherein the adjusting the mapping relationship to make the primary track in the marker point to the first media file comprises: determining first track information corresponding to the first media file from the track base information, wherein the first track information includes a data mapping address; adjusting the data mapping address in the first track information according to the primary track in the marker to make the primary track in the marker point to the first media file.
32. The computer program product of claim 29, wherein the adjusting the track base information to make the primary track in the marker point to the first media file comprises: determining a second media file other than the first media file from the plurality of media files in different tracks; determining second track information corresponding to the second media file from the track base information, and deleting the track information corresponding to the second media file to make the primary track in the marker point to the first media file.
33. The computer program product of claim 29, wherein the adjusting the track base information to make the primary track in the marker point to the first media file comprises: determining a second media file other than the first media file from the plurality of media files in different tracks; determining second track information corresponding to the second media file from the track base information, wherein the second track information includes a Box type; adjusting the Box type in the second track information based on a preset type to make the primary track in the marker point to the first media file.
34. The computer program product of claim 32 or 33, wherein the second media file includes one or more media files.
35. The switching method of the media file of claim 29, after the step of adjusting the track base information to make the primary track in the marker point to the first media file, the method further comprises: in the case that the media format of the first media file is different from the media format of the previously played media file in the embedded player of the webpage; prompting the embedded player of the webpage to adjust the MIME Type according to the media format of the first media file.
Citation Information
Patent Citations
Media file synchronous playing method and device and storage medium
CN110545456A
Webpage-based media file playing method and device and storage medium
CN110545466A
Method and device for switching resolution in webpage to play media file and storage medium
CN110545483A
Media file switching method and device
CN118890525A
Playing method, device and storage medium of webpage-based media file
US20200413130A1