CN108600826A - A kind of method and device playing TS streams - Google Patents
A kind of method and device playing TS streams Download PDFInfo
- Publication number
- CN108600826A CN108600826A CN201810496351.4A CN201810496351A CN108600826A CN 108600826 A CN108600826 A CN 108600826A CN 201810496351 A CN201810496351 A CN 201810496351A CN 108600826 A CN108600826 A CN 108600826A
- Authority
- CN
- China
- Prior art keywords
- streams
- audio
- video
- information
- multicast
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000012545 processing Methods 0.000 claims abstract description 11
- 230000008676 import Effects 0.000 claims abstract description 7
- 238000012544 monitoring process Methods 0.000 claims description 6
- 230000003139 buffering effect Effects 0.000 claims description 2
- 238000000926 separation method Methods 0.000 claims 1
- 238000002347 injection Methods 0.000 abstract description 10
- 239000007924 injection Substances 0.000 abstract description 10
- 230000008569 process Effects 0.000 description 11
- 238000010586 diagram Methods 0.000 description 6
- 239000000243 solution Substances 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 4
- 241001269238 Data Species 0.000 description 2
- 239000008186 active pharmaceutical agent Substances 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 230000006378 damage Effects 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000000750 progressive effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/434—Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
- H04N21/4341—Demultiplexing of audio and video streams
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/434—Disassembling of a multiplex stream, e.g. demultiplexing audio and video streams, extraction of additional data from a video stream; Remultiplexing of multiplex streams; Extraction or processing of SI; Disassembling of packetised elementary stream
- H04N21/4345—Extraction or processing of SI, e.g. extracting service information from an MPEG stream
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/44—Processing 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/44004—Processing 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 video buffer management, e.g. video decoder buffer or video display buffer
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing 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/443—OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB
- H04N21/4431—OS processes, e.g. booting an STB, implementing a Java virtual machine in an STB or power management in an STB characterized by the use of Application Program Interface [API] libraries
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/60—Network 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/63—Control 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/64—Addressing
- H04N21/6405—Multicasting
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/80—Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
- H04N21/85—Assembly of content; Generation of multimedia applications
- H04N21/858—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot
- H04N21/8586—Linking data to content, e.g. by linking an URL to a video object, by creating a hotspot by using a URL
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Library & Information Science (AREA)
- Software Systems (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
This application provides a kind of method and device of broadcasting TS streams, this method includes:Receive TS streams to be played;It parses TS and flows corresponding URL parameter, obtain programme information;By programme information and TS streams, by SDK, [api interface imports in DEMUX hardware, to carry out audio and video separating treatment;Information after progress audio and video separating treatment is imported and carries out audio/video decoding processing in DECODE hardware;To carry out audio/video decoding, treated that information plays out.This method transmits complete programme information by URL, avoids obtaining programme information using TS streams, to save the time;Injection and the broadcasting that TS streams are realized using SDKAPI interfaces, the conveniences feature such as make full use of interface high efficiency and can support more coding type, high stability, to quickly decode media format and successfully play out image, improve user experience.
Description
Technical field
This application involves field of video broadcasting technology more particularly to a kind of method and devices playing TS streams.
Background technology
In video playing, live streaming class App, video processing mode includes hard decoder and soft decoding, wherein soft decoding is one
Kind is decoded processing by CPU by software to video, by way of exactly running coding and decoding video code CPU;Firmly
Decoding is a kind of mode original whole transferred to CPU come a part for the video data handled and transfer to GPU to do, and GPU
Concurrent operation ability will be significantly larger than CPU, can greatly reduce the load to CPU in this way, after the occupancy of CPU is relatively low
Some other programs can be run simultaneously.Therefore, the hard solution of video has more smooth, more power saving excellent compared with soft solution
Gesture.
Native Media are a kind of currently used hard decoder modes, however its stability problem annoyings always greatly
Family is mainly manifested in and using process, is occurring the machine collapse suddenly, and its can only decode it is H.264+AAC this common and
The video and audio type combination of the format of standard, and be with regard to incapability for formats such as other codec formats, such as mpeg2 or ac3
Power, moreover, when playing injection flow data, for code stream H.264, it is necessary to when analyzing sps and pps Data Identification blocks,
It can just start to inject when namely what is often called key I frame data, otherwise decode video pictures needs and wait for a long time.Therefore, these are asked
Topic has greatly influenced user experience, it is desirable to provide a kind of new mode solves these problems.
Invention content
In view of this, this application provides it is a kind of broadcasting TS stream method and device, with overcome in the prior art video it is hard
Solution is susceptible to the machine collapse, and narrow application range, decoding process is complicated, speed is slow, the problem of influencing user experience.
To achieve the above object, this application provides following technical schemes:
A method of TS streams being played, this method includes:
Receive TS streams to be played;
It parses the TS and flows corresponding URL parameter, obtain programme information;
The programme information and TS streams are imported by SDK api interfaces in DEMUX hardware, to carry out audio and video
Separating treatment;
Information after progress audio and video separating treatment is imported and carries out audio/video decoding processing in DECODE hardware;
To carry out audio/video decoding, treated that information plays out.
Preferably, reception TS streams to be played include:
It parses the TS and flows corresponding URL parameter, to determine multicast request type and create multicast reception channel;
Two-way domain name socket is created, and the write-in end of the two-way domain name socket is added to the first IO multiplexings
Device;
When the TS is flowed and reached, by TS streams caching to the shared buffer of the two-way domain name socket distribution.
Preferably, described that the programme information and TS streams are imported into it in DEMUX hardware by SDK api interfaces
Before, further include:
The reading end of the two-way domain name socket is added to the second I/O multiplexer, to monitor arriving for the TS streams
It reaches.
Preferably, the parsing TS flows corresponding URL parameter, to determine multicast request type and create multicast reception
Channel includes:
Multicast request type is determined according to the prefix of the URL parameter, according to the multicast address of the URL parameter and port
Create multicast reception channel.
Preferably, further include:When a failure occurs it, stop the broadcasting to decoded information, and discharge playing resource.
A kind of device playing TS streams, the device include:
Receiving unit, for receiving TS streams to be played;
Resolution unit flows corresponding URL parameter for parsing the TS, obtains programme information;
Separative element, for the programme information and TS streams to be imported DEMUX hardware by SDK api interfaces
In, to carry out audio and video separating treatment;
Decoding unit is used to carry out the information after audio and video separating treatment and imports progress audio and video solution in DECODE hardware
Code processing;
Broadcast unit, treated for will carry out audio/video decoding, and information plays out.
Preferably, the receiving unit includes:
Sub- resolution unit flows corresponding URL parameter, to determine multicast request type and create multicast for parsing the TS
Receiving channel;
Creating unit is added to for creating two-way domain name socket, and by the write-in end of the two-way domain name socket
First I/O multiplexer;
Buffer unit, for when the TS is flowed and reached, TS streams caching to the two-way domain name socket to be distributed
Shared buffer.
Preferably, further include:
Monitoring unit, for the reading end of the two-way domain name socket to be added to the second I/O multiplexer, with prison
Control the arrival of the TS streams.
Preferably, the sub- resolution unit is specifically used for determining multicast request type, root according to the prefix of the URL parameter
Multicast reception channel is created according to the multicast address of the URL parameter and port.
Preferably, further include:
Releasing unit, for when a failure occurs it, stopping the broadcasting to decoded information, and discharge playing resource.
By above technical scheme it is found that the method for broadcasting TS provided by the present application streams, parsing TS flow corresponding URL ginsengs
Number, obtains programme information, directly transmits complete programme information by URL, avoids and obtains programme information by parsing TS streams,
To save the time;Injection and the broadcasting for directly realizing TS streams in the application using SDK api interfaces, make full use of interface height
Efficiency and the conveniences feature such as can support more coding type, high stability, simultaneously to quick decoding media format
Successfully play out image.The program provided by the present application can realize quick multicast data flow data playback, quickly play display
Go out audio and video picture, and media format can be decoded, improves user experience.
Description of the drawings
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of the method for broadcasting TS streams that the embodiment of the present application one provides;
Fig. 2 is a kind of flow chart of the method for broadcasting TS streams that the embodiment of the present application two provides;
Fig. 3 is a kind of flow chart of the method for reception TS streams to be played that the embodiment of the present application two provides;
Fig. 4 is a kind of structural schematic diagram of the device for broadcasting TS streams that the embodiment of the present application three provides;
Fig. 5 is a kind of structural schematic diagram of the device for broadcasting TS streams that the embodiment of the present application four provides;
Fig. 6 is a kind of structural schematic diagram for receiving unit that the embodiment of the present application four provides.
Specific implementation mode
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete
Site preparation describes, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on
Embodiment in the present invention, it is obtained by those of ordinary skill in the art without making creative efforts every other
Embodiment shall fall within the protection scope of the present invention.
For overcome in the prior art the hard solution of video be susceptible to the machine collapse, and narrow application range, decoding process is complicated, speed
The problem of spending slowly, influencing user experience, this application provides a kind of method and device of quick broadcasting TS streams, concrete scheme is as follows
It is described:
Embodiment one
The embodiment of the present application one provides a kind of method of broadcasting TS streams, and as shown in FIG. 1, FIG. 1 is the embodiment of the present application one
A kind of flow chart of the method for the broadcasting TS streams provided, this method include:
S101:Receive TS streams to be played;
S102:It parses TS and flows corresponding URL parameter, obtain programme information;
Specifically, in this application, according to corresponding URL (the Uniform Resource of TS streams to be played
Locator, uniform resource locator) parameter, audio and video parameter is parsed, format is as follows:"program://19audio_
Stream_pid=257&audio_stream_type=audio_aac&video_stream_ pid=256&video_
Stream_type=video_h264&pcr_stream_pid=256 ", the exactly actual program parsed according to format
At audio and video.
The application directly transmits complete programme information by URL, avoids and obtains programme information by parsing TS streams, from
And save the time.
S103:Programme information and TS streams are imported by SDK api interfaces in DEMUX hardware, to carry out audio and video point
From processing;
Using SDK api interfaces directly in the application realize TS stream injection and broadcasting, make full use of interface high efficiency and
The conveniences feature such as more coding type, high stability can be supported, to quickly decode media format and successfully broadcast
Release image.
S104:Information after progress audio and video separating treatment is imported and carries out audio/video decoding processing in DECODE hardware;
S105:To carry out audio/video decoding, treated that information plays out.
By above technical scheme it is found that the method for the broadcasting TS streams that the embodiment of the present application one provides, parsing TS streams correspond to
URL parameter, obtain programme information, complete programme information directly transmitted by URL, avoid by parse TS streams saved
Mesh information, to save the time;Directly realize injection and the broadcasting of TS streams, fully profit in the application using SDK api interfaces
With interface high efficiency and the conveniences feature such as can support more coding type, high stability, to quickly decode a variety of matchmakers
Physique formula simultaneously successfully plays out image.The program provided by the present application can realize quick multicast data flow data playback, quickly
Broadcasting shows audio and video picture, and can decode media format, provides user experience.
Embodiment two
On the basis of embodiment one, the embodiment of the present application two provides a kind of more specific method for playing TS streams, such as
Shown in Fig. 2, Fig. 2 is a kind of flow chart of the method for broadcasting TS streams that the embodiment of the present application two provides, and this method includes:
S101:Receive TS streams to be played;
Specifically, as shown in figure 3, Fig. 3 is a kind of method for reception TS streams to be played that the embodiment of the present application two provides
Flow chart, this method includes:
S1011:It parses TS and flows corresponding URL parameter, to determine multicast request type and create multicast reception channel;
The step specifically may include:Multicast request type is determined according to the prefix of URL parameter, according to the multicast of URL parameter
Address and port create multicast reception channel.
Specifically, in this application, according to the URL parameter of broadcasting, such as udp://224.0.0.1:8000/media/
play/1.ts, its prefix " udp is analyzed first:// " confirm that this is a multicast request type.Then according to multicast address (example
Such as " 224.0.0.1 " in above-mentioned parameter) and port (such as " 8000 " in above-mentioned parameter after multicast address) create multicast connect
Receive channel.Question markNumber content be transmitted in playing module.
It should be noted that in this application, the process that multicast reception channel is created according to multicast address and port includes:
The socket of a SOCK_DGRAM type is initially set up, then the address of the specified port binding local reception network interface card of basis,
Multicast address is added in multicast group again, recycles receiving multicast data.
S1012:Two-way domain name socket is created, and the write-in end of two-way domain name socket is added to the first IO multichannels and is answered
Use device;
In the application, two-way domain name socket is the channel for carrying out data interaction with playing module.Specifically, wound
The process of building can utilize a pair of socket being connected with each other that socketpiar is created, and any one section can both send, can also
Do receiving terminal.It should be there are two buf in all each socket descriptors.One is transmission buf, and one is to receive buf.
The advantage for creating the two-way domain name socket includes:The particular attribute of socket, a similar cycle can be utilized
Buffering area, and the buffer size sent and received can be adjusted;Socket is a file handle, and it is multiple that IO multichannels can be added
With device, write-in end is added to IO multiplexings here, to realize the passive wake-up of " wait for the arrival of news and be ready to ", is avoided actively
Poll wastes the CPU time;Data reception module obtains the file handle at socket write-in end, playing module obtains socket and reads
End.By the monitoring of socket, data reception module and playing module the two modules can be completely independent, reduce intermodule
Coupling.
S1013:When TS is flowed and reached, TS streams are cached into the shared buffer distributed to two-way domain name socket.
It should be noted that in the application, step S101 and its associated satellite step are completed by data reception module,
Subsequent step is completed by playing module.
S102:It parses TS and flows corresponding URL parameter, obtain programme information;
Specifically, flowing corresponding URI parameters according to TS, audio and video parameter is parsed, format is as follows:"program://19
Audio_stream_pid=257&audio_stream_type=audio_aac&video_s tream_pid=256&
Video_stream_type=video_h264&pcr_stream_pid=256 ", parsed according to format is exactly current
At the audio and video of program.
The application directly transmits complete programme information by URL, avoids and obtains programme information by parsing TS streams, from
And save the time.
Start the player in playing module according to the programme information of acquisition, which may be based on applying and be opened in APP
Hair realizes the view for playing and presenting and controlling using JAVA, and realizes multicast data reception and send, compiled finally by C language
The player of the TS streams of Cheng Shixian, hereinafter referred to as TSPlayer.
The SDK api interfaces that TSPlayer directly invokes set-top box realize that software can be divided into three layers on general set-top box:
Application layer refers to the various application software of installation, and the management of resource and function logic are packaged into application layer tune of accommodating by ccf layer
Interface layer, connecing for realizing driving, conveniently to what ccf layer called by one layer of the realization of SDK Ceng Zhi hardware set-top boxes producer
Mouth layer, this layer interface are commonly referred to as SDK api layers.The application makes full use of the convenience feature of SDK api interfaces, encapsulates
The basic interface of a set of broadcasting, such as establishment, beginning, data injection, volume adjustment, video size setting, stopping, destruction.
In the present embodiment, can also include, but nonessential includes step S103:By the reading end of two-way domain name socket
It is added to the second I/O multiplexer, to monitor the arrival of TS streams;
Specifically, the reading end of socket is added in IO multiplexings, its reading of the arrival notice of the pending datas such as monitoring
Evidence of fetching avoids active poll from wasting the CPU time to realize the passive wake-up of " wait for the arrival of news and be ready to ".
S104:Programme information and TS streams are imported by SDK api interfaces in DEMUX hardware, to carry out audio and video point
From processing;
It detects that data arrival then wakes up digital independent process flow, is directly realized in the application using SDK api interfaces
The injection and broadcasting of TS streams, make full use of interface high efficiency and can support the conveniences such as more coding type, high stability
Feature, to quickly decode media format and successfully play out image.
S105:Information after progress audio and video separating treatment is imported and carries out audio/video decoding processing in DECODE hardware;
S106:To carry out audio/video decoding, treated that information plays out;
S107:When a failure occurs it, stop the broadcasting to decoded information, and discharge playing resource.
The method for the broadcasting TS streams that the embodiment of the present application two provides, the abundant audio and video supported using platform SDK API
Codec format, the quick and stable TS flow data playing functions for realizing a set of efficient multicast source.Directly pass through URL
Complete programme information is transmitted, avoids and obtains programme information by parsing TS streams, to save the time;Utilize SDK API
Interface directly realizes injection and the broadcasting of TS streams in the application, makes full use of interface high efficiency and can support more codec class
The conveniences feature such as type, high stability, to quickly decode media format and successfully play out image.It is provided by the present application
The program can realize quick multicast data flow data playback, quickly play and show audio and video picture, and can decode a variety of
Media formats improve user experience.
Embodiment three
On the basis of embodiment one, the embodiment of the present application three provides a kind of device of broadcasting TS streams, as shown in figure 4,
Fig. 4 is a kind of structural schematic diagram of the device for broadcasting TS streams that the embodiment of the present application three provides.The device includes:
Receiving unit 201, for receiving TS streams to be played;
Resolution unit 202 flows corresponding URL parameter for parsing TS, obtains programme information;
Separative element 203, for by programme information and TS stream by SDK api interfaces import DEMUX hardware in, with into
Row audio and video separating treatment;
Decoding unit 204 is regarded for the information after progress audio and video separating treatment to be imported progress sound in DECODE hardware
Frequency decoding process;
Broadcast unit 205, treated for will carry out audio/video decoding, and information plays out.
By above technical scheme it is found that the device for the broadcasting TS streams that the embodiment of the present application three provides, connected URL transmission
Complete programme information avoids and obtains programme information by parsing TS streams, to save the time;Utilize SDK api interfaces
Directly in the application realize TS stream injection and broadcasting, make full use of interface high efficiency and can support more coding type,
The conveniences feature such as high stability, to quickly decode media format and successfully play out image.It is provided by the present application to be somebody's turn to do
Scheme can realize quick multicast data flow data playback, quickly play and show audio and video picture, and can decode a variety of matchmakers
Physique formula, improves user experience.
Example IV
The embodiment of the present application four provides a kind of more specific device for playing TS streams, as shown in figure 5, Fig. 5 is the application
A kind of structural schematic diagram of the device for broadcasting TS streams that example IV provides.The device includes:
Receiving unit 201, for receiving TS streams to be played;
As shown in fig. 6, Fig. 6 is a kind of structural schematic diagram for receiving unit that the embodiment of the present application four provides.The reception list
Member includes:
Sub- resolution unit 2011 flows corresponding URL parameter, to determine multicast request type and create multicast for parsing TS
Receiving channel;
The sub- resolution unit is specifically used for determining multicast request type according to the prefix of URL parameter, according to the group of URL parameter
It broadcasts address and port and creates multicast reception channel.
Creating unit 2012 is added to for creating two-way domain name socket, and by the write-in end of two-way domain name socket
First I/O multiplexer;
Write-in end is added to IO multiplexings, to realize the passive wake-up of " wait for the arrival of news and be ready to ", is avoided actively
Poll wastes the CPU time.
Buffer unit 2013, for when TS is flowed and reached, TS streams caching to two-way domain name socket being distributed shared slow
Rush area.
It should be noted that receiving unit and attached several subelements belong to data reception module, that is, it has been used for
At the function of data receiver.
Resolution unit 202 flows corresponding URL parameter for parsing TS, obtains programme information;
The application directly transmits complete programme information by URL, avoids and obtains programme information by parsing TS streams, from
And save the time.
In this embodiment, it can also include, but nonessential include:Monitoring unit 203 is used for two-way domain name socket
It reads end and is added to the second I/O multiplexer, to monitor the arrival of TS streams.
Specifically, the reading end of socket is added in IO multiplexings, its reading of the arrival notice of the pending datas such as monitoring
Evidence of fetching avoids active poll from wasting the CPU time to realize the passive wake-up of " wait for the arrival of news and be ready to ".
Separative element 204, for by programme information and TS stream by SDK api interfaces import DEMUX hardware in, with into
Row audio and video separating treatment;
Decoding unit 205 is regarded for the information after progress audio and video separating treatment to be imported progress sound in DECODE hardware
Frequency decoding process;
Broadcast unit 206, treated for will carry out audio/video decoding, and information plays out.
Releasing unit 207, for when a failure occurs it, stopping the broadcasting to decoded information, and discharge playing resource.
By above technical scheme it is found that the device for the broadcasting TS streams that the embodiment of the present application four provides, utilizes platform
The abundant audio/video decoding format of SDKAPI supports, the quick and stable TS fluxions for realizing a set of efficient multicast source
According to playing function.Complete programme information is directly transmitted by URL, avoids and obtains programme information by parsing TS streams, to
Save the time;Injection and the broadcasting for directly realizing TS streams in the application using SDK api interfaces, make full use of interface high efficiency
And the conveniences feature such as can support more coding type, high stability, to quickly decode media format and successfully
Play out image.The program provided by the present application can realize quick multicast data flow data playback, quickly play and show sound
Video pictures, and media format can be decoded, improve user experience.
It should be noted that same or analogous part can mutually refer between each embodiment of the application, in this application
It repeats no more.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by
One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation
Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning
Covering non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only that
A little elements, but also include other elements that are not explicitly listed, or further include for this process, method, article or
The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged
Except there is also other identical elements in the process, method, article or apparatus that includes the element.
Each embodiment is described by the way of progressive in this specification, the highlights of each of the examples are with other
The difference of embodiment, just to refer each other for identical similar portion between each embodiment.
The foregoing description of the disclosed embodiments enables professional and technical personnel in the field to realize or use the application.
Various modifications to these embodiments will be apparent to those skilled in the art, as defined herein
General Principle can in other embodiments be realized in the case where not departing from spirit herein or range.Therefore, the application
It is not intended to be limited to the embodiments shown herein, and is to fit to and the principles and novel features disclosed herein phase one
The widest range caused.
Claims (10)
1. a kind of method playing TS streams, which is characterized in that this method includes:
Receive TS streams to be played;
It parses the TS and flows corresponding URL parameter, obtain programme information;
The programme information and TS streams are imported by SDKAPI interfaces in DEMUX hardware, to carry out audio and video separation
Processing;
Information after progress audio and video separating treatment is imported and carries out audio/video decoding processing in DECODE hardware;
To carry out audio/video decoding, treated that information plays out.
2. according to the method described in claim 1, it is characterized in that, described receive TS streams to be played and include:
It parses the TS and flows corresponding URL parameter, to determine multicast request type and create multicast reception channel;
Two-way domain name socket is created, and the write-in end of the two-way domain name socket is added to the first I/O multiplexer;
When the TS is flowed and reached, by TS streams caching to the shared buffer of the two-way domain name socket distribution.
3. according to the method described in claim 2, it is characterized in that, the programme information and the TS streams are passed through described
Before SDKAPI interfaces import in DEMUX hardware, further include:
The reading end of the two-way domain name socket is added to the second I/O multiplexer, to monitor the arrival of the TS streams.
4. according to the method described in claim 2, it is characterized in that, the parsing TS flows corresponding URL parameter, with determination
Multicast request type simultaneously creates multicast reception channel and includes:
Multicast request type is determined according to the prefix of the URL parameter, is created according to the multicast address of the URL parameter and port
Multicast reception channel.
5. according to the method described in claim 1, it is characterized in that, further including:When a failure occurs it, stop to decoded letter
The broadcasting of breath, and discharge playing resource.
6. a kind of device playing TS streams, which is characterized in that the device includes:
Receiving unit, for receiving TS streams to be played;
Resolution unit flows corresponding URL parameter for parsing the TS, obtains programme information;
Separative element, for by the programme information and the TS stream by SDKAPI interfaces import DEMUX hardware in, with into
Row audio and video separating treatment;
Decoding unit is used to carry out the information after audio and video separating treatment and imports in DECODE hardware at progress audio/video decoding
Reason;
Broadcast unit, treated for will carry out audio/video decoding, and information plays out.
7. device according to claim 6, which is characterized in that the receiving unit includes:
Sub- resolution unit flows corresponding URL parameter, to determine multicast request type and create multicast reception for parsing the TS
Channel;
Creating unit is added to first for creating two-way domain name socket, and by the write-in end of the two-way domain name socket
I/O multiplexer;
Buffer unit, for when the TS is flowed and reached, TS streams caching to be total to what the two-way domain name socket distributed
Enjoy buffering area.
8. device according to claim 7, which is characterized in that further include:
Monitoring unit, for the reading end of the two-way domain name socket to be added to the second I/O multiplexer, to monitor
State the arrival of TS streams.
9. device according to claim 7, which is characterized in that the sub- resolution unit is specifically used for being joined according to the URL
Several prefixes determines multicast request type, and multicast reception channel is created according to the multicast address of the URL parameter and port.
10. device according to claim 6, which is characterized in that further include:
Releasing unit, for when a failure occurs it, stopping the broadcasting to decoded information, and discharge playing resource.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810496351.4A CN108600826B (en) | 2018-05-22 | 2018-05-22 | Method and device for playing TS (transport stream) |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810496351.4A CN108600826B (en) | 2018-05-22 | 2018-05-22 | Method and device for playing TS (transport stream) |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108600826A true CN108600826A (en) | 2018-09-28 |
CN108600826B CN108600826B (en) | 2021-04-20 |
Family
ID=63632583
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810496351.4A Active CN108600826B (en) | 2018-05-22 | 2018-05-22 | Method and device for playing TS (transport stream) |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108600826B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113596495A (en) * | 2021-07-28 | 2021-11-02 | 广州方硅信息技术有限公司 | Live broadcast stream pushing processing method and device, equipment and medium thereof |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040230659A1 (en) * | 2003-03-12 | 2004-11-18 | Chase Michael John | Systems and methods of media messaging |
CN101202919A (en) * | 2007-11-06 | 2008-06-18 | 深圳市同洲电子股份有限公司 | Digital television receiver and intermediate part |
US20130218663A1 (en) * | 2010-06-07 | 2013-08-22 | Affectiva, Inc. | Affect based political advertisement analysis |
CN103796078A (en) * | 2014-01-23 | 2014-05-14 | 深圳创维-Rgb电子有限公司 | Multicast video playing method and video playing terminal |
CN105744380A (en) * | 2016-02-25 | 2016-07-06 | 深圳创维数字技术有限公司 | Media data stream playing method and system based on Android system |
CN105898496A (en) * | 2015-11-18 | 2016-08-24 | 乐视网信息技术(北京)股份有限公司 | HLS stream hardware decoding method based on Android device and device |
US20160337426A1 (en) * | 2015-05-14 | 2016-11-17 | Hola Networks Ltd. | System and Method for Streaming Content from Multiple Servers |
-
2018
- 2018-05-22 CN CN201810496351.4A patent/CN108600826B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040230659A1 (en) * | 2003-03-12 | 2004-11-18 | Chase Michael John | Systems and methods of media messaging |
CN101202919A (en) * | 2007-11-06 | 2008-06-18 | 深圳市同洲电子股份有限公司 | Digital television receiver and intermediate part |
US20130218663A1 (en) * | 2010-06-07 | 2013-08-22 | Affectiva, Inc. | Affect based political advertisement analysis |
CN103796078A (en) * | 2014-01-23 | 2014-05-14 | 深圳创维-Rgb电子有限公司 | Multicast video playing method and video playing terminal |
US20160337426A1 (en) * | 2015-05-14 | 2016-11-17 | Hola Networks Ltd. | System and Method for Streaming Content from Multiple Servers |
CN105898496A (en) * | 2015-11-18 | 2016-08-24 | 乐视网信息技术(北京)股份有限公司 | HLS stream hardware decoding method based on Android device and device |
CN105744380A (en) * | 2016-02-25 | 2016-07-06 | 深圳创维数字技术有限公司 | Media data stream playing method and system based on Android system |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113596495A (en) * | 2021-07-28 | 2021-11-02 | 广州方硅信息技术有限公司 | Live broadcast stream pushing processing method and device, equipment and medium thereof |
CN113596495B (en) * | 2021-07-28 | 2023-11-24 | 广州方硅信息技术有限公司 | Live broadcast push stream processing method and device, equipment and medium thereof |
Also Published As
Publication number | Publication date |
---|---|
CN108600826B (en) | 2021-04-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6463886B2 (en) | Receiving apparatus and method, and program | |
CN1842160B (en) | Rapid media channel changing mechanism and access network node comprising same | |
CN101159830B (en) | Apparatus for receiving adaptive broadcast signal and method thereof | |
CN100387055C (en) | Receiver | |
KR102506963B1 (en) | Receiving device, sending device, and data processing method | |
WO2012133064A1 (en) | Transmission device, transmission method, receiving device, receiving method, program, and broadcasting system | |
WO2007128194A1 (en) | Method, apparatus and system for playing audio/video data | |
KR101581818B1 (en) | A method for processing a digital broadcasting signal and an apparatus thereof | |
CN108494792A (en) | A kind of flash player plays the converting system and its working method of hls video flowings | |
US11050805B2 (en) | Method of controlling stream buffer in media playback device and related buffering device | |
JP5428734B2 (en) | Network device, information processing apparatus, stream switching method, information processing method, program, and content distribution system | |
CN103024441B (en) | A kind of method of playing television program at mobile terminal | |
CN106231363A (en) | A kind of barrage video stream transmission method and equipment thereof | |
CN101729755B (en) | Multimedia terminal | |
US8036154B2 (en) | Device and method for saving power in digital broadcasting receiver | |
KR101805424B1 (en) | Manifest mechanism in broadcast involved system | |
CN104023260A (en) | Hardware decoding implementation method and device, and player | |
CN108600826A (en) | A kind of method and device playing TS streams | |
CN1805503A (en) | Method and apparatus of implementing point-to-multipoint wireless network interconnection for digital televisions | |
CN101489068B (en) | Background sound and key pressing sound playing method and system based on built-in brower | |
WO2008083560A1 (en) | Method for transmitting program information of mobile multimedia broadcast system | |
CN102244813A (en) | Video playing method and internet television terminal applying same | |
CN103281585A (en) | Set top box (STB) device of Internet protocol television (IPTV) | |
CN107248991B (en) | IP stream scheduling system and method based on video key frame | |
KR101414638B1 (en) | IPTV receiver and method of changing channel |
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 |