Disclosure of Invention
The application provides a multimedia live broadcast method, device and equipment, which can reduce the time delay between a multimedia playing point and a live broadcast point of terminal equipment on the basis of avoiding the occurrence of pause of live broadcast multimedia.
In a process of live broadcasting a first live multimedia by a terminal device, the terminal device may determine a play time length of a multimedia which is downloaded to the terminal device and is not played in the first live multimedia. When the playing time is shorter than a first preset time, reducing the playing rate of the first direct playing multimedia and/or downloading the multimedia fragments corresponding to the first code rate, wherein the first code rate is smaller than the code rate of the multimedia fragments being downloaded; and when the playing time length is longer than a second preset time length, increasing the playing speed of the first direct playing multimedia and/or downloading the multimedia fragments corresponding to a second code rate, wherein the second code rate is larger than the code rate of the multimedia fragments being downloaded, and the second preset time length is longer than or equal to the first preset time length.
In the above process, when the playing duration is shorter than the first preset duration, which indicates that the multimedia content currently cached by the terminal device is less, the playing rate of the first live multimedia is reduced, and/or the multimedia fragments corresponding to the first code rate pair (the first code rate is smaller than the code rate of the multimedia fragments being downloaded) are downloaded, so that the blocking of live broadcasting can be avoided. When the playing time is longer than the second preset time, it indicates that the multimedia content currently cached by the terminal device is more, the playing rate of the first live multimedia is increased, and/or the multimedia fragment corresponding to the second code rate (the second code rate is larger than the code rate of the multimedia fragment being downloaded) is downloaded, so that the time delay between the multimedia playing point and the live broadcasting point of the terminal device can be reduced. Therefore, by adjusting the playing rate of the live broadcast multimedia and/or the code rate of the downloaded multimedia fragments, the time delay between the multimedia playing point and the live broadcast point of the terminal device can be reduced on the basis of avoiding the blockage of the live broadcast multimedia.
In a possible embodiment, reducing the playing rate of the first live multimedia and/or downloading the multimedia slice corresponding to the first bitrate includes: if the code rate of the multimedia fragment being downloaded is greater than the third code rate, determining the first code rate, and downloading the multimedia fragment corresponding to the first code rate, wherein the first code rate is less than the third code rate; if the code rate of the multimedia fragment being downloaded is less than the fourth code rate, the playing rate of the first direct playing multimedia is reduced, and the third code rate is greater than or equal to the fourth code rate.
In the above process, when the playing duration is shorter than the first preset duration, the code rate of the multimedia fragment is preferentially adjusted, and after the code rate of the multimedia fragment being downloaded meets the preset condition (is shorter than the fourth code rate), the playing rate of the first live multimedia is adjusted.
In another possible embodiment, increasing the playing rate of the first direct playing multimedia and/or downloading the multimedia slice corresponding to the second code rate includes: if the code rate of the multimedia fragment being downloaded is smaller than the fifth code rate, determining a second code rate, and downloading the multimedia fragment corresponding to the second code rate, wherein the second code rate is larger than the fifth code rate; and if the code rate of the currently downloaded multimedia fragment is greater than the sixth code rate, increasing the playing rate of the first direct playing multimedia, wherein the sixth code rate is greater than or equal to the fifth code rate.
In the process, when the playing duration is longer than the second preset duration, the code rate of the multimedia fragment is preferentially adjusted, and after the code rate of the multimedia fragment being downloaded meets the preset condition (is larger than the sixth code rate), the playing speed of the first live multimedia is adjusted.
In another possible embodiment, after decreasing the playing rate of the first live multimedia, or increasing the playing rate of the first live multimedia, the method further includes: and when the playing time length of the multimedia fragments which are downloaded to the terminal equipment and are not played in the first direct-playing multimedia is determined to be between the first preset time length and the second preset time length, setting the playing speed of the first direct-playing multimedia as the preset playing speed. In this way, adverse effects on the user's viewing can be reduced.
In another possible implementation manner, before determining the playing time length of the multimedia fragment that has been downloaded to the terminal device and is not played in the first direct-playing multimedia, the method further includes: determining a starting playing multimedia fragment of a first live multimedia; and downloading the playing multimedia fragment from the server according to the playing multimedia fragment.
Optionally, the time delay between the obtained start-playing multimedia fragment and the live broadcast point is determined to be less than or equal to the playing time duration corresponding to the three multimedia fragments, so that when the time delay between the obtained start-playing multimedia fragment and the live broadcast point is determined to be less than the playing time duration corresponding to the three multimedia fragments, the time delay between the multimedia playing point of the terminal device and the live broadcast point when the terminal device starts live broadcast can also be reduced.
In another possible embodiment, determining an initiating multimedia slice of a first ongoing multimedia comprises: if a user-defined start-playing multimedia fragment identifier configured in advance by a user exists in the terminal equipment, determining a start-playing multimedia fragment according to the user-defined start-playing multimedia fragment identifier; if the user-defined starting multimedia fragment identification does not exist in the terminal equipment, the starting multimedia fragment is determined according to the parameter information of the terminal equipment, wherein the parameter information comprises the historical bandwidth and the initial code rate of the terminal equipment.
In the process, if the user configures the self-defined start-playing multimedia fragment identifier in the terminal device, the start-playing multimedia fragment is determined according to the self-defined start-playing multimedia fragment identifier configured by the user, and if the user does not configure the self-defined start-playing multimedia fragment identifier in the terminal device, the start-playing multimedia fragment is determined according to the parameter information of the terminal device. The determined start-playing multimedia fragment is related to the playing requirement of the user or the actual situation of the terminal equipment, so that the flexibility of determining the start-playing multimedia fragment is improved, and the flexibility of live broadcast control is further improved.
In another possible embodiment, determining the start-playing multimedia fragment according to the customized start-playing multimedia fragment identifier includes: if the user-defined start-playing multimedia fragment identifier indicates the generated multimedia fragment, determining the start-playing multimedia fragment as the multimedia fragment indicated by the user-defined start-playing multimedia fragment identifier; if the user-defined starting multimedia fragment identifier indicates the multimedia fragment being generated, whether the multimedia fragment being generated can be downloaded is judged, if yes, the starting multimedia fragment is determined to be the multimedia fragment being generated, and if not, the starting multimedia fragment is determined to be the latest generated multimedia fragment.
In another possible implementation, determining the start-playing multimedia segment according to the parameter information includes: determining a ratio range in which the ratio of the historical bandwidth to the initial code rate is; acquiring the identifier of the multimedia fragment corresponding to the ratio range; and determining the starting playing of the multimedia fragment according to the identifier of the multimedia fragment corresponding to the ratio range.
Optionally, if the identifier of the multimedia fragment corresponding to the ratio range indicates a generated multimedia fragment, determining that the multimedia fragment played is the multimedia fragment indicated by the identifier of the multimedia fragment corresponding to the ratio range; if the identifier of the multimedia fragment corresponding to the ratio range indicates the multimedia fragment being generated, judging whether the multimedia fragment being generated can be downloaded, if so, determining that the multimedia fragment being played is the multimedia fragment being generated, and if not, determining that the multimedia fragment being played is the latest generated multimedia fragment.
When the start-playing multimedia fragment is determined according to the parameter information of the terminal equipment, the obtained start-playing multimedia fragment is determined to be related to the network condition of the terminal equipment, so that the time delay between the multimedia playing point and the live playing point of the terminal equipment when the terminal equipment starts to directly play the multimedia can be reduced as much as possible on the premise of avoiding the multimedia jamming in the live playing process.
In another possible implementation, whether the multimedia fragment being generated is downloadable may be determined by the following possible implementation manners: acquiring a difference value between the current moment and the initial generation moment of the multimedia fragment being generated; judging whether the difference value is respectively greater than a third time length and a first time difference, wherein the third time length is the minimum time length required by preparing the multimedia fragment being generated, and the first time difference is the time difference between the playing time length of the multimedia fragment being generated and the preset downloading time length in advance; if yes, determining that the generated multimedia fragment can be downloaded; if not, determining that the generated multimedia fragment is not downloadable.
In another possible implementation manner, if the start-playing multimedia segment is the latest generated multimedia segment, after downloading the start-playing multimedia segment from the server according to the start-playing multimedia segment, the method further includes: judging whether the start-playing multimedia fragment comprises a key frame; if yes, starting playing the multimedia fragment from the key frame; if not, starting playing the multimedia fragment from the preset middle position of the starting playing multimedia fragment.
The time delay between the multimedia playing point and the live broadcasting point of the terminal equipment can be reduced by starting playing the multimedia fragment from the key frame or the preset middle position of the multimedia fragment.
In a second aspect, the present application provides a multimedia live broadcasting device, including a first determining module and a processing module, wherein,
the first determining module is used for determining the playing time length of multimedia which is downloaded to the terminal equipment and is not played in the first direct-playing multimedia;
the processing module is used for reducing the playing rate of the first direct playing multimedia and/or downloading the multimedia fragments corresponding to a first code rate when the playing time is shorter than a first preset time, wherein the first code rate is smaller than the code rate of the multimedia fragments being downloaded;
the processing module is further configured to increase a playing rate of the first direct-playing multimedia and/or download a multimedia fragment corresponding to a second bitrate when the playing duration is longer than a second preset duration, where the second bitrate is greater than a bitrate of the multimedia fragment being downloaded, and the second preset duration is longer than or equal to the first preset duration.
In a possible implementation, the processing module is specifically configured to:
If the code rate of the multimedia fragment being downloaded is greater than a third code rate, determining the first code rate, and downloading the multimedia fragment corresponding to the first code rate, wherein the first code rate is less than the third code rate;
and if the code rate of the multimedia fragment being downloaded is less than a fourth code rate, reducing the playing rate of the first direct-playing multimedia, wherein the third code rate is greater than or equal to the fourth code rate.
In another possible implementation manner, the processing module is specifically configured to:
if the code rate of the multimedia fragment being downloaded is smaller than a fifth code rate, determining the second code rate, and downloading the multimedia fragment corresponding to the second code rate, wherein the second code rate is larger than the fifth code rate;
and if the code rate of the currently downloaded multimedia fragment is greater than a sixth code rate, increasing the playing rate of the first direct playing multimedia, wherein the sixth code rate is greater than or equal to the fifth code rate.
In another possible implementation, the processing module is further configured to:
after the processing module reduces the playing rate of the first direct-playing multimedia or increases the playing rate of the first direct-playing multimedia, when it is determined that the playing time of the multimedia fragments which are downloaded to the terminal equipment and are not played in the first direct-playing multimedia is between the first preset time and the second preset time, the playing rate of the first direct-playing multimedia is set to be a preset playing rate.
In another possible embodiment, the apparatus further comprises a second determining module and a downloading module, wherein,
the second determining module is configured to determine a start-playing multimedia fragment of the first live multimedia before the first determining module determines a playing time length of a multimedia fragment which is downloaded to the terminal device and is not played in the first live multimedia;
and the downloading module is used for downloading the play-starting multimedia fragment from the server according to the play-starting multimedia fragment.
In another possible implementation manner, the second determining module is specifically configured to:
if a user-defined start-playing multimedia fragment identifier configured by a user in advance exists in the terminal equipment, determining a start-playing multimedia fragment according to the user-defined start-playing multimedia fragment identifier;
if the user-defined start-playing multimedia fragment identification does not exist in the terminal equipment, determining the start-playing multimedia fragment according to parameter information of the terminal equipment, wherein the parameter information comprises historical bandwidth and initial code rate of the terminal equipment.
In another possible implementation manner, the second determining module is specifically configured to:
if the user-defined start-playing multimedia fragment identifier indicates a generated multimedia fragment, determining the start-playing multimedia fragment as the multimedia fragment indicated by the user-defined start-playing multimedia fragment identifier;
If the user-defined starting multimedia fragment identification indicates the multimedia fragment being generated, judging whether the multimedia fragment being generated can be downloaded, if so, determining that the starting multimedia fragment is the multimedia fragment being generated, and if not, determining that the starting multimedia fragment is the latest generated multimedia fragment.
In another possible implementation manner, the second determining module is specifically configured to:
determining a ratio range in which the ratio of the historical bandwidth to the initial code rate is located;
acquiring the identifier of the multimedia fragment corresponding to the ratio range;
and determining the starting playing multimedia fragment according to the identifier of the multimedia fragment corresponding to the ratio range.
In another possible implementation manner, the second determining module is specifically configured to:
if the identifier of the multimedia fragment corresponding to the ratio range indicates the generated multimedia fragment, determining that the playing start multimedia fragment is the multimedia fragment indicated by the identifier of the multimedia fragment corresponding to the ratio range;
if the identifier of the multimedia fragment corresponding to the ratio range indicates the multimedia fragment being generated, judging whether the multimedia fragment being generated can be downloaded, if so, determining that the playing multimedia fragment is the multimedia fragment being generated, and if not, determining that the playing multimedia fragment is the latest generated multimedia fragment.
In another possible implementation manner, the second determining module is specifically configured to:
acquiring a difference value between the current moment and the initial generation moment of the multimedia fragment being generated;
judging whether the difference value is respectively greater than a third time length and a first time difference, wherein the third time length is the minimum time length required for preparing the multimedia fragment being generated, and the first time difference is the time difference between the playing time length of the multimedia fragment being generated and the preset time length of downloading in advance;
if yes, determining that the multimedia fragment being generated can be downloaded;
if not, determining that the generated multimedia fragment cannot be downloaded.
In another possible embodiment, the apparatus further comprises a determining module and a playing module, wherein,
the judging module is used for judging whether the start-playing multimedia fragment comprises a key frame or not after the downloading module downloads the start-playing multimedia fragment from the server;
the playing module is used for starting to play the play multimedia fragment from the key frame when the judging module judges that the play multimedia fragment comprises the key frame;
the playing module is further configured to start playing the start multimedia segment from a preset middle position of the start multimedia segment when the judging module judges that the start multimedia segment does not include the key frame.
In a third aspect, the present application provides a multimedia live broadcasting device, which includes a memory and a processor, where the processor executes program instructions in the memory to implement the multimedia live broadcasting method described in any one of the above first aspects.
In a third aspect, the present application provides a storage medium for storing a computer program, where the computer program is used to implement the multimedia live broadcast method of any one of the above first aspects.
According to the multimedia live broadcasting method, device and equipment, in the process that the terminal equipment broadcasts the first live broadcasting multimedia live, when the playing time is shorter than the first preset time, the fact that the multimedia content cached at the current terminal equipment is less is indicated, the playing speed of the first live broadcasting multimedia is reduced, and/or the multimedia fragments corresponding to the first code rate (the first code rate is smaller than the code rate of the multimedia fragments being downloaded) are downloaded, and therefore the situation that the live broadcasting is blocked can be avoided. When the playing time is longer than the second preset time, it indicates that the multimedia content currently cached by the terminal device is more, the playing rate of the first live multimedia is increased, and/or the multimedia fragment corresponding to the second code rate (the second code rate is larger than the code rate of the multimedia fragment being downloaded) is downloaded, so that the time delay between the multimedia playing point and the live broadcasting point of the terminal device can be reduced. Therefore, by adjusting the playing rate of the live broadcast multimedia and/or the code rate of the downloaded multimedia fragment, the time delay between the multimedia playing point and the live broadcast point of the terminal equipment can be reduced on the basis of avoiding the blockage of the live broadcast multimedia.
Detailed Description
Fig. 1 is an architecture diagram of an HLS live broadcast system provided in the present application. Referring to fig. 1, the multimedia recording apparatus 101, the encoder 102, the server 103, and the terminal apparatus 104 are included.
Alternatively, the multimedia recording apparatus 101 may be a video camera, a video recorder, a voice recorder, or the like. The multimedia recording device 101 is configured to record live multimedia, and send a recorded live multimedia file to the encoder 102. Optionally, when the multimedia recording device is used for recording a video, the recorded live video file may be in a Moving Picture Experts Group (MPEG) 4 format, and the like. When the multimedia recording device is used for recording audio, the recorded live audio file may be in MPEG3 format.
Optionally, the encoder 102 is used to encode a live multimedia file. Optionally, the encoder 102 may encode the multimedia file according to a plurality of different code rates to obtain a plurality of multimedia fragments with different code rates, where a multimedia fragment is a multimedia file with a preset playing time duration, and the multimedia fragment may be in a Transport Stream (TS) format, for example. For example, assuming that the code rates include 8000kbps and 3000kbps, multimedia slices corresponding to 8000kbps and multimedia slices corresponding to 3000kbps can be obtained. The encoder 102 sends the multimedia slices with various code rates to the server 103.
The server 103 is used for storing the multimedia slices transmitted by the encoder 102. The server 103 further includes an index file, where the index file includes multimedia fragment information of N multimedia fragments that are received by the server most recently, and N is an integer greater than or equal to 1. Optionally, the multimedia fragment information may include a playing time length of the multimedia fragment, a storage address of the multimedia fragment in the server 103, and the like. The server may periodically update the index file according to the received multimedia fragments.
Optionally, the terminal device 104 has a multimedia playing function, for example, the terminal device 104 may be a mobile phone, a computer, or the like. When the terminal device 104 needs to perform live broadcasting, the terminal device 104 accesses the server 103, downloads the multimedia fragment according to the index file in the server 103, and performs live broadcasting according to the downloaded multimedia fragment.
It should be noted that the HLS live broadcast system is illustrated in an exemplary form, and is not limited to the HLS live broadcast system, and in an actual application process, the HLS live broadcast system may be set according to actual needs. For example, the multimedia recording apparatus 101 may also be other apparatuses that can generate live multimedia, and the encoder 102 may also be an apparatus provided in the multimedia recording apparatus 101, and the like. The HLS live broadcast system is not specifically limited in this application.
In the application, before the terminal device performs the multimedia live broadcast, the terminal device may select to play the multimedia fragment according to the setting of the user or the parameter of the terminal device. Furthermore, in the process of performing the multimedia live broadcast by the terminal device, the terminal device may adjust the play rate of the live broadcast multimedia and/or the code rate of the downloaded multimedia fragment according to the play duration of the downloaded and unplayed multimedia fragment, so as to reduce the time delay between the multimedia play point and the live broadcast point of the terminal device on the basis of avoiding the pause of the live broadcast multimedia.
The technical means shown in the present application will be described in detail below with reference to specific examples. It should be noted that the following embodiments may be combined with each other, and the description of the same or similar contents in different embodiments is not repeated.
Fig. 2 is a schematic flowchart of a multimedia live broadcasting method provided in the present application. Referring to fig. 2, the method may include:
s201, determining the starting playing multimedia fragment of the first direct playing multimedia.
Optionally, the execution subject in the embodiment of the present invention may be a terminal device, and may also be a multimedia live device disposed in the terminal device. Alternatively, the multimedia live broadcasting device may be implemented by software, or may be implemented by a combination of software and hardware.
Optionally, the terminal device may execute the embodiment shown in fig. 2 before the first live multimedia is live.
For example, the terminal device may execute the embodiment shown in fig. 2 after receiving a play instruction corresponding to the first live multimedia input by the user.
Optionally, the first live multimedia may be live video, live audio, or the like.
Of course, the first live multimedia may be other, and this application is not limited to this specifically.
Optionally, the starting playing of the multimedia fragment refers to a first multimedia fragment downloaded from a server when the terminal device broadcasts the first live multimedia. That is, the starting playing of the multimedia fragment refers to the first played multimedia fragment when the terminal device broadcasts the first live multimedia.
Optionally, the multimedia fragment refers to a multimedia file with a preset playing duration. For example, the playing duration of a multimedia slice may be 3 seconds, etc.
Optionally, the start-playing multimedia segment may be a generated multimedia segment, where the server stores all contents in the generated multimedia segment. For example, the start-playing multimedia segment may be the third last multimedia segment before the live point, or the start-playing multimedia segment may be the second last multimedia segment before the live point, or the start-playing multimedia segment may be the first last multimedia segment before the live point.
Optionally, the start-playing multimedia segment may also be a generated multimedia segment, where a server stores a part of content of the generated multimedia segment, and another part of content server is not obtained from the encoder.
Optionally, the start playing multimedia segment of the first live multimedia may be determined by the following feasible implementation manners:
judging whether a user-defined starting multimedia fragment identifier configured in advance by a user exists in the terminal equipment, if so, determining the starting multimedia fragment according to the user-defined starting multimedia fragment identifier, and if not, determining the starting multimedia fragment according to the parameter information of the terminal equipment, wherein the parameter information comprises the historical bandwidth and the initial code rate of the terminal equipment.
Optionally, if the terminal device used by the user supports the configuration of the start-playing multimedia fragment, the user may configure the user-defined start-playing multimedia fragment identifier in the terminal device according to the performance of the terminal device.
Optionally, the historical bandwidth may be an average bandwidth in a preset time period before the current time. For example, the preset period may be one day, two days, etc. before the current time. The preset time period can be set according to actual needs.
Optionally, the initial code rate may be a preset value.
Optionally, the initial code rate may also be determined according to a code rate of a multimedia fragment downloaded by the terminal device during the historical multimedia live broadcast.
Optionally, the time delay between the obtained start-playing multimedia fragment and the live broadcast point is determined to be less than or equal to the playing time duration corresponding to the three multimedia fragments.
It should be noted that, in the embodiment shown in fig. 3, a process of determining a start multimedia segment of a first live multimedia is described in detail, and details are not repeated here.
S202, downloading the playing multimedia fragment from the server according to the playing multimedia fragment.
Optionally, the terminal device may send the fragment downloading request message to the server, and the server may send the index file to the terminal device according to the fragment downloading request message.
Alternatively, the index file may be in the M3U8 format.
Optionally, the index file may include information such as the identifiers and storage locations of the latest N multimedia slices. N is an integer greater than or equal to 1, and the size of N may be set according to actual needs in an actual application process.
Of course, the index file may also include other contents, for example, the playing time length of the multimedia segment, the generation time of the multimedia segment, and the like. In an actual application process, the content included in the index file may be set according to actual needs, which is not specifically limited in the present application.
Optionally, the identifier of the multimedia fragment in the index file may indicate an order of generating the multimedia fragment, for example, the larger the identifier of the multimedia fragment is, the later the multimedia fragment is generated, that is, the newer the multimedia fragment is.
Optionally, the storage location of the multimedia fragment may be a Uniform Resource Locator (URL).
In the process of multimedia live broadcasting, the encoder generates and sends new multimedia fragments to the server in real time, so that the latest N multimedia fragments in the server are updated in real time, and correspondingly, the server needs to update the index file in real time or periodically. For example, the server may update the index file once every time it receives a complete multimedia fragment sent by the encoder.
For example, the index file may be as shown in table 1:
TABLE 1
| Identification of multimedia fragments
|
Storage location
|
| S8
|
URL1
|
| S9
|
URL2
|
| S10
|
URL3
|
| S11
|
URL4 |
As can be seen from table 1, the generation sequence of the multimedia fragments is as follows: s8, S9, S10 and S11. S11 may be the multimedia segment being generated, S8-S10 are the generated multimedia segments, S8 is the third last multimedia segment before the live point, S9 is the second last multimedia segment before the live point, and S10 is the first last multimedia segment before the live point.
It should be noted that table 1 illustrates the index file in an exemplary form, and does not limit the index file, and in an actual application process, the index file may be set according to actual needs, which is not specifically limited in this application.
It should be noted that the index file may not include the storage location of the multimedia slice being generated. Correspondingly, when the terminal device needs to acquire the multimedia fragment being generated, the terminal device may calculate the storage location of the multimedia fragment being generated according to the storage location of the last multimedia fragment before the live broadcast point, and acquire the multimedia fragment being generated according to the calculated storage location of the multimedia fragment being generated.
For example, the terminal device may calculate the storage location of the multimedia fragment being generated according to the time length of the multimedia fragment and the storage location of the last-to-last multimedia fragment before the live broadcast point.
After the terminal device obtains the index file, the corresponding multimedia fragment can be determined in the index file according to the start-playing multimedia fragment, and the start-playing multimedia fragment is downloaded in the server according to the storage position of the corresponding multimedia fragment in the index file.
For example, assuming that the index file is shown in table 1, and it is determined that the start playing multimedia clip is the second last multimedia clip before the live point, the terminal device determines that the start playing multimedia clip is S9, and downloads S9 according to URL 2.
It should be noted that the terminal device further downloads a plurality of multimedia fragments after the multimedia fragment is played.
For example, after the terminal device has downloaded S9 shown in table 1, the terminal device also downloads S10 and S11. After the server updates the index file, the terminal device can also continue to download the multimedia fragment according to the updated index file.
Optionally, after the terminal device downloads the start-playing multimedia fragment, the terminal device may determine whether the start-playing multimedia fragment includes a key frame; if yes, starting playing the multimedia fragment from the key frame; if not, starting playing the multimedia fragment from the preset middle position of the starting playing multimedia fragment.
Optionally, the preset middle position may be one half of the playing length of the multimedia fragment played, two thirds of the playing length of the multimedia fragment played, and the like.
For example, assuming that the playing duration of the multimedia segment is 3 seconds, the preset middle position may be 2 seconds, etc.
It should be noted that, in the actual application process, the preset intermediate position may be set according to actual needs, and this application is not specifically limited to this.
The time delay between the multimedia playing point and the live broadcasting point of the terminal equipment can be reduced by starting playing the multimedia fragment from the key frame or the preset middle position of the multimedia fragment.
In the embodiment shown in fig. 2, the terminal device may determine the start-playing multimedia fragment according to the setting of the user or the parameter information of the terminal device, so that the determined start-playing multimedia fragment is related to the playing requirement of the user or the actual situation of the terminal device, thereby improving the flexibility of determining the start-playing multimedia fragment and further improving the flexibility of live broadcast control. Due to the fact that the time delay between the obtained start playing multimedia fragment and the live broadcasting point is determined to be smaller than or equal to the playing time length corresponding to the three multimedia fragments, when the time delay between the obtained start playing multimedia fragment and the live broadcasting point is determined to be smaller than the playing time length corresponding to the three multimedia fragments, the time delay between the multimedia playing point and the live broadcasting point of the terminal equipment when the terminal equipment starts live broadcasting can be reduced.
On the basis of the embodiment shown in fig. 2, optionally, the start multimedia segment of the first live multimedia can be determined through the following feasible implementation manner (S201 in the embodiment of fig. 2), specifically, please refer to the embodiment shown in fig. 3.
Fig. 3 is a schematic flow chart of a method for determining an initiating multimedia fragment according to the present application. Referring to fig. 3, the method may include:
s301, judging whether a user-defined start-playing multimedia fragment identifier configured in advance by a user exists in the terminal equipment.
If yes, S302-S306 are executed.
If not, S307-S310 are executed.
S302, judging whether the user-defined playing starting multimedia fragment identification indicates the multimedia fragment being generated.
If not, go to S303.
If so, S304-S306 are performed.
Optionally, a corresponding relationship between the user-defined start-playing multimedia fragment identifier and the multimedia fragment indicated by the user-defined start-playing multimedia fragment identifier may be preset.
For example, the corresponding relationship between the self-defined start-playing multimedia fragment identifier and the multimedia fragment indicated by the self-defined start-playing multimedia fragment identifier may be as shown in table 2:
TABLE 2
Referring to table 2, when the identifier of the customized start playing multimedia segment is-3, the multimedia segment indicated by-3 is the third last multimedia segment before the live broadcast point. When the identifier of the customized play-starting multimedia fragment is-2, the multimedia fragment indicated by-2 is the last-but-one multimedia fragment before the live broadcast point. When the mark of the customized play-start multimedia segment is-1, the multimedia segment indicated by-1 is the last multimedia segment before the live broadcast point. When the identifier of the custom start-playing multimedia fragment is 0, the multimedia fragment indicated by 0 is the multimedia fragment being generated.
Optionally, when the corresponding relationship is shown in table 2, it may be determined whether the self-defined start-playing multimedia fragment identifier is less than 0, if yes, it is determined that the self-defined start-playing multimedia fragment identifier indicates a generated multimedia fragment, and if not, it is determined that the self-defined start-playing multimedia fragment identifier indicates a multimedia fragment being generated.
It should be noted that, the foregoing is only an example form showing the corresponding relationship between the user-defined start-playing multimedia fragment identifier and the multimedia fragment indicated by the user-defined start-playing multimedia fragment identifier, and the corresponding relationship is not limited to this.
And S303, determining the start playing multimedia fragment as the multimedia fragment indicated by the self-defined start playing multimedia fragment identifier.
For example, referring to table 2, assuming that the customized play-start multimedia segment identifier is-2, the multimedia segment indicated by the customized play-start multimedia segment identifier is the penultimate multimedia segment before the live broadcast point, and accordingly, the penultimate multimedia segment before the live broadcast point may be determined as the play-start multimedia segment.
S304, judging whether the generated multimedia fragment can be downloaded.
If yes, S305 is performed.
If not, go to S306.
Optionally, it may be determined whether the generated multimedia fragment is downloadable through the following feasible implementation manners:
acquiring a difference value between the current time and the initial generation time of the multimedia fragment being generated, and judging whether the difference value is greater than a third time length and a first time difference respectively; if yes, determining that the multimedia fragment being generated can be downloaded; if not, determining that the generated multimedia fragment is not downloadable.
Optionally, the starting time of the multimedia fragment being generated refers to a time when the multimedia fragment being generated starts to be generated.
Wherein the third time duration is a minimum time duration required for preparing the multimedia slice being generated.
After a third time period has elapsed since the initial generation of the multimedia segment being generated, the encoder and/or the server can only prepare the multimedia segment being generated, so that the terminal device downloads the prepared multimedia segment being generated.
Optionally, the third duration is less than the playing duration of the multimedia fragment being generated.
For example, assuming that the playing time duration of the multimedia slice being generated is 5 seconds, the third time duration may be 2 seconds, etc.
In an actual application process, the third time period may be set according to actual needs, which is not specifically limited in the present application.
The first time difference is the time difference between the playing time of the multimedia fragment being generated and the preset downloading time in advance.
Optionally, the first time difference may be: the playing time length of the multimedia fragment being generated is subtracted by the preset advanced downloading time length, and then the error time length is added.
Optionally, the preset download duration in advance is less than the play duration of the multimedia fragment being generated.
For example, assuming that the playing time duration of the multimedia slice being generated is 5 seconds, the third time duration may be 3 seconds, and so on.
In the actual application process, the preset advanced downloading duration can be set according to actual needs, which is not specifically limited in the present application.
Optionally, the error duration may be a duration reserved when the playing duration of the multimedia segment is not fixed.
For example, the error duration may be-1 second, etc.
Of course, in the actual application process, the error duration may be set according to actual needs, which is not specifically limited in the present application.
S305, determining the multimedia fragment played at the beginning as the generated multimedia fragment.
S306, determining the multimedia fragment played to be the latest generated multimedia fragment.
Optionally, the generated latest multimedia segment is a multimedia segment that is closest to the live broadcast point. That is, the latest generated multimedia segment is the last multimedia segment before the generated live broadcast point.
S307, determining a ratio range in which the ratio of the historical bandwidth to the initial code rate is located.
Alternatively, the range of ratios may be a preset setting.
Alternatively, at least two ratio ranges may be preset.
S308, acquiring the identifier of the multimedia fragment corresponding to the ratio range.
Optionally, each ratio range corresponds to an identifier of one multimedia slice.
For example, the correspondence between the ratio range and the identifier of the multimedia fragment may be as shown in table 3:
TABLE 3
| Range of ratio
|
Identification of multimedia fragments
|
| Greater than 20
|
0 (multimedia slice being generated)
|
| 15-20
|
-1 (last multimedia slicing before live broadcast point)
|
| 10-15
|
-2 (penultimate multimedia slicing before live broadcast point)
|
| Less than 10
|
-3 (third last multimedia slicing before live broadcast point) |
It should be noted that table 3 only shows the corresponding relationship between the ratio range and the identifier of the multimedia fragment in an exemplary form, and in an actual application process, the corresponding relationship between the ratio range and the identifier of the multimedia fragment may be preset according to actual needs, which is not specifically limited in this application.
S309, judging whether the identification of the multimedia fragment corresponding to the ratio range indicates the multimedia fragment being generated.
If not, go to S310.
If so, S304-S306 are performed.
It should be noted that the execution process of S309 may refer to the execution process of S302, and a repeated description is not repeated herein.
S310, determining the multimedia fragment played at the beginning to be the multimedia fragment indicated by the multimedia fragment identifier corresponding to the ratio range.
For example, referring to table 3, assuming that the ratio range is 20-25, the multimedia segment indicated by the identifier of the multimedia segment corresponding to the ratio range is the last-but-one multimedia segment before the live point, and accordingly, the last-but-one multimedia segment before the live point may be determined as the play-start multimedia segment.
In the embodiment shown in fig. 3, if the user configures the self-defined start-playing multimedia fragment identifier in the terminal device, the start-playing multimedia fragment is determined according to the self-defined start-playing multimedia fragment identifier configured by the user, and if the user does not configure the self-defined start-playing multimedia fragment identifier in the terminal device, the start-playing multimedia fragment is determined according to the parameter information of the terminal device. Therefore, the determined start-up multimedia fragment is related to the playing requirement of the user or the actual situation of the terminal device, so that the flexibility of determining the start-up multimedia fragment is improved, and the flexibility of live broadcast control is further improved. When the start-playing multimedia fragment is determined according to the parameter information of the terminal equipment, the obtained start-playing multimedia fragment is determined to be related to the network condition of the terminal equipment, so that the time delay between the multimedia playing point and the live playing point of the terminal equipment when the terminal equipment starts to directly play the multimedia can be reduced as much as possible on the premise of avoiding the multimedia jamming in the live playing process.
In the present application, in the process of live multimedia broadcast, the playing rate of live multimedia and/or the code rate of downloaded multimedia fragments may be adjusted according to the playing duration of downloaded and unplayed multimedia fragments by a terminal device, specifically, please refer to the embodiment shown in fig. 4.
Fig. 4 is a schematic flowchart of another multimedia live broadcasting method provided in the present application. Referring to fig. 4, the method may include:
s401, determining the playing time length of multimedia which is downloaded to the terminal equipment and is not played in the first direct-playing multimedia.
Optionally, the execution subject in the embodiment of the present invention may be a terminal device, and may also be a multimedia live device disposed in the terminal device. Alternatively, the multimedia live broadcasting device may be implemented by software, or may be implemented by a combination of software and hardware.
In the practical application process, aiming at the same live broadcast multimedia, the server comprises multimedia fragments with various code rates of the live broadcast multimedia. The higher the code rate of the multimedia fragment is, the higher the quality of the multimedia fragment is, and the larger the size of the multimedia fragment with the same playing time length is.
For example, the multimedia fragments stored in the server may be as shown in fig. 5.
Fig. 5 is a schematic diagram of a multimedia fragment stored in a server provided in the present application. Referring to fig. 5, the server includes a multimedia fragment with a bitrate of 8000kbps, a multimedia fragment with a bitrate of 3000kbps, a multimedia fragment with a bitrate of 2000kbps, a multimedia fragment with a bitrate of 1000kbps, and a multimedia fragment with a bitrate of 500 kbps.
When the playing time lengths of the multimedia fragments with different code rates are the same, the size of one multimedia fragment with the code rate of 8000kbps is larger than that of one multimedia fragment with the code rate of 3000 kbps. The size of a multimedia fragment with a code rate of 3000kbps is larger than that of a multimedia fragment with a code rate of 2000 kbps.
Of course, in the actual application process, the multiple different code rates may be set according to actual needs, which is not specifically limited in the present application.
In the process of the terminal device in the multimedia live broadcast, the terminal device can request the server to acquire the multimedia fragments with a certain code rate according to the actual situation. Correspondingly, the multimedia fragments with a certain code rate are cached in the terminal equipment.
Optionally, the playing duration of each multimedia segment is generally the same. Correspondingly, the terminal device may determine the playing time length of the multimedia which is downloaded to the terminal device and is not played according to the number of the multimedia fragments which are downloaded to the terminal device and are not played and the non-played time length of the multimedia fragments which are currently played.
For example, assuming that the duration of one multimedia fragment is 5 seconds, 3 multimedia fragments which are not played are stored in the terminal device, and the multimedia fragment which is currently played by the terminal device has been played for 3 seconds, the playing duration of the multimedia which has been downloaded to the terminal device and has not been played is: 5 x 3+ (5-3) ═ 17 seconds.
S402, when the playing time is shorter than a first preset time, reducing the playing speed of the first direct playing multimedia and/or downloading the multimedia fragments corresponding to the first code rate, wherein the first code rate is smaller than the code rate of the multimedia fragments being downloaded.
For example, the first preset time period may be 2 seconds, 3 seconds, and the like.
Of course, in the actual application process, the first preset time period may be set according to actual needs.
Optionally, the reason for the playing time being less than the first preset time may be: the code rate of the downloaded multimedia fragment is higher, or the playing rate of the first direct-playing multimedia is faster, or the network bandwidth of the terminal device is smaller.
Optionally, when the playing duration is shorter than a first preset duration, it indicates that the multimedia cached in the terminal device is less, at this time, in the multimedia live broadcasting process, a pause may occur, and in order to avoid the pause, the following feasible implementation manner may be used to process:
If the code rate of the multimedia fragment being downloaded is greater than the third code rate, determining the first code rate, and downloading the multimedia fragment corresponding to the first code rate; and if the code rate of the multimedia fragment being downloaded is less than the fourth code rate, reducing the playing rate of the first direct playing multimedia.
Optionally, the third code rate is greater than or equal to the fourth code rate.
Optionally, when the code rate of the multimedia segment being downloaded is greater than the third code rate, it indicates that the code rate of the multimedia segment being downloaded is higher, that is, the quality of the currently played multimedia is higher. Therefore, the bitrate of the downloaded multimedia slice can be reduced. For example, the third code rate may be subtracted by a code rate with a preset size to obtain a first code rate, and the multimedia slice corresponding to the first code rate is downloaded. After the code rate of the downloaded multimedia fragments is reduced, the playing time of the multimedia fragments with the same size downloaded in the same time length is prolonged, and the multimedia cached by the terminal equipment can be further increased step by step.
Optionally, when it is determined that the code rate of the multimedia fragment being downloaded is greater than the third code rate, the code rate of the multimedia fragment being downloaded may be further gradually reduced until the code rate is reduced by the third code rate, or the playing duration of the multimedia which is cached by the terminal device and is not played is greater than or equal to the first preset duration.
Optionally, when the code rate of the multimedia fragment being downloaded is less than or equal to the third code rate, it indicates that the code rate of the multimedia fragment being downloaded is not high, that is, the quality of the currently played multimedia is not high. Therefore, the play rate of the first live multimedia can be reduced.
Optionally, the playing rate of the first live multimedia can be reduced to a first preset playing rate. For example, the first preset playback rate may be 0.9 times the playback rate, 0.8 times the playback rate, or the like.
Of course, in the actual application process, the first preset playing rate may be set according to actual needs, which is not specifically limited in the present application.
Optionally, the playing rate of the first direct-playing multimedia may be gradually reduced until the playing rate of the first direct-playing multimedia is less than the preset minimum playing rate, or the playing duration of the multimedia that is not played and is cached by the terminal device is greater than or equal to the first preset duration.
Optionally, the preset minimum playing rate may be 0.8 times playing rate, 0.85 times playing rate, or the like.
Of course, in the actual application process, the preset minimum playing rate may be set according to actual needs, which is not specifically limited in the present application.
For example, the playing speed of the first always-played multimedia may be reduced by a preset size, after the preset duration, if the playing duration of the multimedia that is not played and is cached by the terminal device is still less than the first preset duration, and the reduced playing speed is still greater than the preset minimum playing speed, the playing speed of the first always-played multimedia may be reduced by the preset size again, and the above process may be repeated until the playing speed of the first always-played multimedia is less than the preset minimum playing speed, or the playing duration of the multimedia that is not played and is cached by the terminal device is greater than or equal to the first preset duration.
Optionally, the playing rate of the first always-played multimedia may also be reduced through other feasible implementation manners, and/or the multimedia fragment corresponding to the first code rate is downloaded, for example, the playing rate of the first always-played multimedia may be reduced at the same time, and the code rate of the downloaded multimedia fragment may be reduced, and the reduction of the playing rate of the first always-played multimedia may be suspended until the playing rate of the first always-played multimedia is smaller than the preset minimum rate, and the reduction of the code rate of the downloaded multimedia fragment may be suspended when the code rate of the downloaded multimedia fragment is smaller than the preset minimum code rate.
Optionally, the playing rate of the first live multimedia may also be reduced through other feasible implementation manners, and/or the multimedia fragment corresponding to the first code rate is downloaded, for example, if the playing rate of the first live multimedia is greater than the first playing rate, the playing rate of the first live multimedia is reduced; if the playing speed of the first direct playing multimedia is less than the second playing speed, the code rate of the downloaded multimedia fragments is reduced, and the first playing speed is greater than or equal to the second playing speed.
And S403, when the playing duration is longer than a second preset duration, increasing the playing rate of the first direct playing multimedia and/or downloading the multimedia fragments corresponding to a second code rate, wherein the second code rate is larger than the code rate of the multimedia fragments being downloaded.
Optionally, the second preset time period may be greater than or equal to the first preset time period.
For example, the second preset time period may be 8 seconds, 10 seconds, etc.
Of course, in the actual application process, the second preset time period may be set according to actual needs.
Optionally, the reason for the playing time length being greater than the second preset time length may be: the code rate of the downloaded multimedia fragments is low, or the playing speed of the first direct playing multimedia is slow.
Optionally, when the playing duration is longer than the second preset duration, it indicates that there are more multimedia cached in the terminal device, so that the time delay between the multimedia playing point and the live broadcasting point of the terminal device is relatively large, and the processing may be implemented in the following feasible implementation manner:
optionally, if the code rate of the multimedia fragment being downloaded is smaller than the fifth code rate, determining a second code rate, and downloading the multimedia fragment corresponding to the second code rate; and if the code rate of the currently downloaded multimedia fragment is greater than the sixth code rate, increasing the playing rate of the first direct playing multimedia.
Optionally, the sixth code rate is greater than or equal to the fifth code rate.
Optionally, when the code rate of the multimedia fragment being downloaded is smaller than the fifth code rate, it indicates that the code rate of the multimedia fragment being downloaded is lower, that is, the quality of the currently played multimedia is lower. Therefore, the code rate of the downloaded multimedia slices can be improved. For example, the fifth code rate may be added to a code rate with a preset size to obtain a second code rate, and the multimedia slice corresponding to the second code rate is downloaded. After the code rate of the downloaded multimedia fragments is improved, the playing time of the multimedia fragments with the same size downloaded in the same time length is shortened, and the multimedia cached by the terminal equipment can be further reduced step by step.
Optionally, when it is determined that the code rate of the multimedia fragment being downloaded is smaller than the fifth code rate, the code rate of the multimedia fragment being downloaded may be further increased step by step until the code rate is increased to the fifth code rate, or the playing duration of the multimedia which is not played and is cached by the terminal device is smaller than or equal to a second preset duration.
Optionally, when the code rate of the multimedia fragment being downloaded is greater than the sixth code rate, it indicates that the code rate of the multimedia fragment being downloaded is higher, that is, the quality of the currently played multimedia is higher. Therefore, the play rate of the first through multimedia can be increased.
Optionally, the playing rate of the first live multimedia can be increased to a second preset playing rate. For example, the second preset playback rate may be 1.1 times the playback rate, 1.2 times the playback rate, or the like.
Of course, in the actual application process, the second preset playing rate may be set according to actual needs, which is not specifically limited in the present application.
Optionally, the playing speed of the first direct-playing multimedia may be gradually increased until the playing speed of the first direct-playing multimedia is greater than the preset maximum playing speed, or the playing time of the multimedia that is not played and is cached by the terminal device is less than or equal to the second preset time.
Optionally, the preset maximum play rate may be 1.2 times of the play rate, 1.3 times of the play rate, or the like.
Of course, in the actual application process, the preset maximum playing speed may be set according to actual needs, which is not specifically limited in the present application.
For example, the playing speed of the first direct-playing multimedia may be increased by a preset size, after the preset duration, if the playing duration of the unplayed multimedia cached by the terminal device is still greater than the second preset duration, and the increased playing speed is still less than the preset maximum playing speed, the playing speed of the first direct-playing multimedia may be increased by the preset size again, and the above process may be repeated until the playing speed of the first direct-playing multimedia is greater than the preset maximum playing speed, or the playing duration of the unplayed multimedia cached by the terminal device is less than or equal to the second preset duration.
Optionally, the playing rate of the first live multimedia can be increased and/or the multimedia fragment corresponding to the second code rate can be downloaded through other feasible implementation manners, for example, the playing rate of the first live multimedia can be increased and the code rate of the downloaded multimedia fragment can be increased at the same time, until the playing rate of the first live multimedia is greater than the preset maximum rate, the playing rate of the first live multimedia is paused to be increased, and when the code rate of the downloaded multimedia fragment is greater than the preset maximum code rate, the code rate of the downloaded multimedia fragment is paused to be increased.
Optionally, the playing rate of the first live multimedia may also be increased by other feasible implementation manners, and/or the multimedia fragment corresponding to the second code rate is downloaded, for example, if the playing rate of the first live multimedia is smaller than the third playing rate, the playing rate of the first live multimedia is increased; and if the playing speed of the first direct playing multimedia is greater than the fourth playing speed, the code rate of the downloaded multimedia fragment is increased.
It should be noted that, if it is determined that the playing time of the multimedia fragment that has been downloaded to the terminal device and is not played in the first live multimedia is between the first preset time and the second preset time, the playing rate of the first live multimedia may not be adjusted, and the code rate of the downloaded multimedia fragment may not be adjusted.
Optionally, after the play rate of the first direct-play multimedia is reduced or increased, when it is determined that the play duration of the multimedia fragment that has been downloaded to the terminal device and is not played in the first direct-play multimedia is between the first preset duration and the second preset duration, the play rate of the first direct-play multimedia may be set to the preset play rate.
Optionally, the preset playing rate is 1 time of the playing rate, that is, the preset playing rate is a normal playing rate.
In the embodiment shown in fig. 4, in the process of performing the multimedia live broadcast by the terminal device, when the playing duration is shorter than the first preset duration, which indicates that the multimedia content currently cached by the terminal device is less, the playing rate of the first live broadcast multimedia is reduced, and/or the multimedia fragment corresponding to the first code rate (the first code rate is smaller than the code rate of the multimedia fragment being downloaded) is downloaded, so that the live broadcast can be prevented from being blocked. When the playing time is longer than the second preset time, it indicates that the multimedia content currently cached by the terminal device is more, the playing rate of the first live multimedia is increased, and/or the multimedia fragment corresponding to the second code rate (the second code rate is larger than the code rate of the multimedia fragment being downloaded) is downloaded, so that the time delay between the multimedia playing point and the live broadcasting point of the terminal device can be reduced. Therefore, by adjusting the playing rate of the live broadcast multimedia and/or the code rate of the downloaded multimedia fragment, the time delay between the multimedia playing point and the live broadcast point of the terminal equipment can be reduced on the basis of avoiding the blockage of the live broadcast multimedia.
Fig. 6 is a schematic structural diagram of a multimedia live broadcasting device provided in the present application. Referring to fig. 6, the multimedia live device 10 may include a first determining module 11 and a processing module 12, wherein,
the first determining module 11 is configured to determine a playing time length of multimedia which is downloaded to the terminal device and is not played in the first direct-playing multimedia;
the processing module 12 is configured to, when the playing duration is less than a first preset duration, reduce the playing rate of the first direct-playing multimedia and/or download a multimedia fragment corresponding to a first code rate, where the first code rate is less than a code rate of a multimedia fragment being downloaded;
the processing module 12 is further configured to, when the playing duration is longer than a second preset duration, increase the playing rate of the first direct playing multimedia and/or download a multimedia fragment corresponding to a second bitrate, where the second bitrate is greater than a bitrate of a multimedia fragment being downloaded, and the second preset duration is longer than or equal to the first preset duration.
Alternatively, the first determining module may perform S401 in the embodiment of fig. 4.
Optionally, the processing module 12 may perform S402-S403 in the embodiment of fig. 4.
It should be noted that the multimedia live broadcasting device described in the present application may execute the technical solution shown in the foregoing method embodiment, and the implementation principle and the beneficial effect thereof are similar, and are not described herein again.
In a possible implementation, the processing module 12 is specifically configured to:
if the code rate of the multimedia fragment being downloaded is greater than a third code rate, determining the first code rate, and downloading the multimedia fragment corresponding to the first code rate, wherein the first code rate is less than the third code rate;
if the code rate of the multimedia fragment being downloaded is smaller than a fourth code rate, the playing rate of the first direct-playing multimedia is reduced, and the third code rate is larger than or equal to the fourth code rate.
In another possible implementation, the processing module 12 is specifically configured to:
if the code rate of the multimedia fragment being downloaded is smaller than a fifth code rate, determining the second code rate, and downloading the multimedia fragment corresponding to the second code rate, wherein the second code rate is larger than the fifth code rate;
and if the code rate of the currently downloaded multimedia fragment is greater than a sixth code rate, increasing the playing rate of the first direct playing multimedia, wherein the sixth code rate is greater than or equal to the fifth code rate.
In another possible embodiment, the processing module 12 is further configured to:
after the processing module reduces the playing rate of the first direct-playing multimedia or increases the playing rate of the first direct-playing multimedia, when it is determined that the playing time of the multimedia fragments which are downloaded to the terminal equipment and are not played in the first direct-playing multimedia is between the first preset time and the second preset time, the playing rate of the first direct-playing multimedia is set to be a preset playing rate.
Fig. 7 is a schematic structural diagram of another multimedia live broadcasting device provided in the present application. On the basis of the embodiment shown in fig. 6, please refer to fig. 7, the apparatus further comprises a second determining module 13 and a downloading module 14, wherein,
the second determining module 13 is configured to determine a starting multimedia segment of the first direct playing multimedia before the first determining module determines the playing time of a multimedia segment that has been downloaded to the terminal device and has not been played in the first direct playing multimedia;
the downloading module 14 is configured to download the start playing multimedia fragment from the server according to the start playing multimedia fragment.
Optionally, the second determining module 13 may execute S201 in the embodiment of fig. 2 and S301 to S306 in the embodiment of fig. 3.
Optionally, the downloading module 14 may execute S202 in the embodiment of fig. 2.
In another possible implementation manner, the second determining module 13 is specifically configured to:
if a user-defined start-playing multimedia fragment identifier configured in advance by a user exists in the terminal equipment, determining a start-playing multimedia fragment according to the user-defined start-playing multimedia fragment identifier;
if the user-defined start-playing multimedia fragment identification does not exist in the terminal equipment, determining the start-playing multimedia fragment according to parameter information of the terminal equipment, wherein the parameter information comprises historical bandwidth and initial code rate of the terminal equipment.
In another possible implementation manner, the second determining module 13 is specifically configured to:
if the user-defined start-playing multimedia fragment identifier indicates a generated multimedia fragment, determining the start-playing multimedia fragment as the multimedia fragment indicated by the user-defined start-playing multimedia fragment identifier;
if the user-defined start playing multimedia fragment mark indicates the multimedia fragment being generated, judging whether the multimedia fragment being generated can be downloaded, if so, determining that the start playing multimedia fragment is the multimedia fragment being generated, and if not, determining that the start playing multimedia fragment is the latest generated multimedia fragment.
In another possible implementation manner, the second determining module 13 is specifically configured to:
determining a ratio range in which the ratio of the historical bandwidth to the initial code rate is located;
acquiring the identifier of the multimedia fragment corresponding to the ratio range;
and determining the starting multimedia fragment according to the identifier of the multimedia fragment corresponding to the ratio range.
In another possible implementation manner, the second determining module 13 is specifically configured to:
if the identifier of the multimedia fragment corresponding to the ratio range indicates the generated multimedia fragment, determining that the playing start multimedia fragment is the multimedia fragment indicated by the identifier of the multimedia fragment corresponding to the ratio range;
if the identifier of the multimedia fragment corresponding to the ratio range indicates the multimedia fragment being generated, judging whether the multimedia fragment being generated can be downloaded, if so, determining that the playing multimedia fragment is the multimedia fragment being generated, and if not, determining that the playing multimedia fragment is the latest generated multimedia fragment.
In another possible implementation manner, the second determining module 13 is specifically configured to:
acquiring a difference value between the current moment and the initial generation moment of the multimedia fragment being generated;
Judging whether the difference value is respectively greater than a third time length and a first time difference, wherein the third time length is the minimum time length required for preparing the generated multimedia fragment, and the first time difference is the time difference between the playing time length of the generated multimedia fragment and the preset downloading time length in advance;
if yes, determining that the generated multimedia fragment can be downloaded;
if not, determining that the generated multimedia fragment is not downloadable.
In another possible embodiment, the apparatus further comprises a determining module 15 and a playing module 16, wherein,
the judging module 15 is configured to, after the downloading module 14 downloads the start-playing multimedia fragment from the server, judge whether a key frame is included in the start-playing multimedia fragment;
the playing module 16 is configured to, when the determining module 15 determines that the start-playing multimedia segment includes a key frame, start playing the start-playing multimedia segment from the key frame;
the playing module 16 is further configured to start playing the start multimedia segment from a preset middle position of the start multimedia segment when the determining module 15 determines that the start multimedia segment does not include the key frame.
It should be noted that the multimedia live broadcasting device described in the present application may execute the technical solution shown in the foregoing method embodiment, and the implementation principle and the beneficial effect thereof are similar, and are not described herein again.
Fig. 8 is a schematic hardware structure diagram of a multimedia live broadcasting device provided in the present application. Referring to fig. 8, the multimedia live device 20 includes: a memory 21 and a processor 22, wherein the memory 21 and the processor 22 are in communication; illustratively, the memory 21 and the processor 22 communicate via a communication bus 23, the memory 21 being configured to store a computer program, the processor 22 executing the computer program to implement the method shown in the above embodiments.
Optionally, the multimedia live device 20 may further include a transmitter and/or a receiver.
Optionally, the Processor may be a Central Processing Unit (CPU), or may be another general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present application may be embodied directly in a hardware processor, or in a combination of the hardware and software modules in the processor.
The present application provides a computer-readable storage medium comprising instructions that, when executed on a computer, cause the computer to perform a multimedia live method provided by any of the above method embodiments.
The present application provides a chip, where the chip is used to support a multimedia live broadcast device to implement functions shown in this application embodiment (for example, functions shown in steps in fig. 2 to fig. 4), and the chip is specifically used in a chip system, where the chip system may be formed by a chip, or may include a chip and other discrete devices. When the chip in the multimedia live broadcasting device for implementing the method includes a processing unit, the chip may further include a communication unit, and the processing unit may be, for example, a processor, and when the chip includes a communication unit, the communication unit may be, for example, an input/output interface, a pin, a circuit, or the like. The processing unit performs all or part of the actions performed by the various processing modules in the embodiments of the present application (e.g., the various modules included in fig. 6-7), and the communication unit may perform the corresponding receiving or sending actions (e.g., downloading a playing multimedia slice from a server, etc.).
All or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The aforementioned program may be stored in a readable memory. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned memory (storage medium) includes: read-only memory (ROM), RAM, flash memory, hard disk, solid state disk, magnetic tape (magnetic tape), floppy disk (flexible disk), optical disk (optical disk), and any combination thereof.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processing unit of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processing unit of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the embodiments of the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to encompass such modifications and variations.
In the present application, the terms "include" and variations thereof may refer to non-limiting inclusions; the term "or" and variations thereof may mean "and/or". The terms "first," "second," and the like in this application are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. In the present application, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.