CN107809678B - Multimedia file processing method, device and equipment - Google Patents

Multimedia file processing method, device and equipment Download PDF

Info

Publication number
CN107809678B
CN107809678B CN201610815427.6A CN201610815427A CN107809678B CN 107809678 B CN107809678 B CN 107809678B CN 201610815427 A CN201610815427 A CN 201610815427A CN 107809678 B CN107809678 B CN 107809678B
Authority
CN
China
Prior art keywords
file
multimedia
information
server
target
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.)
Active
Application number
CN201610815427.6A
Other languages
Chinese (zh)
Other versions
CN107809678A (en
Inventor
李飞勃
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610815427.6A priority Critical patent/CN107809678B/en
Publication of CN107809678A publication Critical patent/CN107809678A/en
Application granted granted Critical
Publication of CN107809678B publication Critical patent/CN107809678B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/61Network physical structure; Signal processing
    • H04N21/6156Network physical structure; Signal processing specially adapted to the upstream path of the transmission network
    • H04N21/6175Network physical structure; Signal processing specially adapted to the upstream path of the transmission network involving transmission via Internet
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments

Abstract

The application provides a method, a device and equipment for processing a multimedia file. The method comprises the following steps: the multimedia server determines file offset information corresponding to the playing position according to the playing position carried in the playing positioning request and file position information of the source multimedia file acquired from the remote server; the method comprises the steps that a multimedia server sends a first acquisition request carrying file offset information to a far-end server, so that the far-end server determines target multimedia data corresponding to the file offset information from a source multimedia file and sends the target multimedia data to the multimedia server; and the multimedia server sends the target multimedia data to the client. According to the method, the multimedia server does not need to acquire the whole multimedia file from the remote server, so that the communication overhead between the multimedia server and the remote server is greatly saved; and the multimedia server only needs to forward the target multimedia data sent by the remote server to the client, so that the processing overhead of the multimedia server is greatly reduced.

Description

Multimedia file processing method, device and equipment
Technical Field
The present application relates to internet technologies, and in particular, to a method, an apparatus, and a device for processing a multimedia file.
Background
Under the condition that the bandwidth of the internet home network is wider and the multimedia files are larger and larger, 'side-to-side playing' becomes a mainstream solution for playing streaming media. Taking the multimedia file as a video file as an example, if the user drags to the downloaded video part, because the part of the video is downloaded to the local part of the player, the player can directly start to parse the video file from the corresponding file offset position; if the user drags to the un-downloaded video part, the player will request a new video from the video server again, and carry the dragging time position indicated by the start parameter, at this time, the video server needs to support the downloading of the video file played from the time position indicated by the start parameter, that is, the video server is required to support the cutting of the original video into the video file played from the time position indicated by the start parameter.
However, in the prior art, the video files are stored in the file system local to the video server, which is limited by the size of the storage space of the file system local to the video server, when the video files are larger and larger, a plurality of video servers are required to store all the video files, and at the same time, the video scheduling server is also required to schedule the video request sent by the player to the video server storing the corresponding video files, and the player is also required to complete the scheduling of the video request by performing 302 jumps, so that the processing process of playing is complex, and the resource cost required by playing is also large.
Therefore, how to reduce the playing complexity of the multimedia file and the resource cost required for playing becomes a technical problem to be solved urgently at present.
Disclosure of Invention
The application provides a method, a device and equipment for processing a multimedia file, and aims to solve the technical problems that playing complexity is high and resource cost required by playing is high when the multimedia file is played in the prior art.
In one aspect, an embodiment of the present application provides a method for processing a multimedia file, including:
the multimedia server determines file offset information corresponding to a playing position according to the playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server; the file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information;
the multimedia server sends a first acquisition request carrying the file offset information to the remote server so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server;
and the multimedia server sends the target multimedia data to the client.
When the user changes the current playing position of the multimedia file, the multimedia server determines the file offset information corresponding to the playing position according to the playing position carried in the playing positioning request sent by the client and the file position information of the source multimedia file acquired from the remote server, and then sends a first acquisition request carrying the file offset information to the remote server, so that the remote server determines the target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server, and the multimedia server sends the target multimedia data to the client without acquiring the whole multimedia file from the remote server by the multimedia server, the remote server can conveniently skip the multimedia data which does not need to be read according to the file offset information, therefore, accurate target multimedia data are transmitted to the multimedia server, unnecessary byte transmission is reduced, and communication overhead between the multimedia server and a remote server is greatly saved; and the multimedia server only needs to forward the target multimedia data sent by the far-end server to the client, and does not need to do other operations, thereby greatly reducing the processing overhead of the multimedia server and the playing complexity of the system, greatly saving the playing resource cost and providing good service experience for multimedia providers.
As an implementation manner, the acquiring, by the multimedia server, file location information of the source multimedia file from the remote server specifically includes:
and the multimedia server sends at least one second acquisition request to the remote server and acquires the file position information of the source multimedia file from the remote server.
As an implementation manner, the sending, by the multimedia server, at least one second obtaining request to the remote server, and obtaining the file location information of the source multimedia file from the remote server specifically includes:
the multimedia server sends a second acquisition request carrying a preset first fragmentation threshold range to the remote server so as to acquire a first information fragmentation returned by the remote server according to the first fragmentation threshold range;
the multimedia server judges whether a first information fragment located locally at present is complete file position information or not;
if so, the multimedia server determines to acquire the file position information of the source multimedia file; and if not, the multimedia server sends a new second acquisition request to the remote server again until the file position information of the source multimedia file is acquired.
As an implementation manner, the determining, by the multimedia server, whether a first information fragment currently located locally is complete file location information specifically includes:
the multimedia server acquires the size of the file position information of the source multimedia file from a first information fragment which is currently located locally;
and the multimedia server determines whether the first information fragment currently positioned locally is complete file position information or not according to the size of the file position information of the source multimedia file.
As an implementation manner, the determining, by the multimedia server, whether the current local first information fragment is complete file location information specifically includes:
and the multimedia server determines whether the first information fragment currently positioned locally is complete file position information or not according to the ending identifier of the file position information of the source multimedia file.
According to the multimedia file processing method provided by each possible implementation manner, the first fragmentation threshold range is carried in the second acquisition request, so that the file position information of the source multimedia file is requested to the remote server in a fragmentation manner, unnecessary byte transmission between the remote server and the multimedia server is reduced, meanwhile, the fragmentation is also beneficial for the remote server to cache the file so as to improve the caching efficiency, and particularly under the CDN scene, the caching efficiency of the remote server can be greatly improved.
As an implementation manner, the sending, by the multimedia server, the first obtaining request carrying the file offset information to the remote server, so that the remote server determines, from the source multimedia file, target multimedia data corresponding to the file offset information and sends the target multimedia data to the multimedia server, specifically includes:
and the multimedia server sends at least one first acquisition request to the remote server to acquire the target multimedia data from the remote server.
As an implementation manner, the sending, by the multimedia server, at least one first obtaining request to the remote server, and obtaining the target multimedia data from the remote server specifically includes:
the multimedia server sends a first acquisition request to the remote server, wherein the first acquisition request comprises a preset second fragmentation threshold range;
after receiving a second information fragment sent by the remote server according to the second fragment threshold range, the multimedia server judges whether the currently acquired second information fragment is complete target media data;
if so, the multimedia server determines to acquire the target multimedia data; and if not, updating the file offset information to be the starting position of the next second information fragment, obtaining a new first acquisition request and sending the new first acquisition request to the remote server again until the target multimedia data is determined to be acquired.
According to the multimedia file processing method provided by each possible implementation manner, the first acquisition request carries the file offset information and the second fragmentation threshold range, so that the multimedia data of the target multimedia file is requested to the remote server in a fragmentation manner, unnecessary byte transmission between the remote server and the multimedia server is reduced, and the communication overhead between the remote server and the multimedia server is greatly reduced.
As an achievable way, the playing position is a first target playing time, and the file position information includes key frames corresponding to different target playing times and file offset information corresponding to different key frames; the method includes that the multimedia server determines file offset information corresponding to a playing position according to the playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server, and specifically includes:
the multimedia server determines a first key frame corresponding to the first target playing time according to the first target playing time and the file position information;
and the multimedia server determines file offset information corresponding to the first target playing time according to the file position information and the first key frame.
As an implementation manner, before the multimedia server sends the target multimedia data to the client, the method further includes:
the multimedia server deletes other key frames positioned before the first key frame in the file position information, and updates file offset information corresponding to the first key frame to obtain new file position information;
and the multimedia server sends the new file position information to the client.
As one implementable manner, the multimedia file includes at least one of audio, video.
As an implementation manner, the multimedia file is a video, and the play positioning request is a request carrying a start parameter, where the start parameter represents the first target play time.
As an implementable manner, the first get request and the second get request are both hypertext transfer protocol, HTTP, requests; the file location information is meta information.
On the other hand, an embodiment of the present application provides a processing apparatus for a multimedia file, including:
the determining module is used for determining file offset information corresponding to a playing position according to the playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server; the file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information;
the receiving and sending module is used for sending a first acquisition request carrying the file offset information to the remote server so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server;
the transceiver module is further configured to send the target multimedia data to the client.
The beneficial effects of the processing apparatus for multimedia files provided above can refer to the beneficial effects brought by the processing method for multimedia files in the above implementation manners, and are not described herein again.
On the other hand, an embodiment of the present application provides a processing device for a multimedia file, including: a transceiver and a processor coupled to the transceiver;
the processor is used for determining file offset information corresponding to the playing position according to the playing position carried in the playing positioning request sent by the client and the file position information of the source multimedia file acquired from the remote server, wherein the playing position information is received by the transceiver; the file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information;
the transceiver is configured to send a first acquisition request carrying the file offset information to the remote server, so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server;
the transceiver is further configured to send the target multimedia data to the client.
In the application, when a user changes the current playing position of a multimedia file, a multimedia server determines file offset information corresponding to the playing position according to the playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server, then sends a first acquisition request carrying the file offset information to the remote server, so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server, and then the multimedia server sends the target multimedia data to the client without acquiring the whole multimedia file from the remote server by the multimedia server, the remote server can conveniently skip the multimedia data which are not required to be read according to the file offset information, thereby transmitting accurate target multimedia data to the multimedia server, unnecessary byte transmission is reduced, and communication overhead between the multimedia server and a remote server is greatly saved; and the multimedia server only needs to forward the target multimedia data sent by the far-end server to the client, and does not need to do other operations, thereby greatly reducing the processing overhead of the multimedia server and the playing complexity of the system, greatly saving the playing resource cost and providing good service experience for multimedia providers.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a schematic diagram of an alternative file playback system of the present application;
fig. 2 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application;
fig. 4 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application;
fig. 5 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application;
fig. 6 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application;
fig. 7 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application;
FIG. 8 is a block diagram of a multimedia file processing apparatus according to an embodiment of the present application;
FIG. 9 is a schematic structural diagram of a device for processing multimedia files according to an embodiment of the present application;
FIG. 10 is a block diagram of a multimedia file processing apparatus according to an embodiment of the present application;
fig. 11 is a schematic hardware structure diagram of a multimedia file processing device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The method, the device and the equipment for processing the multimedia file can be suitable for any scene of playing the multimedia file, the multimedia file can be a video file, an audio file or a file in a simple subtitle stream form, and the embodiment of the application does not limit the type of the multimedia file.
Optionally, the embodiment of the present application may be applicable to the file playing system shown in fig. 1, as shown in fig. 1, the file playing system may include a client, a multimedia server, and a remote server, where in this embodiment, one multimedia server is required. In fig. 1, a client may be implemented by hardware, software, or a combination of hardware and software, for example, the client may be various types of players, such as a software player or a playing device, and may also be a terminal device that installs player software; the remote server may be a server or a file storage system capable of performing any protocol communication with the multimedia server and having a storage function, for example, the remote server may be a cloud storage system, a cloud server, a network cloud disk, and the like.
In the prior art, when a user enjoys a multimedia file through a client, the multimedia file is often dragged, for example, when the user watches a video, the video is often played in a 'play-under-edge' mode, when the user drags a progress bar of the video, if a video corresponding to a currently dragged position is cached locally, the client can directly play, when the video corresponding to the dragged position is not downloaded, the client requests a new video from a video server again and carries a dragging time position represented by a start parameter, and the video server cuts an original video stored locally into a video file which is played from the time position represented by the start parameter according to the start parameter, so as to deliver the video file to the client. However, as video files become larger and larger, the local file storage capacity of a single video server is limited, multiple video servers need to be added, a video scheduling server needs to be added, and a client needs to support 302 jumps to normally play videos, so that the cost of playing resources is increased, and the complexity of video playing is also increased.
Based on this, the method, the apparatus, and the device for processing a multimedia file provided in the embodiments of the present application aim to solve the above technical problems, and the following describes the technical solutions of the present application in detail with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application. The embodiment relates to a specific process that when a user changes the current playing position of a multimedia file, a multimedia server sends file offset information corresponding to the playing position specified by the user to a remote server, so that the remote server sends target multimedia data corresponding to the file offset information to the multimedia server, and then the multimedia server returns the target multimedia data corresponding to the playing position specified by the user to a client, and the playing requirement of the user is met. As shown in fig. 2, the method may include the steps of:
s101: and the multimedia server determines file offset information corresponding to the playing position according to the playing position carried in the playing positioning request sent by the client and the file position information of the source multimedia file acquired from the remote server.
The file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information.
Specifically, in an actual usage scenario, a user plays a source multimedia file through a client. It should be noted that the source multimedia file is a complete multimedia file, and the source multimedia file not only includes complete multimedia data content, but also includes some parameter information capable of assisting the client in playing. Taking the example that the multimedia file is a video file, the source multimedia file may include meta information and specific video content, and the meta information carries parameters such as encoding and decoding modes of the video file.
Generally, the source multimedia file is played from the beginning frame position. When a user needs to change a current playing position, the user drags the playing progress of a current multimedia file, and at the moment, a client learns the user requirement according to the dragging operation of the user, so that a playing positioning request is sent to a multimedia server, wherein the playing positioning request carries a playing position specified by the user, optionally, the playing position can be a target playing time specified by the user (the target playing time is actually the time position dragged by the user), and optionally, the playing position can also be a playing byte number specified by the user.
After the multimedia server receives a play positioning request sent by the client, the multimedia server obtains file position information of the source multimedia file from a remote server, wherein the file position information comprises file offset information corresponding to the play position. Optionally, the multimedia server may send a second obtaining request to the remote server to request the remote server to obtain the file location information of the source multimedia file. Optionally, the remote server may send the file location information to the multimedia server at one time, and may also send the file location information to the multimedia server multiple times in different sizes. Optionally, the second obtaining request may be a request message of any Protocol type, for example, a hypertext Transfer Protocol (HTTP) request, a logic electrical signal transmitted by a wire, or a request of another Protocol.
After the multimedia server obtains the file position information of the source multimedia file, the file position information includes mapping relationships between a plurality of preset playing positions and a plurality of file offset information, so that the file offset information corresponding to the playing position in the playing positioning request can be determined by combining the playing position specified by the user in the playing positioning request. Optionally, the file offset information corresponding to the playing position may be a specific file offset byte, or may also be a direct file offset, or may also be a sequence number of a specific video subunit (sample, that is, the source multimedia file may be divided into a plurality of video subunits, each video subunit having a sequence number), and the like. Optionally, the mapping relationship between the multiple preset playing positions and the multiple file offset information in the file position information obtained from the remote server may exist in a form of a list, for example, if the playing position in the playing position request is a target playing time specified by a user, the multiple preset playing positions in the file position information are specific preset playing times, and the file offset information is set as file offset bytes, where different preset playing times correspond to different file offset bytes, for example, as shown in table 1, the following times are all preset playing positions, and the file position information may be:
TABLE 1
Figure BDA0001112405380000091
Figure BDA0001112405380000101
Of course, the above table 1 is only an example, and the embodiment of the present application does not limit the form of the specific mapping relationship in the file location information.
S102: and the multimedia server sends a first acquisition request carrying the file offset information to the remote server so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server.
Specifically, after the multimedia server acquires the file offset information corresponding to the playing position, the file offset information may be carried in a first acquisition request and sent to the remote server, so that the remote server may clip or otherwise process the source multimedia file stored on the remote server according to the file offset information to obtain target multimedia data corresponding to the file offset information, and if the file offset information is a specific file offset byte, the target multimedia file data may be all multimedia data in the source multimedia file starting from the file offset information or may be a part of the multimedia file starting from the file offset information (that is, the remote server may transmit the multimedia data to the multimedia server one by one in a streaming manner until the target multimedia data is transmitted, thus for the multimedia server it belongs to "download while transmitting data to the client"). And then, the remote server sends the target multimedia data to the multimedia server.
S103: and the multimedia server sends the target multimedia data to the client.
In the prior art, when the multimedia server does not locally cache the multimedia data at the playing position designated by the user, the multimedia server often directly downloads the whole source multimedia file from the remote server, and returns the target multimedia data to the client according to the playing position designated by the user after the downloading is completed, so that the multimedia server has high processing overhead and increased playing complexity; however, in this embodiment, when the user changes the current playing position of the multimedia file, the multimedia server sends the determined file offset information corresponding to the playing position specified by the user to the remote server, so that the remote server determines the target multimedia data corresponding to the file offset information from the source multimedia file, for example, assuming that one multimedia file is 10s, the user is at the current playing position 5s, and the user has re-specified a playing position assumed to be 9s, the multimedia server sends the specified playing position to the remote server, so that the remote server can determine the target multimedia data, which is the multimedia data from 9s onward, and then the remote server sends the target multimedia data to the multimedia server, and the multimedia server returns the target multimedia data to the client for playing, the remote server can conveniently skip the multimedia data which does not need to be read by sending the file offset information corresponding to the playing position appointed by the user to the remote server, so that the accurate target multimedia data is transmitted to the multimedia server, unnecessary byte transmission is reduced, and the communication overhead between the multimedia server and the remote server is greatly saved; in addition, the multimedia server only needs to forward the target multimedia data sent by the remote server to the client, and does not need to perform other operations, so that the processing overhead of the multimedia server and the playing complexity of the system are greatly reduced, the playing resource cost is greatly saved, and good service experience is provided for multimedia providers.
In the method for processing a multimedia file provided in the embodiment of the present application, when a user changes a current playing position of the multimedia file, a multimedia server determines file offset information corresponding to the playing position according to a playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server, and then sends a first acquisition request carrying the file offset information to the remote server, so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server, and the multimedia server sends the target multimedia data to the client without the need of the multimedia server acquiring the entire multimedia file from the remote server, and the remote server can conveniently skip the multimedia data which does not need to be read according to the file offset information, therefore, accurate target multimedia data are transmitted to the multimedia server, unnecessary byte transmission is reduced, and communication overhead between the multimedia server and a remote server is greatly saved; and the multimedia server only needs to forward the target multimedia data sent by the far-end server to the client, and does not need to do other operations, thereby greatly reducing the processing overhead of the multimedia server and the playing complexity of the system, greatly saving the playing resource cost and providing good service experience for multimedia providers.
Fig. 3 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application. Optionally, the playing position in the playing positioning request may be a first target playing time, and the file position information may include key frames corresponding to different target playing times and file offset information corresponding to different key frames. The embodiment relates to a specific process in which the multimedia server acquires file location information of a source multimedia file from a remote server in a fragmentation manner, and determines file offset information according to the file location information, that is, the step S101 may specifically include:
s201: and after receiving the playing positioning request sent by the client, the multimedia server sends at least one second acquisition request to a remote server, and acquires the file position information of the source multimedia file from the remote server.
Specifically, after receiving a play positioning request sent by a client, the multimedia server may send a second acquisition request to the remote server according to a first target play time in the play positioning request, optionally, the second acquisition request may not carry the first target play time, and the second acquisition request is used to request the remote server to acquire file position information of the current source multimedia file. Optionally, the second obtaining request may represent that the data to be obtained currently is file location information of the source multimedia file by carrying an identifier of a message type, and a manner of how the second obtaining request represents the data type to be obtained currently to the remote server is not limited in the embodiment of the present application.
Optionally, the multimedia server may obtain the file location information of the source multimedia file by sending a second obtaining request to the remote server, and may also obtain the file location information of the source multimedia file by sending a plurality of second obtaining requests, that is, the file location information is divided into a plurality of first information fragments, and the first information fragments are obtained respectively. Optionally, the multimedia server may send a plurality of second acquisition requests to the remote server at the same time, or may send a plurality of second acquisition requests to the remote server one by one. Optionally, when the multimedia server sends multiple second acquisition requests to the remote server at the same time, the multimedia server needs to pre-divide the size of the required first information fragment that should be carried in each second acquisition request, for example, assuming that the file location information of the source multimedia file is 10M, and the multimedia server determines to send two second acquisition requests to the remote server at the same time, the multimedia server needs to carry the byte range of the required first information fragment in each second acquisition request, so as to avoid repetition of the first information fragments obtained by the two second acquisition requests.
Optionally, if the multimedia server requests the file location information of the source multimedia file from the remote server one by one, for a plurality of times, specifically, refer to the following embodiment shown in fig. 4:
s301: the multimedia server sends a second acquisition request carrying a preset first fragmentation threshold range to the remote server so as to acquire a first information fragmentation returned by the remote server according to the first fragmentation threshold range.
Specifically, after receiving a play positioning request sent by a client, a multimedia server sends a first second acquisition request to a remote server, where the second acquisition request carries a preset first fragmentation threshold range, and the preset first fragmentation threshold range includes a byte start position and a byte end position of a first information fragment. And after receiving the first acquisition request, the remote server sends a first information fragment to the multimedia server.
S302: the multimedia server judges whether the first information fragment located locally at present is complete file position information. If so, go to step S303, otherwise, go to step S304.
S303: and the multimedia server determines to acquire the file position information of the source multimedia file.
S304: and the multimedia server sends a new second acquisition request to the remote server again until the file position information of the source multimedia file is acquired.
Specifically, after the multimedia server acquires the first information fragment, the multimedia server determines whether all the first information fragments acquired locally (at this time, only the first information fragment is locally acquired by the multimedia server) are source file location information of the complete multimedia file. If so, the multimedia server determines that the file position information of the source multimedia file is already acquired, and if not, the multimedia server sends a second acquisition request (i.e. a new second acquisition request) to the remote server again, wherein a preset first fragmentation threshold range in the second acquisition request comprises a byte start position of a second first information fragment (i.e. equal to an end position of the first information fragment) and a byte end position of the second first information fragment. And after the multimedia server receives the second first information fragment again, continuously judging whether all the first information fragments obtained locally currently (at the moment, the multimedia server locally comprises the first information fragment and the second first information fragment) are complete file position information, and so on until the multimedia server determines that the file position information of the source multimedia file is obtained. Optionally, the size of each first information fragment may be the same or different.
In a possible implementation manner, the specific process of the multimedia server determining whether the current local first information fragment is complete file location information of the source multimedia file may be: the multimedia server obtains the size of the file position information of the source multimedia file from the first information fragment located locally at present, and determines whether the first information fragment located locally at present is complete file position information or not according to the size of the file position information of the source multimedia file.
Specifically, in the process that the multimedia server successively obtains a plurality of first information fragments, the size of the complete file position information of the source multimedia file can be carried in one first information fragment, so that the multimedia server knows the size of the whole file position information, then the multimedia server judges whether the added capacity size of all the first information fragments currently located locally is not smaller than the size of the file position information, and if the added capacity size is larger than or equal to the size of the file position information, the multimedia server is determined to have obtained the complete file position information.
In another possible implementation manner, the specific process of the multimedia server determining whether the first information fragment currently located locally is complete file location information of the source multimedia file may further be: and the multimedia server determines whether the first information fragment currently positioned locally is complete file position information or not according to the ending identifier of the file position information of the source multimedia file.
Specifically, the multimedia server learns the end identifier of the file location information of the source multimedia file in advance, optionally, the end identifier of the file location information of the source multimedia file may be loaded on the multimedia server by a multimedia provider, or may be notified to the multimedia server by a remote server. In the process that the multimedia server successively obtains a plurality of first information fragments, if the multimedia server analyzes an ending identifier of the file position information of the source multimedia file when analyzing a certain first information fragment, the multimedia server determines that the complete file position information is obtained currently.
Based on this, the multimedia server can acquire the file position information of the source multimedia file in a fragmentation mode.
S202: and the multimedia server determines a first key frame corresponding to the first target playing time according to the first target playing time and the file position information in the playing positioning request.
S203: and the multimedia server determines file offset information corresponding to the first target playing time according to the file position information and the first key frame.
Specifically, when the multimedia server obtains the file location information and the first target playing time in the playing positioning request, since the file location information may include key frames corresponding to different target playing times and file offset information corresponding to different key frames, the multimedia server may determine the first key frame corresponding to the first target playing time according to the correspondence between the first target playing time and the file location information, and then determine the file offset information corresponding to the first key frame in the file location information according to the first key frame again.
It should be noted that a multimedia file may include multiple frames of data, where a portion of the frames are key frames of the multimedia file, and the key frames are used to locate the position of the target multimedia data corresponding to the first target playing time. Optionally, the file offset information corresponding to the first playing time may be offset information of a starting position of the target multimedia data relative to the source multimedia file, and the offset information may be an offset or an offset byte. Optionally, the file location information may further include parameter information related to the playing of the source multimedia file, such as an encoding and decoding manner.
Optionally, after obtaining the complete file location information of the source multimedia file, the multimedia server may modify the file location information, that is: after the multimedia server obtains the first key frame corresponding to the first playing time, the multimedia server may delete other key frames located before the first key frame in the file location information of the source multimedia file, update the file offset information corresponding to the first key frame, obtain new file location information, and then send the new file location information to the client. Then, the multimedia server requests the target multimedia data corresponding to the first playing time from the remote server through a first acquisition request described below, and then sends the target multimedia data to the client, so that the client can play the target multimedia data based on the new file position information.
It should be noted that, when the time corresponding to a certain key frame in the file position information of the source multimedia file is the same as the first target playing time, the key frame is the first key frame, and when the time corresponding to any key frame in the file position information of the source multimedia file is not the same as the first target playing time, the first key frame is the key frame located before the first target playing time and having the shortest time distance from the first target playing time. For example, if the target playing time is 7s, and the key frames of the multimedia file are the 1 st frame (corresponding to the time hypothesis being 1s), the 5 th frame (corresponding to the time hypothesis being 5s), and the 8 th frame (corresponding to the time hypothesis being 8s), the first key frame is the key frame corresponding to the 5 th frame.
According to the multimedia file processing method provided by the embodiment of the application, the first fragmentation threshold range is carried in the second acquisition request, so that the file position information of the source multimedia file is requested to the remote server in a fragmentation mode, unnecessary byte transmission between the remote server and the multimedia server is reduced, meanwhile, the fragmentation is also beneficial to the remote server to cache the file so as to improve the caching efficiency, and particularly under the context of a Content Delivery Network (CDN), the caching efficiency of the remote server can be greatly improved.
Fig. 5 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application. The embodiment relates to a specific process of acquiring target multimedia data from a remote server by a multimedia server. On the basis of the foregoing embodiment, further, the foregoing S102 may specifically include:
s401: the multimedia server sends at least one first acquisition request to the remote server, and acquires the target multimedia data from the remote server.
Optionally, the multimedia server may obtain the target multimedia data by sending a first obtaining request to the remote server, and may also obtain the target multimedia data by sending a plurality of first obtaining requests, that is, the target multimedia data is divided into a plurality of second information fragments, and the second information fragments are obtained respectively. Optionally, the multimedia server may send a plurality of first acquisition requests to the remote server at the same time, or may send a plurality of first acquisition requests to the remote server one by one. Optionally, when the multimedia server sends multiple first acquisition requests to the remote server at the same time, the multimedia server needs to pre-divide the size of the required second information fragment that should be carried in each first acquisition request, for example, assuming that the target multimedia data is 50M, the multimedia server determines to send two first acquisition requests to the remote server at the same time, and then the multimedia server needs to carry the byte range of the required second information fragment in each first acquisition request, so as to avoid repetition of the second information fragments that are obtained by the two first acquisition requests.
Optionally, if the multimedia server requests the remote server for the target multimedia data one by one, in multiple times, reference may be specifically made to the embodiment shown in fig. 6, specifically:
s501: the multimedia server sends a first acquisition request to the remote server, wherein the first acquisition request comprises a preset second fragmentation threshold range.
Optionally, the file offset information in the first acquisition request may be a byte start position of the second information fragment, and the preset second fragment threshold range may be a size of the second information fragment, or may be a byte end position of the second information fragment.
S502: and after receiving the second information fragment sent by the remote server according to the second fragment threshold range, the multimedia server judges whether the currently acquired second information fragment is complete target media data. If so, S503 is executed, otherwise, S5504 is executed.
S503: and the multimedia server determines to acquire the target multimedia data.
S504: and the multimedia server updates the file offset information to the starting position of the next second information fragment to obtain a new first acquisition request and sends the new first acquisition request to the remote server again until the target multimedia data is determined to be acquired.
Specifically, after the multimedia server acquires the first second information fragment, the second multimedia server determines whether all currently acquired second information fragments (at this time, the multimedia server currently acquires only the first second information fragment) are complete target multimedia data, that is, whether the target multimedia data is completely transmitted. If so, the multimedia server determines that the target multimedia data is acquired, otherwise, the multimedia server updates the file offset information to be the starting byte position of the next second information fragment (or the byte ending position of the first second information fragment), and then carries the updated file offset information in a second first acquisition request (namely a new first acquisition request) and sends the second first acquisition request to the remote server. And after the multimedia server receives the second information fragment again, continuously judging whether all the currently acquired second information fragments (at the moment, the multimedia server already acquires the first second information fragment and the second information fragment) are complete target multimedia data, and so on until the multimedia server determines that all the currently acquired second information fragments reach the end position of the file. Optionally, the size of each second information fragment may be the same or different.
According to the multimedia file processing method provided by the embodiment of the application, the file offset information and the second fragmentation threshold range are carried in the first acquisition request, so that the multimedia data of the target multimedia file is requested to the remote server in a fragmentation mode, unnecessary byte transmission between the remote server and the multimedia server is reduced, and the communication overhead between the remote server and the multimedia server is greatly reduced.
Optionally, the multimedia file may include at least one of audio and video. When the multimedia file is a video file, the play positioning request is a request carrying a start parameter, the start parameter represents the first target play time, the file position information of the source multimedia file is meta information, and both the first acquisition request and the second acquisition request can be HTTP requests.
For a clearer introduction of the embodiment of the present application, the following description specifically refers to the embodiment shown in fig. 7, taking a multimedia file as a video file. It should be noted that, when the multimedia file is a video file, the client may be any type of player, and the multimedia server is a video server. The video file includes meta information and video data.
Fig. 7 is a flowchart illustrating a method for processing a multimedia file according to an embodiment of the present application. As shown in fig. 7, the method includes:
s601: the client sends a play positioning request carrying a start parameter to the video server.
The start parameter represents a first target playing time that a current user drags the video, that is, the user wants to play the video from the first target playing time.
Optionally, the first target playing time represented by the start parameter may be 0s, or may be a time greater than 0s, and when the first target playing time is 0s, it indicates that the user wishes to play the video from 0 s.
S602: the video server sends a first HTTP request to a remote server.
The first HTTP request carries a first range operation, where the first range operation carries a preset first fragmentation threshold range, so as to represent, to a remote server, the size of a meta information fragment (i.e., a first information fragment) of a video file to be currently read, where the first HTTP request is a second acquisition request in the above embodiment.
Specifically, after the user drags the current playing progress, the client is triggered to send a playing positioning request carrying a start parameter to the video server, where the start parameter represents a first target playing time desired by the current user, that is, represents a time position dragged by the user. Then, the client determines whether the video data corresponding to the first target playing time is cached locally, if so, the video is directly played from the first target playing time, and if not, the video server needs to send a first HTTP request to the remote server.
S603: and the remote server sends the corresponding first information fragment to the video server according to the first HTTP request.
S604: after receiving the first information fragment, the video server determines whether all the first information fragments obtained locally are complete meta information. If yes, go to S605, otherwise go to S606.
S605: the video server determines that meta information is acquired, and then executes S607.
S606: the video server updates the first fragmentation threshold range to obtain a new first HTTP request, and returns to execute S602 to S604 until the video server determines to obtain complete meta information. After that, S607 is executed.
S607: and the video server analyzes the meta information to acquire the key frame information of the video file.
The key frame information includes a time corresponding to each key frame of the video file and file offset information corresponding to each key frame, and optionally, the file offset information may be a file offset. The video file is a source video file.
S608: the video server determines a first key frame corresponding to the first target playing time according to the first target playing time and the key frame information, deletes other key frames positioned before the first key frame in meta information, only remains the first key frame and key frames after the first key frame, and then the video player modifies the first key frame and file offsets corresponding to the key frames after the first key frame to obtain new meta information.
This step can be referred to in the prior art and is not described in detail herein.
S609: the video server outputs the new meta information to the client.
S610: the video server sends a second HTTP request to the remote server.
The second HTTP request carries a second range operation, which carries file offset information and a preset second fragmentation threshold range (for example, carries a byte start position and a byte end position of one video fragment) to characterize the size of the video fragment currently to be read (i.e., the second information fragment) to the remote server. The second HTTP request is the first get request in the above embodiment
S611: and the remote server sends the corresponding second information fragment to the video server according to the second HTTP request.
S612: and the video server outputs the obtained second information fragment to the client.
S613: the video server judges whether all the second information fragments obtained currently reach the end position of the video file (namely, judges whether all the second information fragments located locally currently are complete target multimedia data). If yes, go to step S614, otherwise, go to step S615.
S614: the video server determines that the complete target multimedia data has been acquired.
S615: and the video server updates the file offset information to the starting byte position of the next second information fragment, updates the threshold range of the second fragment to obtain a new first acquisition request, and returns to execute S610-S613 until the complete video data is determined to be acquired.
For the above detailed description of S601 to S615, reference may be made to the processes in the embodiments of fig. 2 to 6, and the implementation principle and the technical effect are similar, which are not described herein again.
A processing apparatus of a multimedia file according to one or more embodiments of the present application will be described in detail below. The processing means of the multimedia file may be implemented on a multimedia server, or a system consisting of multimedia servers. Those skilled in the art will appreciate that the processing means of the multimedia file can be constructed by configuring the steps taught in the present scheme using commercially available hardware components. For example, the modules related to the determination function and the processing function in the following embodiments may be implemented by using components such as a single chip microcomputer, a microcontroller, and a microprocessor.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 8 is a schematic structural diagram of a multimedia file processing apparatus according to an embodiment of the present application, where the multimedia file processing apparatus can be implemented by software or a combination of software and hardware. As shown in fig. 8, the apparatus includes: a determination module 11 and a transceiver module 12.
Specifically, the determining module 11 is configured to determine, according to a playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server, file offset information corresponding to the playing position; the file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information;
a transceiver module 12, configured to send a first obtaining request carrying the file offset information to the remote server, so that the remote server determines, from the source multimedia file, target multimedia data corresponding to the file offset information and sends the target multimedia data to the multimedia server;
the transceiver module 12 is further configured to send the target multimedia data to the client.
The processing apparatus for multimedia files provided in the embodiment of the present application can execute the method embodiments described above, and the implementation principle and the technical effect are similar, which are not described herein again.
Optionally, the transceiver module 12 is further configured to send at least one second obtaining request to the remote server, and obtain the file location information of the source multimedia file from the remote server.
Optionally, as a possible implementation manner of the embodiment of the present application, refer to a schematic structural diagram of a processing device for a multimedia file provided in an embodiment of the present application shown in fig. 9. On the basis of the embodiment shown in fig. 8, further, the transceiver module 12 specifically includes: a first transmitting unit 121, a first receiving unit 122, and a first judging unit 123;
specifically, the first sending unit 121 is configured to send a second obtaining request carrying a preset first fragmentation threshold range to the remote server;
a first receiving unit 122, configured to obtain a first information fragment returned by the remote server according to the first fragment threshold range;
the first determining unit 123 is configured to determine whether the first information fragment currently located locally is complete file location information, determine to acquire the file location information of the source multimedia file when the first information fragment currently located locally is determined to be complete file location information, and instruct the first sending unit 121 to send a new second acquisition request to the remote server again when the first information fragment currently located locally is determined not to be complete file location information until the file location information of the source multimedia file is acquired.
In this possible implementation manner, optionally, the first determining unit 123 is specifically configured to obtain the size of the file location information of the source multimedia file from the first information fragment currently located locally, and determine whether the first information fragment currently located locally is complete file location information according to the size of the file location information of the source multimedia file.
In this possible implementation manner, optionally, the first determining unit 123 is specifically configured to determine, according to an end identifier of the file location information of the source multimedia file, whether the first information fragment currently located locally is complete file location information.
The processing apparatus for multimedia files provided in the embodiment of the present application can execute the method embodiments described above, and the implementation principle and the technical effect are similar, which are not described herein again.
Optionally, as another possible implementation manner of the embodiment of the present application, refer to a schematic structural diagram of a processing device for a multimedia file provided in an embodiment of the present application shown in fig. 10. The transceiver module 12 is specifically configured to send at least one first obtaining request to the remote server, and obtain the target multimedia data from the remote server. On the basis of the embodiment shown in fig. 9, further, the transceiver module 12 specifically includes: a second transmitting unit 124, a second receiving unit 125, and a second judging unit 126;
a second sending unit 124, configured to send a first obtaining request to the remote server, where the first obtaining request includes a preset second fragmentation threshold range;
a second determining unit 126, configured to determine whether a currently acquired second information fragment is complete target media data after the second receiving unit 125 receives a second information fragment sent by the remote server according to the second fragment threshold range; if yes, determining to acquire the target multimedia data; if not, the second sending unit 124 is instructed to update the file offset information to the starting position of the next second information fragment, obtain a new first obtaining request, and send the new first obtaining request to the remote server again until the target multimedia data is determined to be obtained.
Optionally, the playing position is a first target playing time, and the file position information includes key frames corresponding to different target playing times and file offset information corresponding to different key frames; the determining module 11 is specifically configured to determine a first key frame corresponding to the first target playing time according to the first target playing time and the file position information, and determine file offset information corresponding to the first target playing time according to the file position information and the first key frame.
With continuing reference to fig. 10, optionally, the processing device of the multimedia file may further include a processing module 13; the processing module 13 is specifically configured to delete other key frames located before the first key frame in the file location information, and update file offset information corresponding to the first key frame to obtain new file location information; the transceiver module 12 is further configured to send the new file location information to the client.
Optionally, the multimedia file includes at least one of audio and video; optionally, the multimedia file is a video, the file dragging request is a request carrying a start parameter, and the start parameter represents the first target playing time; optionally, the first obtaining request and the second obtaining request are both hypertext transfer protocol HTTP requests; the positioning information is meta information.
The processing apparatus for multimedia files provided in the embodiment of the present application can execute the method embodiments described above, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 11 is a schematic hardware structure diagram of a multimedia file processing device according to an embodiment of the present application. Optionally, the processing device of the multimedia file may be the multimedia server. As shown in fig. 11, the multimedia file processing apparatus may include a transceiver 20, a processor 21, a memory 22, and at least one communication bus 23. The communication bus 23 is used to realize communication connection between the elements. The memory 22 may comprise a high speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, in which various programs may be stored for performing various processing functions and implementing the method steps of the present embodiment.
Alternatively, the processor 21 may be implemented by, for example, a Central Processing Unit (CPU), an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a controller, a microcontroller, a microprocessor or other electronic components,
optionally, the transceiver 20 may include a receiver 201 and a transmitter 202, the receiver 201 and the transmitter 202 may be integrated together in a multimedia file processing device, and optionally, the transceiver 20 may be a transceiver, and may also be at least one of an input and output interface of a device.
In this embodiment of the present application, the processor 21 is configured to determine, according to a play position carried in a play positioning request sent by a client and file position information of a source multimedia file acquired from a remote server, which are received by the transceiver 20, file offset information corresponding to the play position; the file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information;
a transceiver 20, configured to send a first obtaining request carrying the file offset information to the remote server, so that the remote server determines, from the source multimedia file, target multimedia data corresponding to the file offset information and sends the target multimedia data to the multimedia server;
the transceiver 20 is further configured to transmit the target multimedia data to the client.
The processing device of the multimedia file provided in the embodiment of the present application may execute the method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Optionally, the transceiver 20 is further configured to send at least one second obtaining request to the remote server, and obtain file location information of the source multimedia file from the remote server.
Optionally, when obtaining the file location information, the transceiver 20 is specifically configured to send a second obtaining request carrying a preset first fragmentation threshold range to the remote server, so as to obtain a first information fragmentation returned by the remote server according to the first fragmentation threshold range; the processor 21 is further configured to determine whether a first information fragment currently located locally is complete file location information, and if so, determine to obtain file location information of the source multimedia file; if not, the transceiver 20 is instructed to send a new second acquisition request to the remote server again until the file location information of the source multimedia file is acquired.
Optionally, the processor 21 is specifically configured to obtain the size of the file location information of the source multimedia file from the first information fragment currently located locally, and determine whether the first information fragment currently located locally is complete file location information according to the size of the file location information of the source multimedia file.
Optionally, the processor 21 is specifically configured to determine whether the first information fragment currently located locally is complete file location information according to the end identifier of the file location information of the source multimedia file.
Optionally, when the target multimedia data is obtained, the transceiver 20 is specifically configured to send at least one first obtaining request to the remote server, and obtain the target multimedia data from the remote server. Optionally, the transceiver 20 is specifically configured to send a first obtaining request to the remote server, where the first obtaining request includes a preset second fragmentation threshold range; the processor 21 is specifically configured to, after the transceiver 20 receives a second information fragment sent by the remote server according to the second fragmentation threshold range, determine whether the currently acquired second information fragment is complete target media data, and if so, determine to acquire the target multimedia data; if not, updating the file offset information to be the starting position of the next second information fragment, obtaining a new first acquisition request, and instructing the transceiver 20 to send to the remote server again until the target multimedia data is determined to be acquired.
Further, the playing position is a first target playing time, and the file position information includes key frames corresponding to different target playing times and file offset information corresponding to different key frames; the processor 21 is specifically configured to determine a first key frame corresponding to the first target playing time according to the first target playing time and the file position information, and determine file offset information corresponding to the first target playing time according to the file position information and the first key frame.
Optionally, the processor 21 is further configured to delete other key frames located before the first key frame in the file location information, update file offset information corresponding to the first key frame to obtain new file location information, and instruct the transceiver 20 to send the new file location information to the client.
Optionally, the multimedia file includes at least one of audio and video; optionally, the multimedia file is a video, the file dragging request is a request carrying a start parameter, and the start parameter represents the first target playing time; optionally, the first obtaining request and the second obtaining request are both hypertext transfer protocol HTTP requests; the positioning information is meta information.
The processing device of the multimedia file provided in the embodiment of the present application may execute the method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
A computer/processor readable storage medium having stored therein program instructions for causing a computer/processor to perform:
the multimedia server determines file offset information corresponding to a playing position according to the playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server; the file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information;
the multimedia server sends a first acquisition request carrying the file offset information to the remote server so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server;
the multimedia server sends the target multimedia data to the client
The readable storage medium may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (25)

1. A method for processing a multimedia file, comprising:
the multimedia server determines file offset information corresponding to a playing position according to the playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server; the file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information, and the source multimedia file comprises a complete multimedia file and parameter information for assisting the client in playing;
the multimedia server sends a first acquisition request carrying the file offset information to the remote server so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server;
the multimedia server sends the target multimedia data to the client, wherein the target multimedia data are all multimedia data in the source multimedia file from the file offset information or are part of multimedia files in the source multimedia file from the file offset information;
the playing position is a first target playing time, and the file position information comprises key frames corresponding to different target playing times and file offset information corresponding to different key frames; the method includes that the multimedia server determines file offset information corresponding to a playing position according to the playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server, and specifically includes:
the multimedia server determines a first key frame corresponding to the first target playing time according to the first target playing time and the file position information;
and the multimedia server determines file offset information corresponding to the first target playing time according to the file position information and the first key frame.
2. The method according to claim 1, wherein the multimedia server obtains file location information of the source multimedia file from a remote server, specifically comprising:
and the multimedia server sends at least one second acquisition request to the remote server and acquires the file position information of the source multimedia file from the remote server.
3. The method according to claim 2, wherein the multimedia server sends at least one second acquisition request to the remote server to acquire the file location information of the source multimedia file from the remote server, and specifically includes:
the multimedia server sends a second acquisition request carrying a preset first fragmentation threshold range to the remote server so as to acquire a first information fragmentation returned by the remote server according to the first fragmentation threshold range;
the multimedia server judges whether a first information fragment located locally at present is complete file position information or not;
if so, the multimedia server determines to acquire the file position information of the source multimedia file; and if not, the multimedia server sends a new second acquisition request to the remote server again until the file position information of the source multimedia file is acquired.
4. The method according to claim 3, wherein the determining, by the multimedia server, whether the first information fragment currently located locally is complete file location information specifically includes:
the multimedia server acquires the size of the file position information of the source multimedia file from a first information fragment which is currently located locally;
and the multimedia server determines whether the first information fragment currently positioned locally is complete file position information or not according to the size of the file position information of the source multimedia file.
5. The method according to claim 3, wherein the determining, by the multimedia server, whether the current local first information fragment is complete file location information specifically includes:
and the multimedia server determines whether the first information fragment currently positioned locally is complete file position information or not according to the ending identifier of the file position information of the source multimedia file.
6. The method according to claim 1, wherein the multimedia server sends a first obtaining request carrying the file offset information to the remote server, so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server, specifically comprising:
and the multimedia server sends at least one first acquisition request to the remote server to acquire the target multimedia data from the remote server.
7. The method according to claim 6, wherein the multimedia server sends at least one first acquisition request to the remote server to acquire the target multimedia data from the remote server, specifically comprising:
the multimedia server sends a first acquisition request to the remote server, wherein the first acquisition request comprises a preset second fragmentation threshold range;
after receiving a second information fragment sent by the remote server according to the second fragment threshold range, the multimedia server judges whether the currently acquired second information fragment is complete target media data;
if so, the multimedia server determines to acquire the target multimedia data; and if not, updating the file offset information to be the starting position of the next second information fragment, obtaining a new first acquisition request and sending the new first acquisition request to the remote server again until the target multimedia data is determined to be acquired.
8. The method of claim 1, wherein before the multimedia server sends the target multimedia data to the client, the method further comprises:
the multimedia server deletes other key frames positioned before the first key frame in the file position information, and updates file offset information corresponding to the first key frame to obtain new file position information;
and the multimedia server sends the new file position information to the client.
9. The method of any of claims 1-8, wherein the multimedia file comprises at least one of audio, video.
10. The method according to claim 9, wherein the multimedia file is a video, and the play positioning request is a request carrying a start parameter, and the start parameter represents the first target play time.
11. The method of any of claims 2-5, wherein the first get request and the second get request are both hypertext transfer protocol (HTTP) requests; the file location information is meta information.
12. A device for processing multimedia files, comprising:
the determining module is used for determining file offset information corresponding to a playing position according to the playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server; the file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information, and the source multimedia file comprises a complete multimedia file and parameter information for assisting the client in playing;
the receiving and sending module is used for sending a first acquisition request carrying the file offset information to the remote server so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server;
the transceiver module is further configured to send the target multimedia data to the client, where the target multimedia data is all multimedia data in the source multimedia file from the file offset information or is a part of multimedia file in the source multimedia file from the file offset information;
the playing position is a first target playing time, and the file position information comprises key frames corresponding to different target playing times and file offset information corresponding to different key frames;
the determining module is specifically configured to determine a first key frame corresponding to the first target playing time according to the first target playing time and the file position information, and determine file offset information corresponding to the first target playing time according to the file position information and the first key frame.
13. The apparatus according to claim 12, wherein the transceiver module is further configured to send at least one second obtaining request to the remote server, and obtain file location information of the source multimedia file from the remote server.
14. The apparatus according to claim 13, wherein the transceiver module specifically comprises: the device comprises a first sending unit, a first receiving unit and a first judging unit;
the first sending unit is configured to send a second acquisition request carrying a preset first fragmentation threshold range to the remote server;
the first receiving unit is configured to obtain a first information fragment returned by the remote server according to the first fragment threshold range;
the first judging unit is configured to judge whether the first information fragment currently located locally is complete file location information, determine to acquire the file location information of the source multimedia file when the first information fragment currently located locally is judged to be complete file location information, and instruct the first sending unit to send a new second acquisition request to the remote server again when the first information fragment currently located locally is judged not to be complete file location information until the file location information of the source multimedia file is acquired.
15. The apparatus according to claim 14, wherein the first determining unit is specifically configured to obtain a size of the file location information of the source multimedia file from the first information fragment currently located locally, and determine whether the first information fragment currently located locally is complete file location information according to the size of the file location information of the source multimedia file.
16. The apparatus according to claim 14, wherein the first determining unit is specifically configured to determine whether the first information slice currently located locally is complete file location information according to an end identifier of file location information of the source multimedia file.
17. The apparatus according to claim 12, wherein the transceiver module is specifically configured to send at least one first obtaining request to the remote server to obtain the target multimedia data from the remote server.
18. The apparatus according to claim 17, wherein the transceiver module specifically comprises: a second transmitting unit, a second receiving unit and a second judging unit;
the second sending unit is configured to send a first acquisition request to the remote server, where the first acquisition request includes a preset second fragmentation threshold range;
the second judging unit is configured to judge whether the currently acquired second information fragment is complete target media data after the second receiving unit receives the second information fragment sent by the remote server according to the second fragment threshold range; if yes, determining to acquire the target multimedia data; and if not, indicating the second sending unit to update the file offset information to the starting position of the next second information fragment, obtaining a new first obtaining request and sending the new first obtaining request to the remote server again until the target multimedia data is determined to be obtained.
19. The apparatus of claim 12, further comprising a processing module;
the processing module is specifically configured to delete other key frames located before the first key frame in the file location information, and update file offset information corresponding to the first key frame to obtain new file location information;
the transceiver module is further configured to send the new file location information to the client.
20. The apparatus of any of claims 12-19, wherein the multimedia file comprises at least one of audio, video.
21. The apparatus of claim 20, wherein the multimedia file is a video, and wherein the file dragging request is a request carrying a start parameter, and wherein the start parameter represents the first target playing time.
22. The apparatus of any of claims 13-16, wherein the first get request and the second get request are both hypertext transfer protocol (HTTP) requests; the positioning information is meta information.
23. A device for processing multimedia files, characterized in that it comprises: a transceiver and a processor coupled to the transceiver;
the processor is used for determining file offset information corresponding to the playing position according to the playing position carried in the playing positioning request sent by the client and the file position information of the source multimedia file acquired from the remote server, wherein the playing position information is received by the transceiver; the file position information comprises a mapping relation between a plurality of preset playing positions and a plurality of file offset information, wherein the source multimedia file comprises a complete multimedia file and parameter information for assisting the client in playing;
the transceiver is configured to send a first acquisition request carrying the file offset information to the remote server, so that the remote server determines target multimedia data corresponding to the file offset information from the source multimedia file and sends the target multimedia data to the multimedia server;
the transceiver is further configured to send the target multimedia data to the client, where the target multimedia data is all multimedia data in the source multimedia file from the file offset information or is a part of multimedia file in the source multimedia file from the file offset information;
the playing position is a first target playing time, and the file position information comprises key frames corresponding to different target playing times and file offset information corresponding to different key frames; the method includes that the multimedia server determines file offset information corresponding to a playing position according to the playing position carried in a playing positioning request sent by a client and file position information of a source multimedia file acquired from a remote server, and specifically includes:
the multimedia server determines a first key frame corresponding to the first target playing time according to the first target playing time and the file position information;
and the multimedia server determines file offset information corresponding to the first target playing time according to the file position information and the first key frame.
24. The device of claim 23, wherein the transceiver comprises at least one of a transceiver, a device-oriented input-output interface.
25. The apparatus of claim 24, wherein the processor is further configured to perform the method of processing a multimedia file according to any one of claims 2-11.
CN201610815427.6A 2016-09-09 2016-09-09 Multimedia file processing method, device and equipment Active CN107809678B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610815427.6A CN107809678B (en) 2016-09-09 2016-09-09 Multimedia file processing method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610815427.6A CN107809678B (en) 2016-09-09 2016-09-09 Multimedia file processing method, device and equipment

Publications (2)

Publication Number Publication Date
CN107809678A CN107809678A (en) 2018-03-16
CN107809678B true CN107809678B (en) 2020-09-08

Family

ID=61569695

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610815427.6A Active CN107809678B (en) 2016-09-09 2016-09-09 Multimedia file processing method, device and equipment

Country Status (1)

Country Link
CN (1) CN107809678B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111367592B (en) * 2018-12-07 2023-07-11 北京字节跳动网络技术有限公司 Information processing method and device
CN109640113B (en) * 2018-12-28 2021-08-27 网宿科技股份有限公司 Processing method for dragging video data and proxy server
CN109819306B (en) * 2018-12-29 2022-11-04 花瓣云科技有限公司 Media file clipping method, electronic device and server
CN110113655B (en) * 2019-05-05 2021-09-21 北京奇艺世纪科技有限公司 Video playing method and device and user terminal
CN112104897B (en) * 2020-11-04 2021-03-12 北京达佳互联信息技术有限公司 Video acquisition method, terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004760A (en) * 2010-11-03 2011-04-06 深圳市同洲电子股份有限公司 Multimedia file storing and applying method, related device and system
CN102883187A (en) * 2012-09-17 2013-01-16 华为技术有限公司 Time-shift program service method, equipment and system
WO2013075342A1 (en) * 2011-11-26 2013-05-30 华为技术有限公司 Video processing method and device
CN104394476A (en) * 2014-11-28 2015-03-04 乐视致新电子科技(天津)有限公司 Time shifting playing method and media player
CN104539984A (en) * 2014-12-30 2015-04-22 北京奇艺世纪科技有限公司 Video playing method, device and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102004760A (en) * 2010-11-03 2011-04-06 深圳市同洲电子股份有限公司 Multimedia file storing and applying method, related device and system
WO2013075342A1 (en) * 2011-11-26 2013-05-30 华为技术有限公司 Video processing method and device
CN102883187A (en) * 2012-09-17 2013-01-16 华为技术有限公司 Time-shift program service method, equipment and system
CN104394476A (en) * 2014-11-28 2015-03-04 乐视致新电子科技(天津)有限公司 Time shifting playing method and media player
CN104539984A (en) * 2014-12-30 2015-04-22 北京奇艺世纪科技有限公司 Video playing method, device and system

Also Published As

Publication number Publication date
CN107809678A (en) 2018-03-16

Similar Documents

Publication Publication Date Title
CN107809678B (en) Multimedia file processing method, device and equipment
JP5588517B2 (en) Streaming with optional broadcast delivery of data segments
EP2537319B1 (en) Method and arrangement for adaption in http streaming
US10110507B2 (en) Push-based transmission of resources and correlated network quality estimation
CN106791933B (en) The method and system of online quick editor's video based on web terminal
US9356985B2 (en) Streaming video to cellular phones
US9917916B2 (en) Media delivery service protocol to support large numbers of client with error failover processes
CN108063769B (en) Method and device for realizing content service and content distribution network node
JP2015179551A (en) Method, apparatus and system for updating metadata file
WO2016053526A1 (en) Systems and methods for signaling request acceleration in the transport layer
WO2014060927A2 (en) A congestion control method for dynamically maximizing communication link throughput
TWI616097B (en) Streaming apparatus, streaming method, streaming service system using the streaming apparatus and the recording medium
CN113542904B (en) Video projection playing method and device, electronic equipment and storage medium
BR112015004266B1 (en) METHOD AND SYSTEM FOR DELIVERY OF AUDIOVISUAL CONTENT TO A CUSTOMER DEVICE
CN110677737A (en) HLS live broadcast quick playing method and system
WO2021073539A1 (en) Hls playback method, client, server and storage medium
US20240106891A1 (en) Peer-to-peer network scheduling method and system
CN111385660B (en) Video on demand method, device, equipment and storage medium
US10404781B2 (en) Flow characteristic based peer-to-peer system
CN110309342B (en) Media file acquisition method, device and storage medium
WO2019085243A1 (en) Audio and video data playback method and server and client terminal
US20230224548A1 (en) Streaming Assistance System and Computer-Implemented Method
CN110213330B (en) Pre-push system, method, device, electronic equipment and computer readable medium
CN110710220A (en) Method and apparatus for streaming data
CN113891176A (en) HLS-based on-demand flow control method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant