CN109803151B - Multimedia data stream switching method and device, storage medium and electronic device - Google Patents

Multimedia data stream switching method and device, storage medium and electronic device Download PDF

Info

Publication number
CN109803151B
CN109803151B CN201711138180.XA CN201711138180A CN109803151B CN 109803151 B CN109803151 B CN 109803151B CN 201711138180 A CN201711138180 A CN 201711138180A CN 109803151 B CN109803151 B CN 109803151B
Authority
CN
China
Prior art keywords
data stream
multimedia data
switching
acquiring
information
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
CN201711138180.XA
Other languages
Chinese (zh)
Other versions
CN109803151A (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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201711138180.XA priority Critical patent/CN109803151B/en
Publication of CN109803151A publication Critical patent/CN109803151A/en
Application granted granted Critical
Publication of CN109803151B publication Critical patent/CN109803151B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a multimedia data stream switching method, a multimedia data stream switching device, a storage medium and an electronic device. Wherein, the method comprises the following steps: acquiring switching indication information, wherein the switching indication information is used for indicating that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used for indicating attribute characteristics of the second multimedia data stream; acquiring a second multimedia data stream according to the target attribute information; and switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream. The invention solves the technical problem of low switching efficiency when switching the multimedia data stream in the prior art.

Description

Multimedia data stream switching method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of computers, and in particular, to a multimedia data stream switching method, device, storage medium, and electronic device.
Background
With the network popularization and the pursuit of people in the mental level, the live broadcast is already at the wind gap wave tip, the video source of the live broadcast can be various, including the collection of hardware equipment, local files, network flows and the like, wherein different video sources and resolutions can also be various. In real-time live broadcasting requiring interaction, the delay of audio and video caused by switching of resolution ratio directly affects the experience of users, and the influence is more serious under the condition of bidirectional interaction.
In the current live broadcast process, the resolution of the video stream is usually fixed at the beginning of live broadcast or push stream, and the resolution of the video stream is not changed until the end of live broadcast or push stream, if the resolution needs to be modified, the live broadcast or push stream needs to be ended, and after the resolution is reset, the live broadcast or push stream is restarted.
This results in the following disadvantages in the current live broadcast resolution switching scheme:
1) the anchor end/stream pushing party needs to restart the live broadcast/stream pushing, which directly causes the interruption of the video stream in the live broadcast or stream pushing process;
2) the spectator/streamers cannot predict the stream interruption and after the interruption, it cannot be determined whether the anchor/streamers are actually finished or the finishing process in restarting the resolution. The following problems may arise:
A) the anchor/plug is really over, and the viewer/plug is waiting for reconnection as an interrupt process, and user interaction may require long time for showing reconnection waiting until the timeout is over or no response, in addition to performance consumption.
B) The anchor/plug-flow party is a restart interrupt, and the viewer/plug-flow party is treated as a true end, so that no reconnection operation is performed, and manual operation is required to connect the flow again after the restart.
C) If the anchor terminal/stream pushing party is a restart interrupt, and the viewer terminal/stream receiving party is used as a restart interrupt process, a long-time reconnection process may be performed before reconnection is successful, and in addition to performance consumption, user interaction may require long-time display of reconnection waiting until reconnection succeeds in acquiring a new video stream or timeout ends.
Because of the shortcomings of the prior art, both the anchor/plug-flow side and the viewer/plug-flow side will bring poor user experience, and the manual negotiation and operation are not required in the whole switching process.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a multimedia data stream switching method, a multimedia data stream switching device, a storage medium and an electronic device, and at least solves the technical problem of low switching efficiency when switching multimedia data streams in the prior art.
According to an aspect of the embodiments of the present invention, there is provided a multimedia data stream switching method, including: acquiring switching indication information, wherein the switching indication information is used for indicating that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used for indicating attribute characteristics of the second multimedia data stream; acquiring the second multimedia data stream according to the target attribute information; switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream.
According to another aspect of the embodiments of the present invention, there is also provided a multimedia data stream switching apparatus, including: a first obtaining module, configured to obtain switching indication information, where the switching indication information is used to indicate that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, where the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used to indicate an attribute feature of the second multimedia data stream; a second obtaining module, configured to obtain the second multimedia data stream according to the target attribute information; a switching module, configured to switch the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream.
Optionally, the second obtaining module includes: the determining unit is used for determining a target multimedia data stream acquiring mode corresponding to the target attribute information, wherein the attribute information of the multimedia data stream and the acquiring mode of the multimedia data stream have a preset corresponding relation; and the first acquisition unit is used for acquiring the second multimedia data stream according to the multimedia data stream acquisition mode.
Optionally, in a case that the target attribute information includes a data type of the second multimedia data stream, the determining unit includes: a first determining subunit, configured to determine that the target multimedia data stream acquisition manner is a first acquisition manner when the data type of the second multimedia data stream is pre-stored file data; the second determining subunit is configured to determine that the target multimedia data stream acquisition manner is a second acquisition manner when the data type of the second multimedia data stream is data acquired by a hardware acquisition device; a third determining subunit, configured to determine that the target multimedia data stream acquisition manner is a third acquisition manner when the data type of the second multimedia data stream is network data.
Optionally, the first obtaining unit includes: a first obtaining subunit, configured to, when the target multimedia data stream obtaining manner is a first obtaining manner, obtain a storage path of a pre-stored file corresponding to the second multimedia data stream, and load the pre-stored file in a pre-allocated storage space according to the storage path to obtain the second multimedia data stream; the second acquiring subunit is configured to, in a case that the target multimedia data stream acquiring manner is a second acquiring manner, invoke and start a hardware device for acquiring the second multimedia data stream, and acquire and cache the second multimedia data stream through the hardware device; and the third acquiring subunit is configured to, when the target multimedia data stream acquiring manner is a third acquiring manner, establish a connection with a network corresponding to the second multimedia data stream, and acquire the second multimedia data stream from the network.
Optionally, the switching module includes: the first processing unit is used for stopping the transmission of the first multimedia data stream and acquiring a first time stamp corresponding to the first multimedia data stream end data; a timestamp offset unit, configured to perform timestamp offset on a second timestamp corresponding to start data of the second multimedia data stream according to the first timestamp, so that the first timestamp and the second timestamp are consecutive in time; the second processing unit is used for acquiring the configuration information of the second multimedia data stream from the second multimedia data stream and configuring the transmission channel of the currently output multimedia data stream according to the configuration information; and the transmission unit is used for transmitting the second multimedia data stream in the configured transmission channel of the currently output multimedia data stream.
Optionally, the first obtaining module includes: a second obtaining unit, configured to obtain a switching instruction, where the switching instruction is used to instruct to switch the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream; a third obtaining unit, configured to obtain the target attribute information of the second multimedia data stream according to the switching instruction, and generate the switching indication information.
Optionally, the second obtaining unit includes: the first display subunit is used for displaying a switching icon on a display interface of the client, wherein the switching icon is triggered to indicate that the currently output multimedia data stream needs to be switched from the first multimedia data stream to the second multimedia data stream; and the fourth acquiring subunit is configured to acquire first trigger information for the switching icon to obtain the switching instruction, where the first trigger information is used to indicate that the switching icon is triggered.
Optionally, the third obtaining unit includes: the second display subunit is used for responding to the first trigger information and displaying one or more attribute options on the display interface, wherein the one or more attribute options are used for indicating attribute characteristics of the multimedia data stream; a fifth obtaining subunit, configured to obtain second trigger information for an attribute option in the one or more attribute options, where the second trigger information is used to indicate a triggered attribute option in the one or more attribute options; a generating subunit, configured to generate the handover indication information according to the second trigger information, where the target attribute information carried in the handover indication information includes the triggered attribute option indicated by the second trigger information.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium including a stored program, wherein the program executes to perform the method described in any one of the above.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the method described in any one of the above through the computer program.
In the embodiment of the present invention, switching indication information is obtained, where the switching indication information is used to indicate that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used to indicate attribute characteristics of the second multimedia data stream; acquiring a second multimedia data stream according to the target attribute information; and switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream. That is, switching of the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream is instructed by the acquired switching instruction information, and target attribute information indicating an attribute characteristic of the second multimedia data stream is carried in the handover indication information, after the second multimedia data stream is acquired according to the target attribute information, the currently output multimedia data stream is switched from the first multimedia data stream to the second multimedia data stream, thereby ensuring that the currently output multimedia data stream is not interrupted in the multimedia data stream switching process, avoiding the delay phenomenon in the multimedia data stream switching process, improving the switching efficiency when switching the multimedia data stream, improving the user experience, and then overcome the problem that the switching efficiency is low when switching the multimedia data stream in the prior art.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a schematic application environment diagram of an alternative multimedia data stream switching method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an alternative multimedia data stream switching method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of target attribute information in an alternative multimedia data stream switching method according to an embodiment of the present invention;
fig. 3a is a schematic diagram of target attribute information in an alternative multimedia data stream switching method according to an embodiment of the present invention;
fig. 3b is a schematic diagram of target attribute information in an alternative multimedia data stream switching method according to an embodiment of the present invention;
fig. 3c is a schematic diagram of target attribute information in an alternative multimedia data stream switching method according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating attribute type selection in an alternative multimedia data stream switching method according to an embodiment of the present invention;
fig. 4a is a schematic diagram of attribute type selection in an alternative multimedia data stream switching method according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an alternative multimedia data stream switching method according to an alternative example of the present invention;
fig. 6 is a schematic diagram of an alternative multimedia data stream switching apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an application scenario of an alternative multimedia data stream switching method according to an embodiment of the present invention; and
FIG. 8 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In an embodiment of the present invention, an embodiment of the foregoing multimedia data stream switching method is provided. As an optional implementation, the multimedia data stream switching method may be but is not limited to be applied to an application environment as shown in fig. 1, where a client 104 is installed in a terminal 102, and the client 104 obtains switching indication information, where the switching indication information is used to indicate that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used to indicate an attribute feature of the second multimedia data stream; acquiring a second multimedia data stream according to the target attribute information; and switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream.
In this embodiment, the client 104 instructs, by the acquired switching instruction information, to switch the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream, and target attribute information indicating an attribute characteristic of the second multimedia data stream is carried in the handover indication information, after the second multimedia data stream is acquired according to the target attribute information, the currently output multimedia data stream is switched from the first multimedia data stream to the second multimedia data stream, thereby ensuring that the currently output multimedia data stream is not interrupted in the multimedia data stream switching process, avoiding the delay phenomenon in the multimedia data stream switching process, improving the switching efficiency when switching the multimedia data stream, improving the user experience, and then overcome the problem that the switching efficiency is low when switching the multimedia data stream in the prior art.
Optionally, in this embodiment, the terminal may include, but is not limited to, at least one of the following: mobile phones, tablet computers, notebook computers, desktop PCs, digital televisions and other hardware devices that perform multimedia data streaming.
According to an embodiment of the present invention, there is provided a multimedia data stream switching method, as shown in fig. 2, the method includes:
s202, acquiring switching indication information, wherein the switching indication information is used for indicating that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used for indicating attribute characteristics of the second multimedia data stream;
s204, acquiring a second multimedia data stream according to the target attribute information;
s206, switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream.
Optionally, in this embodiment, the multimedia data stream switching method may be, but is not limited to, applied in a scene where a multimedia data stream is switched. The client may be, but not limited to, various types of software, such as online education software, live broadcast software, instant messaging software, community space software, game software, video software, music software, radio station software, and the like. Specifically, the method can be applied to, but not limited to, a scene in which the live-broadcast software switches the multimedia data stream, or can also be applied to, but not limited to, a scene in which the video software switches the multimedia data stream, so as to achieve an effect of improving the switching efficiency when the multimedia data stream is switched. The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the multimedia data stream may include, but is not limited to: video data streams (e.g., programs or dramas on demand on a video website, content live on a live platform, etc.), audio data streams (e.g., music played, radio programs listened to, etc.), plain text data streams (e.g., web novels, web magazines, web newspapers, blogs, electronic books, etc.), hypertext data streams (e.g., hypertext markup language documents, etc.), picture data streams (e.g., slides, electronic albums, animated pictures, etc.).
Optionally, in this embodiment, the obtained switching indication information may be, but is not limited to, triggered by a user, and the user indicates switching of the multimedia data stream by clicking an icon on a terminal screen, for example: the anchor using live software can select a click icon on the screen during the live video to instruct the client to switch the multimedia data stream. Or the switching indication information may also be triggered by a server, and the server instructs the terminal to switch the multimedia data stream by sending the switching indication information to the terminal, for example: when a user watches videos on video software, when the current video is about to be played, the client can send a request for switching the videos to the server, and the server responds to the request to send switching indication information to the client so as to indicate the client to switch the currently played video to a next set.
Optionally, in this embodiment, the target attribute information of the second multimedia data stream may include, but is not limited to: a stream type of the second multimedia data stream, a resolution of the second multimedia data stream, an encoding type of the second multimedia data stream, and so on.
Optionally, in this embodiment, after the handover indication information is acquired, a new thread may be started, but is not limited to, to process an event related to the second multimedia data stream.
As can be seen, through the above steps, the obtained switching indication information indicates to switch the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream, and target attribute information indicating an attribute characteristic of the second multimedia data stream is carried in the handover indication information, after the second multimedia data stream is acquired according to the target attribute information, the currently output multimedia data stream is switched from the first multimedia data stream to the second multimedia data stream, thereby ensuring that the currently output multimedia data stream is not interrupted in the multimedia data stream switching process, avoiding the delay phenomenon in the multimedia data stream switching process, improving the switching efficiency when switching the multimedia data stream, improving the user experience, and then overcome the problem that the switching efficiency is low when switching the multimedia data stream in the prior art.
As an optional scheme, the obtaining the second multimedia data stream according to the target attribute information includes:
s1, determining a target multimedia data stream acquisition mode corresponding to the target attribute information, wherein the attribute information of the multimedia data stream and the multimedia data stream acquisition mode have a preset corresponding relationship;
and S2, acquiring the second multimedia data stream according to the multimedia data stream acquisition mode.
Optionally, in this embodiment, the attribute information of the multimedia data stream has a preset corresponding relationship with an obtaining manner of the multimedia data stream, and different obtaining manners may be adopted for second multimedia data streams of different types or different resolutions.
Optionally, in this embodiment, the target attribute information may include, but is not limited to, a data type of the second multimedia data stream, and then the second multimedia data of different data types may correspond to different obtaining manners. For example: determining the target multimedia data stream acquisition mode as a first acquisition mode under the condition that the data type of the second multimedia data stream is pre-stored file data; determining that the target multimedia data stream acquisition mode is a second acquisition mode under the condition that the data type of the second multimedia data stream is data acquired by hardware acquisition equipment; and under the condition that the data type of the second multimedia data stream is network data, determining that the target multimedia data stream acquisition mode is a third acquisition mode.
Optionally, in this embodiment, the second multimedia data stream may be divided into, but not limited to: the system comprises pre-stored file data (such as video files or songs stored on a terminal where a client of the anchor is located, video files or audio files downloaded from a website, and the like), data collected by hardware collection equipment (such as data collected by a camera, a microphone, a recording pen, and the like), network data (such as data transmitted by other live broadcast rooms of the anchor, data obtained in real time from the network, and the like), and the like.
Optionally, in this embodiment, when the target multimedia data stream acquiring manner is the first acquiring manner, a storage path of a pre-stored file corresponding to the second multimedia data stream may be acquired, and the pre-stored file is loaded in a pre-allocated storage space according to the storage path, so as to obtain the second multimedia data stream; under the condition that the target multimedia data stream acquisition mode is the second acquisition mode, calling and starting hardware equipment for acquiring the second multimedia data stream, and acquiring and caching the second multimedia data stream through the hardware equipment; and under the condition that the target multimedia data stream acquisition mode is the third acquisition mode, establishing connection with a network corresponding to the second multimedia data stream, and acquiring the second multimedia data stream from the network.
In an optional embodiment, as shown in fig. 3, for example, a certain anchor creates a live broadcast room in live broadcast software for live broadcast, during the live broadcast of the anchor, a client may be instructed to switch multimedia video streams, and the client displays a selectable type of a second multimedia video stream (including a local file, a device acquisition, and a network connection) on an interface. As shown in fig. 3a, if the anchor selects a local file option (the dashed line in fig. 3a indicates that the icon is selected), the client may display an input box and an option for selecting a file path, the anchor inputs the file path in the input box or selects the file path through the option, and the client locally obtains a file under the file path from the terminal device where the client is located according to the received file path and loads the file. As shown in fig. 3b, if the anchor selects device acquisition (the dashed line in fig. 3b indicates that the icon is selected), the client may display an input box and an option for selecting acquisition devices, and call and start the acquisition devices selected by the anchor, where the acquisition devices may be, but are not limited to, a camera, a microphone, etc. of the terminal where the client is located, or may be, but are not limited to, external devices (such as a video camera, a digital camera, a computer, etc.) connected to the terminal where the client is located, and the acquisition devices in fig. 3b are exemplified by a video camera. As shown in fig. 3c, if the anchor selects the option of network connection (the dashed box in fig. 3c indicates that the icon is selected), the client may display the input box and the option of the network address, and establish a connection with the server corresponding to the network address input or selected by the anchor to obtain the second multimedia data stream transmitted by the network.
Through the steps, the second multimedia data streams with different target attribute information correspond to different acquisition modes, and the acquisition modes corresponding to the second multimedia data streams are acquired by determining the target attribute information of the second multimedia data streams, so that the second multimedia data streams are acquired according to the acquisition modes, the switching of the multimedia data streams is applied to various different multimedia data streams, the switching efficiency during the switching of the multimedia data streams is improved, and the user experience is improved.
As an alternative, switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream includes:
s1, stopping the transmission of the first multimedia data stream and obtaining a first time stamp corresponding to the first multimedia data stream end data;
s2, time-stamp shifting a second time stamp corresponding to the start data of the second multimedia data stream according to the first time stamp, so that the first time stamp and the second time stamp are consecutive in time;
s3, obtaining the configuration information of the second multimedia data flow, and configuring the transmission channel of the current output multimedia data flow according to the configuration information;
s4, transmitting the second multimedia data stream on the configured transmission channel of the currently output multimedia data stream.
Optionally, in this embodiment, the second processing unit may be, but is not limited to, configured to obtain the configuration information of the second multimedia data stream by one of the following ways:
in the first mode, the configuration information of the second multimedia data stream is obtained from the second multimedia data stream.
Optionally, in this embodiment, the manner of obtaining the configuration information of the second multimedia data stream from the second multimedia data stream may be, but is not limited to: and acquiring a video configuration frame of the second multimedia data stream and/or an audio configuration frame of the second multimedia data stream from the second multimedia data stream, and extracting configuration information of the second multimedia data stream from the video configuration frame and/or the audio configuration frame.
In an optional embodiment, taking the second multimedia data stream as an example of a video data stream, the configuration information of the second multimedia data stream obtained from the second multimedia data stream may include an audio configuration frame and a video configuration frame of the video data stream.
And secondly, acquiring configuration information of the second multimedia data stream from the target attribute information.
In an alternative embodiment, the configuration information of the second multimedia data stream obtained from the target attribute information may be, but is not limited to, configuration information input or selected by a user when triggering the switching indication information.
Optionally, in this embodiment, a timestamp of a last multimedia data packet of the first multimedia data stream may be used as the first timestamp.
Optionally, in this embodiment, the second timestamp corresponding to the start data of the second multimedia data stream is time-stamp-shifted according to the first timestamp at the end of the first multimedia data stream, so that the first timestamp and the second timestamp are consecutive in time, which ensures that the user does not feel a click-through feeling when viewing.
In an alternative embodiment, taking a live video as an example, the first multimedia data stream is played for 48 minutes and 4 seconds 52, that is, the first multimedia data stream is played from 0s to 48 minutes and 4 seconds 52, then the first timestamp may be obtained as 48 minutes and 4 seconds 52, the second timestamp corresponding to the start data of the second multimedia data stream is time-stamp-shifted according to the first timestamp, and the second timestamp corresponding to the start data of the second multimedia data stream is shifted to 48 minutes and 4 seconds 52, that is, when the second multimedia data stream starts to be played, the second multimedia data stream is not played from 0s, but is played from 48 minutes and 4 seconds 52.
Optionally, in this embodiment, the configuration information may include, but is not limited to, a video resolution of the multimedia data stream, and the video resolution of the transmission channel is configured as the video resolution carried in the configuration information, so that the transmission channel can meet a requirement for transmitting the second multimedia data stream. For example: the target video resolution carried in the configuration information may be obtained, where the target video resolution is a video resolution of the second multimedia data stream, and the video resolution of the transmission channel is configured as the target video resolution.
As can be seen, in this embodiment, switching between multimedia data streams with different configuration information is achieved by configuring the transmission channel. Furthermore, the transmission channel is configured by using the video resolution of the second multimedia data stream, and switching between multimedia data streams with different resolutions is realized, so that switching between the multimedia data streams with different video resolutions can be realized when the multimedia data streams are switched under the condition that the transmission data streams are not interrupted, and the switching efficiency of switching the multimedia data streams is improved.
As an optional scheme, the obtaining of the handover indication information includes:
s1, acquiring a switching instruction, wherein the switching instruction is used for instructing to switch the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream;
and S2, acquiring the target attribute information of the second multimedia data stream according to the switching instruction, and generating switching instruction information.
Optionally, in this embodiment, for a second multimedia data stream with a different data type, the second multimedia data stream may carry different information, such as: some video data streams with different coding types may have audio configuration frames and video configuration frames per se, and some video data streams may not have audio configuration frames and video configuration frames per se, the data stream transmitted by the hardware acquisition device may not carry audio configuration frames and video configuration frames, and the network stream may carry audio configuration frames and video configuration frames. In order to obtain the configuration information used for configuring the transmission channel, different target attribute information may be obtained according to different data types of the second multimedia data stream when obtaining the target attribute information, so as to obtain the configuration information of the second multimedia data stream from the target attribute information.
For example: the target attribute information of the second multimedia data stream may be obtained, but is not limited to, by: acquiring the data type of the second multimedia data stream; under the condition that the data type of the second multimedia data stream is pre-stored file data, acquiring the coding type of the second multimedia data stream; under the condition that the coding type of the second multimedia data stream is the first coding type, acquiring the video resolution of the second multimedia data stream, and taking the data type of the second multimedia data stream, the coding type of the second multimedia data stream and the video resolution of the second multimedia data stream as target attribute information; determining the data type of the second multimedia data stream as target attribute information under the condition that the encoding mode of the second multimedia data stream is the second encoding mode; under the condition that the data type of the second multimedia data stream is the data acquired by the hardware acquisition equipment, acquiring the video resolution of the second multimedia data stream, and determining the data type of the second multimedia data stream and the video resolution of the second multimedia data stream as target attribute information; and determining the data type of the second multimedia data stream as the target attribute information under the condition that the data type of the second multimedia data stream is network data.
Optionally, in this embodiment, the switching instruction may be displayed on a display interface of the client in the form of an icon, whether the icon is triggered is detected by detecting an operation of clicking the icon by a user, and the switching instruction is obtained when the operation of clicking the icon by the user is detected. For example: the switching icon can be displayed on a display interface of the client, wherein the switching icon is triggered to indicate that the currently output multimedia data stream needs to be switched from the first multimedia data stream to the second multimedia data stream, first trigger information for the switching icon is acquired, and a switching instruction is obtained, wherein the first trigger information is used for indicating that the switching icon is triggered.
Optionally, in this embodiment, the user may further configure target attribute information of the second multimedia data stream, and the client may display one or more attribute options on the display interface for the user to select. For example: and responding to the first trigger information to display one or more attribute options on a display interface, wherein the one or more attribute options are used for indicating attribute characteristics of the multimedia data stream, acquiring second trigger information of the attribute options in the one or more attribute options, wherein the second trigger information is used for indicating the triggered attribute options in the one or more attribute options, and generating switching indication information according to the second trigger information, wherein the target attribute information carried in the switching indication information comprises the triggered attribute options indicated by the second trigger information.
In an optional implementation manner, taking live video as an example, as shown in fig. 4, a switching icon "shot switching" may be displayed on an interface of a client, and a click of a user on a position of the icon is detected to obtain first trigger information of the icon, so as to obtain a switching instruction. As shown in fig. 4a, according to the switching instruction, the property options are displayed on the display interface, and the property options may be, but are not limited to, displayed in a hierarchical manner, such as: the configurable property options are first displayed: data type, video resolution, video coding type, and options for displaying specific configuration information under each configurable attribute option according to user selection, for example: if the user selects the option of the data type, specific data types (local files, equipment acquisition, network connection and the like) can be displayed in a pull-down menu of the data types for the user to select, if the user selects the option of the video resolution, specific video resolutions (1080 p, 720p, 480p, 270 p) can be displayed in the pull-down menu of the video resolution for the user to select, and if the user selects the option of the video coding type, specific video coding types (MP 4, RMVB, AVC, MKV) can be displayed in the pull-down menu of the video coding types for the user to select.
Optionally, in this embodiment, the target attribute information may be obtained by detecting, by the client, the second multimedia data stream selected by the user.
In an alternative example, a method for switching multimedia data streams is provided, and a multimedia data stream switching process is described with reference to fig. 5. In this optional example, taking an example of audio/video switching in live video, at a main broadcasting end/a stream pushing side, there may be multiple pieces of audio/video streams in a preview state, when the audio/video streams need to be switched, a signal can be given to the to-be-switched stream to prepare for switching the upstream audio/video data, and the to-be-prepared data is in place to perform audio/video stream switching operation. As shown in fig. 5, the user APP interface interactive operation, the switched audio/video stream (equivalent to the first multimedia data stream), and the to-be-switched audio/video stream (equivalent to the second multimedia data stream) are all processed by independent threads, and the timing relationship between the threads in the stream switching process is as follows:
the user performs stream switching operation as required, the user APP thread informs the thread B to be switched of the audio and video stream of the thread B, and at the moment, the uplink data is still the audio and video data of the switched stream A;
preparing uplink data by the thread to be switched, preparing downlink connection if the media source is a network stream, loading a local file if the media source is a local VCR, initializing and starting equipment if the media source is a hardware acquisition device, and the like. Informing a cut flow thread A after the data is ready;
terminating the media source data of the cut stream thread A and releasing the cut stream thread resource;
and starting the data of the to-be-switched stream thread B, and at the moment, switching the uplink to the audio and video data of the to-be-switched stream thread B.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
According to an embodiment of the present invention, there is also provided a multimedia data stream switching apparatus for implementing the multimedia data stream switching method, as shown in fig. 6, the apparatus includes:
1) a first obtaining module 62, configured to obtain switching indication information, where the switching indication information is used to indicate that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, and the switching indication information carries target attribute information of the second multimedia data stream, where the target attribute information is used to indicate attribute characteristics of the second multimedia data stream;
2) a second obtaining module 64, configured to obtain a second multimedia data stream according to the target attribute information;
3) a switching module 66, configured to switch the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream.
Optionally, in this embodiment, the multimedia data stream switching apparatus may be applied, but not limited to, in a scenario of switching multimedia data streams. The client may be, but not limited to, various types of software, such as online education software, live broadcast software, instant messaging software, community space software, game software, video software, music software, radio station software, and the like. Specifically, the method can be applied to, but not limited to, a scene in which the live-broadcast software switches the multimedia data stream, or can also be applied to, but not limited to, a scene in which the video software switches the multimedia data stream, so as to achieve an effect of improving the switching efficiency when the multimedia data stream is switched. The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the multimedia data stream may include, but is not limited to: video data streams (e.g., programs or dramas on demand on a video website, content live on a live platform, etc.), audio data streams (e.g., music played, radio programs listened to, etc.), plain text data streams (e.g., web novels, web magazines, web newspapers, blogs, electronic books, etc.), hypertext data streams (e.g., hypertext markup language documents, etc.), picture data streams (e.g., slides, electronic albums, animated pictures, etc.).
Optionally, in this embodiment, the obtained switching indication information may be, but is not limited to, triggered by a user, and the user indicates switching of the multimedia data stream by clicking an icon on a terminal screen, for example: the anchor using live software can select a click icon on the screen during the live video to instruct the client to switch the multimedia data stream. Or the switching indication information may also be triggered by a server, and the server instructs the terminal to switch the multimedia data stream by sending the switching indication information to the terminal, for example: when a user watches videos on video software, when the current video is about to be played, the client can send a request for switching the videos to the server, and the server responds to the request to send switching indication information to the client so as to indicate the client to switch the currently played video to a next set.
Optionally, in this embodiment, the target attribute information of the second multimedia data stream may include, but is not limited to: a stream type of the second multimedia data stream, a resolution of the second multimedia data stream, an encoding type of the second multimedia data stream, and so on.
Optionally, in this embodiment, after the handover indication information is acquired, a new thread may be started, but is not limited to, to process an event related to the second multimedia data stream.
As can be seen, by the above device, the switching of the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream is instructed by the acquired switching instruction information, and target attribute information indicating an attribute characteristic of the second multimedia data stream is carried in the handover indication information, after the second multimedia data stream is acquired according to the target attribute information, the currently output multimedia data stream is switched from the first multimedia data stream to the second multimedia data stream, thereby ensuring that the currently output multimedia data stream is not interrupted in the multimedia data stream switching process, avoiding the delay phenomenon in the multimedia data stream switching process, improving the switching efficiency when switching the multimedia data stream, improving the user experience, and then overcome the problem that the switching efficiency is low when switching the multimedia data stream in the prior art.
As an optional scheme, the second obtaining module includes:
1) the determining unit is used for determining a target multimedia data stream acquiring mode corresponding to the target attribute information, wherein the attribute information of the multimedia data stream and the acquiring mode of the multimedia data stream have a preset corresponding relation;
2) and the first acquisition unit is used for acquiring the second multimedia data stream according to the multimedia data stream acquisition mode.
Optionally, in this embodiment, the attribute information of the multimedia data stream has a preset corresponding relationship with an obtaining manner of the multimedia data stream, and different obtaining manners may be adopted for second multimedia data streams of different types or different resolutions.
Optionally, in this embodiment, the target attribute information may include, but is not limited to, a data type of the second multimedia data stream, and then the second multimedia data of different data types may correspond to different obtaining manners.
Optionally, in this embodiment, in a case that the target attribute information includes a data type of the second multimedia data stream, the determining unit includes: the first determining subunit is used for determining that the target multimedia data stream acquisition mode is the first acquisition mode under the condition that the data type of the second multimedia data stream is pre-stored file data; the second determining subunit is configured to determine that the target multimedia data stream acquisition mode is the second acquisition mode when the data type of the second multimedia data stream is data acquired by the hardware acquisition device; and the third determining subunit is configured to determine that the target multimedia data stream acquisition manner is the third acquisition manner when the data type of the second multimedia data stream is network data.
Optionally, in this embodiment, the second multimedia data stream may be divided into, but not limited to: the system comprises pre-stored file data (such as video files or songs stored on a terminal where a client of the anchor is located, video files or audio files downloaded from a website, and the like), data collected by hardware collection equipment (such as data collected by a camera, a microphone, a recording pen, and the like), network data (such as data transmitted by other live broadcast rooms of the anchor, data obtained in real time from the network, and the like), and the like.
Optionally, in this embodiment, the first obtaining unit includes: the first acquiring subunit is configured to, when the target multimedia data stream acquiring manner is the first acquiring manner, acquire a storage path of a pre-stored file corresponding to the second multimedia data stream, and load the pre-stored file in a pre-allocated storage space according to the storage path to obtain the second multimedia data stream; the second acquiring subunit is used for calling and starting the hardware equipment for acquiring the second multimedia data stream under the condition that the target multimedia data stream acquiring mode is the second acquiring mode, and acquiring and caching the second multimedia data stream through the hardware equipment; and the third acquiring subunit is configured to, in a case that the target multimedia data stream acquiring manner is the third acquiring manner, establish connection with a network corresponding to the second multimedia data stream, and acquire the second multimedia data stream from the network.
In an optional embodiment, as shown in fig. 3, for example, a certain anchor creates a live broadcast room in live broadcast software for live broadcast, during the live broadcast of the anchor, a client may be instructed to switch multimedia video streams, and the client displays a selectable type of a second multimedia video stream (including a local file, a device acquisition, and a network connection) on an interface. As shown in fig. 3a, if the anchor selects a local file option, the client may display an input box and an option for selecting a file path, where the anchor inputs the file path in the input box or selects the file path through the option, and the client locally obtains a file in the file path from the terminal device where the client is located according to the received file path and loads the file. As shown in fig. 3b, if the anchor selects device acquisition, the client may display an input box and an option for selecting the acquisition device, and invoke and start the acquisition device selected by the anchor, where the acquisition device may be, but is not limited to, a camera, a microphone, and the like of the terminal where the client is located, or may be, but is not limited to, an external device (such as a video camera, a digital camera, a computer, and the like) connected to the terminal where the client is located, and in fig. 3b, the acquisition device is exemplified by a video camera. As shown in fig. 3c, if the anchor selects the option of network connection, the client may display an input box and options of a network address, and establish a connection with a server corresponding to the network address input or selected by the anchor to obtain a second multimedia data stream transmitted by the network.
By the device, the second multimedia data streams with different target attribute information correspond to different acquisition modes, and the acquisition modes corresponding to the second multimedia data streams are acquired by determining the target attribute information of the second multimedia data streams, so that the second multimedia data streams are acquired according to the acquisition modes, the switching of the multimedia data streams is applied to various different multimedia data streams, the switching efficiency during the switching of the multimedia data streams is improved, and the experience degree of a user is improved.
As an optional solution, the switching module includes:
1) the first processing unit is used for stopping the transmission of the first multimedia data stream and acquiring a first time stamp corresponding to the first multimedia data stream end data;
2) a timestamp offset unit, configured to perform timestamp offset on a second timestamp corresponding to start data of a second multimedia data stream according to the first timestamp, so that the first timestamp and the second timestamp are consecutive in time;
3) the second processing unit is used for acquiring configuration information of a second multimedia data stream and configuring a transmission channel of the currently output multimedia data stream according to the configuration information;
4) and the transmission unit is used for transmitting the second multimedia data stream in the configured transmission channel of the currently output multimedia data stream.
Optionally, in this embodiment, the configuration information of the second multimedia data stream may be obtained, but is not limited to, by one of the following manners:
in the first mode, the configuration information of the second multimedia data stream is obtained from the second multimedia data stream.
Optionally, in this embodiment, the manner of obtaining the configuration information of the second multimedia data stream from the second multimedia data stream may be, but is not limited to: and acquiring a video configuration frame of the second multimedia data stream and/or an audio configuration frame of the second multimedia data stream from the second multimedia data stream, and extracting configuration information of the second multimedia data stream from the video configuration frame and/or the audio configuration frame.
In an optional embodiment, taking the second multimedia data stream as an example of a video data stream, the configuration information of the second multimedia data stream obtained from the second multimedia data stream may include an audio configuration frame and a video configuration frame of the video data stream.
And secondly, acquiring configuration information of the second multimedia data stream from the target attribute information.
In an alternative embodiment, the configuration information of the second multimedia data stream obtained from the target attribute information may be, but is not limited to, configuration information input or selected by a user when triggering the switching indication information.
Optionally, in this embodiment, a timestamp of a last multimedia data packet of the first multimedia data stream may be used as the first timestamp.
Optionally, in this embodiment, the second timestamp corresponding to the start data of the second multimedia data stream is time-stamp-shifted according to the first timestamp at the end of the first multimedia data stream, so that the first timestamp and the second timestamp are consecutive in time, which ensures that the user does not feel a click-through feeling when viewing.
In an alternative embodiment, taking a live video as an example, the first multimedia data stream is played for 48 minutes and 4 seconds 52, that is, the first multimedia data stream is played from 0s to 48 minutes and 4 seconds 52, then the first timestamp may be obtained as 48 minutes and 4 seconds 52, the second timestamp corresponding to the start data of the second multimedia data stream is time-stamp-shifted according to the first timestamp, and the second timestamp corresponding to the start data of the second multimedia data stream is shifted to 48 minutes and 4 seconds 52, that is, when the second multimedia data stream starts to be played, the second multimedia data stream is not played from 0s, but is played from 48 minutes and 4 seconds 52.
Optionally, in this embodiment, the configuration information may include, but is not limited to, a video resolution of the multimedia data stream, and the video resolution of the transmission channel is configured as the video resolution carried in the configuration information, so that the transmission channel can meet a requirement for transmitting the second multimedia data stream. For example: the second processing unit may be configured to obtain a target video resolution carried in the configuration information, where the target video resolution is a video resolution of the second multimedia data stream, and configure the video resolution of the transmission channel as the target video resolution.
As can be seen, in this embodiment, switching between multimedia data streams with different configuration information is achieved by configuring the transmission channel. Furthermore, the transmission channel is configured by using the video resolution of the second multimedia data stream, and switching between multimedia data streams with different resolutions is realized, so that switching between the multimedia data streams with different video resolutions can be realized when the multimedia data streams are switched under the condition that the transmission data streams are not interrupted, and the switching efficiency of switching the multimedia data streams is improved.
As an optional solution, the first obtaining module includes:
1) the second acquisition unit is used for acquiring a switching instruction, wherein the switching instruction is used for indicating that the currently output multimedia data stream is switched from the first multimedia data stream to the second multimedia data stream;
2) and the third acquisition unit is used for acquiring the target attribute information of the second multimedia data stream according to the switching instruction and generating switching indication information.
Optionally, in this embodiment, for a second multimedia data stream with a different data type, the second multimedia data stream may carry different information, such as: some video data streams with different coding types may have audio configuration frames and video configuration frames per se, and some video data streams may not have audio configuration frames and video configuration frames per se, the data stream transmitted by the hardware acquisition device may not carry audio configuration frames and video configuration frames, and the network stream may carry audio configuration frames and video configuration frames. In order to obtain the configuration information used for configuring the transmission channel, different target attribute information may be obtained according to different data types of the second multimedia data stream when obtaining the target attribute information, so as to obtain the configuration information of the second multimedia data stream from the target attribute information.
For example: the third obtaining unit may be, but is not limited to, for obtaining the target attribute information of the second multimedia data stream by: acquiring the data type of the second multimedia data stream; under the condition that the data type of the second multimedia data stream is pre-stored file data, acquiring the coding type of the second multimedia data stream; under the condition that the coding type of the second multimedia data stream is the first coding type, acquiring the video resolution of the second multimedia data stream, and taking the data type of the second multimedia data stream, the coding type of the second multimedia data stream and the video resolution of the second multimedia data stream as target attribute information; determining the data type of the second multimedia data stream as target attribute information under the condition that the encoding mode of the second multimedia data stream is the second encoding mode; under the condition that the data type of the second multimedia data stream is the data acquired by the hardware acquisition equipment, acquiring the video resolution of the second multimedia data stream, and determining the data type of the second multimedia data stream and the video resolution of the second multimedia data stream as target attribute information; and determining the data type of the second multimedia data stream as the target attribute information under the condition that the data type of the second multimedia data stream is network data.
Optionally, in this embodiment, the second obtaining unit includes: the first display subunit is used for displaying a switching icon on a display interface of the client, wherein the switching icon is triggered to indicate that the currently output multimedia data stream needs to be switched from the first multimedia data stream to the second multimedia data stream; and the fourth acquiring subunit is configured to acquire first trigger information for the switching icon to obtain a switching instruction, where the first trigger information is used to indicate that the switching icon is triggered.
Optionally, in this embodiment, the switching instruction may be displayed on a display interface of the client in the form of an icon, whether the icon is triggered is detected by detecting an operation of clicking the icon by a user, and the switching instruction is obtained when the operation of clicking the icon by the user is detected.
Optionally, in this embodiment, the third obtaining unit includes: the second display subunit is used for responding to the first trigger information and displaying one or more attribute options on the display interface, wherein the one or more attribute options are used for indicating attribute characteristics of the multimedia data stream; the fifth acquiring subunit is configured to acquire second trigger information for an attribute option in the one or more attribute options, where the second trigger information is used to indicate a triggered attribute option in the one or more attribute options; a generating subunit, configured to generate switching indication information according to the second trigger information, where the target attribute information carried in the switching indication information includes a triggered attribute option indicated by the second trigger information, and the third obtaining unit includes: the second display subunit is used for responding to the first trigger information and displaying one or more attribute options on the display interface, wherein the one or more attribute options are used for indicating attribute characteristics of the multimedia data stream; the fifth acquiring subunit is configured to acquire second trigger information for an attribute option in the one or more attribute options, where the second trigger information is used to indicate a triggered attribute option in the one or more attribute options; and the generating subunit is configured to generate switching indication information according to the second trigger information, where the target attribute information carried in the switching indication information includes the triggered attribute option indicated by the second trigger information.
Optionally, in this embodiment, the user may further configure target attribute information of the second multimedia data stream, and the client may display one or more attribute options on the display interface for the user to select.
In an optional implementation manner, taking live video as an example, as shown in fig. 4, a switching icon "shot switching" may be displayed on an interface of a client, and a click of a user on a position of the icon is detected to obtain first trigger information of the icon, so as to obtain a switching instruction. According to the switching instruction, displaying attribute options on the display interface, wherein the attribute options can be displayed in a hierarchical mode, such as: the configurable property options are first displayed: data type, video resolution, video coding type, and options for displaying specific configuration information under each configurable attribute option according to user selection, for example: if the user selects the option of the data type, specific data types (local files, equipment acquisition, network connection and the like) can be displayed in a pull-down menu of the data types for the user to select, if the user selects the option of the video resolution, specific video resolutions (1080 p, 720p, 480p, 270 p) can be displayed in the pull-down menu of the video resolution for the user to select, and if the user selects the option of the video coding type, specific video coding types (MP 4, RMVB, AVC, MKV) can be displayed in the pull-down menu of the video coding types for the user to select.
Optionally, in this embodiment, the target attribute information may be obtained by detecting, by the client, the second multimedia data stream selected by the user.
The application environment of the embodiment of the present invention may refer to the application environment in embodiment 1, but is not described herein again. The embodiment of the invention provides an optional specific application example for implementing the multimedia data stream switching method.
As an alternative embodiment, the multimedia data stream switching method can be applied, but not limited to, in the scenario of switching multimedia data streams as shown in fig. 7. Taking multimedia data stream switching in live video as an example, stream switching can be active operation of a user, according to the requirement of a live broadcast activity site, there can be switching of a camera position, switching of a multi-live broadcast platform anchor, a local VCR gasket, real-time RTMP stream, direct cascade of a soft director and the like, there can be random switching, switching between different media sources, switching of resolution, and the specific switching flow is as follows:
receiving parameters of a to-be-cut stream (corresponding to the second multimedia data stream) configured by a user, wherein the parameters comprise a media stream type, a video resolution, a video coding type and the like; starting a new thread for processing all related matters of the to-be-switched stream; determining the type of the stream media of the stream to be cut: A) if the media stream is a local file, loading file data according to the file path; B) if the media stream is hardware acquisition equipment (such as a camera), calling equipment drive, initializing the equipment and starting the equipment; C) if the media stream is a network stream, newly building a network channel, building a connection, and pulling network stream data; waiting for successfully acquiring an audio and video data packet of the to-be-switched stream, storing an audio configuration frame and a video configuration frame of the to-be-switched stream, and informing a main thread that the to-be-switched stream is ready; applying for the stream uplink resource according to the acquired frame data packet to be cut-off configuration; informing the cut stream (corresponding to the first multimedia data stream) that the upstream data to be cut is ready; ending the transmission of the cut stream uplink data, recording a video time stamp (which is equivalent to the first time stamp) according to the last video data packet, and performing time stamp offset on the cut stream uplink data according to the calculated time stamp; resetting uplink coding configuration according to the information of the audio configuration frame and the video configuration frame to be cut-off, and starting to transmit uplink data to be cut-off in the same uplink network channel; releasing the uplink resource applied to the flow by the cut flow; and ending the cut flow thread.
Through the switching process of the multimedia data stream, in the live broadcasting stream switching process, because the switched stream and the stream to be switched are different (mainly embodied in the aspects of audio and video source types, video picture resolution and the like), double configuration frame resource cache is used, the audio and video data of the stream to be switched are ensured to be obtained in time under the condition that the switched stream which is going up is not influenced, and delay-free and pause-free switching is realized. After each audio and video stream is switched, the audio and video source data of the anchor terminal/the stream pushing party is switched from one thread to the other thread, and the stream pushing network channel is not changed all the time, so that the high-efficiency experience without perception and delay at the audience terminal/the stream receiving party is realized.
The switching scheme of the multimedia data stream can automatically switch audio and video streams according to the live broadcast requirements of a main broadcast end/a stream pushing party in live broadcast activities, and can switch variable resolution in live broadcast according to the activity requirements; according to the activity requirement, switching among multi-scene, multi-site and multi-audio video streams can be carried out in the live broadcast; the method realizes non-delay switching, improves the user experience of the audience terminal/the stream receiving party, and can realize real-time interaction on the basis.
According to an embodiment of the present invention, there is also provided an electronic device for implementing the method for switching multimedia data streams, as shown in fig. 8, the apparatus includes:
1) a communication interface 802 configured to acquire switching indication information, where the switching indication information is used to indicate that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used to indicate attribute characteristics of the second multimedia data stream;
2) a processor 804, connected to the communication interface 802, configured to obtain a second multimedia data stream according to the target attribute information; and switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream.
3) The memory 806, coupled to the communication interface 802 and the processor 804, is configured to store the second multimedia data stream.
Optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not described herein again.
The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be located in at least one of a plurality of network devices in a network.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
s1, acquiring switching indication information, wherein the switching indication information is used for indicating switching of a currently output multimedia data stream from a first multimedia data stream to a second multimedia data stream, the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used for indicating attribute characteristics of the second multimedia data stream;
s2, acquiring a second multimedia data stream according to the target attribute information;
s3, switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (14)

1. A method for switching multimedia data streams, comprising:
acquiring switching indication information, wherein the switching indication information is used for indicating that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used for indicating attribute characteristics of the second multimedia data stream;
acquiring the second multimedia data stream according to the target attribute information;
switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream if the second multimedia data stream is ready;
acquiring the second multimedia data stream according to the target attribute information comprises: determining a target multimedia data stream acquisition mode corresponding to the target attribute information, wherein the attribute information of the multimedia data stream and the acquisition mode of the multimedia data stream have a preset corresponding relationship; acquiring the second multimedia data stream according to the multimedia data stream acquisition mode;
and after the switching indication information is acquired, starting a new thread to process the relevant event of the second multimedia data stream.
2. The method of claim 1, wherein when the target attribute information includes the data type of the second multimedia data stream, determining the target multimedia data stream acquisition manner corresponding to the target attribute information comprises:
determining that the target multimedia data stream acquisition mode is a first acquisition mode under the condition that the data type of the second multimedia data stream is pre-stored file data;
determining that the target multimedia data stream acquisition mode is a second acquisition mode under the condition that the data type of the second multimedia data stream is data acquired by hardware acquisition equipment;
and determining that the target multimedia data stream acquisition mode is a third acquisition mode under the condition that the data type of the second multimedia data stream is network data.
3. The method of claim 2, wherein obtaining the second multimedia data stream according to the multimedia data stream obtaining manner comprises:
under the condition that the target multimedia data stream acquisition mode is a first acquisition mode, acquiring a storage path of a pre-stored file corresponding to the second multimedia data stream, and loading the pre-stored file in a pre-allocated storage space according to the storage path to obtain the second multimedia data stream;
under the condition that the target multimedia data stream acquisition mode is a second acquisition mode, calling and starting hardware equipment for acquiring the second multimedia data stream, and acquiring and caching the second multimedia data stream through the hardware equipment;
and under the condition that the target multimedia data stream acquisition mode is a third acquisition mode, establishing connection with a network corresponding to the second multimedia data stream, and acquiring the second multimedia data stream from the network.
4. The method of claim 1, wherein switching the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream comprises:
stopping transmission of the first multimedia data stream, and acquiring a first time stamp corresponding to the first multimedia data stream end data;
time-stamp shifting a second time stamp corresponding to the start data of the second multimedia data stream according to the first time stamp, so that the first time stamp and the second time stamp are continuous in time;
acquiring configuration information of the second multimedia data stream, and configuring a transmission channel of the currently output multimedia data stream according to the configuration information;
and transmitting the second multimedia data stream on the configured transmission channel of the currently output multimedia data stream.
5. The method of claim 4, wherein obtaining configuration information for the second multimedia data stream comprises:
acquiring configuration information of the second multimedia data stream from the second multimedia data stream; alternatively, the first and second electrodes may be,
and acquiring the configuration information of the second multimedia data stream from the target attribute information.
6. The method of claim 5, wherein obtaining configuration information for the second multimedia data stream from the second multimedia data stream comprises:
acquiring a video configuration frame of the second multimedia data stream and/or an audio configuration frame of the second multimedia data stream from the second multimedia data stream;
extracting configuration information of the second multimedia data stream from the video configuration frame and/or the audio configuration frame.
7. The method of claim 4, wherein configuring the transmission channel of the currently output multimedia data stream according to the configuration information comprises:
acquiring a target video resolution carried in the configuration information, wherein the target video resolution is the video resolution of the second multimedia data stream;
configuring the video resolution of the transmission channel to the target video resolution.
8. The method according to any one of claims 1 to 7, wherein obtaining the handover indication information comprises:
acquiring a switching instruction, wherein the switching instruction is used for instructing to switch the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream;
and acquiring the target attribute information of the second multimedia data stream according to the switching instruction, and generating the switching indication information.
9. The method of claim 8, wherein obtaining the target attribute information of the second multimedia data stream according to the handover instruction comprises:
acquiring the data type of the second multimedia data stream;
under the condition that the data type of the second multimedia data stream is pre-stored file data, acquiring the coding type of the second multimedia data stream; under the condition that the encoding type of the second multimedia data stream is a first encoding type, acquiring the video resolution of the second multimedia data stream, and taking the data type of the second multimedia data stream, the encoding type of the second multimedia data stream and the video resolution of the second multimedia data stream as the target attribute information; determining the data type of the second multimedia data stream as the target attribute information under the condition that the encoding mode of the second multimedia data stream is a second encoding mode;
under the condition that the data type of the second multimedia data stream is data acquired by hardware acquisition equipment, acquiring the video resolution of the second multimedia data stream, and determining the data type of the second multimedia data stream and the video resolution of the second multimedia data stream as the target attribute information;
and determining the data type of the second multimedia data stream as the target attribute information under the condition that the data type of the second multimedia data stream is network data.
10. The method of claim 8, wherein obtaining the handover instruction comprises:
displaying a switching icon on a display interface of a client, wherein the switching icon is triggered to indicate that the currently output multimedia data stream needs to be switched from a first multimedia data stream to a second multimedia data stream;
and acquiring first trigger information of the switching icon to obtain the switching instruction, wherein the first trigger information is used for indicating that the switching icon is triggered.
11. The method of claim 10, wherein obtaining the target attribute information of the second multimedia data stream according to the handover instruction, and wherein generating the handover indication information comprises:
displaying one or more attribute options on the display interface in response to the first trigger information, wherein the one or more attribute options are used for indicating attribute characteristics of the multimedia data stream;
acquiring second trigger information of the attribute option in the one or more attribute options, wherein the second trigger information is used for indicating a triggered attribute option in the one or more attribute options;
and generating the switching indication information according to the second trigger information, wherein the target attribute information carried in the switching indication information includes the triggered attribute option indicated by the second trigger information.
12. A multimedia data stream switching apparatus, comprising:
a first obtaining module, configured to obtain switching indication information, where the switching indication information is used to indicate that a currently output multimedia data stream is switched from a first multimedia data stream to a second multimedia data stream, where the switching indication information carries target attribute information of the second multimedia data stream, and the target attribute information is used to indicate an attribute feature of the second multimedia data stream;
a second obtaining module, configured to obtain the second multimedia data stream according to the target attribute information;
a switching module, configured to switch the currently output multimedia data stream from the first multimedia data stream to the second multimedia data stream when the second multimedia data stream is ready;
the second obtaining module is configured to obtain the second multimedia data stream according to the target attribute information in the following manner: determining a target multimedia data stream acquisition mode corresponding to the target attribute information, wherein the attribute information of the multimedia data stream and the acquisition mode of the multimedia data stream have a preset corresponding relationship; acquiring the second multimedia data stream according to the multimedia data stream acquisition mode;
the device is further configured to start a new thread to process an event related to the second multimedia data stream after the handover indication information is acquired.
13. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 11.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 11 by means of the computer program.
CN201711138180.XA 2017-11-16 2017-11-16 Multimedia data stream switching method and device, storage medium and electronic device Active CN109803151B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711138180.XA CN109803151B (en) 2017-11-16 2017-11-16 Multimedia data stream switching method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711138180.XA CN109803151B (en) 2017-11-16 2017-11-16 Multimedia data stream switching method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN109803151A CN109803151A (en) 2019-05-24
CN109803151B true CN109803151B (en) 2022-02-08

Family

ID=66555549

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711138180.XA Active CN109803151B (en) 2017-11-16 2017-11-16 Multimedia data stream switching method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN109803151B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110248253B (en) * 2019-06-18 2021-11-23 北京字节跳动网络技术有限公司 Switching method, device and equipment of interactive interface of live broadcast room and storage medium
CN110297705B (en) * 2019-06-27 2021-12-14 百度在线网络技术(北京)有限公司 Function switching processing method, device, equipment and storage medium
CN110708564B (en) * 2019-10-21 2021-12-07 上海网达软件股份有限公司 Live transcoding method and system for dynamically switching video streams
CN111541925B (en) * 2020-04-30 2021-09-14 青岛海信宽带多媒体技术有限公司 Display device and display method thereof
CN113612728B (en) * 2021-06-25 2023-09-01 阿里巴巴新加坡控股有限公司 Streaming media playing method, transmission equipment and system
CN114827747B (en) * 2022-06-29 2023-01-10 广州市广播电视台 Streaming media data switching method, device, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101052044A (en) * 2007-05-18 2007-10-10 华为技术有限公司 IPTV stream media business realizing method IMS, network equipment and terminal equipment
CN101217648A (en) * 2008-01-08 2008-07-09 华为技术有限公司 Video monitoring information transferring method, device and system
CN101990112A (en) * 2009-08-07 2011-03-23 未序网络科技(上海)有限公司 Internet request signal dynamic switching method
CN103391465A (en) * 2013-07-11 2013-11-13 深圳数字电视国家工程实验室股份有限公司 Terminal device control method and network device
CN103955338A (en) * 2014-04-15 2014-07-30 奇瑞汽车股份有限公司 Application data processing method and application data processing device based on vehicle-mounted multimedia terminal
CN103997677A (en) * 2014-05-06 2014-08-20 深圳创维数字技术股份有限公司 Audio and video play method and play device
CN107071536A (en) * 2017-03-29 2017-08-18 武汉斗鱼网络科技有限公司 User's switching definition loads the method and system of video flowing
CN107277594A (en) * 2017-07-06 2017-10-20 广州华多网络科技有限公司 A kind of video and audio and barrage synchronous method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101193105A (en) * 2006-11-27 2008-06-04 中兴通讯股份有限公司 A media stream transmission/switching method
US8340344B2 (en) * 2008-10-01 2012-12-25 Broadcom Corporation Method and system for video transmission and processing with customized watermarking delivery

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101052044A (en) * 2007-05-18 2007-10-10 华为技术有限公司 IPTV stream media business realizing method IMS, network equipment and terminal equipment
CN101217648A (en) * 2008-01-08 2008-07-09 华为技术有限公司 Video monitoring information transferring method, device and system
CN101990112A (en) * 2009-08-07 2011-03-23 未序网络科技(上海)有限公司 Internet request signal dynamic switching method
CN103391465A (en) * 2013-07-11 2013-11-13 深圳数字电视国家工程实验室股份有限公司 Terminal device control method and network device
CN103955338A (en) * 2014-04-15 2014-07-30 奇瑞汽车股份有限公司 Application data processing method and application data processing device based on vehicle-mounted multimedia terminal
CN103997677A (en) * 2014-05-06 2014-08-20 深圳创维数字技术股份有限公司 Audio and video play method and play device
CN107071536A (en) * 2017-03-29 2017-08-18 武汉斗鱼网络科技有限公司 User's switching definition loads the method and system of video flowing
CN107277594A (en) * 2017-07-06 2017-10-20 广州华多网络科技有限公司 A kind of video and audio and barrage synchronous method and device

Also Published As

Publication number Publication date
CN109803151A (en) 2019-05-24

Similar Documents

Publication Publication Date Title
CN109803151B (en) Multimedia data stream switching method and device, storage medium and electronic device
CN105701217B (en) Information processing method and server
CN104735542B (en) A kind of video broadcasting method and device
US8667533B2 (en) Customizing streaming content presentation
US20170171274A1 (en) Method and electronic device for synchronously playing multiple-cameras video
US10225613B2 (en) Method and apparatus for video playing processing and television
CN103338407B (en) A kind of method of television set and TV set for browsing channel
CN111541930A (en) Live broadcast picture display method and device, terminal and storage medium
KR101991188B1 (en) Promotion information processing method, device, and apparatus, and non-volatile computer storage medium
CN108810580B (en) Media content pushing method and device
CN103747345A (en) Method and equipment for video playing of intelligent televisions
CN104202652A (en) Television set top box and playback control method thereof
CN107690093B (en) Video playing method and device
CN110913237A (en) Live broadcast control method and device, live broadcast initiating device and storage medium
Ohmata et al. Hybridcast: A new media experience by integration of broadcasting and broadband
US20200099987A1 (en) Systems and methods for displaying a live video stream in a graphical user interface
CN108965961B (en) Multimedia data processing method and device and screen projection equipment
CN108668159A (en) A kind of split screen plays the method and terminal of video and advertisement
CN114257572B (en) Data processing method, device, computer readable medium and electronic equipment
CN109561337A (en) The playing method and device of preview video
WO2016155375A1 (en) Advertisement loading method and device
CN109982135B (en) Channel switching method, device, terminal and computer readable storage medium
JP6219531B2 (en) Television program image frame capture device, television program image frame acquisition device, system and method
US10491681B2 (en) Method and a device for enriching a call
CN106302543B (en) Multimedia display method, device and system

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