Media file switching method and device
By adjusting the track basic information of multimedia files, seamless switching of multi-track media in the browser is achieved, solving the cost and support problems of multimedia video playback in the browser, and avoiding lags and time jumps during playback .
Patent Information
- Application Number
- CN202410904736.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-11-01
AI Technical Summary
The prior art When playing multimedia videos in a browser, multiple media files need to be preprocessed, resulting in increased usage costs and difficulty in reusing existing server and client systems. The multi-track media has poor support in the browser, resulting in playback. There are problems such as lag, black screen and playback time jumps.
By obtaining the track basic information of multimedia files, responding to switching events, adjusting the track basic information to point to the media files that need to be played, real-time switching of media files is realized, avoiding preprocessing, and supporting on embedded web players that do not support multi-track media Play and switch multi-track media.
It enables seamless switching of audio or video tracks in the browser, avoids lag, black screen and playback time jumps, reduces usage costs, and achieves a similar playback experience in local players and browsers.
Smart Images

Figure CN118890525A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of Internet technology, and in particular, to a method, apparatus, computer device, computer-readable storage medium, and computer program product for switching media files. Background Art
[0002] Although multi-track media is an industry standard, it is currently only used in local playback scenarios because only a few browsers support it. When playing multimedia videos in a browser, although the media files of multiple tracks can be pre-processed into multiple media files on the server to achieve playback and track switching, the pre-processing and playback logic is quite different from the ordinary media playback logic. The difference is that previously, only one media file needed to be downloaded to play the media, but with this solution, at least two media files need to be downloaded. Therefore, the cost of use increases, and it is difficult to reuse the existing server and client systems.
[0003] It should be noted that the above content is not necessarily prior art, nor is it intended to limit the scope of patent protection of this application. Summary of the invention
[0004] The embodiments of the present application provide a method, apparatus, computer device, computer-readable storage medium, and computer program product for switching media files to solve or alleviate one or more of the technical problems mentioned above.
[0005] One aspect of an embodiment of the present application provides a method for switching media files, the method comprising:
[0006] Acquire basic track information corresponding to the multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the basic track information includes a mark bit for indicating a main track currently to be played;
[0007] In response to a switching event for the played media file, determining a first media file to be played from the media files of the multiple different tracks, and adjusting the track basic information so that the main track in the mark position points to the first media file;
[0008] According to the adjusted track basic information, the media file played in the embedded player of the webpage is controlled to switch.
[0009] Optionally, the adjusting the track basic information so that the main track in the marker position points to the first media file includes:
[0010] Determining first track information corresponding to the first media file from the track basic information, wherein the first track information includes a track number;
[0011] The track number in the first track information is adjusted according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
[0012] Optionally, adjusting the mapping relationship so that the main track in the marker bit points to the first media file includes:
[0013] Determining first track information corresponding to the first media file from the track basic information, wherein the first track information includes a data mapping address;
[0014] The data mapping address in the first track information is adjusted according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
[0015] Optionally, the adjusting the track basic information so that the main track in the marker position points to the first media file includes:
[0016] Determine a second media file other than the first media file among the media files of the multiple different tracks;
[0017] The second track information corresponding to the second media file is determined from the 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.
[0018] Optionally, the adjusting the track basic information so that the main track in the marker position points to the first media file includes:
[0019] Determine a second media file other than the first media file among the media files of the multiple different tracks;
[0020] Determining second track information corresponding to the second media file from the track basic information, wherein the second track information includes a Box type;
[0021] The Box type in the second track information is adjusted based on a preset type, so that the main track in the marker position points to the first media file.
[0022] Optionally, the second media file includes one or more media files.
[0023] Optionally, after the step of adjusting the track basic information so that the main track in the marker position points to the first media file, the method further includes:
[0024] In the case where the media file previously played in the embedded player of the webpage has a different media format from the first media file;
[0025] The embedded player of the webpage is prompted to adjust the MIME Type according to the media format of the first media file.
[0026] Another aspect of an embodiment of the present application provides a device for switching media files, the device comprising:
[0027] A track basic information acquisition module is used to acquire the track basic information corresponding to the multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information includes a mark bit for indicating the main track currently to be played;
[0028] A track basic information adjustment module, configured to determine, in response to a switching event for a played media file, a first media file to be played from the media files of the plurality of different tracks, and adjust the track basic information so that the main track in the mark position points to the first media file;
[0029] The media file switching module is used to control the switching of the media files played in the embedded player of the web page according to the adjusted track basic information.
[0030] Another aspect of an embodiment of the present application provides a computer device, including:
[0031] at least one processor; and
[0032] a memory communicatively coupled to the at least one processor;
[0033] Wherein: the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the above-mentioned method for switching media files.
[0034] Another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the above-mentioned method for switching media files is implemented.
[0035] Another aspect of an embodiment of the present application provides a computer program product, including a computer program, which implements the above-mentioned method for switching media files when executed by a processor.
[0036] The technical solution adopted in the embodiment of the present application may include the following advantages: by determining the first media file to be played when the media file to be played needs to be switched, and modifying the basic track information so that the main track in the marker position points to the first media file, the switching of media files can be achieved by adjusting the basic track information in real time before playing the multimedia file without preprocessing the media file, and multi-track media can be played and switched on a web page embedded player that does not support multi-track media, and seamless switching of audio or video tracks can be achieved in the browser like a local player without the occurrence of freezes, black screens, playback time jumps, etc. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0038] Figure 1 A diagram schematically shows an operating environment of a method for switching media files according to Embodiment 1 of the present application;
[0039] Figure 2 A flowchart schematically shows a method for switching media files according to the first embodiment of the present application;
[0040] Figure 3 A module block diagram for switching a media file in MP4 format is schematically shown;
[0041] Figure 4 A block diagram schematically shows a device for switching media files according to a second embodiment of the present application; and
[0042] Figure 5 The hardware architecture diagram of the computer device according to the third embodiment of the present application is schematically shown. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0044] It should be noted that the descriptions involving "first", "second", etc. in the embodiments of the present application are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0045] In the description of the present application, it should be understood that the numerical labels before the steps do not indicate the order in which the steps are executed, but are only used to facilitate the description of the present application and to distinguish each step, and therefore should not be understood as a limitation on the present application.
[0046] First, the following terms are explained:
[0047] Encapsulation format: generally called encapsulation format or container format, it is a format used to store audio and video data.
[0048] MP4: MP4 or MPEG-4 Part 14 is a standard digital multimedia container format. The extension of MPEG-4 Part 14 is .mp4. It is mainly used to store digital audio and digital video, but can also store subtitles and static images. Because it can accommodate video streams that support bitstreams (such as advanced video coding), it is a streaming media. In the MP4 format, various data are stored in boxes, where a box can contain another box.
[0049] Track: Common media files contain audio and video, which are generally called audio tracks and video tracks respectively. Generally, media files only contain one audio track and one video track, but many packaging formats support multiple tracks.
[0050] MediaSource: Media Source Extensions API or MSE, is a media playback interface provided by the browser to developers, allowing the playback of audio and video files generated by program code, rather than only being able to play audio and video from files or network addresses.
[0051] MIME Type: Multipurpose Internet Mail Extensions (MIME) is an Internet standard. Browsers usually use MIME types (rather than file extensions) to determine how to handle URLs, so it is very important that the web server adds the correct MIME type in the response header. If it is not configured correctly, the browser may not be able to parse the file content, the website will not work properly, and the downloaded file will be processed incorrectly. In MediaSource, MIME Type is needed to tell the browser the current audio and video format.
[0052] Secondly, in order to facilitate those skilled in the art to understand the technical solutions provided in the embodiments of the present application, the relevant technologies are described below:
[0053] 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.
[0054] In the web browser standard, tracks can be switched by controlling the enabled property of audioTracks and videoTracks, but the new version and most browser kernels on the market do not support this function.
[0055] Due to the poor browser support for multi-track media formats, most solutions store tracks in multiple media files, so that each media file has only one audio or video track. Each time the file is played, the video track file and audio track file to be played are downloaded, and then played through the MediaSource interface provided by the browser.
[0056] Although multi-track media is an industry standard, it is currently only used in local playback scenarios because only a few browsers support it. When playing multimedia videos in a browser, although the media files of multiple tracks can be pre-processed into multiple media files on the server to achieve playback and track switching, the pre-processing and playback logic is quite different from the ordinary media playback logic. The difference is that previously, only one media file needed to be downloaded to play the media, but with this solution, at least two media files need to be downloaded. Therefore, the cost of use increases, and it is difficult to reuse the existing server and client systems.
[0057] To this end, an embodiment of the present application provides a technical solution for switching media files. In this technical solution, by obtaining the basic track information corresponding to the multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the basic track information includes a mark bit for indicating the main track currently to be played; in response to a switching event for the played media file, the first media file to be played is determined from the media files of the plurality of different tracks, and the basic track information is adjusted so that the main track in the mark bit points to the first media file; according to the adjusted basic track information, the media file played in the embedded player of the switching web page is controlled. When the media file to be played needs to be switched, the first media file to be played is determined, and the basic track information is modified so that the main track in the mark position points to the first media file. It can be understood that the basic track information contains the 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 basic track information is to change the mapping relationship between the track and the media file. For example, operations such as 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. Therefore, the switching of media files can be achieved by adjusting the basic track information in real time before playing the multimedia file without preprocessing the media file. It can play and switch multi-track media on a web page embedded player that does not support multi-track media, and realize seamless switching of audio or video tracks in the browser like a local player, without freezes, black screens, play time jumps, etc. See the following for details.
[0058] Finally, for ease of understanding, an exemplary operating environment is provided below.
[0059] Figure 1 The following schematically shows an environmental application diagram according to an embodiment of the present application.
[0060] The environment diagram may include a service platform 2 , one or more clients 4 , and a network 6 .
[0061] The service platform 2 and one or more clients 4 may be coupled via a network 6 to achieve information transmission interaction.
[0062] The service platform 2, the client 4, and the network 6 are respectively described in detail below.
[0063] The service platform 2 can be composed of a single or multiple computing devices. The one or more computing devices may include virtualized computing instances. The virtualized computing instances may include virtual machines, such as simulations of computer systems, operating systems, servers, etc. The computing device may load the virtual machine based on a virtual image and / or other data defining a specific software (e.g., operating system, dedicated application, server) for simulation. As the demand for different types of processing services changes, different virtual machines may be loaded and / or terminated on one or more computing devices. A hypervisor may be implemented to manage the use of different virtual machines on the same computing device. The service platform 2 may run one or more services or software applications that enable execution according to the method described in the present application. The service platform 2 may also provide other services or software applications, which may include non-virtual environments and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as provided to users of the client 4 under a software as a service (SaaS) model.
[0064] The service platform 2 may include one or more components that implement the functions performed by the service platform 2. These components may include software components, hardware components, or a combination thereof that can be executed by one or more processors. In some embodiments, the service platform 2 may provide services such as storage, reading, writing, querying, and deletion, such as providing a switching service for media files for the client. In other embodiments, a user operating the client 4 may sequentially use one or more client applications to interact with the service platform 2 to utilize the services provided by these components.
[0065] The client 4 may 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, game systems, thin clients, various messaging devices, sensors or other electronic devices, etc. These computer devices may 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 ChromeOS); or include various mobile operating systems, such as MICROSOFT Windows, Mobile OS, iOS, Windows Phone, Android. Portable handheld devices may include cellular phones, smart phones, tablet computers, personal digital assistants, etc. Wearable devices may include head-mounted displays (such as smart glasses), etc. Game systems may include various handheld game devices, Internet-enabled game devices, etc. 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 may use various communication protocols.
[0066] Based on the operating system described above, the client 4 may also be installed with one or more application programs, such as a processing program for switching media files.
[0067] The client 4 may include an input / output interface. The input interface may include a touch pad, a touch screen, a mouse, a keyboard, or other sensing elements. The input interface may be configured to receive user instructions, which may enable the client 4 to perform various operations, such as switching of media files. The output interface is used to output information to the user, such as display information.
[0068] The service platform 2 and the client 4 may use a network 6 as a transmission medium. 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 may include physical links, such as coaxial cable links, twisted pair cable links, optical fiber links, combinations thereof, or wireless links, such as cellular links, satellite links, Wi-Fi links, and the like.
[0069] It should be noted that the above devices are exemplary, and the number and type of devices are adjustable in different scenarios or according to different needs.
[0070] Embodiment 1
[0071] Figure 2The flowchart of the method for switching media files according to the first embodiment of the present application is schematically shown.
[0072] like Figure 2 As shown, the method for switching media files may include steps S202 to S206, wherein:
[0073] Step S202, obtaining basic track information corresponding to the multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the basic track information includes a mark bit for indicating a main track that needs to be played currently;
[0074] Step S204, in response to a switching event for the played media file, determining a first media file to be played from the media files of the multiple different tracks, and adjusting the track basic information so that the main track in the mark position points to the first media file;
[0075] Step S206: Control switching of the media file played in the embedded player of the web page according to the adjusted track basic information.
[0076] The method for switching media files provided in this embodiment: when it is necessary to switch the media file to be played, by determining the first media file to be played, and modifying the basic track information so that the main track in the mark position points to the first media file, it can be understood that the basic track information contains the 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 basic track information is to change the mapping relationship between the track and the media file. For example, operations such as 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. Therefore, the switching of media files can be achieved by adjusting the basic track information in real time before playing the multimedia file without preprocessing the media file. Multi-track media can be played and switched on a web page embedded player that does not support multi-track media, and seamless switching of audio or video tracks can be achieved in the browser like a local player without the occurrence of freezes, black screens, play time jumps, etc.
[0077] The following combination Figure 2 , each step in steps S202 to S206 and other optional steps are described in detail.
[0078] Step S202 , obtaining basic track information corresponding to the multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the basic track information includes a mark bit for indicating a main track currently to be played;
[0079] The multimedia file corresponds to a plurality of media files with different tracks, such as two video tracks and two audio tracks. The media files with different tracks can be packaged in one multimedia file, and the media file to be currently played can be selected when playing in the embedded player of the web page.
[0080] In this embodiment, the track basic information can be parsed from the header information Track Header of the multimedia file, and the track basic information includes the track information corresponding to each media file, and the track information of the media file always points to the location of the data area corresponding to the track. In addition, the track basic information can also include a mark bit, which is used to indicate the main track that needs to be played currently, wherein the main track is the track used by the player by default.
[0081] Specifically, a processing program for switching media files is deployed in the embedded player of the web page. The processing program can parse the packaging format of the multimedia file. Different packaging formats have different storage structures for multi-track files, but most formats contain a "track information area" and a "data area", such as Figure 3 A module block diagram of switching a media file in MP4 format is shown. Figure 3 Take the MP4 format multimedia file as an example. This format calls each area a Box. TKHD and TFHD Box are used to store basic track information. MDAT is the audio and video data block. TKHD and TFHD Box can be used to match tracks and data. It should be noted that MP4 format multimedia files also contain other types of Boxes. Figure 3 Omitted. TKHD contains a flag to indicate whether the current track is a primary track. At the same time, if TFHD exists, the track number (track_id) in TKHD will be associated with the TFHD of the same track number.
[0082] Step S204 , in response to a switching event for the played media file, determining a first media file to be played from the media files of the multiple different tracks, and adjusting the track basic information so that the main track in the mark position points to the first media file;
[0083] Specifically, a processing program for implementing the switching of media files is deployed in the embedded player of the web page. When the embedded player of the web page receives a switching event for the played media file, the processing program responds to the switching event for the played media file, determines the first media file to be played from the media files of multiple different tracks, and adjusts the track basic information so that the main track in the mark bit points to the first media file. For example, the track number in the track basic information or the mapping address of the track information and the data area is modified to point the main track in the mark bit to the first media file. It is also possible to delete non-main information (track information corresponding to media files of other tracks except the first media file), or replace the Box type with a Box type that the player will ignore, such as the FREE Box type. In this way, even if the media files of the track still exist in the data area, the player does not know the existence of these tracks. At this time, the MIME Type type of MediaSource can be set like ordinary single audio and video, so that the embedded player of the web page can directly play the first media file.
[0084] Step S206 , according to the adjusted track basic information, control the switching of the media file played in the embedded player of the web page.
[0085] In this embodiment, each time the embedded player of the web page plays a multimedia file, it reads the main track recorded in the mark bit field and obtains the multimedia file corresponding to the main track for playback. Specifically, after the embedded player of the web page finishes playing the media file being played, it re-reads the mark bit in the track basic information, and then obtains the key frame of the media file corresponding to the main track according to the mark bit, sends the key frame to the MediaSource interface of the embedded player of the web page, and uses the MediaSource interface to play the media file corresponding to the main track.
[0086] Specifically, adjusting the basic track information includes two situations. 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 playback, the main track in the mark bit will also point to the first media file. When playing multimedia files, the first media file can be obtained according to the adjusted basic track information to control the media file played in the embedded player of the switching web page.
[0087] In an optional embodiment of the present application, adjusting the track basic information so that the main track in the mark position points to the first media file includes:
[0088] Determine first track information corresponding to the first media file from the track basic information, wherein the first track information includes a track number; and adjust the track number in the first track information according to the main track in the mark position so that the main track in the mark position points to the first media file.
[0089] In this embodiment, a processing program for implementing the switching of media files is deployed in the embedded player of the web page. When the media file needs to be switched, the processing program determines the first track information corresponding to the first media file from the track basic information, wherein the first track information includes a track number, which is a unique identification code of the track. Then, the track number in the first track information is adjusted according to the main track in the mark position, so that the main track in the mark position points to the first media file.
[0090] In an optional embodiment of the present application, adjusting the mapping relationship so that the main track in the mark bit points to the first media file includes:
[0091] Determine first track information corresponding to the first media file from the track basic information, wherein the first track information includes a data mapping address; and 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.
[0092] In this embodiment, when it is necessary to switch the media file, the first track information corresponding to the first media file is determined from the track basic information through a processing program, wherein the first track information includes a data mapping address, and then the data mapping address in the first track information is adjusted according to the main track in the mark bit, so that the main track in the mark bit points to the first media file.
[0093] In an optional embodiment of the present application, adjusting the track basic information so that the main track in the mark position points to the first media file includes:
[0094] Determine a second media file other than the first media file in the media files of the multiple different tracks; determine second track information corresponding to the second media file from the track basic information, and delete the track information corresponding to the second media file, so that the main track in the mark position points to the first media file.
[0095] In this embodiment, when it is necessary to switch media files, a second media file other than the first media file is determined by a processing program in the media files of multiple different tracks, wherein the second media file includes one or more media files; then, the second track information corresponding to the second media file is determined from the track basic information, and the track information corresponding to the second media file is deleted, so that the main track in the mark position points to the first media file. Since the embedded player of the web page reads data according to the track information, after deleting the track information corresponding to the second media file, even if the data of the track still exists in the data area, the embedded player of the web page does not know the existence of these tracks, and the MIME Type of MediaSource can be set like ordinary single audio and video.
[0096] In an optional embodiment of the present application, adjusting the track basic information so that the main track in the mark position points to the first media file includes:
[0097] Determine a second media file other than the first media file among the media files of the multiple different tracks; determine second track information corresponding to the second media file from the track basic information, wherein the second track information includes 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 marker position points to the first media file.
[0098] The Box type refers to the data type of the basic unit of the media packaging format. The preset type refers to some data packaging structures that are ignored / not supported by the embedded player on the web page, for example, the FREE Box type.
[0099] In this embodiment, when it is necessary to switch media files, a second media file other than the first media file in the media files of multiple different tracks is determined by a processing program, wherein the second media file includes one or more media files; then, the second track information corresponding to the second media file is determined from the track basic information, and then the Box type in the second track information is adjusted based on the preset type so that the main track in the mark position points to the first media file. Since the embedded player of the web page performs data reading operations based on the track information, after replacing the Box type in the track information corresponding to the second media file with the preset type, the preset type is a type that is not supported by the embedded player of the web page, even if the data of the track still exists in the data area, the embedded player of the web page does not know the existence of these tracks, and the MIME Type of MediaSource can be set like ordinary single audio and video.
[0100] In an optional embodiment of the present application, after the step of adjusting the track basic information so that the main track in the mark position points to the first media file, the method further includes:
[0101] In the case that the media format of the media file previously played in the embedded player of the webpage is different from that of the first media file; the embedded player of the webpage is prompted to adjust the MIMEType type according to the media format of the first media file.
[0102] In this embodiment, after adjusting the basic track information, the processing program can also determine whether the media format of the media file previously played in the embedded player of the web page is the same as that of the first media file. If the media format of the media file previously played in the embedded player of the web page is different from that of the first media file, the embedded player of the web page is prompted to adjust the MIME Type type according to the media format of the first media file.
[0103] Embodiment 2
[0104] Figure 4 The block diagram of the media file switching device according to the second embodiment of the present application is schematically shown. The device can be divided into one or more program modules, one or more program modules are stored in a storage medium, and are executed by one or more processors to complete the embodiment of the present application. The program module referred to in the embodiment of the present application refers to a series of computer program instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment. Figure 4 As shown, the media file switching device 400 may include: a track basic information acquisition module 410, a track basic information adjustment module 420 and a media file switching module 430, wherein:
[0105] The track basic information acquisition module 410 is used to acquire the track basic information corresponding to the multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information includes a mark bit for indicating the main track currently to be played;
[0106] A track basic information adjustment module 420 is used to determine a first media file to be played from the media files of the multiple different tracks in response to a switching event for the played media file, and adjust the track basic information so that the main track in the mark position points to the first media file;
[0107] The media file switching module 430 is used to control the switching of the media file played in the embedded player of the web page according to the adjusted track basic information.
[0108] In an optional embodiment of the present application, the track basic information adjustment module 420 includes:
[0109] A first track information determination submodule, configured to determine first track information corresponding to the first media file from the track basic information, wherein the first track information includes a track number;
[0110] The track number adjustment submodule is used to adjust the track number in the first track information according to the main track in the mark position, so that the main track in the mark position points to the first media file.
[0111] In an optional embodiment of the present application, the track basic information adjustment module 420 includes:
[0112] A first track information determination submodule, configured to determine first track information corresponding to the first media file from the track basic information, wherein the first track information includes a data mapping address;
[0113] The data mapping address adjustment submodule is used to adjust the data mapping address in the first track information according to the main track in the mark position, so that the main track in the mark position points to the first media file.
[0114] In an optional embodiment of the present application, the track basic information adjustment module 420 includes:
[0115] A second media file determination submodule, configured to determine a second media file other than the first media file among the media files of the multiple different tracks;
[0116] The track information deletion submodule is used to determine the 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 position points to the first media file.
[0117] In an optional embodiment of the present application, the track basic information adjustment module 420 includes:
[0118] A second media file determination submodule, configured to determine a second media file other than the first media file among the media files of the multiple different tracks;
[0119] The box type adjustment submodule is used to determine the second track information corresponding to the second media file from the track basic information, wherein the second track information includes 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 position points to the first media file.
[0120] In an optional embodiment of the present application, the second media file includes one or more media files.
[0121] In an optional embodiment of the present application, the device further includes:
[0122] The MIME Type adjustment module is used to prompt the embedded player of the web page to adjust the MIME Type according to the media format of the first media file when the media format of the media file previously played in the embedded player of the web page is different from that of the first media file.
[0123] Embodiment 3
[0124] Figure 5 The schematic diagram of the hardware architecture of a computer device 10000 suitable for implementing a method for switching media files according to the third embodiment of the present application is shown schematically. In some embodiments, the computer device 10000 may be a terminal device such as a smart phone, a wearable device, a tablet computer, a personal computer, a vehicle-mounted terminal, a game console, a virtual device, a workbench, a digital assistant, a set-top box, a robot, etc. In other embodiments, the computer device 10000 may be a rack server, a blade server, a tower server, or a cabinet server (including an independent server, or a server cluster composed of multiple servers), etc. Figure 5 As shown, the computer device 10000 includes but is not limited to: a memory 10010, a processor 10020, and a network interface 10030 that can communicate with each other through a system bus. Among them:
[0125] The memory 10010 includes at least one type of computer-readable storage medium, and the readable storage medium includes a flash memory, a hard disk, a multimedia card, a card-type memory (such as an 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, etc. In some embodiments, the memory 10010 may be an internal storage 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 may also be an external storage device of the computer device 10000, such as a plug-in hard disk equipped on the computer device 10000, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 10010 may also include both the internal storage module of the computer device 10000 and its external storage device. In this embodiment, the memory 10010 is generally used to store the operating system and various application software installed in the computer device 10000, such as program codes of the method for switching media files, etc. In addition, the memory 10010 can also be used to temporarily store various data that have been output or will be output.
[0126] In some embodiments, the processor 10020 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other chips. 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 with the computer device 10000. In this embodiment, the processor 10020 is used to run the program code stored in the memory 10010 or process data.
[0127] The network interface 10030 may include a wireless network interface or a wired network interface, and the network interface 10030 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 to an external terminal through a network, and to establish a data transmission channel and a communication link between the computer device 10000 and the external terminal. The network may be a wireless or wired network such as an intranet, the Internet, the Global System of Mobile communication (GSM), Wideband Code Division Multiple Access (WCDMA), 4G network, 5G network, Bluetooth, Wi-Fi, etc.
[0128] It should be pointed out that Figure 5 Only a computer device having components 10010 - 10030 is shown, but it should be understood that implementation of all of the components shown is not a requirement, and more or fewer components may alternatively be implemented.
[0129] In this embodiment, the method for switching media files stored in the memory 10010 can also be divided into one or more program modules and executed by one or more processors (such as processor 10020) to complete the embodiment of the present application.
[0130] Embodiment 4
[0131] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the media file switching method in the embodiment are implemented.
[0132] In this embodiment, the computer-readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the computer-readable storage medium can be an internal storage unit of a computer device, such as a hard disk or memory of the computer device. In other embodiments, the computer-readable storage medium can also be an external storage device of a computer device, such as a plug-in hard disk equipped on the computer device, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the computer-readable storage medium can also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the computer-readable storage medium is generally used to store the operating system and various application software installed on the computer device, such as the program code of the switching method of the media file in the embodiment, etc. In addition, the computer-readable storage medium can also be used to temporarily store various types of data that have been output or are to be output.
[0133] Embodiment 5
[0134] An embodiment of the present application also provides a computer program product, including a computer program, which implements the method in the above embodiment when executed by a processor.
[0135] Obviously, those skilled in the art should understand that the modules or steps of the above-mentioned embodiments of the present application can be implemented by general-purpose computer devices, they can be concentrated on a single computer device, or distributed on a network composed of multiple computer devices, optionally, they can be implemented by executable program codes of computer devices, so that they can be stored in a storage device and executed by the computer device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the embodiments of the present application are not limited to any specific combination of hardware and software.
[0136] It should be noted that the above are only preferred embodiments of the present application, and the patent protection scope of the present application is not limited thereto. Any equivalent structure or equivalent process transformation made using the contents of the specification and drawings of the present application, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for switching media files, characterized in that: The method comprises: Acquire basic track information corresponding to the multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the basic track information includes a mark bit for indicating a main track currently to be played; In response to a switching event for the played media file, determining a first media file to be played from the media files of the multiple different tracks, and adjusting the track basic information so that the main track in the mark position points to the first media file; According to the adjusted track basic information, the media file played in the embedded player of the switching webpage is controlled.
2. The method for switching media files according to claim 1, characterized in that: The step of adjusting the track basic information so that the main track in the marker position points to the first media file includes: Determining first track information corresponding to the first media file from the track basic information, wherein the first track information includes a track number; The track number in the first track information is adjusted 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 method for switching media files according to claim 1, characterized in that: The adjusting the mapping relationship so that the main track in the mark position points to the first media file includes: Determining first track information corresponding to the first media file from the track basic information, wherein the first track information includes a data mapping address; The data mapping address in the first track information is adjusted 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 method for switching media files according to claim 1, characterized in that: The step of adjusting the track basic information so that the main track in the marker position points to the first media file includes: Determine a second media file other than the first media file among the media files of the multiple different tracks; The second track information corresponding to the second media file is determined from the 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.
5. The method for switching media files according to claim 1, characterized in that: The step of adjusting the track basic information so that the main track in the marker position points to the first media file includes: Determine a second media file other than the first media file among the media files of the multiple different tracks; Determining second track information corresponding to the second media file from the track basic information, wherein the second track information includes a Box type; The Box type in the second track information is adjusted based on a preset type, so that the main track in the marker position points to the first media file.
6. The method for switching media files according to claim 4 or 5, characterized in that: The second media file includes one or more media files.
7. The method for switching media files according to claim 1, characterized in that: After the step of adjusting the track basic information so that the main track in the marker position points to the first media file, the method further includes: In the case where the media file previously played in the embedded player of the webpage has a different media format from the first media file; The embedded player of the webpage is prompted to adjust the MIME Type according to the media format of the first media file.
8. A device for switching media files, characterized in that: The device comprises: A track basic information acquisition module is used to acquire the track basic information corresponding to the multimedia file; wherein the multimedia file corresponds to a plurality of media files of different tracks, and the track basic information includes a mark bit for indicating the main track currently to be played; A track basic information adjustment module, configured to determine, in response to a switching event for a played media file, a first media file to be played from the media files of the plurality of different tracks, and adjust the track basic information so that the main track in the mark position points to the first media file; The media file switching module is used to control the switching of the media files played in the embedded player of the web page according to the adjusted track basic information.
9. A computer device, characterized in that: include: at least one processor; and a memory communicatively connected to the at least one processor; wherein: The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the media file switching method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by a processor, the method for switching media files according to any one of claims 1 to 7 is implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the media file switching method according to claims 1 to 7 are implemented.
Citation Information
Cited By
Media file switching method and apparatus
WO2026007585A1
Media file switching method and apparatus
WO2026007586A1
