CN111541916A - Code stream transmission method and device - Google Patents

Code stream transmission method and device Download PDF

Info

Publication number
CN111541916A
CN111541916A CN202010304078.8A CN202010304078A CN111541916A CN 111541916 A CN111541916 A CN 111541916A CN 202010304078 A CN202010304078 A CN 202010304078A CN 111541916 A CN111541916 A CN 111541916A
Authority
CN
China
Prior art keywords
code stream
information
target code
target
current
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.)
Granted
Application number
CN202010304078.8A
Other languages
Chinese (zh)
Other versions
CN111541916B (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.)
Hisense Visual Technology Co Ltd
Original Assignee
Hisense Visual Technology 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 Hisense Visual Technology Co Ltd filed Critical Hisense Visual Technology Co Ltd
Priority to CN202010304078.8A priority Critical patent/CN111541916B/en
Publication of CN111541916A publication Critical patent/CN111541916A/en
Application granted granted Critical
Publication of CN111541916B publication Critical patent/CN111541916B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/238Interfacing the downstream path of the transmission network, e.g. adapting the transmission rate of a video stream to network bandwidth; Processing of multiplex streams
    • H04N21/2387Stream processing in response to a playback request from an end-user, e.g. for trick-play
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/643Communication protocols
    • H04N21/6437Real-time Transport Protocol [RTP]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a code stream transmission method and equipment, wherein the method comprises the following steps: acquiring a query request sent by first equipment, wherein the query request comprises target code stream information; after determining that the query request is a request sent based on the established connection, acquiring current code stream information, wherein the current code stream information is code stream information of a code stream transmitted based on the established connection; and after the current code stream information is determined to be not matched with the target code stream information, transmitting the target code stream corresponding to the target code stream information to the first equipment based on the established connection, and transmitting the target code stream without re-establishing the connection, so that the fast switching of the code stream is realized, the efficiency required by code stream switching is improved, the problem of low existing code stream switching efficiency is solved, and the user experience is improved.

Description

Code stream transmission method and device
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a code stream transmission method and device.
Background
Real Time Streaming Protocol (RTSP) is a Client/Server (C/S) multimedia program Protocol. When the server transmits the multimedia data requested by the client, a data transmission channel needs to be established with the client based on an RTSP (real time streaming protocol), namely, connection is established, then, a main code stream corresponding to the multimedia data is transmitted to the client based on the connection, and the client decodes and plays the main code stream. However, due to poor network environment of the client, the server needs to perform stream switching to transmit the sub-stream with low picture quality to the client.
In the prior art, when switching the code stream, the server needs to disconnect the data transmission channel established with the client, that is, disconnect the connection, and then reestablish the connection, so as to transmit the subcode stream corresponding to the multimedia to the client by using the newly established connection.
However, the inventors found that at least the following problems exist in the prior art: when the code stream is switched, the server can transmit the sub-code stream to the client only when the connection is required to be disconnected and reestablished, so that the time required by the code stream switching is long, the switching efficiency is low, and the user experience is influenced.
Disclosure of Invention
The embodiment of the invention provides a code stream transmission method and equipment, which aim to solve the problem that in the prior art, the code stream switching efficiency is low because the connection needs to be reestablished when the code stream is switched, so that the code stream switching time is long.
In a first aspect, an embodiment of the present invention provides a code stream transmission method, including:
acquiring a query request sent by first equipment, wherein the query request comprises target code stream information;
after determining that the query request is a request sent based on the established connection, acquiring current code stream information, wherein the current code stream information is code stream information of a code stream transmitted based on the established connection;
and after determining that the current code stream information is not matched with the target code stream information, transmitting a target code stream corresponding to the target code stream information to the first equipment based on the established connection.
In one possible design, the target code stream information includes a target code stream address, and the current code stream information includes a current code stream address;
after determining that the current code stream information is not matched with the target code stream information, and before transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection, the method further includes:
judging whether the target code stream address is the same as the current code stream address;
and if the target code stream address is different from the current code stream address, determining that the current code stream information is not matched with the target code stream information.
In a possible design, before obtaining current codestream information after determining that the query request is a request sent based on an established connection, the method further includes:
acquiring a channel identifier in the query request, and acquiring a connection state corresponding to the channel identifier;
and if the connection state is in connection, determining that the query request is a request sent based on the established connection.
In one possible design, the transmitting, based on the established connection, a target code stream corresponding to target code stream information to the first device includes:
sending a preset expansion data packet to the first device, wherein the preset expansion data packet is used for indicating the first device to receive a target code stream corresponding to the target code stream address;
and transmitting the target code stream corresponding to the target code stream information to the first equipment based on the established connection.
In one possible design, the target code stream information includes a target code stream identifier, and the current code stream information includes a current code stream identifier;
after determining that the current code stream information is not matched with the target code stream information, and before transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection, the method further includes:
judging whether the target code stream identifier is the same as the current code stream identifier;
and if the target code stream identifier is different from the current code stream identifier, determining that the current code stream information is not matched with the target code stream information.
In one possible design, before the sending the preset extension packet to the first device, the method further includes:
and generating query response information and returning the query response information to the first equipment, wherein the query response information comprises an expansion identifier.
In a second aspect, an embodiment of the present invention provides a code stream transmission device, including:
the device comprises a receiving and sending module, a sending and receiving module and a sending and receiving module, wherein the receiving and sending module is used for obtaining a query request sent by first equipment, and the query request comprises target code stream information;
the processing module is used for acquiring current code stream information after determining that the query request is a request sent based on the established connection, wherein the current code stream information is the code stream information of the code stream transmitted based on the established connection;
and the transceiver module is used for transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection after determining that the current code stream information is not matched with the target code stream information.
In one possible design, the target code stream information includes a target code stream address, and the current code stream information includes a current code stream address;
the transceiver module is further configured to determine whether a target code stream address is the same as the current code stream address or not before transmitting a target code stream corresponding to target code stream information to the first device based on the established connection after determining that the current code stream information is not matched with the target code stream information;
the transceiver module is further configured to determine that the current code stream information is not matched with the target code stream information when the target code stream address is different from the current code stream address.
In a possible design, the processing module is further configured to, after determining that the query request is a request sent based on an established connection, obtain a channel identifier in the query request and obtain a connection state corresponding to the channel identifier before obtaining current code stream information;
the processing module is further configured to determine that the query request is a request sent based on an established connection when the connection status is in a connection.
In a possible design, the transceiver module is further configured to send a preset extension data packet to the first device, where the preset extension data packet is used to instruct the first device to receive a target code stream corresponding to the target code stream address;
and the transceiver module is further configured to transmit a target code stream corresponding to the target code stream information to the first device based on the established connection.
In one possible design, the target code stream information includes a target code stream identifier, and the current code stream information includes a current code stream identifier;
the transceiver module is further configured to determine whether the target code stream identifier is the same as the current code stream identifier or not before transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection after determining that the current code stream information is not matched with the target code stream information;
the transceiver module is further configured to determine that the current code stream information is not matched with the target code stream information when the target code stream identifier is different from the current code stream identifier.
In a possible design, the transceiver module is further configured to generate query response information before the sending of the preset extension packet to the first device, and return the query response information to the first device, where the query response information includes an extension identifier.
In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor and a memory.
The memory stores computer-executable instructions.
The at least one processor executes computer-executable instructions stored in the memory, so that the at least one processor executes the code stream transmission method according to any one of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where a computer executing instruction is stored in the computer-readable storage medium, and when a processor executes the computer executing instruction, the code stream transmission method according to any one of the first aspects is implemented.
The code stream transmission method and the device provided by the embodiment of the invention indicate that the code stream switching is possible after the query request sent by the first device is determined to be the request sent based on the established connection, the current code stream information transmitted based on the established connection is taken as the current code stream information, the current code stream information is compared with the target code stream information in the query request, when the two are determined to be not matched, the target code stream requested by the first device is not the code stream transmitted based on the established connection, namely the code stream switching is required, the established connection is directly given, the target code stream is transmitted to the first device, the target code stream is transmitted without re-establishing the connection, the fast switching of the code stream is realized, the efficiency required by the code stream switching is improved, and the problem of low efficiency of the existing code stream switching is avoided, the user experience is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a schematic diagram of a code stream transmission system according to an embodiment of the present invention;
fig. 2 is a first flowchart of a code stream transmission method according to an embodiment of the present invention;
fig. 3 is a second flowchart of a code stream transmission method according to an embodiment of the present invention;
fig. 4 is a schematic diagram of a header of an extended RTP packet according to an embodiment of the present invention;
fig. 5 is a schematic diagram of a code stream transmission device according to an embodiment of the present invention;
fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention.
Detailed Description
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.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, 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, for example, capable of operation in sequences other than those illustrated or otherwise 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.
When the server encodes multimedia data, for example, video data, the server may encode the multimedia data according to two encoding formats, so as to obtain a main code stream and a sub code stream, where the main code stream and the sub code stream are two digitized data streams. The main code stream has higher picture quality and higher requirement on network bandwidth, and the sub code stream has lower picture quality and lower requirement on network bandwidth.
Fig. 1 is a schematic diagram of a code stream transmission system according to an embodiment of the present invention, as shown in fig. 1, the system includes a client 101 and a server 102, the client sends a relevant request, such as an OPTIONS request, a DESCRIBE request, a SETUP request, and a request to the server to request a main code stream corresponding to multimedia data to be transmitted from the server, and to request to establish a data transmission channel, that is, to establish a connection, after the connection is successfully established, the server packages the main code stream into a Real-time Transport Protocol (RTP) data packet based on the connection, and transmits the RTP data packet to the client, and the client performs relevant analysis on the RTP data packet to obtain the main code stream, and decodes the main code stream to play the decoded main code stream.
In the prior art, when a client requests a server to send a subcode stream corresponding to multimedia data due to a network, the client may send a TEARDOWN request to the server, so that the server disconnects the connection, i.e., disconnects the data transmission channel, and resends a related request to the server to request the server for the subcode stream corresponding to the multimedia data to be transmitted, and request to reestablish the data transmission channel, i.e., establish a new connection. And then the server sends the subcode stream to the client based on the new connection to realize the switching of the code stream, but when the code stream is switched, the server can only transmit the subcode stream to the client due to the disconnection and the connection reestablishment, so that the time required by the code stream switching is longer, the switching efficiency is low, and the user experience is influenced.
Therefore, in order to solve the above problems, the technical idea of the present invention is to expand an OPTIONS request provided by an RTSP protocol so as to include a target code stream address, after receiving the OPTIONS request sent by a client, a server determines whether the OPTIONS request is a request made in an established connection and determines whether the target code stream address is an address of a currently transmitted code stream, if the OPTIONS request is a request made in an established connection and the target code stream address is not an address of a currently transmitted code stream, it determines that the client is requesting to transmit a new code stream, after preparing the target code stream, the server sends response information including a dy identifier to the client to satisfy an answer mechanism of the RTSP protocol, sends an RTP expansion dedicated packet to the client, which indicates that the new code stream starts to be transmitted, and then based on the established connection, transmits the new code stream, namely, the target code stream is sent to the client, so that the switching of the code stream is realized without reestablishing a new connection to transmit a new code stream.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 2 is a first flowchart of a code stream transmission method provided in an embodiment of the present invention, where the method of this embodiment may be executed by a second device or by the server in fig. 1, as shown in fig. 2, the method of this embodiment may include:
s201, acquiring a query request sent by first equipment, wherein the query request comprises target code stream information.
In this embodiment, the second device obtains an inquiry request sent by the first device, where the inquiry request includes target code stream information, the target code stream information is information of a target code stream, and the target code stream is code stream information requested by the first device, that is, information of a code stream that the second device needs to transmit.
The query request is an OPTIONS request, the request is obtained by expanding a basic OPTIONS request provided by an RTSP (real time streaming protocol), the basic OPTIONS request provided by the RTSP does not include target code stream information, and the OPTIONS request including the target code stream information is obtained after the basic OPTIONS request provided by the RTSP is expanded.
Optionally, the second device is a server, the first device is a client, and specifically, the server is a media server.
S202, after the query request is determined to be a request sent based on the established connection, current code stream information is obtained, wherein the current code stream information is code stream information of a code stream transmitted based on the established connection.
In this embodiment, after receiving the query request sent by the first device, the second device determines whether the query request is a request sent based on an established connection, that is, whether the query request is a request made in a currently established data transmission channel.
After determining that the query request is a request performed in a currently established data transmission channel, indicating that a code stream requested by a client may not be a code stream currently transmitted in the data transmission channel, that is, indicating that a transmission may need to be switched, acquiring information of the code stream currently transmitted in the data transmission channel, that is, acquiring code stream information of the code stream currently transmitted based on the established connection, and using the information as current code stream information, so as to determine whether the code stream needs to be switched for transmission by using the current code stream information, that is, determining whether a new code stream needs to be transmitted.
And S203, after the current code stream information is determined to be not matched with the target code stream information, transmitting the target code stream corresponding to the target code stream information to the first equipment based on the established connection.
In this embodiment, it is determined whether the current code stream information matches the target code stream information, and when it is determined that the current code stream information matches the target code stream, it indicates that the target code stream is code stream information of a code stream transmitted based on an established connection, that is, the target code stream is a code stream currently being transmitted, and thus, the transmitted code stream does not need to be switched, and useless code stream switching is avoided.
When the current code stream information is determined to be not matched with the target code stream information, the target code stream is indicated to be not the code stream transmitted based on the established connection, the target code stream is a new code stream, the code stream transmitted based on the established connection needs to be switched, so that the code stream currently being transmitted is switched to the target code stream, the target code stream is obtained from the address of the target code stream, and the target code stream is transmitted to the first device.
When the target code stream is determined to be different from the currently transmitted code stream, the target code stream and the currently transmitted code stream are the same multimedia data, such as the same video, and code streams with different formats, when the target code stream is a main code stream, the currently transmitted code stream is a sub-code stream, and when the target code stream is a sub-code stream, the currently transmitted code stream is a main code stream.
In addition, after receiving the target code stream transmitted by the second device, the first device decodes and plays the target code stream, so that the target code stream is played.
As can be seen from the above description, after it is determined that the query request sent by the first device is a request sent based on an established connection, it indicates that code stream switching may be required, then the code stream information transmitted based on the established connection at present is used as current code stream information, the current code stream information is compared with the target code stream information in the query request, and when it is determined that the two are not matched, it indicates that the target code stream requested by the first device is not the code stream transmitted based on the established connection at present, i.e., the code stream switching is required, the established connection is directly given, the target code stream is transmitted to the first device, and connection does not need to be reestablished to transmit the target code stream, so that fast code stream switching is achieved, efficiency required by code stream switching is improved, and thus a problem of low efficiency in existing code stream switching does not occur, and user experience is improved.
In addition, before transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection, an extended data packet may also be transmitted to the first device, so that the first device knows that the second device starts to transmit a new code stream, which is described in detail below with reference to a specific embodiment.
Fig. 3 is a second flowchart of a code stream transmission method according to an embodiment of the present invention, and this embodiment describes in detail a specific implementation process of transmitting an extended data packet based on the embodiment of fig. 2. As shown in fig. 3, the method includes:
s301, acquiring a query request sent by the first device, wherein the query request comprises target code stream information.
S302, after the query request is determined to be a request sent based on the established connection, current code stream information is obtained, wherein the current code stream information is code stream information of a code stream transmitted based on the established connection.
In this embodiment, after receiving the query request sent by the first device, it is determined whether the query request is a request sent based on an already established connection, that is, whether the query request is a request made in a currently already established connection.
Optionally, the data transmission channel established between the second device and the other device/terminal has a corresponding channel identifier, that is, the established connection has a corresponding channel identifier, the second device stores a connection state corresponding to the connection established between the second device and the other device/terminal, and the second device periodically updates the connection state corresponding to each connection, where the connection state includes a connection in and a connection out.
When determining whether the query request is a request sent based on an established connection, the second device may determine through the connection state, that is, obtain the channel identifier in the query request, and obtain the connection state corresponding to the channel identifier. If the connection state is in the connection, determining that the query request is a request sent based on the established connection.
In a specific implementation, the query request includes a channel identifier, where the channel identifier is an identifier of a data transmission channel established between the first device and the second device, and obtains a connection state corresponding to the channel identifier, and when the connection state is in a connection, it indicates that the query request is a request performed in the currently established data transmission channel, that is, the query request is a request sent based on the established connection.
And S303, after the current code stream information is determined to be not matched with the target code stream information, sending a preset expansion data packet to the first device, wherein the preset expansion data packet is used for indicating the first device to receive the target code stream corresponding to the target code stream address.
In this embodiment, whether the current code stream information and the target code stream information are matched is determined, and after it is determined that the current code stream information and the target code stream information are not matched, it indicates that the target code stream is not a currently transmitted code stream, and a code stream needs to be switched, a preset extension data packet is sent to the first device to notify the first device that the second device starts to transmit the target code stream, that is, the second device starts to transmit a new code stream, so that the first device performs a related code stream receiving operation, for example, a storage address of the target code stream is set, even if the first device is ready to receive the target code stream.
Optionally, the preset extended data packet may be an extended RTP data packet, that is, an RTP extended dedicated packet, where a format of the data packet is shown in fig. 4, a packet header of the extended RTP data packet includes an RTP header, a sequence number, a timestamp, and an SSRC, where the RTP header and the sequence number occupy 4 bytes, the timestamp occupies 4 bytes, the SSRC occupies 4 bytes, the last 8 bytes in the data packet all become 0, and when both the timestamp and the SSRC are 0, it indicates that a new code stream starts to be sent.
In addition, in order to avoid the situation that the first device does not successfully receive the extended data packet due to the loss or transmission failure of the extended data packet, the extended data packet is continuously transmitted for a preset number of times, for example, the extended data packet is continuously transmitted to the first device for 3 times.
In addition, after the first device sends the query request and before receiving the extended data packet, the first device also receives the code stream currently being transmitted, after receiving the extended data packet, the first device indicates that the second device starts to transmit a new code stream, that is, the target code stream starts to be transmitted, and then the first device starts to switch to the new code stream and decodes according to a decoding mode corresponding to the new code stream, so that the problem of code stream interruption or playing interruption is avoided.
Specifically, when determining whether the current code stream information and the target code stream information are matched, the following two ways may be implemented.
One implementation is as follows: the target code stream information comprises a target code stream address, and the current code stream information comprises a current code stream address. And judging whether the target code stream address is the same as the current code stream address. And if the target code stream address is different from the current code stream address, determining that the current code stream information is not matched with the target code stream information.
In this embodiment, the address of the target code stream is an address of the target code stream, that is, an address of a code stream to be transmitted. The current code stream address is an address of a code stream transmitted by the second device based on the established connection, that is, an address of a code stream currently being transmitted to the first device by the second device. And judging whether the target code stream address is the same as the current code stream address, if not, indicating that the code stream currently transmitted to the first equipment is not the target code stream and the target code stream is the requested new code stream, and determining that the current code stream information is not matched with the target code stream information.
The other realization mode is as follows: the target code stream information comprises a target code stream identifier, and the current code stream information comprises a current code stream identifier. And judging whether the target code stream identifier is the same as the current code stream identifier. And if the target code stream identifier is different from the current code stream identifier, determining that the current code stream information is not matched with the target code stream information.
In this embodiment, the target code stream identifier is an identifier of the target code stream, that is, an identifier of the code stream that needs to be transmitted. The current code stream identifier is an identifier of a code stream transmitted by the second device based on the established connection, that is, an identifier of a code stream currently being transmitted to the first device by the second device. And judging whether the target code stream identifier is the same as the current code stream identifier, if not, indicating that the code stream currently transmitted to the first equipment is not the target code stream, and the target code stream is a new code stream requested, and determining that the current code stream information is not matched with the target code stream information.
Optionally, before sending the preset extension data packet to the first device, query response information may also be generated and returned to the first device, where the query response information includes the extension identifier.
In specific implementation, since the RTSP protocol is a mechanism for responding to a request, after receiving the query information, the RTSP protocol needs to respond to corresponding query response information, where the query response information includes not only a request supported by the second device, but also an extension identifier, where the extension identifier indicates that the second device has prepared a target code stream, that is, the target code stream has been encoded. For example, the query response information is Public, OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, PAUSE, SCALE, READY, the OPTIONS, DESCRIBE, SETUP, TEARDOWN, PLAY, use, and SCALE in the query response information are supported requests of the second device, and READY is the extension identifier.
And S304, transmitting the target code stream corresponding to the target code stream information to the first equipment based on the established connection.
In this embodiment, the target code stream is transmitted to the first device based on the established connection, that is, based on the data transmission channel corresponding to the channel identifier in the query request, so that a new code stream is transmitted in the established data transmission channel without re-establishing the data transmission channel to transmit the new code stream.
In addition, when the second device transmits the target code stream to the first device, the target code stream is packed into an RTP data packet for transmission.
In this embodiment, the second device sends the extended data packet to the first device, so that the first device can know that the second device starts to send a new code stream, and perform a related switching operation, so that the first device can quickly receive and process the new code stream, thereby implementing quick playing of the new code stream, and improving user experience.
Fig. 5 is a schematic structural diagram of a code stream transmission device according to an embodiment of the present invention, and as shown in fig. 5, the code stream transmission device 50 according to this embodiment may include a transceiver module 501 and a processing module 502.
The transceiver module 501 is configured to obtain an inquiry request sent by a first device, where the inquiry request includes target code stream information.
The processing module 502 is configured to obtain current code stream information after determining that the query request is a request sent based on the established connection, where the current code stream information is code stream information of a code stream transmitted based on the established connection.
The transceiver module 501 is configured to transmit a target code stream corresponding to the target code stream information to the first device based on the established connection after determining that the current code stream information is not matched with the target code stream information.
In one possible design, the target code stream information includes a target code stream address, and the current code stream information includes a current code stream address.
The transceiver module 501 is further configured to determine whether the address of the target code stream is the same as the address of the current code stream after determining that the current code stream information is not matched with the target code stream information, and before transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection.
The transceiving module 501 is further configured to determine that the current code stream information is not matched with the target code stream information when the target code stream address is different from the current code stream address.
In a possible design, the processing module 502 is further configured to, after determining that the query request is a request sent based on an established connection, obtain a channel identifier in the query request and obtain a connection state corresponding to the channel identifier before obtaining current code stream information.
The processing module 502 is further configured to determine that the query request is a request sent based on an established connection when the connection status is in connection.
In a possible design, the transceiver module 501 is further configured to send a preset extension data packet to the first device, where the preset extension data packet is used to instruct the first device to receive a target code stream corresponding to a target code stream address.
The transceiver module 501 is further configured to transmit a target code stream corresponding to the target code stream information to the first device based on the established connection.
In one possible design, the target code stream information includes a target code stream identifier, and the current code stream information includes a current code stream identifier.
The transceiver module 501 is further configured to determine whether the target code stream identifier is the same as the current code stream identifier or not before transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection after determining that the current code stream information is not matched with the target code stream information.
The transceiver module 501 is further configured to determine that the current code stream information is not matched with the target code stream information when the target code stream identifier is different from the current code stream identifier.
In a possible design, the transceiver module 501 is further configured to generate query response information before sending the preset extension packet to the first device, and return the query response information to the first device, where the query response information includes the extension identifier.
The code stream transmission device provided by the embodiment of the invention can realize the code stream transmission method of the embodiment, the realization principle and the technical effect are similar, and the description is omitted here.
Fig. 6 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present invention. As shown in fig. 6, the electronic device 600 provided in the present embodiment includes: at least one processor 601 and memory 602. The processor 601 and the memory 602 are connected by a bus 603.
In a specific implementation process, the at least one processor 601 executes computer-executable instructions stored in the memory 602, so that the at least one processor 601 executes the code stream transmission method in the foregoing method embodiment.
For a specific implementation process of the processor 601, reference may be made to the above method embodiments, which implement the principle and the technical effect similarly, and details of this embodiment are not described herein again.
In the embodiment shown in fig. 6, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The embodiment of the invention also provides a computer-readable storage medium, wherein a computer execution instruction is stored in the computer-readable storage medium, and when a processor executes the computer execution instruction, the code stream transmission method of the embodiment of the method is realized.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for transmitting a code stream, comprising:
acquiring a query request sent by first equipment, wherein the query request comprises target code stream information;
after determining that the query request is a request sent based on the established connection, acquiring current code stream information, wherein the current code stream information is code stream information of a code stream transmitted based on the established connection;
and after determining that the current code stream information is not matched with the target code stream information, transmitting a target code stream corresponding to the target code stream information to the first equipment based on the established connection.
2. The method of claim 1, wherein the target codestream information includes a target codestream address, and the current codestream information includes a current codestream address;
after determining that the current code stream information is not matched with the target code stream information, and before transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection, the method further includes:
judging whether the target code stream address is the same as the current code stream address;
and if the target code stream address is different from the current code stream address, determining that the current code stream information is not matched with the target code stream information.
3. The method according to claim 1, wherein before obtaining current codestream information after determining that the query request is a request sent based on an established connection, further comprising:
acquiring a channel identifier in the query request, and acquiring a connection state corresponding to the channel identifier;
and if the connection state is in connection, determining that the query request is a request sent based on the established connection.
4. The method according to any one of claims 1 to 3, wherein the transmitting, based on the established connection, a target code stream corresponding to target code stream information to the first device includes:
sending a preset expansion data packet to the first device, wherein the preset expansion data packet is used for indicating the first device to receive a target code stream corresponding to the target code stream address;
and transmitting the target code stream corresponding to the target code stream information to the first equipment based on the established connection.
5. The method of claim 1, wherein the target codestream information comprises a target codestream identification and the current codestream information comprises a current codestream identification;
after determining that the current code stream information is not matched with the target code stream information, and before transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection, the method further includes:
judging whether the target code stream identifier is the same as the current code stream identifier;
and if the target code stream identifier is different from the current code stream identifier, determining that the current code stream information is not matched with the target code stream information.
6. The method of claim 4, wherein before the sending the pre-determined extension packet to the first device, further comprising:
and generating query response information and returning the query response information to the first equipment, wherein the query response information comprises an expansion identifier.
7. A code stream transmission apparatus, comprising:
the device comprises a receiving and sending module, a sending and receiving module and a sending and receiving module, wherein the receiving and sending module is used for obtaining a query request sent by first equipment, and the query request comprises target code stream information;
the processing module is used for acquiring current code stream information after determining that the query request is a request sent based on the established connection, wherein the current code stream information is the code stream information of the code stream transmitted based on the established connection;
and the transceiver module is used for transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection after determining that the current code stream information is not matched with the target code stream information.
8. The device of claim 7, wherein the target codestream information includes a target codestream address, and the current codestream information includes a current codestream address;
the processing module is further configured to determine whether an address of the target code stream is the same as the address of the current code stream before transmitting the target code stream corresponding to the target code stream information to the first device based on the established connection after determining that the current code stream information is not matched with the target code stream information;
the processing module is further configured to determine that the current code stream information is not matched with the target code stream information when the target code stream address is different from the current code stream address.
9. An electronic device, comprising: at least one processor and memory;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored by the memory, so that the at least one processor executes the codestream transmission method according to any one of claims 1 to 6.
10. A computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, the code stream transmission method according to any one of claims 1 to 6 is implemented.
CN202010304078.8A 2020-04-17 2020-04-17 Code stream transmission method and device Active CN111541916B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010304078.8A CN111541916B (en) 2020-04-17 2020-04-17 Code stream transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010304078.8A CN111541916B (en) 2020-04-17 2020-04-17 Code stream transmission method and device

Publications (2)

Publication Number Publication Date
CN111541916A true CN111541916A (en) 2020-08-14
CN111541916B CN111541916B (en) 2022-08-26

Family

ID=71979967

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010304078.8A Active CN111541916B (en) 2020-04-17 2020-04-17 Code stream transmission method and device

Country Status (1)

Country Link
CN (1) CN111541916B (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102572517A (en) * 2011-12-21 2012-07-11 深圳市同洲视讯传媒有限公司 Bit stream switching method, device, server and system
CN102595199A (en) * 2011-01-11 2012-07-18 中兴通讯股份有限公司 Streaming media packet packaging and transmitting method, and streaming media processing device
CN102868930A (en) * 2012-09-06 2013-01-09 珠海全志科技股份有限公司 Method and device for decoding transport-stream data packets
CN102957672A (en) * 2011-08-25 2013-03-06 中国电信股份有限公司 Method, client side and system for self-adaptive playing of FLV (flash video) media streams
CN103188529A (en) * 2011-12-27 2013-07-03 北京朝歌数码科技股份有限公司 Multimedia play method for switching from first channel to second channel and multimedia play device
CN103873948A (en) * 2012-12-10 2014-06-18 中国电信股份有限公司 Streaming media self-adaption matching transmission method, system and server
US20160073106A1 (en) * 2014-09-08 2016-03-10 Apple Inc. Techniques for adaptive video streaming
CN109495761A (en) * 2017-09-13 2019-03-19 杭州海康威视***技术有限公司 Video switching method and device
CN110460878A (en) * 2019-07-19 2019-11-15 视联动力信息技术股份有限公司 A kind of switching method and apparatus of video communication link

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102595199A (en) * 2011-01-11 2012-07-18 中兴通讯股份有限公司 Streaming media packet packaging and transmitting method, and streaming media processing device
CN102957672A (en) * 2011-08-25 2013-03-06 中国电信股份有限公司 Method, client side and system for self-adaptive playing of FLV (flash video) media streams
CN102572517A (en) * 2011-12-21 2012-07-11 深圳市同洲视讯传媒有限公司 Bit stream switching method, device, server and system
CN103188529A (en) * 2011-12-27 2013-07-03 北京朝歌数码科技股份有限公司 Multimedia play method for switching from first channel to second channel and multimedia play device
CN102868930A (en) * 2012-09-06 2013-01-09 珠海全志科技股份有限公司 Method and device for decoding transport-stream data packets
CN103873948A (en) * 2012-12-10 2014-06-18 中国电信股份有限公司 Streaming media self-adaption matching transmission method, system and server
US20160073106A1 (en) * 2014-09-08 2016-03-10 Apple Inc. Techniques for adaptive video streaming
CN109495761A (en) * 2017-09-13 2019-03-19 杭州海康威视***技术有限公司 Video switching method and device
CN110460878A (en) * 2019-07-19 2019-11-15 视联动力信息技术股份有限公司 A kind of switching method and apparatus of video communication link

Also Published As

Publication number Publication date
CN111541916B (en) 2022-08-26

Similar Documents

Publication Publication Date Title
EP2429144B1 (en) Method and apparatus for transmitting hyper text transport protocol (http) media
CN109889543B (en) Video transmission method, root node, child node, P2P server and system
US8745246B2 (en) Method and device for selecting an SVC operation point, and method and device for providing information of SVC operation points
EP3515083B1 (en) Method and apparatus for performing synchronization operation on contents
US10820229B2 (en) Method for providing streaming service and apparatus therefor
US20210136128A1 (en) Interaction information transmission method and apparatus
WO2014063297A1 (en) Method and apparatus for playing streaming media files
CN107113474B (en) Apparatus and computer-readable recording medium having program recorded therein for providing low-latency real-time broadcast content
US10856015B2 (en) Method for operating a cache arranged along a transmission path between client terminals and at least one server, and corresponding cache
KR20060096211A (en) Method for transmitting moving picture in mobile terminal using pseudo streaming technology
CN113852824A (en) Video transcoding method and device, electronic equipment and storage medium
KR20230002784A (en) Methods and servers for transmitting audio and/or video content
CN114245153B (en) Slicing method, slicing device, slicing equipment and readable storage medium
CN111541916B (en) Code stream transmission method and device
US20080104267A1 (en) Systems and methods for reducing display latency between streaming digital media
US10820025B2 (en) Method and system of push-template and URL list for dash on full-duplex protocols
JP4909590B2 (en) Media signal receiving device, transmitting device, and transmitting / receiving system
KR102237900B1 (en) Method for retrieving, by a client terminal, a content part of a multimedia content
CN117579679B (en) Signaling interaction method and device, electronic equipment and storage medium
CN114710694B (en) Distributed plug flow method in cloud game scene
CN114173151B (en) Live broadcast stream pushing system, method and device and electronic equipment
WO2023095438A1 (en) Terminal device, wireless communication system, and terminal device processing method
JP2006041819A (en) Stream distributing server, mobile terminal, stream distribution system, and stream distribution method
CN109196870B (en) Method and apparatus for transmitting and receiving MMTP packets
CN117997885A (en) Multimedia stream transmission system, method, electronic equipment and storage medium

Legal Events

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