CN113507639A - Channel fast switching method, player and readable storage medium - Google Patents

Channel fast switching method, player and readable storage medium Download PDF

Info

Publication number
CN113507639A
CN113507639A CN202110746639.4A CN202110746639A CN113507639A CN 113507639 A CN113507639 A CN 113507639A CN 202110746639 A CN202110746639 A CN 202110746639A CN 113507639 A CN113507639 A CN 113507639A
Authority
CN
China
Prior art keywords
multicast
unicast
streaming media
media data
pts
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.)
Pending
Application number
CN202110746639.4A
Other languages
Chinese (zh)
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.)
Shenzhen SDMC Technology Co Ltd
Original Assignee
Shenzhen SDMC 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 Shenzhen SDMC Technology Co Ltd filed Critical Shenzhen SDMC Technology Co Ltd
Priority to CN202110746639.4A priority Critical patent/CN113507639A/en
Publication of CN113507639A publication Critical patent/CN113507639A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/438Interfacing the downstream path of the transmission network originating from a server, e.g. retrieving encoded video stream packets from an IP network
    • H04N21/4383Accessing a communication channel
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/44012Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving rendering scenes according to scene graphs, e.g. MPEG-4 scene graphs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/482End-user interface for program selection
    • H04N21/4825End-user interface for program selection using a list of items to be played back in a given order, e.g. playlists
    • 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/64Addressing
    • H04N21/6405Multicasting
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/44Receiver circuitry for the reception of television signals according to analogue transmission standards
    • H04N5/50Tuning indicators; Automatic tuning control

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Human Computer Interaction (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a channel fast switching method, a player and a readable storage medium, wherein the channel fast switching method comprises the following steps: when a channel switching instruction is received, acquiring a unicast playing address and a multicast playing address corresponding to a target channel; acquiring unicast streaming media data based on the unicast playing address, and rendering a playing picture based on the unicast streaming media data; acquiring multicast streaming media data based on the multicast playing address; reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data; rendering a play screen based on the multicast streaming media data when the first PTS leads or is synchronized with the second PTS. The invention judges whether the unicast stream and the multicast stream are synchronous according to the display time stamp PTS, realizes the encapsulation protocol and the transmission protocol which do not depend on the upper layer streaming media when the fast channel switching is carried out, and enlarges the application range.

Description

Channel fast switching method, player and readable storage medium
Technical Field
The present invention relates to the field of streaming media technologies, and in particular, to a method for quickly switching channels, a player, and a readable storage medium.
Background
In the IPTV system, a multicast transmission technology is mainly used to transmit streaming media content, and the application of the multicast technology greatly reduces the bandwidth occupation of the network, but at the same time, the time for the user to watch the first screen of a channel is unstable because the data stream cannot be cached. The method for solving the problem is to add a channel cache server in the network, wherein the cache server caches the channel data in advance and provides RTSP service for the client to obtain the cache data. When the player at the client plays channels, the player firstly rapidly acquires the channel cache data from the channel cache server in a unicast mode, then adds the corresponding multicast group, receives the channel data in the multicast mode, and when the multicast data is successfully received and is synchronous with the unicast data, the player disconnects the unicast connection with the cache server and switches to the multicast mode to continue playing the channels.
In order to implement seamless switching between unicast and multicast, it is necessary to perform RTP protocol encapsulation on a multicast signal source, and determine whether unicast and multicast data are synchronous by comparing sequence numbers of RTP packets. In an actual IPTV production environment, a multicast media stream is usually directly output by an encoding device, and the encoding device of a large part of manufacturers does not support RTP encapsulation or an RTP sequence number field in an output RTP packet is always zero, so that a scheme for fast switching a channel by an RTP sequence number cannot work normally, and an application range is small.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method for quickly switching channels, which aims to judge whether unicast and multicast streams are synchronous or not by adopting a display time stamp (PTS) and solve the problem that the application range is smaller because multicast and unicast media streams need to be encapsulated by RTP.
In order to achieve the above object, the present invention provides a method for fast switching channels, comprising the following steps:
when a channel switching instruction is received, acquiring a unicast playing address and a multicast playing address corresponding to a target channel;
acquiring unicast streaming media data based on the unicast playing address, and rendering a playing picture based on the unicast streaming media data;
acquiring multicast streaming media data based on the multicast playing address;
reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data;
rendering a play screen based on the multicast streaming media data when the first PTS leads or is synchronized with the second PTS.
Further, the step of acquiring unicast streaming media data based on the unicast playing address comprises:
searching a corresponding unicast server according to the unicast playing address;
sending a data request instruction to the unicast server, so that the unicast server sends unicast streaming media data after receiving the data request instruction;
and receiving the unicast streaming media data.
Further, the step of acquiring multicast streaming media data based on the multicast play address includes:
searching a corresponding channel multicast group according to the multicast playing address;
sending an IGMP request to the channel multicast group, so that the channel multicast group sends multicast streaming media data according to the IGMP request;
and receiving the multicast streaming media data.
Further, after the step of reading the first PTS corresponding to the unicast frame in the unicast streaming media data and the second PTS corresponding to the multicast frame in the multicast streaming media data, the method further includes:
and when the first PTS lags behind the second PTS, continuing to execute the steps of acquiring the unicast streaming media data based on the unicast playing address and rendering a playing picture based on the unicast streaming media data.
Further, before the step of rendering the playing picture based on the multicast streaming media data, the method further includes:
when the first PTS leads the second PTS, discarding the multicast frame with the PTS lagging the first PTS, and closing the unicast thread;
and executing the step of rendering the playing picture based on the multicast streaming media data according to the residual multicast frames.
Further, after the step of obtaining the unicast streaming media data based on the unicast playing address, the method further includes:
separating unicast streaming media data to obtain a unicast frame, reading and storing the PTS of the unicast frame;
and injecting the unicast frame into a decoding buffer area to wait for decoding and rendering.
Further, after the step of acquiring multicast streaming media data based on the multicast address, the method further includes:
separating multicast streaming media data to obtain a multicast frame, and reading a PTS (partial transmit time) of the multicast frame;
and storing the multicast frame and the corresponding PTS into a temporary container, so as to obtain multicast streaming media data from the temporary container when the PTS of the unicast frame is ahead or synchronous to the PTS of the multicast frame, and rendering a playing picture based on the multicast streaming media data.
In order to achieve the above object, the present invention further provides a fast channel switching player, which includes a memory, a processor, and a fast channel switching program stored in the memory and operable on the processor, wherein the fast channel switching program, when executed by the processor, implements the steps of the fast channel switching method described in any one of the above.
In order to achieve the above object, the present invention further provides a readable storage medium, which stores a channel fast switching program, and the channel fast switching program, when executed by a processor, implements the steps of the channel fast switching method according to any one of the above items.
In the technical scheme of the invention, when a channel switching instruction is received, a unicast playing address and a multicast playing address corresponding to a target channel are obtained; acquiring unicast streaming media data based on the unicast playing address, and rendering a playing picture based on the unicast streaming media data; acquiring multicast streaming media data based on the multicast playing address; reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data; rendering a play screen based on the multicast streaming media data when the first PTS leads or is synchronized with the second PTS. Therefore, whether the unicast stream and the multicast stream are synchronous or not is judged by adopting the display time stamp PTS, so that the scheme of quickly switching the channel does not need to depend on the encapsulation protocol and the transmission protocol of the upper layer streaming media, and the application range of the scheme of quickly switching the channel is expanded.
Drawings
FIG. 1 is a schematic diagram of an apparatus in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for fast switching channels according to an embodiment of the present invention;
fig. 3 is a detailed flowchart of step S300 in the fast channel switching method according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main technical scheme of the invention is as follows:
when a channel switching instruction is received, acquiring a unicast playing address and a multicast playing address corresponding to a target channel;
acquiring unicast streaming media data based on the unicast playing address, and rendering a playing picture based on the unicast streaming media data;
acquiring multicast streaming media data based on the multicast playing address;
reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data;
rendering a play screen based on the multicast streaming media data when the first PTS leads or is synchronized with the second PTS.
In the related technology, in order to implement seamless switching between unicast and multicast, a multicast signal source needs to be encapsulated by an RTP protocol, and whether unicast and multicast data are synchronous is determined by comparing sequence numbers of RTP packets. In an actual IPTV production environment, a multicast media stream is usually directly output by an encoding device, and the encoding device of a large part of manufacturers does not support RTP encapsulation or an RTP sequence number field in an output RTP packet is always zero, so that a scheme for fast switching a channel by an RTP sequence number cannot work normally, and an application range is small.
In the technical scheme of the invention, when a channel switching instruction is received, a unicast playing address and a multicast playing address corresponding to a target channel are obtained; acquiring unicast streaming media data based on the unicast playing address, and rendering a playing picture based on the unicast streaming media data; acquiring multicast streaming media data based on the multicast playing address; reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data; rendering a play screen based on the multicast streaming media data when the first PTS leads or is synchronized with the second PTS. Therefore, whether the unicast stream and the multicast stream are synchronous or not is judged by adopting the display time stamp PTS, so that the scheme of quickly switching the channel does not need to depend on the encapsulation protocol and the transmission protocol of the upper layer streaming media, and the application range of the scheme of quickly switching the channel is expanded.
As shown in fig. 1, fig. 1 is a schematic diagram of a hardware operating environment of a terminal according to an embodiment of the present invention.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a memory 1005, and a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., a non-volatile memory such as a disk memory), the memory 1005 may optionally also be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the terminal shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include an operating system, a network communication module, and a channel fast-switching program therein.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; and the processor 1001 may be configured to call the channel fast switching program stored in the memory 1005 and perform the following operations:
when a channel switching instruction is received, acquiring a unicast playing address and a multicast playing address corresponding to a target channel;
acquiring unicast streaming media data based on the unicast playing address, and rendering a playing picture based on the unicast streaming media data;
acquiring multicast streaming media data based on the multicast playing address;
reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data;
rendering a play screen based on the multicast streaming media data when the first PTS leads or is synchronized with the second PTS.
Further, the processor 1001 may call the channel fast switching program stored in the memory 1005, and further perform the following operations:
searching a corresponding unicast server according to the unicast playing address;
sending a data request instruction to the unicast server, so that the unicast server sends unicast streaming media data after receiving the data request instruction;
and receiving the unicast streaming media data.
Further, the processor 1001 may call the channel fast switching program stored in the memory 1005, and further perform the following operations:
searching a corresponding channel multicast group according to the multicast playing address;
sending an IGMP request to the channel multicast group, so that the channel multicast group sends multicast streaming media data according to the IGMP request;
and receiving the multicast streaming media data.
Further, the processor 1001 may call the channel fast switching program stored in the memory 1005, and further perform the following operations:
and when the first PTS lags behind the second PTS, continuing to execute the steps of acquiring the unicast streaming media data based on the unicast playing address and rendering a playing picture based on the unicast streaming media data.
Further, the processor 1001 may call the channel fast switching program stored in the memory 1005, and further perform the following operations:
when the first PTS leads the second PTS, discarding the multicast frame with the PTS lagging the first PTS, and closing the unicast thread;
and executing the step of rendering the playing picture based on the multicast streaming media data according to the residual multicast frames.
Further, the processor 1001 may call the channel fast switching program stored in the memory 1005, and further perform the following operations:
separating unicast streaming media data to obtain a unicast frame, reading and storing the PTS of the unicast frame;
and injecting the unicast frame into a decoding buffer area to wait for decoding and rendering.
Further, the processor 1001 may call the channel fast switching program stored in the memory 1005, and further perform the following operations:
separating multicast streaming media data to obtain a multicast frame, and reading a PTS (partial transmit time) of the multicast frame;
and storing the multicast frame and the corresponding PTS into a temporary container, so as to obtain multicast streaming media data from the temporary container when the PTS of the unicast frame is ahead or synchronous to the PTS of the multicast frame, and rendering a playing picture based on the multicast streaming media data.
As shown in fig. 2, in an embodiment of the present invention, the method for fast switching channels includes the following steps:
step S100, when a channel switching instruction is received, acquiring a unicast playing address and a multicast playing address corresponding to a target channel;
in this embodiment, when a user performs a channel switching action through a remote controller or other devices, the channel fast switching player acquires a channel switching instruction, determines a corresponding target channel according to the instruction, and acquires a unicast playing address and a multicast playing address corresponding to the target channel, so as to acquire corresponding unicast streaming media data according to the unicast playing address and acquire corresponding multicast streaming media data according to the multicast playing address.
Step S200, acquiring unicast streaming media data based on the unicast playing address, and rendering a playing picture based on the unicast streaming media data;
in this embodiment, after acquiring a unicast playing address and a multicast playing address according to a target channel, a channel fast switching player analyzes the unicast playing address and sends a data request instruction to a unicast server, so that the unicast server sends corresponding unicast streaming media data to the player after receiving the data request instruction. Because the data stream cannot be cached, and the time for the user to view the first screen of the channel after performing the channel switching action cannot be guaranteed only by using the multicast technology, the received unicast streaming media data needs to be sent to a decoding buffer area first, and the unicast streaming media data is decoded and a playing picture is rendered, so that the time from receiving the channel switching instruction to the time from the user to view the first screen of the channel is shortened. If the player is to render a picture quickly and can synchronize with multicast data quickly, the unicast server needs to send data to the player from the starting position of a certain key frame and send the data at a speed exceeding a channel code stream, and on the basis of ensuring reliable data transmission, the unicast server sends own cache data to the player as quickly as possible.
Step S300, acquiring multicast streaming media data based on the multicast playing address;
in this embodiment, after acquiring a multicast play address according to a target channel, sending an IGMP request to a target channel multicast group to join the target channel multicast group, and waiting for receiving multicast streaming media data, where the IGMP is a protocol for supporting a host and a router to perform multicast, and the IGMP protocol can know to which interface of the router the multicast data should be forwarded, and actually, the router maintains a table for each interface, and records a multicast group including at least one host on an interface in the table. And after receiving the multicast streaming media data, storing the multicast streaming media data.
Step S400, reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data;
in this embodiment, after acquiring unicast streaming media data from a unicast server, separating an audio/video frame, i.e., a unicast frame, of the unicast streaming media data in a frame unit, reading and storing a display time stamp PTS, i.e., a first PTS, of the unicast frame, and performing a step of rendering a play picture based on the unicast streaming media data. After multicast streaming media data are acquired in a multicast mode, audio and video frames, namely multicast frames, of the multicast streaming media data are separated by taking the frames as units, a display time stamp PTS, namely a second PTS, of the multicast frames is read, and the second PTS and the multicast streaming media data are stored in a temporary container.
Step S500, when the first PTS is ahead of or synchronous with the second PTS, rendering a playing picture based on the multicast streaming media data.
In this embodiment, a first second PTS in the temporary container is compared with a first PTS acquired by the current unicast, and when the first PTS and the second PTS are synchronized, the unicast data and the multicast data are already synchronized, and at this time, the multicast frame in the temporary container can be directly sent to a decoding buffer to wait for decoding and rendering a picture. When the first PTS leads the second PTS, the unicast data and the multicast data are synchronous, so a temporary container for storing the multicast frame is traversed, and when the second PTS is smaller than the current first PTS, the picture corresponding to the multicast frame corresponding to the second PTS is a picture which is decoded according to the unicast streaming media data and is played in a rendering mode, so the multicast frame corresponding to the second PTS is discarded. After discarding, the remaining multicast frames are audio/video frames corresponding to the unplayed picture, so the remaining multicast frames are sent to a decoding buffer area and the like to decode and render the play picture.
In summary, in this embodiment, when a channel switching instruction is received, a unicast playing address and a multicast playing address corresponding to a target channel are obtained; acquiring unicast streaming media data based on the unicast playing address, and rendering a playing picture based on the unicast streaming media data; acquiring multicast streaming media data based on the multicast playing address; reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data; rendering a play screen based on the multicast streaming media data when the first PTS leads or is synchronized with the second PTS. Therefore, whether the unicast stream and the multicast stream are synchronous or not is judged by adopting the display time stamp PTS, so that the scheme of quickly switching the channel does not need to depend on the encapsulation protocol and the transmission protocol of the upper layer streaming media, and the application range of the scheme of quickly switching the channel is expanded.
In an embodiment of the present invention, the step of acquiring unicast streaming media data based on the unicast address includes:
searching a corresponding unicast server according to the unicast playing address;
sending a data request instruction to the unicast server, so that the unicast server sends unicast streaming media data after receiving the data request instruction;
and receiving the unicast streaming media data.
In this embodiment, after acquiring the unicast playing address according to the target channel, the player may find the corresponding unicast server according to the unicast playing address. And after finding the unicast server, the player sends a data request instruction to the unicast server. And after receiving the data request instruction, the unicast server sends unicast streaming media data to the player so that the player receives the unicast streaming media data and renders a playing picture based on the unicast streaming media data. Therefore, the corresponding unicast server is found through the unicast playing address, the data request instruction is sent to the unicast server to acquire the unicast streaming media data, and when the multicast streaming media data is not acquired yet, the playing picture can be rendered based on the unicast streaming media data, so that the time for a user to wait for the picture when the channel is switched is reduced.
As shown in fig. 3, in an embodiment of the present invention, the step S300 includes:
step S310, searching a corresponding channel multicast group according to the multicast playing address;
step S320, sending an IGMP request to the channel multicast group, so that the channel multicast group sends multicast streaming media data according to the IGMP request;
step S330, receiving the multicast streaming media data.
In this embodiment, after acquiring a multicast broadcast address according to a target channel, searching a corresponding channel multicast group according to the multicast broadcast address; and sending an IGMP request to the channel multicast group to join the channel multicast group, wherein the IGMP is a protocol for supporting multicast of the host and the router, the IGMP protocol can know to which interface of the router the multicast data should be forwarded, actually, the router keeps a table for each interface, and the table records the multicast group at least containing one host on the interface. After joining the channel multicast group, when the server sends multicast streaming media data to the channel multicast group, the player joining the channel multicast group can receive the multicast streaming media data, so that the player renders a playing picture according to the multicast streaming media data. Therefore, a corresponding channel multicast group is found through the multicast playing address, an IGMP application is proposed to join the channel multicast group, multicast streaming media data is received through the channel multicast group so as to obtain a corresponding multicast PTS and judge whether the multicast data and unicast data are synchronous or not.
In an embodiment of the present invention, after the step S400, the method further includes:
and when the first PTS lags behind the second PTS, continuing to execute the steps of acquiring the unicast streaming media data based on the unicast playing address and rendering a playing picture based on the unicast streaming media data.
In this embodiment, the first PTS is a display timestamp corresponding to a currently played unicast frame, and the second PTS is a PTS of a first multicast frame in a temporary container for storing multicast streaming media data. When the first PTS lags behind the second PTS, the playing sequence of the video picture of the currently rendered and played unicast frame is before the playing sequence of the video picture corresponding to the first multicast frame, and the unicast frame corresponding to the unicast streaming media data needs to be continuously played until the picture of the currently rendered and played unicast frame is the same as the picture of the rendered and played first multicast frame, and the picture is switched to the rendering and playing picture based on the multicast streaming media data. Therefore, the switching between unicast and multicast is realized by comparing the PTS of the unicast frame of the current rendering playing picture with the PTS of the first multicast frame in the temporary container, and the application range of the scheme is expanded.
In an embodiment of the present invention, before the step of rendering the playing screen based on the multicast streaming media data, the method further includes:
when the first PTS leads the second PTS, discarding the multicast frame with the PTS lagging the first PTS, and closing the unicast thread;
and executing the step of rendering the playing picture based on the multicast streaming media data according to the residual multicast frames.
In this embodiment, the first PTS is a display timestamp corresponding to a currently played unicast frame, and the second PTS is a PTS of a first multicast frame in a temporary container for storing multicast streaming media data. When the first PTS is ahead of the second PTS, the playing sequence of the video picture of the current rendering and playing unicast frame is behind the playing sequence of the video picture corresponding to the first multicast frame, and then the multicast frame corresponding to the current playing frame can be directly switched to continue playing, and the unicast thread is closed. Therefore, the switching between unicast and multicast is realized by comparing the PTS of the unicast frame of the current rendering playing picture with the PTS of the first multicast frame in the temporary container, and the application range of the scheme is expanded.
In an embodiment of the present invention, after the step of acquiring unicast streaming media data based on the unicast address, the method further includes:
separating unicast streaming media data to obtain a unicast frame, reading and storing the PTS of the unicast frame;
and injecting the unicast frame into a decoding buffer area to wait for decoding and rendering.
In this embodiment, after receiving unicast streaming media data sent by the unicast server to the player, the PTS corresponding to each audio/video frame, i.e., the unicast frame, in the unicast streaming media data is read and stored, so that after the PTS of the multicast frame is read, the PTS of the unicast frame and the PTS of the multicast frame are compared to determine whether unicast and multicast are synchronous, and further, switching between unicast and multicast is implemented. And when the PTS of the unicast frame is read and stored, the unicast frame is injected into a decoding buffer area to wait for decoding and rendering, and a playing picture is rendered based on the unicast frame, so that the condition of long waiting time when a user switches channels due to waiting for the multicast frame is avoided. Therefore, the unicast frame is obtained by separating the unicast streaming media data, and the PTS of the unicast frame is read and stored to compare the corresponding PTS of the unicast frame and the multicast frame, so that the synchronization of unicast and multicast is realized, and the application range of the scheme is expanded.
In an embodiment of the present invention, after the step of acquiring multicast streaming media data based on the multicast address, the method further includes:
separating multicast streaming media data to obtain a multicast frame, and reading a PTS (partial transmit time) of the multicast frame;
and storing the multicast frame and the corresponding PTS into a temporary container, so as to obtain multicast streaming media data from the temporary container when the PTS of the unicast frame is ahead or synchronous to the PTS of the multicast frame, and rendering a playing picture based on the multicast streaming media data.
In this embodiment, when multicast streaming media data is received, the multicast streaming media data is separated to obtain a multicast frame. And reading the PTS of the multicast frame, storing the multicast frame and the corresponding PTS into a temporary container so as to compare the PTS of the unicast frame of the current playing picture with the PTS corresponding to the first multicast frame in the temporary container, and if the PTS of the unicast frame corresponding to the current playing picture is advanced or synchronous with the PTS corresponding to the first multicast frame in the temporary container, switching to rendering the playing picture based on multicast streaming media data after discarding the multicast frame of which the PTS lags behind the PTS of the current unicast frame, and closing a unicast thread. Therefore, the multicast frame is obtained by separating the multicast streaming media data, and the PTS of the multicast frame is read and stored to compare the corresponding PTS of the unicast frame and the multicast frame, so that the synchronization of unicast and multicast is realized, and the application range of the scheme is expanded.
In order to achieve the above object, the present invention further provides a fast channel switching player, which includes a memory, a processor, and a fast channel switching program stored in the memory and operable on the processor, wherein the fast channel switching program, when executed by the processor, implements the steps of the fast channel switching method described in any one of the above.
In order to achieve the above object, the present invention further provides a readable storage medium, which stores a channel fast switching program, and the channel fast switching program, when executed by a processor, implements the steps of the channel fast switching method according to any one of the above items.
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.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. 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 (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A fast channel switching method is characterized in that the fast channel switching method comprises the following steps:
when a channel switching instruction is received, acquiring a unicast playing address and a multicast playing address corresponding to a target channel;
acquiring unicast streaming media data based on the unicast playing address, and rendering a playing picture based on the unicast streaming media data;
acquiring multicast streaming media data based on the multicast playing address;
reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data;
rendering a play screen based on the multicast streaming media data when the first PTS leads or is synchronized with the second PTS.
2. The method for fast switching channel according to claim 1, wherein the step of obtaining the unicast streaming media data based on the unicast playing address comprises:
searching a corresponding unicast server according to the unicast playing address;
sending a data request instruction to the unicast server, so that the unicast server sends unicast streaming media data after receiving the data request instruction;
and receiving the unicast streaming media data.
3. The fast channel switching method according to claim 1, wherein the step of acquiring multicast streaming media data based on the multicast broadcast address comprises:
searching a corresponding channel multicast group according to the multicast playing address;
sending an IGMP request to the channel multicast group, so that the channel multicast group sends multicast streaming media data according to the IGMP request;
and receiving the multicast streaming media data.
4. The method for fast switching channels according to claim 1, wherein after the step of reading a first PTS corresponding to a unicast frame in the unicast streaming media data and a second PTS corresponding to a multicast frame in the multicast streaming media data, the method further comprises:
and when the first PTS lags behind the second PTS, continuing to execute the steps of acquiring the unicast streaming media data based on the unicast playing address and rendering a playing picture based on the unicast streaming media data.
5. The fast channel switching method according to claim 1, wherein the step of rendering the playing picture based on the multicast streaming media data is preceded by:
when the first PTS leads the second PTS, discarding the multicast frame with the PTS lagging the first PTS, and closing the unicast thread;
and executing the step of rendering the playing picture based on the multicast streaming media data according to the residual multicast frames.
6. The method for fast switching channel according to claim 1, wherein the step of obtaining the unicast streaming media data based on the unicast playing address further comprises:
separating unicast streaming media data to obtain a unicast frame, reading and storing the PTS of the unicast frame;
and injecting the unicast frame into a decoding buffer area to wait for decoding and rendering.
7. The fast channel switching method according to claim 1, wherein the step of obtaining multicast streaming media data based on the multicast broadcast address further comprises:
separating multicast streaming media data to obtain a multicast frame, and reading a PTS (partial transmit time) of the multicast frame;
and storing the multicast frame and the corresponding PTS into a temporary container, so as to obtain multicast streaming media data from the temporary container when the PTS of the unicast frame is ahead or synchronous to the PTS of the multicast frame, and rendering a playing picture based on the multicast streaming media data.
8. A zapping player comprising a memory, a processor and a zapping program stored on the memory and executable on the processor, the zapping program when executed by the processor implementing the steps of the zapping method as claimed in any one of claims 1 to 7.
9. A readable storage medium, wherein a channel fast switching program is stored on the readable storage medium, and when executed by a processor, the channel fast switching program implements the steps of the channel fast switching method according to any one of claims 1 to 7.
CN202110746639.4A 2021-06-30 2021-06-30 Channel fast switching method, player and readable storage medium Pending CN113507639A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110746639.4A CN113507639A (en) 2021-06-30 2021-06-30 Channel fast switching method, player and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110746639.4A CN113507639A (en) 2021-06-30 2021-06-30 Channel fast switching method, player and readable storage medium

Publications (1)

Publication Number Publication Date
CN113507639A true CN113507639A (en) 2021-10-15

Family

ID=78009865

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110746639.4A Pending CN113507639A (en) 2021-06-30 2021-06-30 Channel fast switching method, player and readable storage medium

Country Status (1)

Country Link
CN (1) CN113507639A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114786029A (en) * 2022-04-18 2022-07-22 青岛海信宽带多媒体技术有限公司 Intelligent set top box and live channel switching method
CN114827747A (en) * 2022-06-29 2022-07-29 广州市广播电视台 Streaming media data switching method, device, equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656869A (en) * 2008-08-21 2010-02-24 华为技术有限公司 Method, device and system for switching channels
EP2472799A1 (en) * 2009-08-24 2012-07-04 ZTE Corporation Method, apparatus and system for rapid acquisition of multicast realtime transport protocol sessions
US20120269075A1 (en) * 2011-04-20 2012-10-25 Mobitv, Inc. Methods and apparatus for broadcast and multicast/unicast transition
CN104702994A (en) * 2013-12-06 2015-06-10 中兴通讯股份有限公司 Media play method, media play device and set top box
CN106412719A (en) * 2015-08-03 2017-02-15 中国移动通信集团江苏有限公司 Realization method of video mixture play, apparatus and system thereof
CN112511894A (en) * 2020-09-11 2021-03-16 深圳市华曦达科技股份有限公司 OTT channel switching method, OTT channel switching device, electronic equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101656869A (en) * 2008-08-21 2010-02-24 华为技术有限公司 Method, device and system for switching channels
EP2472799A1 (en) * 2009-08-24 2012-07-04 ZTE Corporation Method, apparatus and system for rapid acquisition of multicast realtime transport protocol sessions
US20120269075A1 (en) * 2011-04-20 2012-10-25 Mobitv, Inc. Methods and apparatus for broadcast and multicast/unicast transition
CN104702994A (en) * 2013-12-06 2015-06-10 中兴通讯股份有限公司 Media play method, media play device and set top box
CN106412719A (en) * 2015-08-03 2017-02-15 中国移动通信集团江苏有限公司 Realization method of video mixture play, apparatus and system thereof
CN112511894A (en) * 2020-09-11 2021-03-16 深圳市华曦达科技股份有限公司 OTT channel switching method, OTT channel switching device, electronic equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114786029A (en) * 2022-04-18 2022-07-22 青岛海信宽带多媒体技术有限公司 Intelligent set top box and live channel switching method
CN114786029B (en) * 2022-04-18 2024-02-27 青岛海信宽带多媒体技术有限公司 Intelligent set top box and live channel switching method
CN114827747A (en) * 2022-06-29 2022-07-29 广州市广播电视台 Streaming media data switching method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109168078B (en) Video definition switching method and device
US10250949B2 (en) Broadcast content to HTTP client conversion
US8286213B2 (en) HTTP based video streaming apparatus and method in mobile communication system
TWI716018B (en) Dynamic reduction in playout of replacement content to help align end of replacement content with end of replaced content
US7792998B2 (en) System and method for providing real-time streaming service between terminals
US20100262711A1 (en) Systems, methods, and apparatuses for media file streaming
EP2924998A1 (en) Method, apparatus and system for acquiring playback data stream of real-time video communication
CN107819809B (en) Method and device for synchronizing content
US11321516B2 (en) Processing dynamic web content of an ISO BMFF web resource track
CN113507639A (en) Channel fast switching method, player and readable storage medium
US20180176278A1 (en) Detecting and signaling new initialization segments during manifest-file-free media streaming
WO2018028547A1 (en) Channel switching method and device
JP2003284037A (en) Multimedia data reception device and method therefor, and multimedia data transmission device and method therefor
WO2011112784A1 (en) Method and system for inhibiting audio-video synchronization delay
WO2015180446A1 (en) System and method for maintaining connection channel in multi-device interworking service
TWI820227B (en) Initialization set for network streaming of media data
CN111866526B (en) Live broadcast service processing method and device
CN114553839A (en) RTC data processing method and device
JP2022551436A (en) Random Access at Resynchronization Points of DASH Segments
TW202127897A (en) Multiple decoder interface for streamed media data
WO2023231478A1 (en) Audio and video sharing method and device, and computer-readable storage medium
WO2018171567A1 (en) Method, server, and terminal for playing back media stream
US20150189231A1 (en) Video conferencing system
WO2021195398A1 (en) Determination of availability of chunks of data for network streaming media data
KR102209782B1 (en) Method for providing of streamming service and apparatus for the same

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20211015