WO2022199541A1 - 媒体文件的播放方法、装置、电子设备、服务器和介质 - Google Patents
媒体文件的播放方法、装置、电子设备、服务器和介质 Download PDFInfo
- Publication number
- WO2022199541A1 WO2022199541A1 PCT/CN2022/082076 CN2022082076W WO2022199541A1 WO 2022199541 A1 WO2022199541 A1 WO 2022199541A1 CN 2022082076 W CN2022082076 W CN 2022082076W WO 2022199541 A1 WO2022199541 A1 WO 2022199541A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- segment
- media file
- index information
- target
- file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/21—Server components or server architectures
- H04N21/218—Source of audio or video content, e.g. local disk arrays
- H04N21/2183—Cache memory
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/231—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
- H04N21/23106—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion involving caching operations
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/232—Content retrieval operation locally within server, e.g. reading video streams from disk arrays
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/24—Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
- H04N21/2401—Monitoring of the client buffer
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/25—Management operations performed by the server for facilitating the content distribution or administrating data related to end-users or client devices, e.g. end-user or client device authentication, learning user preferences for recommending movies
- H04N21/262—Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists
- H04N21/26258—Content or additional data distribution scheduling, e.g. sending additional data at off-peak times, updating software modules, calculating the carousel transmission frequency, delaying a video stream transmission, generating play-lists for generating a list of items to be played back in a given order, e.g. playlist, or scheduling item distribution according to such list
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/432—Content retrieval operation from a local storage medium, e.g. hard-disk
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/433—Content storage operation, e.g. storage operation in response to a pause request, caching operations
- H04N21/4331—Caching operations, e.g. of an advertisement for later insertion during playback
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/83—Generation or processing of protective or descriptive data associated with content; Content structuring
- H04N21/845—Structuring of content, e.g. decomposing content into time segments
- H04N21/8456—Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
Definitions
- the present application belongs to the field of communication technologies, and specifically relates to a method, apparatus, electronic device, server and medium for playing media files.
- users can use electronic devices to play media files.
- the user can click the multimedia application icon to trigger the electronic device to display the multimedia application playing interface, and the user can trigger the electronic device to download the media file from the server and play the media file by operating on the playing interface.
- the electronic device may re-download these repeated segments from the server, resulting in wasted traffic.
- the purpose of the embodiments of the present application is to provide a method, apparatus, electronic device, server and medium for playing a media file, which can solve the problem of wasted traffic when playing a media file with repeated segments.
- an embodiment of the present application provides a method for playing a media file, the method comprising:
- the server Sending a first request message to the server, where the first request message is used to request to play a target media file, the target media file includes a first segment and a second segment, and the playback sequence of the first segment is earlier than the playback sequence of the second segment;
- the target configuration file includes at least first index information and second index information, the first index information is used to indicate the first segment, and the second index information is used to indicate the second segment;
- the cached content is retrieved based on the second index information, and if the second index information is the same as the first index information, the cached first segment is played.
- an embodiment of the present application also provides a method for playing a media file, the method comprising:
- the target configuration file includes first index information and second index information, the first index information is used to indicate the first segment, and the second index information is used to indicate the second segment ;
- the second index information is the same as the first index information.
- an embodiment of the present application also provides a device for playing a media file, the device comprising:
- the sending module is used to send a first request message to the server, where the first request message is used to request to play a target media file, the target media file includes a first segment and a second segment, and the playback order of the first segment is earlier than the playback of the second segment order;
- a receiving module configured to receive a target configuration file sent by the server, where the target configuration file includes at least first index information and second index information, the first index information is used to indicate the first segment, and the second index information is used to indicate the second segment;
- a playback module configured to cache and play the first segment after acquiring the first segment from the server based on the first index information, and associate the first index information with the cached first segment; retrieve the cached content based on the second index information, And when the second index information is the same as the first index information, the buffered first segment is played.
- an embodiment of the present application also provides a device for playing a media file, the device comprising:
- a receiving module configured to receive a first request message sent by the electronic device, where the first request message is used to request to play a target media file, the target media file includes a first segment and a second segment, and the playback sequence of the first segment is earlier than that of the second segment the playback order;
- the sending module is configured to send a target configuration file to the electronic device according to the first request message, the target configuration file includes first index information and second index information, the first index information is used to indicate the first segment, and the second index information is used for for indicating the second segment, wherein, in the case that the second segment and the first segment are duplicate segments, the second index information is the same as the first index information.
- an embodiment of the present application provides an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor.
- the program or instruction is executed by the processor, the The steps of the method of the first aspect.
- an embodiment of the present application provides a server, where a program or an instruction is stored, and when the program or instruction is executed by a processor, the steps of the method of the second aspect are implemented.
- an embodiment of the present application provides a readable storage medium, where a computer program is stored on the readable storage medium, and when the computer program is executed by a processor, the method for playing a media file according to the first aspect or the second aspect is implemented A step of.
- an embodiment of the present application provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run programs or instructions to implement the method of the first aspect or the second aspect.
- the server stores a target configuration file corresponding to the target media file, wherein the target media file includes multiple segments, and the multiple segments include a first segment and a second segment; the target configuration file includes Multiple index information, the multiple index information includes first index information and second index information, the first index information and the second index information are respectively used to indicate the first segment and the second segment in the target media file, wherein the first The playback order of the segment is earlier than the playback order of the second segment.
- the electronic device When the electronic device requests the server to play the target media file, after the electronic device downloads and plays the first segment from the server according to the first index information, it can cache the first segment in the cache device of the electronic device, and when playing the second segment, If the index information of the second segment and the first segment are the same, that is, the second index information is the same as the first index information, it means that the second segment and the first segment are duplicate segments with duplicate content, and the electronic device no longer needs to download the server from the server again. Instead, it only needs to retrieve the first segment associated with it in the cache device of the electronic device according to the first index information, and play the first segment to achieve the purpose of playing the second segment, without the need for electronic The device downloads the second segment from the server again, which duplicates the first segment. In this way, in the process of playing the target media file with repeated segments, the electronic device no longer needs to repeatedly download the content repeated segments from the server, thereby saving traffic when playing the media files with repeated segments.
- FIG. 1 is a schematic structural diagram of a communication system provided by an embodiment of the present application.
- FIG. 2 is one of schematic diagrams of interaction of a media file playback method provided by an embodiment of the present application
- FIG. 3 is the second schematic diagram of the interaction of the media file playback method provided by the embodiment of the present application.
- FIG. 4 is a third schematic diagram of interaction of a media file playback method provided by an embodiment of the present application.
- FIG. 5 is one of schematic diagrams of operations for dividing a target media file into segments according to an embodiment of the present application
- FIG. 6 is the second schematic diagram of operations for dividing a target media file into segments according to an embodiment of the present application
- FIG. 7 is a third schematic diagram of operations for dividing a target media file into segments according to an embodiment of the present application.
- FIG. 8 is a fourth schematic diagram of interaction of a media file playback method provided by an embodiment of the present application.
- FIG. 9 is a fifth schematic diagram of interaction of a media file playback method provided by an embodiment of the present application.
- FIG. 10 is a schematic flowchart of a method for playing a media file performed by an electronic device according to an embodiment of the present application
- FIG. 11 is a schematic flowchart of a method for playing a media file performed by a server according to an embodiment of the present application
- FIG. 12 is one of the schematic structural diagrams of a device for playing a media file provided by an embodiment of the application.
- FIG. 13 is the second schematic structural diagram of a device for playing media files according to an embodiment of the application.
- FIG. 15 is the second schematic structural diagram of another media file playback device provided by an embodiment of the application.
- FIG. 16 is a third schematic structural diagram of another media file playback apparatus provided by an embodiment of the application.
- 17 is a schematic diagram of hardware of an electronic device provided by an embodiment of the present application.
- FIG. 18 is a schematic diagram of hardware of a server provided by an embodiment of the present application.
- the execution body of the method for playing media files provided by the embodiments of this application may be a device for playing media files.
- the connected server may also be a functional module and/or functional entity in the electronic device and the server capable of implementing the media file playback method, which can be specifically determined according to actual usage requirements, which are not limited in the embodiments of the present application.
- the method for playing a media file provided by the embodiment of the present application can be applied to a scenario in which an electronic device requests a server to play a media file with repeated segments. Or in a scenario where the electronic device requests the server to play a media file in which audio and video are repeated asynchronously.
- the server stores a target configuration file corresponding to the target media file, wherein the target media file includes multiple segments, and the multiple segments include a first segment and a second segment; the target configuration file includes Multiple index information, the multiple index information includes first index information and second index information, the first index information and the second index information are respectively used to indicate the first segment and the second segment in the target media file, wherein the first The playback order of the segment is earlier than the playback order of the second segment.
- the electronic device requests the server to play the target media file, after the electronic device downloads and plays the first segment from the server according to the first index information, it can cache the first segment in the memory of the electronic device.
- the index information of the second segment and the first segment is the same, that is, the second index information is the same as the first index information, indicating that the second segment and the first segment are duplicate segments with duplicate content, and the electronic device does not need to retrieve the data from the server again.
- To download the second segment it is only necessary to retrieve the first segment associated with it in the memory of the electronic device according to the first index information, and play the first segment to achieve the purpose of playing the second segment, without the need for the electronic device to replay the second segment.
- a second segment that duplicates the first segment is downloaded from the server. In this way, in the process of playing the target media file with repeated segments, the electronic device no longer needs to repeatedly download the repeated segments from the server, thereby saving traffic when playing the media file with repeated segments.
- FIG. 1 shows a schematic structural diagram of a communication system provided by an embodiment of the present application.
- the communication system may include at least one electronic device 01 and a server 02 .
- a connection and communication can be established between at least one electronic device 01 and the server 02 .
- FIG. 1 uses an example of a wired network connection between at least one electronic device 01 and the server 02 for exemplary illustration, which does not impose any limitation on the embodiments of the present application. It can be understood that, in actual implementation, a wireless network connection may also be used between at least one electronic device 01 and the server 02, which may be determined according to actual usage requirements.
- the server may be a computer device that manages resources and provides services for electronic devices.
- a server may include a processor, hard disk, memory, and bus, among others.
- the electronic device may send to the server a first request message for requesting to play the target media file, and after the server receives the first request message, the server may first send to the electronic device each segment including each segment in the target media file.
- the target configuration file of the index information that is, the electronic device obtains the target configuration file sent by the server, and then the electronic device can obtain the cached clips from the electronic device according to the index information in the target configuration file to play, or download the electronic device from the server. Fragments that have not been cached are played.
- the electronic device may be a mobile electronic device or a non-mobile electronic device.
- the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA) etc.
- the non-mobile electronic device may be a personal computer (personal computer, PC), a television (television, TV), a teller machine, or a self-service machine, etc.
- the embodiments of the present application do not specifically limit it.
- the electronic device may be an electronic device with an operating system.
- the operating system may be an Android operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
- an embodiment of the present application provides a method for playing media files, and the method for playing media files can pass between the electronic device 01 and the server 02 in the communication system shown in FIG. 1 .
- information exchange the method for playing a media file provided by the embodiment of the present application will be exemplarily described by taking an example that the media file playing apparatuses are an electronic device and a server respectively.
- the method for playing the media file may include the following steps 201 to 206 .
- Step 201 The electronic device sends a first request message to the server.
- the first request message is used for requesting to play the target media file
- the target media file includes a first segment and a second segment
- the playback sequence of the first segment is earlier than the playback sequence of the second segment.
- the above-mentioned first request message may be used to request to play the target media file. It can be understood that the above-mentioned first request message may be used by the electronic device to request the target media file from the server.
- the electronic device may send the first request message to the server in the following two ways:
- the electronic device may operate according to the user's play request, and in response to the play request operation, send a first request message to the server. That is, the electronic device may send the first request message to the server under the trigger of the user.
- the first request message may be triggered and sent by a user's operation to play a request to play the target media file in the target application.
- the first request message may be triggered and sent by the user's operation of a play button in the play interface of the target application. .
- the above-mentioned target application may be a multimedia application in an electronic device, such as a video application, an audio application, or other applications that may play audio files and/or video files.
- a multimedia application in an electronic device such as a video application, an audio application, or other applications that may play audio files and/or video files.
- it can be determined according to actual usage requirements, which is not limited in this embodiment of the present application.
- the electronic device may automatically send the first request message to the server.
- the above-mentioned electronic device may be installed with a certain video application, and after the electronic device enters the playback interface of the video application, a certain recommended video will be automatically played in the playback interface, that is, after the electronic device enters the playback interface, A first request message for playing the recommended video is automatically sent to the server.
- the above-mentioned target media file may be an audio media file (ie, including audio), a video media file (ie, including video), or an audio-video media file (ie, including audio and video).
- the above-mentioned target media file may include multiple segments, and the multiple segments include at least a first segment and a second segment, and the playback sequence of the first segment is earlier than the playback sequence of the second segment. That is, the second segment is played only after the electronic device plays the first segment.
- the first segment and the second segment may be segments with repeated content or may be segments with different contents.
- the first segment and the second segment are also audio-type media files
- the above-mentioned target media file is a video-type media file.
- the first segment and the second segment are also video media files.
- the second segment is also an audio and video media file.
- Step 202 The server receives the first request message.
- the server may receive the first request message sent by the electronic device, and after the server receives the first request message, the server may obtain the first request message according to the first request message.
- the target configuration file of the target media file indicated by the first request message may be
- Step 203 The server sends the target configuration file to the electronic device.
- the target configuration file includes first index information and second index information, the first index information is used to indicate the first segment, and the second index information is used to indicate the second segment.
- the server may store multiple media files, each media file is configured with a configuration file, and these configuration files are all stored in the server.
- the server may respond to the electronic device's playback request for the target media file, and first send the target configuration file corresponding to the target media file to the electronic device .
- the above-mentioned target configuration file may include multiple index information, the multiple index information includes at least first index information and second index information, and each index information may be used to indicate a target media file.
- the first index information is used to indicate the first segment and the second index information is used to indicate the second segment.
- the target configuration file can be used by the electronic device to download each segment in the target media file from the server before playing the target media file.
- a possible implementation manner is that the foregoing server may perform slice processing on the target media file to obtain multiple slice files (for example, the first segment and the second segment in the embodiment of the present application). , the server configures an index information for each segment. Then, the server may concatenate the above-mentioned multiple index information into a list file (eg, the target configuration file in this embodiment), and store the target configuration file in the server.
- a list file eg, the target configuration file in this embodiment
- the above server may also receive the target configuration file uploaded by the media file provider.
- the electronic device of the media file provider may first perform slice processing on the target media file to obtain multiple slice files (for example, the first segment and the second segment in the embodiment of the present application), and the electronic device of the media file provider One piece of index information is configured for each of the above-mentioned multiple segments, and then the above-mentioned multiple pieces of index information are spliced into a list file (for example, the target configuration file in this embodiment). Then, the electronic device of the media file provider may upload the target configuration file to the server, and after receiving the target configuration file, the server may store the target configuration file in the server.
- the electronic device of the media file provider may first perform slice processing on the target media file to obtain multiple slice files (for example, the first segment and the second segment in the embodiment of the present application), and then slice the target media file.
- the multiple segments are sent to the above-mentioned server, and after receiving the multiple segments, the server configures an index information for each segment respectively. Then, the server may concatenate the above-mentioned multiple index information into a list file (eg, the target configuration file in this embodiment), and store the target configuration file in the server.
- the target configuration file may be configured as a file in M3U8 format.
- the M3U8 file is essentially a M3U file (Moving Picture Experts Group Audio Layer 3 Uniform Resource Locator), which is similar to the directory information of audio files, video files, and audio and video files.
- M3U8 files are not audio files, video files and audio and video files, but a list file of audio files, video files and audio and video files.
- the electronic device opens the M3U8 file, the electronic device does not directly play the M3U8 file, but first obtains the corresponding index information according to the M3U8 file, and then downloads the corresponding segment and plays it.
- the above-mentioned multiple index information is greater than or equal to two index information.
- the above index information may be a uniform resource allocator (Uniform Resource Locator, URL), and the URL locates the resource by providing an abstract identifier for the location of the resource.
- the above index information may also be storage path information, or may be any other possible form of index information, which may be specifically determined according to actual usage requirements, which is not limited in this embodiment of the present application.
- the above-mentioned same index information can be understood as the same key (key) value of the URL, that is, the URLs with the same key are located at the same address.
- the above-mentioned same index information can be understood as the same storage path information.
- Step 204 the electronic device receives the target configuration file.
- the electronic device can play the segments indicated by the index information according to the index information in the target configuration file. Specifically, the electronic device can download and play the first segment from the server according to the plurality of first index information in the target configuration file, and the electronic device can also download and play the second segment from the server according to the second index information.
- Step 205 The electronic device caches and plays the first segment, and associates the first index information with the cached first segment.
- the electronic device may download the first segment from the server according to the first index information in the received target configuration file, cache the first segment in the local cache device of the electronic device, and then store the first segment in the local cache device of the electronic device.
- the index information is associated with the cached first segment, so that the electronic device can retrieve the first segment according to the first index information, and can read the first segment by the electronic device at any time.
- the foregoing electronic device may include a cache device.
- the cache device may be a static memory (SRAM), also known as a random access memory, which has a fast storage speed for data (such as index information, segments, etc.) or instructions (instructions for playing segments, instructions for reading segments, etc.).
- SRAM static memory
- instructions instructions for playing segments, instructions for reading segments, etc.
- the first segment may be cached in the electronic device.
- the first segment may be cached in the electronic device.
- the electronic device may further cache the text indicating the association relationship between the first segment and the first index information in the cache device.
- Step 206 The electronic device plays the buffered first segment when the second index information is the same as the first index information.
- the above-mentioned electronic device can confirm whether there are already cached fragments of the same content in the electronic device according to the second index information.
- the first index information in the The first index information that is the same as the second index information is read from the buffer device and the buffered first segment is played.
- the server can send the target configuration file corresponding to the target media file.
- the target media file includes multiple segments, and the multiple segments include the first segment and the second segment;
- the target configuration file includes multiple index information, and the multiple index information includes the first index information and the second index information,
- the first index information and the second index information are respectively used to indicate the first segment and the second segment in the target media file, wherein the playback sequence of the first segment is earlier than the playback sequence of the second segment.
- the electronic device When the content of the second segment is repeated with the first segment, the electronic device no longer downloads the second segment from the server, but reads it from the cache device of the electronic device. Take the first fragment that has been cached. Therefore, when there are duplicate segments in the target media file, if the electronic device has cached the duplicate segments, the electronic device no longer needs to repeatedly download the duplicate segments from the server, thereby avoiding the waste of traffic when the electronic device plays the media file, and, The efficiency of playing media files by the electronic device is also improved.
- the method for playing a media file may further include the following steps: 207 to step 208.
- Step 207 The electronic device acquires the second segment from the server based on the second index information.
- the above-mentioned electronic device can confirm whether there are already cached fragments of the same content in the electronic device according to the second index information. segment, the electronic device can download the second segment from the server.
- the electronic device when the electronic device performs retrieval according to the second index information, if the same index information as the second index information is not retrieved, it means that there is no cached segment duplicated with the second segment in the electronic device. If the electronic device needs to play the second segment, it needs to download the second segment from the server before it can be played.
- Step 208 The electronic device caches and plays the second segment, and associates the second index information with the cached second segment.
- the second segment is cached in the cache device of the electronic device.
- the electronic device can establish an association relationship between the second index information and the second segment, so that the electronic device can directly read the segment after the second segment that duplicates the content of the second segment.
- the second segment in the device is cached locally without the need to download the duplicate segment from the server again.
- the second segment may be cached in the electronic device.
- the second segment may be cached in the electronic device.
- the electronic device may further cache the text of the association relationship between the second segment and the second index information in the caching device.
- the method for playing a media file provided by the embodiment of the present application is only when the cache device of the electronic device does not cache the segment indicated by the index information that is the same as the second index information, that is, the cache device of the electronic device does not cache the segment indicated by the index information that is the same as the second index information.
- the electronic device is only required to obtain the second segment from the server and play the second segment. Therefore, the electronic device can determine whether to download the second segment from the server according to whether its cache device stores a duplicate segment with the same content as the second segment, so that the electronic device can avoid downloading the second segment from the server when responding to the user's playback request. Traffic waste caused by duplicate segments.
- Step 209 the server identifies the target media file.
- the server may perform an identification operation on the above-mentioned target media file. Specifically, the server identifies whether there is a duplicate segment in the target media file, and if there is a duplicate segment, step 210 is performed.
- Step 210 The server divides the target media file into multiple segments.
- the multiple segments include a first segment and a second segment.
- the server may divide the target media file into multiple segments according to the scene content of the target media file.
- the server may According to the content of the target media file, each segment of repeated actions is divided into a video segment, such as a first segment and a second segment.
- the server can , divides each segment of repeated audio into an audio segment, such as the first segment and the second segment.
- the server can For the content of the media file, each audio and video synchronous repeating segment is divided into an audio and video segment, such as the first segment and the second segment.
- step 210 may be implemented by the following step 210a.
- Step 210a If the duration of the repeated segments in the target media file is greater than or equal to a preset threshold, the server divides the target media file into a first segment and a second segment.
- the duration of the above-mentioned repeated segment may be the duration required for completely playing the repeated audio segment.
- a division method in which a target media file is divided into a plurality of segments is shown, and the above-mentioned target media file includes repeated segments of audio and video synchronously repeated, for example, the target media file is divided into 6 segments, and the first The 5 clips and the 1st clip are repeating clips in which the audio and video are repeated synchronously. If the duration of the first clip or the fifth clip is greater than or equal to the preset threshold, the server confirms that the repeated scene content of the first clip or the fifth clip is longer, indicating that the electronic device needs to download the above-mentioned repeated clips from the server. It consumes a lot of traffic, and it is necessary to divide the target media file into multiple segments, so that when the electronic device plays the repeated segments, it is not necessary to repeatedly download the repeated segments from the server.
- the division method is the same as that when the target media file is an audio and video file.
- a target media file is a video target media file, it is divided into multiple segments.
- the above-mentioned target media file includes repeated segments of the video repetition.
- the target media file is divided into 6 segments, and the third segment, the fourth segment and the fifth segment are the repeated segments of the video repetition.
- the server confirms that the content of the scenes repeated by the 3rd, 4th, and 5th segments is longer, and the electronic device Downloading the above-mentioned repeated segments from the server requires a lot of traffic, and it is necessary to divide the target media file into multiple segments for slicing processing, so that the electronic device does not need to repeatedly download these repeated segments from the server when playing the repeated segments.
- a target media file is an audio target media file
- the above target media file includes repeated audio clips.
- the target media file is divided into 6 clips, and each of the six clips has the same content, that is, the six clips are all repeated audio clips. If the duration of these 6 clips is greater than or equal to the preset threshold, the server confirms that the repeated scene content of these 6 clips is long, and the electronic device needs to download the above-mentioned repeated clips from the server, which consumes a lot of traffic, and it is necessary to convert the target media file It is divided into multiple segments, so that when the electronic device plays the repeated segments, it is not necessary to repeatedly download the repeated segments from the server.
- the server may perform slice processing on the target media file by identifying the segment repetition of the target media file, divide the target media file into multiple segments, and configure the corresponding first index information and the second index information, so that the electronic device does not need to repeatedly download the repeated segments from the server when playing the repeated segments, so that the electronic device can achieve the purpose of saving traffic when playing the target media file.
- the method for playing a media file provided by the embodiment of the present application may further include the following step 211 .
- Step 211 based on the presence of duplicate segments in the media file where the audio and video are synchronously repeated, the server processes the media file into a target media file.
- the above-mentioned media file may be a media file in which audio and video are repeated synchronously.
- the server regards the above-mentioned media file as a target media file, that is, the server regards the above-mentioned media file as a target media file file, and configure a target configuration file for the target media file, that is, an M3U8 file.
- the "repeated segment with synchronous repetition of audio and video” means: the video content of at least two segments in the multiple segments in the media file is the same, and the audio content is also the same.
- the duration of the above-mentioned "repeated segment of audio and video synchronously repeated” may also be greater than or equal to a preset threshold. Media files are sliced. If the duration of the repeated audio and video synchronously repeated segment is very short, and the electronic device consumes less traffic to download the repeated segment from the server, it is not necessary for the server to perform slicing processing on the media file as the target media file.
- the server may separate the audio and video of the media file into two parts. After each target media file is obtained, slice processing is performed on each target media file.
- the media file in the case that the media file has audio and video synchronous repeated segments, the media file is processed into a target media file, so that the electronic device uses a player to play the audio of the target media file at the same time. and video.
- the method for playing a media file provided by the embodiment of the present application may further include the following step 212 .
- Step 212 The electronic device starts the first player to play the first segment and the second segment of the target media file according to the target configuration file of a target media file.
- the above-mentioned first player can be used to play the video and audio of the target media file (that is, the player can play both the audio in the target media file and the audio in the target media file. video).
- the first segment and the second segment are audio and video segments.
- the above-mentioned first player can play the first segment and the second segment of the target media file.
- the electronic device uses the first player to play the first segment and the second segment according to the first index information and the second index information
- the second index information is the same as the first index information
- the electronic device no longer downloads the second segment from the server, but reads the cached first segment from the cache device of the electronic device, and uses the first player to play the first segment. a fragment.
- the method for the electronic device to play the first segment and the second segment according to the first index information and the second index information in the target configuration file will be described in detail in the foregoing embodiment, and will not be repeated here.
- the electronic device uses one player to play the first segment and the second segment in the target media file indicated by the first index information and the second index information, which can save player resources.
- the audio and video synchronization when the target media file is played is ensured, thereby improving the playback efficiency of the terminal device.
- the method for playing the media file provided by the embodiment of the present application may further include the following step 213 .
- Step 213 Based on the existence of duplicate segments in the audio or video in the media file, the server processes the media file into two target media files.
- one target media file in the two target media files is an audio file
- the other target media file in the two target media files is a video file
- the above-mentioned media file may be a media file in which audio or video has duplicate segments respectively.
- the server separates the above-mentioned media file into two target media files, one of which is an audio file. , that is, the audio target media file, and the other is the video file, that is, the video target media file.
- the server separates the above media file into two target media files, and each target media file contains a first segment and a second segment. .
- the above-mentioned server can also configure two target configuration files for the two target media files respectively, that is, the server configures two M3U8 files respectively for the above-mentioned two target media files, and each M3U8 file includes the first index information and the second index information. Index information, the first index information in each M3U8 file is used to indicate the first segment in the M3U8 file, and the second index information is used to indicate the second segment in the M3U8 file.
- the data frame of the media file may carry type identifiers, and through these identifiers, it can be determined whether the data frame is an audio data frame or a video data frame.
- the media file may contain both audio data frames and video data frames.
- the above-mentioned server can extract the audio data frame and the video data frame respectively from the media file, and the extracted audio data frame can be generated as a target media file, that is, the above-mentioned audio target media file, and the extracted video data frame can be generated as a target media file.
- the target media file that is, the above-mentioned video target media file.
- the server when the server is requested by the electronic device to play a media file, if the server separates the media file into two target media files, the server will send a corresponding identification code to the electronic device, and the electronic device Send two first request messages to the server simultaneously according to the identification code, so that the electronic device can use different players to play the two target media files.
- the target configuration files of the two target media files may be different configuration files. That is to say, the first index information of the audio target media file and the first index information of the video target media file may be different index information, and the second index information of the audio target media file and the second index information of the video target media file may be different. for different index information.
- “there are duplicate segments in the audio or video” means: there are duplicate segments in the audio in the media file, there are duplicate segments in the video in the media file, or there are duplicate segments in both the audio and video in the media file, But the repetition of audio and video is out of sync. As shown in FIG. 8 , the contents of the third to fifth segments in the video target media file are repeated, but the third to fifth segments in the audio target media file are different from each other.
- the server separates the media file into two target media files, which are respectively an audio target media file and a video target media file, and one or two of the target media files include repeated segments. Therefore, according to the actual situation of the media files, slice processing can be performed on the two target media files respectively, so as to further save the traffic of downloading the repeated segments.
- the method for playing a media file provided by the embodiment of the present application may further include the following step 214 .
- Step 214 the electronic device starts the second player to play the first segment and the second segment in a target media file according to the target configuration file of a target media file, and the electronic device starts the third player according to the target configuration of another target media file.
- the file plays the first segment and the second segment from another target media file.
- the electronic device may start two players for playing the two target media files respectively.
- the server separates the media file into two target media files, wherein one target media file is a video target media file, and the other target media file is an audio target question file.
- the electronic device uses the second player to play the video target media file, and uses the third player to play the audio target media file.
- the electronic device uses the second player to play the first segment (the first segment in this embodiment) and the second segment according to the target configuration file of the video target media file, since the electronic device has not cached the same video segment, it needs to be Request to download 1st and 2nd fragment from server.
- the index information of the third segment and the first segment is the same, and the file contents are both segment 1.
- segment 1 is directly read and played from the buffer device.
- the electronic device uses the second player to play the fourth segment and the fifth segment, it also directly reads and plays segment 1 from the buffer device. Since the index information of the 6 segments in the audio target media file is different, the contents of the indicated segments are also different, so the third player plays the 6 segments of the audio target media file according to the target configuration file of the audio target media file. , the 6 segments need to be downloaded from the server.
- segment duration and number of segments in the above-mentioned video target media file may be the same or different from the segment duration and number of segments in the above-mentioned video target media file.
- the server separates the media file into two target media files, wherein one target media file is a video target media file, and the other target media file is an audio target question file.
- the electronic device uses the second player to play the video target media file, and uses the third player to play the audio target media file.
- the electronic device uses the second player to play 6 clips according to the target configuration file of the video target media file, the index information of the 6 clips is different, and the contents of the indicated clips are also different, so the second player is playing the 6 clips.
- the electronic device needs to request to download the 6 segments from the server.
- the electronic device uses the third player to play 6 segments according to the target configuration file of the audio target media file, the first segment (the first segment in this embodiment) to the sixth segment (the second segment in this embodiment) ), the index information is the same, and the file content is segment 1. Only the first segment needs to be downloaded from the server. When playing the remaining 5 segments, segment 1 is directly read from the cache device of the electronic device and played.
- the electronic device uses two players to play two target media files respectively.
- the repeated repeated segments are read and played separately, thereby further saving the traffic of the electronic device for downloading the repeated segments according to the respective repetitions of the audio and video in the media file.
- an embodiment of the present application provides a method for playing a media file
- the execution subject is an electronic device, and the method includes:
- Step 1001 Send a first request message to a server.
- the first request message is used for requesting to play the target media file
- the target media file includes a first segment and a second segment
- the playback sequence of the first segment is earlier than the playback sequence of the second segment.
- Step 1002 Receive the target configuration file sent by the server.
- the target configuration file includes first index information and second index information, the first index information is used to indicate the first segment, and the second index information is used to indicate the second segment.
- Step 1003 Cache and play the first segment, and associate the first index information with the cached first segment.
- Step 1004 Play the buffered first segment when the second index information is the same as the first index information.
- the above method further includes steps 1005 to 1006:
- Step 1005 Obtain the second segment from the server based on the second index information.
- Step 1006 Cache and play the second segment, and associate the second index information with the cached second segment.
- the above method further includes step 1007:
- Step 1007 Start the first player to play the first segment and the second segment according to the first index information and the second index information.
- the above method further includes step 1008:
- Step 1008 start the second player to play the first segment and the second segment in a target media file according to the target configuration file of a target media file, and the electronic device starts the third player to play according to the target configuration file of another target media file.
- the first segment and the second segment in another target media file start the second player to play the first segment and the second segment in a target media file according to the target configuration file of a target media file, and the electronic device starts the third player to play according to the target configuration file of another target media file.
- the first segment and the second segment in another target media file.
- steps 1001 to 1008 in the method for playing media files provided by the embodiments of the present application, reference may be made to the steps performed by the electronic device and the related descriptions of the effects achieved in the foregoing embodiments. To avoid repetition, details are not repeated here.
- an embodiment of the present application provides a method for playing a media file
- the execution subject is a server
- the method includes:
- Step 1101 Receive a first request message sent by the electronic device.
- the first request message is used for requesting to play the target media file
- the target media file includes a first segment and a second segment
- the playback sequence of the first segment is earlier than the playback sequence of the second segment.
- Step 1102 Send the target configuration file to the electronic device according to the first request message.
- the target configuration file includes first index information and second index information, the first index information is used to indicate the first segment, and the second index information is used to indicate the second segment.
- the above method further includes:
- Step 1103 Identify the target media file.
- Step 1104 Divide the target media file into multiple segments.
- the multiple segments include a first segment and a second segment.
- step 1104 specifically includes step 1104a:
- Step 1104a If the duration of the repeated segments in the target media file is greater than or equal to a preset threshold, divide the target media file into a first segment and a second segment.
- the above method further includes:
- Step 1105 Based on the presence of repeated segments of audio and video synchronously repeated in the media file, the server processes the media file into a target media file.
- the above method further includes:
- Step 1106 Based on the presence of duplicate segments in the audio or video in the media file, the media file is processed into two target media files.
- One of the two target media files is an audio file
- the other of the two target media files is a video file.
- steps 1101 to 1106 in the media file playback method provided by the embodiments of the present application, reference may be made to the steps performed by the server and the related descriptions of the effects achieved in the foregoing embodiments, which are not repeated here to avoid repetition.
- an embodiment of the present application provides an apparatus 1200 for playing a media file.
- the apparatus 1200 for playing the media file may include a sending module 1201 , a receiving module 1202 and a playing module 1203 .
- the sending module 1201 is used to send a first request message to the server.
- the first request message is used to request to play a target media file.
- the target media file includes a first segment and a second segment.
- the playback order of the first segment is earlier than that of the second segment.
- the playback sequence of the clips; the receiving module 1202 is used to receive the target configuration file sent by the server after the sending module sends 1201 the first request message.
- the target configuration file includes at least the first index information and the second index information.
- the first index information uses For indicating the first segment, the second index information is used for indicating the second segment.
- the playback module 1203 is configured to cache and play the first segment after the receiving module 1202 obtains the first segment from the server based on the first index information, and associate the first index information with the cached first segment; the playback module 1203 is further based on the The second index information retrieves the cached content, and if the second index information is the same as the first index information, the cached first segment is played.
- the playback module 1203 may also be configured to obtain the second segment from the server based on the second index information when the second index information is different from the first index information; and cache and play the first segment. two segments, and associate the second index information with the cached second segment.
- the media file playback apparatus 1200 may further include a start-up module 1204 for starting the first media file when the number of target media files is one.
- a player plays the first segment and the second segment according to the first index information and the second index information.
- the startup module 1204 is used to start the second player according to the target of a target media file.
- the configuration file plays the first segment and the second segment in one target media file, and starts the third player to play the first segment and the second segment in the other target media file according to the target configuration file of the other target media file.
- the apparatus for playing a media file provided in the embodiment of the present application can implement each process implemented by the electronic device in the foregoing method embodiment, and to avoid repetition, details are not repeated here.
- a media file playback device when the media file playback device downloads a segment of a target media file from a server, the media file playback device can first determine the local location according to the second index information of the second segment Whether there is a cached first segment with the same index information in the cache device of the first segment, and play the first segment without downloading the second segment from the server again. In this way, the device for playing a media file does not need to download the repeated segment repeatedly during the process of playing the target media file having the repeated segment, thereby saving the traffic for downloading the repeated segment.
- the apparatus for playing a media file provided in the embodiment of the present application can implement each process implemented by the electronic device in the foregoing method embodiment, and to avoid repetition, details are not repeated here.
- an embodiment of the present application provides an apparatus 1500 for playing a media file.
- the apparatus 1500 for playing the media file may include a receiving module 1501 and a sending module 1502 .
- the receiving module 1501 is configured to receive a first request message sent by the electronic device, the first request message is used to request to play a target media file, the target media file includes a first segment and a second segment, and the playback order of the first segment is earlier than that of the second segment.
- the playback order of the clips may include a receiving module 1501 and a sending module 1502 .
- the receiving module 1501 is configured to receive a first request message sent by the electronic device, the first request message is used to request to play a target media file, the target media file includes a first segment and a second segment, and the playback order of the first segment is earlier than that of the second segment. The playback order of the clips.
- the sending module 1502 is configured to send a target configuration file to the electronic device according to the first request message received by the receiving module 1501, where the target configuration file includes first index information and second index information, and the first index information is used to indicate the first segment , the second index information is used to indicate the second segment; wherein, in the case that the second segment and the first segment are duplicate segments, the second index information is the same as the first index information.
- the apparatus 1500 for playing the media file may further include an identification module 1503 .
- the identifying module 1503 is configured to identify the target media file before the sending module 1502 sends the target configuration file to the electronic device.
- the media file playing apparatus 1500 may further include a dividing module 1504 .
- the dividing module 1504 is configured to divide the target media file into multiple segments if there are duplicate segments in the target media file, and the multiple segments include the first segment and the second segment.
- the dividing module 1504 is specifically configured to divide the target media file into a first segment and a second segment if the duration of the repeated segments in the target media file is greater than or equal to a preset threshold.
- the apparatus 1500 for playing the media file may further include a processing module 1505 .
- the processing module 1505 is used to process the media file as a target media file based on the repeated segments of audio and video synchronization in the media file; based on the presence of repeated segments in the audio or video in the media file, the media file is processed into two targets For media files, one of the two target media files is an audio file, and the other of the two target media files is a video file.
- the apparatus for playing a media file provided by the embodiment of the present application can implement each process implemented by the server in the foregoing method embodiment, and to avoid repetition, details are not described here.
- An embodiment of the present application provides a media file playback device, because before the electronic device sends a first request message to the media file playback device, the media file playback device can first process and identify the target media file, and send the media file to the electronic device.
- a target configuration file is sent, where the target configuration file includes multiple index information, and the multiple index information includes first index information and second index information. Therefore, the electronic device can receive the target configuration file according to the first request message, so that when the electronic device downloads the segments according to the index information, it is not necessary to download duplicate segments, thereby saving traffic.
- FIG. 17 is a schematic diagram of a hardware structure of an electronic device implementing various embodiments of the present application.
- the electronic device 1700 includes but is not limited to: a radio frequency unit 1701 , a network unit 1702 , an audio output unit 1703 , an input unit 1704 , a sensor 1705 , a display unit 1706 , a user input unit 1707 , an interface unit 1708 , and a memory 1709 , a processor 1710, and components such as a power supply.
- a radio frequency unit 1701 a radio frequency unit 1701
- the electronic device 1700 includes but is not limited to: a radio frequency unit 1701 , a network unit 1702 , an audio output unit 1703 , an input unit 1704 , a sensor 1705 , a display unit 1706 , a user input unit 1707 , an interface unit 1708 , and a memory 1709 , a processor 1710, and components such as a power supply.
- the radio frequency unit 1701 is used to send a first request message to the server, and is used to send a first request message to the server, where the first request message is used to request to play a target media file, and the target media file includes a first segment and a second segment, The playback sequence of the first segment is earlier than the playback sequence of the second segment; the radio frequency unit 1701 is further configured to receive the target configuration file sent by the server, and the target configuration file includes the target configuration file including at least the first index information and the second index information, and the first index information and the second index information are included in the target configuration file.
- One index information is used to indicate the first segment
- the second index information is used to indicate the second segment.
- the memory 1709 is configured to cache the first segment in the memory 1708 after the radio frequency unit 1701 receives the first segment sent by the server.
- the audio output unit 1703 and/or the display unit 1706 are used to play the first segment.
- the processor 1710 is configured to associate the first index information with the buffered first segment after the audio output unit 1703 and/or the display unit 1706 play the first segment.
- the audio output unit 1703 and/or the display unit 1706 are further configured to retrieve the cached content with the second index information after the first segment is cached in the memory, and play the content when the second index information is the same as the first index information.
- the first fragment of the cache is further configured to retrieve the cached content with the second index information after the first segment is cached in the memory, and play the content when the second index information is the same as the first index information.
- the first fragment of the cache are further configured to retrieve the cached content with the second index information after the first segment is cached in the memory, and play the content when the second index information is the same as the first index information.
- the first fragment of the cache is further configured to retrieve the cached content with the second index information after the first segment is cached in the memory, and play the content when the second index information is the same as the first index information.
- the server can send the target configuration file corresponding to the target media file and including multiple index information, so that the electronic device The 1700 can play the target media file in segments. Therefore, when there are duplicate segments in the target media file, if the electronic device 1700 has cached the duplicate segments, the electronic device 1700 does not need to repeatedly download the duplicate segments from the server, thereby avoiding the waste of traffic when the electronic device 1700 plays the media file. , and the efficiency of playing media files by the electronic device 1700 is also improved.
- the radio frequency unit 1701 is further configured to acquire the second segment from the server based on the second index information when the second index information is different from the first index information, and cache the second segment in the memory 1708 .
- the processor 1710 is further configured to associate the second index information with the second segment.
- the processor 1710 is further configured to start an audio output unit 1703 and/or a display unit 1706 to play the first segment and the first segment according to the first index information and the second index information when the number of target media files is one. Second segment.
- the processor 1710 activates two frequency output units 1703 and/or display units 1706, wherein one frequency output unit 1703 and/or display unit 1706 is based on the first index information and the second frequency output unit 1706.
- the index information plays the first segment and the second segment in one target media file
- the other audio output unit 1703 and/or the display unit 1706 plays the first segment in another target media file according to the first index information and the second index information and the second fragment.
- the radio frequency unit 1701 can be used for receiving and sending signals during sending and receiving of information or during a call. Specifically, after receiving the downlink data from the base station, it is processed by the processor 1710; The uplink data is sent to the base station.
- the radio frequency unit 1701 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like.
- the radio frequency unit 1701 can also communicate with the network and other devices through a wireless communication system.
- the electronic device provides the user with wireless broadband Internet access through the network unit 1702, such as helping the user to send and receive emails, browse web pages, access streaming media, and the like.
- the audio output unit 1703 may convert audio data received by the radio frequency unit 1701 or the network unit 1702 or stored in the memory 1709 into audio signals and output as sound. Also, the audio output unit 1703 may also provide audio output related to a specific function performed by the electronic device 1700 (eg, call signal reception sound, message reception sound, etc.).
- the audio output unit 1703 includes a speaker, a buzzer, a receiver, and the like.
- the memory 1709 may be used to store software programs as well as various data.
- the memory 1709 may mainly include a stored program area and a stored data area, wherein the stored program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; Data created by the use of the mobile phone (such as audio data, phone book, etc.), etc.
- memory 1709 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
- the processor 1710 is the control center of the electronic device, using various interfaces and lines to connect various parts of the entire electronic device, by running or executing the software programs and/or modules stored in the memory 1709, and calling the data stored in the memory 1709. , perform various functions of electronic equipment and process data, so as to monitor electronic equipment as a whole.
- the processor 1710 may include one or more processing units; optionally, the processor 1710 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem
- the modulation processor mainly handles wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 1710.
- the electronic device 1700 includes some functional modules not shown, which will not be repeated here.
- an embodiment of the present application further provides an electronic device, including a processor 1710 as shown in FIG. 17 , a memory 1709 , a computer program stored in the memory 1709 and executable on the processor 1710 , the computer program being When the processor 1710 executes, each process of the foregoing method embodiment is implemented, and the same technical effect can be achieved, which is not repeated here.
- FIG. 18 is a schematic diagram of a hardware structure of a server according to an embodiment of the present application.
- the server 1800 may include: one or more processors 1801 , a memory 1802 , a communication interface 1803 and a bus 1804 .
- the processor 1801 can be configured to receive a first request message sent by the electronic device through the bus 1804 and the communication interface 1803, where the first request message is used to request to play a target media file, and the target media file includes a first segment and a second segment, The playback sequence of the first segment is earlier than the playback sequence of the second segment, then the target configuration file is sent to the electronic device through the bus 1804 and the communication interface 1803, and the target configuration file is sent to the electronic device.
- the target configuration file includes the first index information and the first index information. Two index information, the first index information is used to indicate the first segment, and the second index information is used to indicate the second segment. The index information is the same.
- the server 1800 may perform slice processing on the target media file, divide the target media file into multiple segments, and configure corresponding index information, so that when the electronic device plays the repeated segments according to the index information, the These repeated segments need to be downloaded from the server repeatedly, so that the electronic device can achieve the purpose of saving traffic when playing the target media file.
- the processor 1801 may also identify the target media file; if there are duplicate segments in the target media file, the target media file is divided into multiple segments, and the multiple segments include the first segment and the second segment.
- the processor 1801 may further divide the target media file into multiple segments.
- the processor 1801 is configured to process the media file as a target media file based on the presence of repeated segments of audio and video synchronously in the media file; based on the presence of repeated segments in the audio or video in the media file, the media The file is processed as two target media files, one of the two target media files is an audio file, and the other of the two target media files is a video file.
- one or more processors 1801 , a memory 1802 , and a communication interface 1803 are connected to each other through a bus 1804 .
- the bus 1804 may be a peripheral component interconnect standard (Peripheral Component Interconnect, PCI) bus or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus or the like.
- PCI Peripheral Component Interconnect
- EISA Extended Industry Standard Architecture
- the bus 1804 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is shown in FIG. 18, but it does not mean that there is only one bus or one type of bus.
- the server 1800 may also include some functional modules not shown, which will not be repeated here.
- an embodiment of the present application further provides a server, including the processor 1801 shown in FIG. 18 , a memory 1802 , and a computer program stored in the memory 1802 and executable on the processor 1801 , the computer program being executed by the processor
- a server including the processor 1801 shown in FIG. 18 , a memory 1802 , and a computer program stored in the memory 1802 and executable on the processor 1801 , the computer program being executed by the processor
- Embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and the computer program is executed by the radio frequency unit 1701, the memory 1709, the processor 1710 as shown in FIG. 17 or the computer program shown in FIG. 18 .
- the processor 1801 shown implements each process of the foregoing method embodiments when executed, and can achieve the same technical effect. To avoid repetition, details are not repeated here.
- the computer-readable storage medium is, for example, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), a magnetic disk, or an optical disk.
- An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the above embodiment of the media file playback method and can achieve the same technical effect, in order to avoid repetition, it will not be repeated here.
- the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-a-chip, or a system-on-a-chip, or the like.
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
Claims (23)
- 一种媒体文件的播放方法,所述方法包括:向服务器发送第一请求消息,所述第一请求消息用于请求播放目标媒体文件,所述目标媒体文件包括第一片段和第二片段,所述第一片段的播放顺序早于所述第二片段的播放顺序;接收所述服务器发送的目标配置文件,所述目标配置文件至少包括第一索引信息和第二索引信息,所述第一索引信息用于指示所述第一片段,所述第二索引信息用于指示所述第二片段;在基于所述第一索引信息从所述服务器获取所述第一片段后,缓存并播放所述第一片段,并将所述第一索引信息与缓存的所述第一片段进行关联;基于所述第二索引信息检索缓存内容,并在所述第二索引信息与所述第一索引信息相同的情况下,播放缓存的所述第一片段。
- 根据权利要求1所述的方法,其中,所述基于所述第二索引信息检索缓存内容之后,所述方法还包括:在所述第二索引信息与所述第一索引信息不同的情况下,基于所述第二索引信息,从所述服务器获取所述第二片段;缓存并播放所述第二片段,并将所述第二索引信息与缓存的所述第二片段进行关联。
- 根据权利要求1或2所述的方法,其中,所述方法还包括:在所述目标媒体文件的数量为一个的情况下,启动第一播放器根据所述第一索引信息和所述第二索引信息播放所述第一片段和所述第二片段。
- 根据权利要求1或2所述的方法,其中,所述方法还包括:在所述目标媒体文件的数量为两个,两个所述目标媒体文件分别为一个媒体文件的音频文件和视频文件的情况下;启动第二播放器根据一个所述目标媒体文件的所述目标配置文件播放一个所述目标媒体文件中的所述第一片段和所述第二片段,且启动第三播放器根据另一个所述目标媒体文件的所述目标配置文件播放另一个所述目标媒体文件中的所述第一片段和所述第二片段。
- 一种媒体文件的播放方法,所述方法包括:接收电子设备发送的第一请求消息,所述第一请求消息用于请求播放目标媒体文件,所述目标媒体文件包括第一片段和第二片段,所述第一片段的播放顺序早于所述第二片段的播放顺序;根据所述第一请求消息,向所述电子设备发送目标配置文件,所述目标配置文件中包括第一索引信息和第二索引信息,所述第一索引信息用于指示所述第一片段,所述第二索引信息用于指示所述第二片段;在所述第二片段与所述第一片段为重复片段的情况下,所述第二索引信息与所述第一索引信息相同。
- 根据权利要求5所述的方法,其中,向所述电子设备发送目标配置文件之前,所述方法还包括:识别所述目标媒体文件;若所述目标媒体文件中存在重复片段,则将所述目标媒体文件划分为多个片段,所述多个片段包括所述第一片段和所述第二片段。
- 根据权利要求6所述的方法,其中,所述若所述目标媒体文件中存在重复片段,则将所述目标媒体文件划分为所述第一片段和所述第二片段,包括:若所述目标媒体文件中的所述重复片段的时长大于或等于预设阈值,则将所述目标媒体文件划分为所述第一片段和所述第二片段。
- 根据权利要求6所述的方法,其中,在识别所述目标媒体文件之前,所述方法还包括:基于媒体文件中存在音频和视频同步重复的重复片段,则将所述媒体文件处理为一个所述目标媒体文件;基于媒体文件中的音频或者视频中存在重复片段,将所述媒体文件处理为两个所述目标媒体文件,两个所述目标媒体文件中的一个目标媒体文件为音频文件,两个所述目标媒 体文件中的另一个目标媒体文件为视频文件。
- 一种媒体文件的播放装置,所述装置包括:发送模块,用于向服务器发送第一请求消息,所述第一请求消息用于请求播放目标媒体文件,所述目标媒体文件包括第一片段和第二片段,所述第一片段的播放顺序早于所述第二片段的播放顺序;接收模块,用于接收所述服务器发送的目标配置文件,所述目标配置文件至少包括第一索引信息和第二索引信息,所述第一索引信息用于指示所述第一片段,所述第二索引信息用于指示所述第二片段;播放模块,用于在基于所述第一索引信息从所述服务器获取所述第一片段后,缓存并播放所述第一片段,并将所述第一索引信息与缓存的所述第一片段进行关联;基于所述第二索引信息检索缓存内容,并在所述第二索引信息与所述第一索引信息相同的情况下,播放缓存的所述第一片段。
- 根据权利要求9所述的媒体文件的播放装置,其中,所述播放模块,还用于在所述第二索引信息与所述第一索引信息不同的情况下,基于所述第二索引信息,从所述服务器获取所述第二片段,且缓存并播放所述第二片段,并将所述第二索引信息与缓存的所述第二片段进行关联。
- 根据权利要求9或10所述的媒体文件的播放装置,其中,所述装置还包括:启动模块,用于在所述目标媒体文件的数量为一个的情况下,启动第一播放器根据所述第一索引信息和所述第二索引信息播放所述第一片段和所述第二片段。
- 根据权利要求9或10所述的媒体文件的播放装置,其中,在所述目标媒体文件的数量为两个的情况下,两个所述目标媒体文件分别为一个媒体文件的音频文件和视频文件,所述装置还包括:启动模块,用于启动第二播放器根据一个所述目标媒体文件的目标配置文件播放一个所述目标媒体文件中的所述第一片段和所述第二片段,且启动第三播放器根据另一个所述目标媒体文件的所述目标配置文件播放另一个所述目标媒体文件中的所述第一片段和所述第二片段。
- 一种媒体文件的播放装置,所述装置包括:接收模块,用于接收电子设备发送的第一请求消息,所述第一请求消息用于请求播放目标媒体文件,所述目标媒体文件包括第一片段和第二片段,所述第一片段的播放顺序早于所述第二片段的播放顺序;发送模块,用于根据所述第一请求消息,向所述电子设备发送目标配置文件,所述目标配置文件中包括第一索引信息和第二索引信息,所述第一索引信息用于指示所述第一片段,所述第二索引信息用于指示所述第二片段;其中,在所述第二片段与所述第一片段为重复片段的情况下,所述第二索引信息与所述第一索引信息相同。
- 根据权利要求13所述的媒体文件的播放装置,其中,所述装置还包括:识别模块,用于在发送模块向电子设备发送目标配置文件之前,识别目标媒体文件;划分模块,用于若所述目标媒体文件中存在重复片段,则将所述目标媒体文件划分为多个片段,所述多个片段包括所述第一片段和所述第二片段。
- 根据权利要求14所述的媒体文件的播放装置,其中,所述划分模块,具体用于若所述目标媒体文件中的重复片段的时长大于或等于预设阈值,则将所述目标媒体文件划分为所述第一片段和所述第二片段。
- 根据权利要求14所述的媒体文件的播放装置,其中,所述装置还包括:处理模块,用于在所述识别模块识别所述目标媒体文件之前,基于媒体文件中存在音频和视频同步重复的重复片段,将媒体文件处理为一个所述目标媒体文件;基于媒体文件中的音频或者视频中存在重复片段,将媒体文件处理为两个所述目标媒体文件,两个所述目标媒体文件中的一个所述目标媒体文件为音频文件,两个所述目标媒体文件中的另一个所述目标媒体文件为视频文件。
- 一种电子设备,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至4中任一项所述的媒体文件的播放方法的步骤。
- 一种服务器,包括处理器,存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求5至8中任一项所述的媒体文件的播放方法的步骤。
- 一种可读存储介质,其特征在于,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1至8中任一项所述的媒体文件的播放方法的步骤。
- 一种计算机程序产品,所述计算机程序产品被至少一个处理器执行以实现如权利要求1-8任一项所述的媒体文件的播放方法的步骤。
- 一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1-8任一项所述的媒体文件的播放方法的步骤。
- 一种电子设备,所述电子设备被配置成用于执行如权利要求1-4任一项所述的媒体文件的播放方法的步骤。
- 一种服务器,所述服务器被配置成用于执行如权利要求5-8任一项所述的媒体文件的播放方法的步骤。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US18/372,686 US20240031615A1 (en) | 2021-03-26 | 2023-09-25 | Media file play method and apparatus, electronic device, server, and medium |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202110328077.1 | 2021-03-26 | ||
| CN202110328077.1A CN113163226B (zh) | 2021-03-26 | 2021-03-26 | 媒体文件的播放方法、装置、电子设备、服务器和介质 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US18/372,686 Continuation US20240031615A1 (en) | 2021-03-26 | 2023-09-25 | Media file play method and apparatus, electronic device, server, and medium |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022199541A1 true WO2022199541A1 (zh) | 2022-09-29 |
Family
ID=76885026
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/082076 Ceased WO2022199541A1 (zh) | 2021-03-26 | 2022-03-21 | 媒体文件的播放方法、装置、电子设备、服务器和介质 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20240031615A1 (zh) |
| CN (1) | CN113163226B (zh) |
| WO (1) | WO2022199541A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113163226B (zh) * | 2021-03-26 | 2023-04-07 | 维沃移动通信有限公司 | 媒体文件的播放方法、装置、电子设备、服务器和介质 |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104601535A (zh) * | 2014-05-08 | 2015-05-06 | 腾讯科技(深圳)有限公司 | 视频处理方法和系统 |
| CN108540868A (zh) * | 2018-05-16 | 2018-09-14 | 北京百度网讯科技有限公司 | Hls直播的处理方法、装置、服务器、终端及存储介质 |
| CN108763375A (zh) * | 2018-05-17 | 2018-11-06 | 上海七牛信息技术有限公司 | 一种媒体文件缓存方法、装置以及多媒体播放系统 |
| CN108965910A (zh) * | 2018-08-09 | 2018-12-07 | 网宿科技股份有限公司 | 一种视频缓存方法及播放器 |
| CN109729386A (zh) * | 2019-01-03 | 2019-05-07 | 深圳市网心科技有限公司 | 一种视频文件启播方法、系统及电子设备和存储介质 |
| CN113163226A (zh) * | 2021-03-26 | 2021-07-23 | 维沃移动通信有限公司 | 媒体文件的播放方法、装置、电子设备、服务器和介质 |
Family Cites Families (13)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP2939394B1 (en) * | 2012-12-27 | 2020-02-26 | Telefonaktiebolaget LM Ericsson (publ) | Distributed caching |
| CN103618919B (zh) * | 2013-11-19 | 2017-09-05 | 深圳Tcl新技术有限公司 | 网络电视加载视频的方法和装置 |
| CN103686455A (zh) * | 2013-11-22 | 2014-03-26 | 乐视致新电子科技(天津)有限公司 | 一种基于hls协议的视频播放方法和装置 |
| US9491239B2 (en) * | 2014-01-31 | 2016-11-08 | Comcast Cable Communications, Llc | Methods and systems for processing data requests |
| CN105100912B (zh) * | 2014-05-12 | 2018-10-12 | 联想(北京)有限公司 | 流媒体处理方法和流媒体处理装置 |
| CN106303577B (zh) * | 2015-06-08 | 2019-10-08 | 广州市动景计算机科技有限公司 | 下载流媒体的方法及装置 |
| CN106550263A (zh) * | 2015-09-16 | 2017-03-29 | 深圳市腾讯计算机系统有限公司 | 媒体播放方法及装置 |
| CN106559677B (zh) * | 2015-09-30 | 2020-04-03 | 华为技术有限公司 | 终端、缓存服务器及获取视频分片的方法及装置 |
| CN106231440A (zh) * | 2016-07-22 | 2016-12-14 | 华为技术有限公司 | 一种流媒体文件分片下载方法、装置及终端 |
| CN109089175B (zh) * | 2017-06-14 | 2022-04-22 | 中兴通讯股份有限公司 | 一种视频缓存加速的方法及装置 |
| CN107911712B (zh) * | 2017-11-30 | 2020-10-09 | 歌尔科技有限公司 | 数据缓冲方法和电子设备 |
| CN111787391A (zh) * | 2020-07-17 | 2020-10-16 | 广州优谷信息技术有限公司 | 一种信息卡片展示方法、装置、设备及存储介质 |
| CN112423140A (zh) * | 2020-12-16 | 2021-02-26 | 富盛科技股份有限公司 | 视频播放方法、装置、电子设备和存储介质 |
-
2021
- 2021-03-26 CN CN202110328077.1A patent/CN113163226B/zh active Active
-
2022
- 2022-03-21 WO PCT/CN2022/082076 patent/WO2022199541A1/zh not_active Ceased
-
2023
- 2023-09-25 US US18/372,686 patent/US20240031615A1/en not_active Abandoned
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN104601535A (zh) * | 2014-05-08 | 2015-05-06 | 腾讯科技(深圳)有限公司 | 视频处理方法和系统 |
| CN108540868A (zh) * | 2018-05-16 | 2018-09-14 | 北京百度网讯科技有限公司 | Hls直播的处理方法、装置、服务器、终端及存储介质 |
| CN108763375A (zh) * | 2018-05-17 | 2018-11-06 | 上海七牛信息技术有限公司 | 一种媒体文件缓存方法、装置以及多媒体播放系统 |
| CN108965910A (zh) * | 2018-08-09 | 2018-12-07 | 网宿科技股份有限公司 | 一种视频缓存方法及播放器 |
| CN109729386A (zh) * | 2019-01-03 | 2019-05-07 | 深圳市网心科技有限公司 | 一种视频文件启播方法、系统及电子设备和存储介质 |
| CN113163226A (zh) * | 2021-03-26 | 2021-07-23 | 维沃移动通信有限公司 | 媒体文件的播放方法、装置、电子设备、服务器和介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN113163226B (zh) | 2023-04-07 |
| US20240031615A1 (en) | 2024-01-25 |
| CN113163226A (zh) | 2021-07-23 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN104081787B (zh) | 接收设备、接收方法、发送设备和发送方法 | |
| JP5805616B2 (ja) | 通信デバイスにおけるコンテンツの検索/ダウンロードのための装置および方法 | |
| US9838758B2 (en) | Relevancy improvement through targeting of information based on data gathered from a networked device associated with a security sandbox of a client device | |
| TWI547159B (zh) | 媒體內容分享方法和終端設備及內容分享系統 | |
| CN103945259B (zh) | 一种在线视频播放方法及装置 | |
| CN110096660A (zh) | 用于加载页面图片的方法、装置和电子设备 | |
| KR101643238B1 (ko) | 공유된 장치 및 개인용 장치를 이용한 개인맞춤화된 사용자 기능의 협력적 제공 | |
| WO2016173396A1 (zh) | 基于视频播放的信息处理方法和系统、客户端和服务器 | |
| CN108540868A (zh) | Hls直播的处理方法、装置、服务器、终端及存储介质 | |
| CN108319708B (zh) | 视频播放方法、装置、存储介质及电子设备 | |
| CN106598996A (zh) | 多媒体海报生成方法及装置 | |
| EP2769312A2 (en) | Optimization of web page content including video | |
| WO2016127799A1 (zh) | 一种视频广告过滤的方法、装置和系统 | |
| WO2015070796A1 (zh) | 智能电视向移动通信终端推送资源的方法和装置 | |
| US20170171339A1 (en) | Advertisement data transmission method, electrnoic device and system | |
| WO2015180446A1 (zh) | 一种多设备联动服务中的连接通道维护系统及方法 | |
| CN103956175A (zh) | 一种多媒体文件的播放方法及播放设备 | |
| CN112784201B (zh) | 网页显示方法、装置、终端及存储介质 | |
| WO2022199541A1 (zh) | 媒体文件的播放方法、装置、电子设备、服务器和介质 | |
| CN110113298B (zh) | 数据传输方法、装置、信令服务器和计算机可读介质 | |
| WO2014139366A1 (zh) | 多媒体信息发布的方法及装置 | |
| CN112738776A (zh) | 获取音乐信息的方法、装置、系统及存储介质 | |
| CN103702167B (zh) | 一种实现节目预览图显示的方法及电子设备 | |
| KR101498920B1 (ko) | 오프라인 실행을 위한 웹 페이지 사전 캐싱 시스템 및 방법 | |
| CN113079545A (zh) | 网络共享方法、装置及电子设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22774200 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22774200 Country of ref document: EP Kind code of ref document: A1 |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 29.02.2024) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22774200 Country of ref document: EP Kind code of ref document: A1 |