CN108632642A - Streaming Media method for pushing and device - Google Patents

Streaming Media method for pushing and device Download PDF

Info

Publication number
CN108632642A
CN108632642A CN201710158093.4A CN201710158093A CN108632642A CN 108632642 A CN108632642 A CN 108632642A CN 201710158093 A CN201710158093 A CN 201710158093A CN 108632642 A CN108632642 A CN 108632642A
Authority
CN
China
Prior art keywords
fragment
stream
target medium
client
preposition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710158093.4A
Other languages
Chinese (zh)
Other versions
CN108632642B (en
Inventor
金玲
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201710158093.4A priority Critical patent/CN108632642B/en
Publication of CN108632642A publication Critical patent/CN108632642A/en
Application granted granted Critical
Publication of CN108632642B publication Critical patent/CN108632642B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/234Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs
    • H04N21/2343Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements
    • H04N21/234336Processing of video elementary streams, e.g. splicing of video streams or manipulating encoded video stream scene graphs involving reformatting operations of video signals for distribution or compliance with end-user requests or end-user device requirements by media transcoding, e.g. video is transformed into a slideshow of still pictures or audio is converted into text
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/235Processing of additional data, e.g. scrambling of additional data or processing content descriptors
    • H04N21/2355Processing of additional data, e.g. scrambling of additional data or processing content descriptors involving reformatting operations of additional data, e.g. HTML pages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/239Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests
    • H04N21/2393Interfacing the upstream path of the transmission network, e.g. prioritizing client content requests involving handling client requests
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/24Monitoring of processes or resources, e.g. monitoring of server load, available bandwidth, upstream requests
    • H04N21/2407Monitoring of transmitted content, e.g. distribution time, number of downloads
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The present invention provides a kind of Streaming Media method for pushing and devices, including:Receive the information for the request target Media Stream that client is sent;Detect whether the fragment of the predetermined quantity of the existing requested target medium stream;If detecting the fragment for the predetermined quantity that not yet there is the target medium stream, send preset preposition Media Stream is indexed to client;The data for obtaining the target medium stream generate the fragment of the target medium stream according to the data of the target medium stream of acquisition;After generating the fragment of predetermined quantity of the target medium stream, the fragment of the target medium stream is sent to client.The present invention can solve the problems, such as client blank screen caused by not generating the fragment of the predetermined quantity of target medium stream in time due to server end.

Description

Streaming Media method for pushing and device
Technical field
The present invention relates to stream media technology field, more particularly to a kind of Streaming Media method for pushing and device.
Background technology
HLS (real-time stream media protocol based on hypertext transfer protocol) is a widely used multi-media protocol, work It is as principle:Server end is many small slicing files multi-medium data cutting according to certain rule, and is generated corresponding Listing file, client downloads the listing file for including code stream burst information first, then again one by one in download list file Slicing files.By constantly updating listing file, multi-medium data may be implemented and broadcast on a web browser without plug-in unit, quasi real time It puts.
When user needs playing stream media, client passes through URL (Uniform Resoure Locator, unified resource Locator) request is connected to server end, and the request of Portable device information in the URL of request, the i.e. client obtains Take the media data of a certain video capture device.It is provided according to HLS protocol, client has to wait for server end and generates three points After piece (fragment includes at least a GOP (Group of Pictures, image group)), index could be obtained, and then obtain Data play out.If server end does not generate three fragments, then generating the time of the GOP of three fragments in server end Interior, client will be in black state.When black state is longer, it is connection failure that perhaps user, which will be considered that, may be carried out Reconnection influences user experience very much in this way.Existing solution has:By the way that the GOP durations of front-end collection equipment, GOP is arranged Duration is smaller, and the time for generating three fragments is also shorter, and the time that client is in blank screen also can be relatively small;Or service After device end generates a fragment, fragment is replicated two parts, three identical fragments has thus been obtained and has met fragment quantity These three fragments directly can be sent to client by condition at this time, thus be equivalent to reduce server end generate two fragments Stand-by period.
The inventors discovered that being had at least the following problems in above-mentioned technology:
Although above-mentioned technology can shorten the part blank screen time, still there are 3 GOP durations or 1 fragment in the blank screen time Generated time with replicate 2 parts of the sum of time, the blank screen time longer in this way is still higher than the vision delay of human eye, can not be by People ignores, this will allow video viewers still to see the blank screen of certain time.
Invention content
In view of this, a kind of Streaming Media method for pushing of present invention offer and device, preferably to solve due to server end Caused by not generating the fragment of the predetermined quantity of target medium stream in time the problem of client blank screen.
Specifically, including technical solution below:
On the one hand, the present invention provides a kind of Streaming Media method for pushing, including:
Receive the information for the request target Media Stream that client is sent;
Detect whether the fragment of the predetermined quantity of the existing requested target medium stream;
If detecting the fragment for the predetermined quantity that not yet there is the target medium stream, preset preposition Media Stream is sent Be indexed to the client, to indicate preposition Media Stream described in the client terminal playing;
The data for obtaining the target medium stream generate the target matchmaker according to the data of the target medium stream of acquisition The fragment of body stream;
After generating the fragment of predetermined quantity of the target medium stream, the fragment of the target medium stream is sent to described Client.
Selectively, the total duration of the preposition Media Stream be not less than from start to obtain the data of the target medium stream to Generate the required duration of fragment of the predetermined quantity of the target medium stream.
Selectively, the data of the target medium stream according to acquisition generate the fragment of the target medium stream, Including:
The data of the target medium stream based on acquisition generate image group, according to the duration of single image group and preset The duration of minimum fragment selects a certain number of image groups to form fragment.
Selectively, it is described send preset preposition Media Stream be indexed to the client, indicate that the client is broadcast The preposition Media Stream is put, including:
Send preset preposition Media Stream is indexed to client, receives the acquisition preposition Media Stream of the client The corresponding fragment of index request, and send the fragment of the preposition Media Stream to the client, so that the client Play the preposition Media Stream;Or,
Send preset preposition Media Stream is indexed to client, indicates the client according to the preposition Media Stream Index plays the preposition Media Stream that the client is locally stored.
Selectively, the fragment of the target medium stream is sent to the client, including:
Send the target medium stream is indexed to the client, receives the acquisition target medium of the client The request of the corresponding fragment of index of stream, and the fragment of the target medium stream is sent to the client.
Selectively, described after generating the fragment of predetermined quantity of the target medium stream, the method further includes:
Label is added to the corresponding index of first fragment of the target medium stream, the label is for informing the visitor Family end stops playing the preposition Media Stream and be played out to the target medium stream.
On the other hand, the present invention provides a kind of Streaming Media pushers, including:
Receiving module, the information of the request target Media Stream for receiving client transmission;
Detection module, for detecting whether the fragment of the predetermined quantity of the existing requested target medium stream;
First sending module, if when fragment for detecting the predetermined quantity that not yet there is the target medium stream, hair That send preset preposition Media Stream is indexed to the client, to indicate preposition Media Stream described in the client terminal playing;
Processing module, the data for obtaining the target medium stream, and the number of the target medium stream according to acquisition According to the fragment for generating the target medium stream;
Second sending module, for after generating the fragment of predetermined quantity of the target medium stream, sending the target The fragment of Media Stream is to the client.
Selectively, the total duration of the preposition Media Stream be not less than from start to obtain the data of the target medium stream to Generate the required duration of fragment of the predetermined quantity of the target medium stream.
Selectively, the processing module is specifically used for:
The data of the data for obtaining the target medium stream, the target medium stream based on acquisition generate image group, root A certain number of image groups are selected to form fragment according to the duration of single image group and the duration of preset minimum fragment.
Selectively, first sending module is specifically used for:
If detecting the fragment for the predetermined quantity that not yet there is the target medium stream, preset preposition Media Stream is sent Be indexed to client, receive the request of the corresponding fragment of index of the acquisition preposition Media Stream of the client, concurrently Send the fragment of the preposition Media Stream to the client, so that preset preposition Media Stream described in the client terminal playing;Or,
Send preset preposition Media Stream is indexed to client, indicates the client according to the preposition Media Stream Index plays the preposition Media Stream that the client is locally stored.
Selectively, second sending module is specifically used for:
After generating the fragment of predetermined quantity of the target medium stream, it is described to send being indexed to for the target medium stream Client, receives the request of the corresponding fragment of index of the acquisition target medium stream of the client, and sends the mesh The fragment of Media Stream is marked to the client.
Selectively, second sending module is additionally operable to:
After generating the fragment of predetermined quantity of the target medium stream, first fragment pair of the target medium stream is given The index answered adds label, and the label is for informing that the client stops playing the preposition Media Stream and to the target Media Stream plays out.
The advantageous effect of technical solution provided in an embodiment of the present invention includes:
The present invention provides a kind of Streaming Media method for pushing and device, this method to include:Not yet there is client detecting When holding the fragment of the predetermined quantity of the target medium stream of request, the index of preset preposition Media Stream is sent to client so that Client can play preposition Media Stream;The fragment for obtaining target medium stream, when the fragment for the predetermined quantity for generating target medium stream Afterwards, the fragment of target medium stream is sent to client, and then client stops playing preposition Media Stream and decodes target medium stream Fragment play out.In this way, even if server end gets out the fragment of the predetermined quantity of target medium stream, visitor in time not yet Family end can also play preset preposition Media Stream.Therefore, method provided in this embodiment can be solved since server end is not timely Generate client request Media Stream Media Stream predetermined quantity fragment and caused by client blank screen the problem of, to really Warranty family, which will not be misread, not to be thought to can connect to streaming media server and carry out the operations such as reconnection, closing, hence improves user Experience.
Description of the drawings
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are only some embodiments of the invention, for For those of ordinary skill in the art, without creative efforts, other are can also be obtained according to these attached drawings Attached drawing.
Attached drawing 1 is a kind of schematic diagram of illustrative implementation environment of the present invention;
Attached drawing 2 is a kind of flow chart of Streaming Media method for pushing in one embodiment of the invention;
Attached drawing 3 is a kind of block diagram of Streaming Media pusher in one embodiment of the invention.
Specific implementation mode
To keep technical scheme of the present invention and advantage clearer, below in conjunction with attached drawing to embodiment of the present invention make into One step it is described in detail.
Fig. 1 is the schematic diagram for implementing a kind of illustrative implementation environment of the present invention.Referring to Fig. 1, which includes: Front-end collection equipment 101, server end 102 and client 103.
Client 103 can be the portable terminals such as mobile phone, or personal computer, work station.Front-end collection is set Standby 101 can be multiple, for example, picture pick-up device.Front-end collection equipment 101 and server end 102 and server end 102 and visitor Family end 103 is communicated by wirelessly or non-wirelessly mode.Front-end collection equipment 101 carries out camera shooting and generates media stream data (referred to as Media Stream), and the media stream data of generation is sent to server end 102, server end 102 handles media stream data Generate the fragment of Media Stream.When client 103 needs to play a certain 101 collected Media Stream of front-end collection equipment, to service Device end 102 sends request, and server end 102 generates the fragment of the Media Stream, and the fragment of the Media Stream is sent to client 103, and then client 103 can play the Media Stream.
Embodiment one
A kind of Streaming Media method for pushing is present embodiments provided, server end is can be applied to.The flow of this method such as Fig. 2 It is shown, each step will be specifically introduced below.
Step S101:Receive the information for the request target Media Stream that client is sent.
For example, in this step, the request that client can send a certain target medium stream by URL to server end is believed Breath.For example, the URL format of solicited message can be http://ip:Format similar in this way port/XXX.m3u8 carries in URL The information of target medium stream can navigate to correspondence after the request to the target medium stream that received server-side client is sent Target medium stream.
In the present embodiment, target medium stream is Media Stream corresponding with the request of client, can be adopted for collecting device The data information that video, audio or the video and audio collected combines.Collecting device can be video recorder, camera and/or hand Machine etc. does not limit herein.
Step S102:Detect whether the fragment of the predetermined quantity of existing requested target medium stream.
In the present embodiment, fragment refer to can independent decoded a part of target medium stream data.For example, server The data of target medium stream are first packaged to form multiple frames by end, and several continuous frames form a GOP, and a GOP is general Including I frames and behind by other frames of the I frame decodings, a fragment may include at least one GOP.Target medium stream Fragment can be with independent play-out, therefore after client receives the fragment of server end transmission, you can starts to play.
In this step, server end detects whether to have existed point of the predetermined quantity of requested target medium stream Piece.Specifically, according to HLS protocol, predetermined quantity can be three, however, the present invention is not limited thereto, it will be understood by those skilled in the art that In the agreement that other existing similar agreements or future further developed, predetermined quantity can not be three but other are suitable Quantity.
If server end detects the fragment for the predetermined quantity for having existed requested target medium stream, step is gone to S103;If server end detects the fragment for the predetermined quantity for not yet generating requested target medium stream, step is gone to S104 and step S105.Step S104 and step S105 can be performed simultaneously, and can also first carry out step S104, then execute S105.
Step S103:If detecting the fragment of the predetermined quantity of existing requested target medium stream, target is sent The fragment of Media Stream is to client.
In this step, if server end detects point of the predetermined quantity of existing requested target medium stream Piece, then server end the fragment of target medium stream is sent to client, client can directly play the fragment of target medium stream, no The problem of will appear blank screen.Specifically, server end can first send the client that is indexed to of target medium stream, client receives mesh After the index for marking Media Stream, the request of the corresponding fragment of index of target medium stream is sent to server end.Received server-side The request of the corresponding fragment of index of the acquisition target medium stream of client sends the fragment of target medium stream to client.Visitor Family end receives the fragment of target medium stream, is decoded broadcasting.
Step S104:If detecting the fragment for the predetermined quantity that not yet there is target medium stream, send preset preposition Media Stream is indexed to client, to indicate the preposition Media Stream of client terminal playing.
In this step, it if server end detects the fragment for the predetermined quantity that not yet there is target medium stream, first sends Preset preposition Media Stream is indexed to client, and client is received to send to server end after the index of preposition Media Stream and be obtained The request of the fragment of the corresponding preposition Media Stream of index of preposition Media Stream.The preposition media of acquisition of received server-side client The request of the corresponding fragment of index of stream, and the fragment of preposition Media Stream is sent to client.Client receives preposition Media Stream Fragment, be decoded broadcasting.In other embodiments, it is also possible to directly transmit the fragment of preposition Media Stream to client. Alternatively, if client has been locally stored preposition Media Stream, server end send preposition Media Stream be indexed to client after, refer to Show the preposition Media Stream that client terminal playing client is locally stored.Specifically, the preposition Media Stream that client is locally stored can be with It is the preposition Media Stream of client to be pre-stored in when installation, or open the preposition Media Stream downloaded when client.
Before this step, server end has prestored one section of preposition Media Stream, and turns to the preposition Media Stream Encapsulation generates fragment and index process.The indexed format of preposition Media Stream for example can be as follows:
The M3U files of #EXTM3U//extension
#EXT-X-VERSION:The adaptability of 3//playlist version
#EXT-X-ALLOW-CACHE:NO//whether allow to buffer
#EXT-X-MEDIA-SEQUENCE:The serial number of the fragment of 0//preposition Media Stream
#EXT-X-TARGETDURATION:The maximum value of the fragment duration of 2//preposition Media Stream
#EXTINF:2.055, //EXTINF recording marks, the label describes point of the preposition Media Stream specified by back Piece
The name of the fragment of PreSet0.ts//preposition Media Stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the preposition Media Stream specified by back Piece
The name of the fragment of PreSet1.ts//preposition Media Stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the preposition Media Stream specified by back Piece
The name of the fragment of PreSet2.ts//preposition Media Stream
In an alternate embodiment of the present invention where, the fragment title front of each preposition Media Stream is provided with EXTINF marks Label, format are as follows:#EXTINF:<DURATION>,<TITLE>;DURATION describes the fragment duration, and unit is the second, when When EXT-X-VERSION labels are greater than or equal to 3, DURATION can be decimal, otherwise can only be integer.
It should be noted that the quantity for the fragment that the index of above-mentioned preposition Media Stream includes with preposition Media Stream be three into Row is for example, however, the present invention is not limited thereto, the quantity for the fragment that preposition Media Stream includes can be other quantity.
Optionally, preposition Media Stream can be advertisement, video clip or song MV etc..Such as preposition Media Stream can be With the relevant video of target medium stream to be played.Assuming that video to be played is film A, preposition Media Stream can be film A Segment or abstract advertisement etc..
In the present embodiment, can be arranged preposition Media Stream total duration be more than server end from start obtain target medium stream Data to generate predetermined quantity the required duration of fragment.For example, the total duration that preposition Media Stream can be arranged is equal to service Device end obtains the data of target medium stream and generates the fragment of predetermined quantity and corresponding index according to the data of target medium stream Required duration, in addition server end sends duration, client reception mesh needed for the index of target medium stream to client Mark the index of Media Stream and duration, received server-side client hair needed for the fragment of the index request target Media Stream The fragment request of the target medium stream sent simultaneously sends the duration needed for the fragment of target medium stream and client reception target medium The fragment of stream is simultaneously decoded required duration.In this way, not only can avoid client blank screen occurs, but also it can avoid preposition Media Stream The problem of target medium stream cannot be played caused by total duration is long in time.
Step S105:The data for obtaining target medium stream generate target medium according to the data of the target medium stream of acquisition The fragment of stream.
In this step, server end is after the data for obtaining target medium stream, by the number of the target medium stream of acquisition To form multiple frames according to being first packaged, several continuous frames form a GOP, and according to the single GOP of target medium stream when The duration of long and preset minimum fragment selects a certain number of GOP to form fragment, and a fragment includes a GOP or several company Continuous GOP.Select fragment when a length of minimum fragment duration, the reproduction time of preposition Media Stream can be reduced.
Step S106:After generating the fragment of predetermined quantity of target medium stream, the fragment of target medium stream is sent to visitor Family end.
In this step, it after server end detects the fragment for the predetermined quantity for generating target medium stream, can first send Target medium stream is indexed to client, and after client receives the index of target medium stream, target matchmaker is sent to server end The request of the corresponding fragment of index of body stream.The corresponding fragment of index of the acquisition target medium stream of received server-side client Request, and send the fragment of target medium stream to client.Client receives the fragment of target medium stream, is decoded and broadcasts It puts.In other embodiments, it is also possible to directly transmit the fragment of target medium stream to client.
After the fragment for generating the predetermined quantity of target medium stream in server end, the first of the target medium stream generated can be given Corresponding index of a fragment adds label, for informing the preposition Media Stream of client stopping broadcasting and playing target medium stream, so Corresponding fragment is sent to client by server in sequence afterwards.
For example, label can be EXT-X-DISCONTINUITY, the then corresponding rope of the fragment of the predetermined quantity of target medium stream The format drawn is as follows:
The M3U files of #EXTM3U//extension
#EXT-X-VERSION:The adaptability of 3//playlist version
#EXT-X-ALLOW-CACHE:NO//whether allow to buffer
#EXT-X-MEDIA-SEQUENCE:The serial number of the fragment of 0//target medium stream
#EXT-X-TARGETDURATION:The maximum value of the fragment duration of 2//target medium stream
The fragment of the target medium stream of EXT-X-DISCONTINUITY//tag representation label back and target before Coding interruption between the fragment of Media Stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the target medium stream specified by back Piece
The name of the fragment of segSet0.ts//target medium stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the target medium stream specified by back Piece
The name of the fragment of segSet1.ts//target medium stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the target medium stream specified by back Piece
The name of segSet2.ts//media file
The index of above-mentioned target medium stream is illustrated with the predetermined quantity of the fragment of target medium stream for three, but The invention is not limited thereto, and predetermined quantity is alternatively other quantity.
After client receives the index of label, then there is the corresponding Media Stream of the index of label to server end request Predetermined quantity fragment, stop playing preposition Media Stream after the fragment for receiving target medium stream and play target medium Stream.Hereafter, server end persistently obtains target medium flow data and generates fragment, and fragment is sent to client, to client It can continual broadcasting target medium stream.
In the present embodiment, the fragment of the corresponding predetermined quantity of an index.Client sends the index pair of target medium stream After the request for the fragment answered, received server-side request, then the production according to the fragment of the corresponding predetermined quantity of the index is suitable Fragment is sent to client by sequence.Client receives the fragment of target medium stream, and is decoded broadcasts in the order received It puts.
After this, server end repeats step S101 to step S106, continues the new data for obtaining target medium stream, New index fragment corresponding with new index is generated simultaneously, and is sent to client.To which client can continuously play target Media Stream.
Streaming Media method for pushing provided in this embodiment, can be used in the stream media system based on HLS, but the present invention is unlimited In this, it can also be used in the stream media system based on other similar agreements.
Using Streaming Media method for pushing provided in this embodiment, not yet there is the target medium of client request in server end When the fragment of the predetermined quantity of stream, send the index of preset preposition Media Stream to client, so client can play it is preposition Media Stream;Server end obtains the data of target medium stream and generates fragment, when point for the predetermined quantity for generating target medium stream After piece, the fragment of target medium stream is sent to client, and then client receives the fragment of target medium stream and is decoded and broadcasts It puts.In this way, even if server end is ready to that if the fragment client of predetermined quantity preset preposition matchmaker can be played not yet in time Body stream, therefore, method provided in this embodiment can solve not generating the target medium of client request in time due to server end The fragment of the predetermined quantity of stream and caused by client blank screen the problem of, not think to can connect to so that it is guaranteed that user will not misread Target streaming media service and carry out the operations such as reconnection, closing, hence improve user experience.
Embodiment two
Corresponding to embodiment one, a kind of Streaming Media pusher, e.g. streaming media server are present embodiments provided, such as Shown in Fig. 3, including receiving module 201, detection module 202, the first sending module 203, processing module 204, the second sending module 205 and third sending module 206.Each module is specifically introduced below.
Mould 201 is received, the information of the request target Media Stream for receiving client transmission.
Client for example asks a certain target medium stream, the URL format of request may be, for example, by URL to server end http://ip:The information of target medium stream, pair that received server-side client is sent are carried in port/XXX.m3u8, URL After the request of the target medium stream, corresponding target medium stream can be navigated to.
In the present embodiment, target medium stream is Media Stream corresponding with the request of client, can be adopted for collecting device The data information that video, audio or the video and audio collected combines.Collecting device can be video recorder, camera and/or hand Machine etc. does not limit herein.
Detection module 202, for detecting whether the fragment of the predetermined quantity of existing requested target medium stream.
Specifically, according to HLS protocol, predetermined quantity can be three, and however, the present invention is not limited thereto, those skilled in the art can To understand, in other similar agreements or the in the future agreement that further developed, predetermined quantity can not be three but its His suitable quantity.
If detection module 202 detects the fragment of the predetermined quantity of existing requested target medium stream, is called Three sending modules 206, if detection module 202 detects the fragment for the predetermined quantity that not yet there is requested target medium stream, The second sending module 204 and processing module 205 are then called, the second sending module 204 and processing module 205 can be called simultaneously, The second sending module 204 can be first called, processing module 205 is recalled.
Third sending module 206, for detecting the predetermined of existing requested target medium stream when detection module 202 When the fragment of quantity, the fragment of target medium stream is sent to client.
If detection module 202 detects the fragment for the predetermined quantity for having existed requested target medium stream, client The problem of end is not in blank screen can directly play target medium stream, and third sending module 206 can first send target medium at this time Stream is indexed to client, after client receives the index of target medium stream, to the transmission of streaming media service pusher and target The request of the fragment of the corresponding target medium stream of index of Media Stream.Third sending module 206 receives the acquisition target of client The request of the corresponding fragment of index of Media Stream, and the fragment of target medium stream is sent to client.Client receives third hair The fragment for sending the target medium stream of the transmission of module 206, is decoded broadcasting.
First sending module 203, for detecting the predetermined quantity that not yet there is target medium stream when detection module 202 When fragment, send preset preposition Media Stream is indexed to client, to indicate the preposition Media Stream of client terminal playing.
First sending module 203 sends the client that is indexed to of preset preposition Media Stream, and client receives preposition media After the index of stream, the request of the fragment of the corresponding preposition Media Stream of index of preposition Media Stream is sent.First sending module 203 connects The request of the corresponding fragment of index of the preposition Media Stream of acquisition of client is received, and sends the fragment of preposition Media Stream to client End.Client receives the fragment for the preposition Media Stream that the first sending module 203 is sent, and is decoded broadcasting.In other embodiment party In formula, it is also possible to directly transmit the fragment of preposition Media Stream to client.Alternatively, if preposition media have been locally stored in client Stream, the first sending module 203 send preposition Media Stream be indexed to client after, instruction client terminal playing client be locally stored Preposition Media Stream.Specifically, the preposition Media Stream that client is locally stored is pre-stored in the preposition of client when can be installation Media Stream, or open the preposition Media Stream downloaded when client.
Before this step, Streaming Media pusher can prestore one section of preposition Media Stream, and to the preposition Media Stream It carries out turning encapsulation, generate fragment and index process.For example, the indexed format of preposition Media Stream is as follows:
The M3U files of #EXTM3U//extension
#EXT-X-VERSION:The adaptability of 3//playlist version
#EXT-X-ALLOW-CACHE:NO//whether allow to buffer
#EXT-X-MEDIA-SEQUENCE:The serial number of the fragment of 0//preposition Media Stream
#EXT-X-TARGETDURATION:The maximum value of the fragment duration of 2//preposition Media Stream
#EXTINF:2.055, //EXTINF recording marks, the label describes point of the preposition Media Stream specified by back Piece
The name of the fragment of PreSet0.ts//preposition Media Stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the preposition Media Stream specified by back Piece
The name of the fragment of PreSet1.ts//preposition Media Stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the preposition Media Stream specified by back Piece
The name of the fragment of PreSet2.ts//preposition Media Stream
It should be noted that the quantity for the fragment that the index of above-mentioned preposition Media Stream includes with preposition Media Stream be three into Row is for example, however, the present invention is not limited thereto, the quantity for the fragment that preposition Media Stream includes can be other quantity.
Optionally, preposition Media Stream can be advertisement, video clip or song MV etc..
In the present embodiment, can be arranged preposition Media Stream total duration be more than from start obtain target medium stream data to Generate the required duration of fragment of predetermined quantity.Specifically, the total duration that preposition Media Stream can be arranged is equal to processing module 204 It obtains the data of target medium stream and is generated needed for fragment and the corresponding index of predetermined quantity according to the data of target medium stream The duration wanted, in addition the duration, client needed for index of second sending module 205 to client transmission target medium stream receive The index of target medium stream and duration, the second sending module 205 needed for the fragment of the index request target Media Stream connect It receives the fragment request for the target medium stream that client is sent and sends the duration needed for the fragment of Media Stream and client reception mesh It marks the fragment of Media Stream and is decoded required duration.In this way, not only can avoid client blank screen occurs, but also it can avoid preposition matchmaker The problem of cannot playing target medium stream in time caused by the total duration of body stream is long.
Processing module 204, the data for obtaining target medium stream generate mesh according to the data of the target medium stream of acquisition Mark the fragment of Media Stream.
After processing module 204 obtains the data of target medium stream, according to the duration of the single GOP of target medium stream and in advance If the duration of minimum fragment select a certain number of GOP to form fragments.Specifically, obtain target medium stream data it Afterwards, the data of the target medium stream of acquisition are first packaged to form multiple frames by processing module 204, and several continuous frames generate one A GOP, and a certain number of GOP are selected according to the duration of the duration of the single GOP of target medium stream and preset minimum fragment Fragment is formed, a fragment includes a continuous GOP of GOP or several.Select fragment when a length of minimum fragment duration, The reproduction time of preposition Media Stream can be reduced.
Second sending module 205, for after generating the fragment of predetermined quantity of target medium stream, sending target medium stream Fragment to client.
In this step, after detecting the fragment for the predetermined quantity for generating target medium stream, the second sending module 205 can First send target medium stream is indexed to client, after client receives the index of target medium stream, sends target medium stream The corresponding fragment of index request.The index that second sending module 205 receives the acquisition target medium stream of client is corresponding The request of fragment, and the fragment of target medium stream is sent to client.Client receives the fragment of target medium stream, is decoded It plays.
After the fragment for generating the predetermined quantity of target medium stream in processing module 204, the target medium stream generated can be given The corresponding index of first fragment adds label, and the label is for informing the preposition Media Stream of client stopping broadcasting and playing target Media Stream.
For example, label can be EXT-X-DISCONTINUITY, the then corresponding rope of the fragment of the predetermined quantity of target medium stream The format drawn is as follows:
The M3U files of #EXTM3U//extension
#EXT-X-VERSION:The adaptability of 3//playlist version
#EXT-X-ALLOW-CACHE:NO//whether allow to buffer
#EXT-X-MEDIA-SEQUENCE:The serial number of the fragment of 0//target medium stream
#EXT-X-TARGETDURATION:The maximum value of the fragment duration of 2//target medium stream
The fragment of the target medium stream of the EXT-X-DISCONTINUITY//tag representation label back and target before Coding interruption between the fragment of Media Stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the target medium stream specified by back Piece
The name of the fragment of segSet0.ts//target medium stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the target medium stream specified by back Piece
The name of the fragment of segSet1.ts//target medium stream
#EXTINF:2.000, //EXTINF recording marks, the label describes point of the target medium stream specified by back Piece
The name of segSet2.ts//media file
The index of above-mentioned target medium stream is illustrated with the predetermined quantity of the fragment of target medium stream for three, but The invention is not limited thereto, and predetermined quantity is alternatively other quantity.
Illustratively, it is corresponding to Streaming Media pusher request index after client receives the index of label The fragment of target medium stream stops playing preposition Media Stream and plays target medium stream after receiving the fragment of target medium stream.
In the present embodiment, the fragment of the corresponding predetermined quantity of an index.Client sends the index pair of target medium stream When the request for the fragment answered, the second sending module 205 receives the request, then according to the fragment of the corresponding predetermined quantity of the index Production sequence, fragment is sent to client.Client receives the fragment of target medium stream, and is decoded broadcasts in sequence It puts.
After this, modules are called successively, continue the new data for obtaining target medium stream, while generating new rope Draw fragment corresponding with new index, and is sent to client.To which client can continuously play target medium stream.
Since embodiment two and embodiment one correspond, so identical advantageous effect can be brought, details are not described herein.
In embodiment provided herein, it should be understood that the method and apparatus provided, only schematically , for example, the division of the step and module, only a kind of division of logic function, can there is other draw in actual implementation The mode of dividing.The software answered and/or hardware can be arranged by computer installation to realize in the above method and device.Term " the One ", " second " etc. is used for description purposes only, and is not understood to indicate or imply relative importance or implicitly indicates indicated Technical characteristic quantity.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can be stored in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The above is merely for convenience of it will be understood by those skilled in the art that technical scheme of the present invention, not limiting The present invention.All within the spirits and principles of the present invention, any modification, equivalent replacement, improvement and so on should be included in this Within the protection domain of invention.

Claims (12)

1. a kind of Streaming Media method for pushing, which is characterized in that including:
Receive the information for the request target Media Stream that client is sent;
Detect whether the fragment of the predetermined quantity of the existing requested target medium stream;
If detecting the fragment for the predetermined quantity that not yet there is the target medium stream, the rope of preset preposition Media Stream is sent The client is led to, to indicate preposition Media Stream described in the client terminal playing;
The data for obtaining the target medium stream generate the target medium stream according to the data of the target medium stream of acquisition Fragment;
After generating the fragment of predetermined quantity of the target medium stream, the fragment of the target medium stream is sent to the client End.
2. Streaming Media method for pushing according to claim 1, which is characterized in that the total duration of the preposition Media Stream is not small In required to the fragment for the predetermined quantity for generating the target medium stream from the data for starting to obtain the target medium stream Duration.
3. Streaming Media method for pushing according to claim 1, which is characterized in that the target medium according to acquisition The data of stream generate the fragment of the target medium stream, including:
The data of the target medium stream based on acquisition generate image group, according to the duration of single image group and preset minimum The duration of fragment selects a certain number of image groups to form fragment.
4. Streaming Media method for pushing according to claim 1, which is characterized in that the preset preposition Media Stream of transmission It is indexed to the client, indicates preposition Media Stream described in the client terminal playing, including:
Send preset preposition Media Stream is indexed to client, receives the rope of the acquisition preposition Media Stream of the client Draw the request of corresponding fragment, and sends the fragment of the preposition Media Stream to the client, so that the client terminal playing The preposition Media Stream;Or,
Send preset preposition Media Stream is indexed to client, indicates index of the client according to the preposition Media Stream Play the preposition Media Stream that the client is locally stored.
5. Streaming Media method for pushing according to claim 1, which is characterized in that send the fragment of the target medium stream extremely The client, including:
Send the target medium stream is indexed to the client, receives the acquisition target medium stream of the client The request of corresponding fragment is indexed, and sends the fragment of the target medium stream to the client.
6. according to the Streaming Media method for pushing described in claim 1-5 any of which items, which is characterized in that described when generation institute After the fragment for stating the predetermined quantity of target medium stream, the method further includes:
Label is added to the corresponding index of first fragment of the target medium stream, the label is for informing the client Stop playing the preposition Media Stream and the target medium stream is played out.
7. a kind of Streaming Media pusher, which is characterized in that including:
Receiving module, the information of the request target Media Stream for receiving client transmission;
Detection module, for detecting whether the fragment of the predetermined quantity of the existing requested target medium stream;
First sending module, if when fragment for detecting the predetermined quantity that not yet there is the target medium stream, sending pre- If preposition Media Stream be indexed to the client, to indicate preposition Media Stream described in the client terminal playing;
Processing module, the data for obtaining the target medium stream, and given birth to according to the data of the target medium stream of acquisition At the fragment of the target medium stream;
Second sending module, for after generating the fragment of predetermined quantity of the target medium stream, sending the target medium The fragment of stream is to the client.
8. Streaming Media pusher according to claim 7, which is characterized in that the total duration of the preposition Media Stream is not small In required to the fragment for the predetermined quantity for generating the target medium stream from the data for starting to obtain the target medium stream Duration.
9. Streaming Media pusher according to claim 7, which is characterized in that the processing module is specifically used for:
The data of the data for obtaining the target medium stream, the target medium stream based on acquisition generate image group, according to list The duration of the duration of a image group and preset minimum fragment selects a certain number of image groups to form fragment.
10. according to the Streaming Media pusher described in claim 7 any of which item, which is characterized in that described first sends mould Block is specifically used for:
If detecting the fragment for the predetermined quantity that not yet there is the target medium stream, the rope of preset preposition Media Stream is sent Client is led to, the request of the corresponding fragment of index of the acquisition preposition Media Stream of the client is received, and sends institute The fragment of preposition Media Stream is stated to the client, so that preset preposition Media Stream described in the client terminal playing;Or,
Send preset preposition Media Stream is indexed to client, indicates index of the client according to the preposition Media Stream Play the preposition Media Stream that the client is locally stored.
11. Streaming Media pusher according to claim 7, which is characterized in that second sending module is specifically used for:
After generating the fragment of predetermined quantity of the target medium stream, send the target medium stream is indexed to the client End, receives the request of the corresponding fragment of index of the acquisition target medium stream of the client, and sends the target matchmaker The fragment of body stream is to the client.
12. according to the Streaming Media pusher described in claim 7-11 any of which items, which is characterized in that described second sends Module is additionally operable to:
It is corresponding to first fragment of the target medium stream after generating the fragment of predetermined quantity of the target medium stream Index adds label, and the label is for informing that the client stops playing the preposition Media Stream and to the target medium Stream plays out.
CN201710158093.4A 2017-03-16 2017-03-16 Streaming media pushing method and device Active CN108632642B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710158093.4A CN108632642B (en) 2017-03-16 2017-03-16 Streaming media pushing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710158093.4A CN108632642B (en) 2017-03-16 2017-03-16 Streaming media pushing method and device

Publications (2)

Publication Number Publication Date
CN108632642A true CN108632642A (en) 2018-10-09
CN108632642B CN108632642B (en) 2021-09-03

Family

ID=63686780

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710158093.4A Active CN108632642B (en) 2017-03-16 2017-03-16 Streaming media pushing method and device

Country Status (1)

Country Link
CN (1) CN108632642B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602122A (en) * 2019-09-20 2019-12-20 北京达佳互联信息技术有限公司 Video processing method and device, electronic equipment and storage medium
WO2020216035A1 (en) * 2019-04-22 2020-10-29 北京开广信息技术有限公司 Real-time pushing method and real-time receiving method for media stream, server, and client
CN112104893A (en) * 2020-11-04 2020-12-18 武汉中科通达高新技术股份有限公司 Video stream management method and device for realizing plug-in-free playing of webpage end
WO2021008061A1 (en) * 2019-07-16 2021-01-21 Zhejiang Dahua Technology Co., Ltd. Systems and methods for live streaming
CN112449209A (en) * 2019-08-29 2021-03-05 中移物联网有限公司 Video storage method and device, cloud server and computer readable storage medium
CN115297095A (en) * 2022-08-08 2022-11-04 上海哔哩哔哩科技有限公司 Return source processing method and device, computing equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094169A (en) * 2006-06-23 2007-12-26 腾讯科技(深圳)有限公司 Method, system, and client terminal for playing back advertisement in procedure of buffering network living broadcast
CN101471919A (en) * 2007-12-29 2009-07-01 突触计算机系统(上海)有限公司 Method and device for downloading slicing of equipment based on point-to-point transmission protocol
CN104125516A (en) * 2013-04-24 2014-10-29 华为技术有限公司 Media file receiving method and apparatus, media file sending method and apparatus, and system
CN104135678A (en) * 2014-08-13 2014-11-05 浪潮软件集团有限公司 Method for realizing video advertisement putting in video on demand based on HLS protocol
CN105872598A (en) * 2016-04-25 2016-08-17 乐视控股(北京)有限公司 Multimedia live method and device
WO2017001289A1 (en) * 2015-06-30 2017-01-05 British Telecommunications Public Limited Company Low latency media streaming

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101094169A (en) * 2006-06-23 2007-12-26 腾讯科技(深圳)有限公司 Method, system, and client terminal for playing back advertisement in procedure of buffering network living broadcast
CN101471919A (en) * 2007-12-29 2009-07-01 突触计算机系统(上海)有限公司 Method and device for downloading slicing of equipment based on point-to-point transmission protocol
CN104125516A (en) * 2013-04-24 2014-10-29 华为技术有限公司 Media file receiving method and apparatus, media file sending method and apparatus, and system
CN104135678A (en) * 2014-08-13 2014-11-05 浪潮软件集团有限公司 Method for realizing video advertisement putting in video on demand based on HLS protocol
WO2017001289A1 (en) * 2015-06-30 2017-01-05 British Telecommunications Public Limited Company Low latency media streaming
CN105872598A (en) * 2016-04-25 2016-08-17 乐视控股(北京)有限公司 Multimedia live method and device

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020216035A1 (en) * 2019-04-22 2020-10-29 北京开广信息技术有限公司 Real-time pushing method and real-time receiving method for media stream, server, and client
WO2021008061A1 (en) * 2019-07-16 2021-01-21 Zhejiang Dahua Technology Co., Ltd. Systems and methods for live streaming
US11849157B2 (en) 2019-07-16 2023-12-19 Zhejiang Dahua Technology Co., Ltd. Systems and methods for live streaming
CN112449209A (en) * 2019-08-29 2021-03-05 中移物联网有限公司 Video storage method and device, cloud server and computer readable storage medium
CN110602122A (en) * 2019-09-20 2019-12-20 北京达佳互联信息技术有限公司 Video processing method and device, electronic equipment and storage medium
CN112104893A (en) * 2020-11-04 2020-12-18 武汉中科通达高新技术股份有限公司 Video stream management method and device for realizing plug-in-free playing of webpage end
CN115297095A (en) * 2022-08-08 2022-11-04 上海哔哩哔哩科技有限公司 Return source processing method and device, computing equipment and storage medium
CN115297095B (en) * 2022-08-08 2024-03-08 上海哔哩哔哩科技有限公司 Back source processing method, device, computing equipment and storage medium

Also Published As

Publication number Publication date
CN108632642B (en) 2021-09-03

Similar Documents

Publication Publication Date Title
CN108632642A (en) Streaming Media method for pushing and device
EP2961162A1 (en) Information processing apparatus, data management method, and program
US20130124683A1 (en) Data distribution system, data distribution method, data relay device on distribution side, and data relay device on reception side
WO2011112003A2 (en) Method and apparatus for providing broadcast content and system using the same
JP2014135749A (en) File transmission method and device in server, and file reproduction method and device in terminal
WO2013053326A1 (en) Method, server, client and system for recording and playing replay program
EP3257216B1 (en) Method of handling packet losses in transmissions based on dash standard and flute protocol
WO2008148268A1 (en) An implementation method and system for a media-on-demand frame-spanning playing mode in a peer-to-peer network
JP2007173987A (en) Multimedia data transmission/reception system and device, or program
EP3001692A1 (en) Streaming media processing method, apparatus and system
CN107534793B (en) Receiving apparatus, transmitting apparatus, and data processing method
US11410199B2 (en) Reception apparatus, transmission apparatus, and data processing method
TWI577186B (en) Rendering time control
WO2012151865A1 (en) Data transmission method and system
CN101848367B (en) File-based video live webcasting method
CN106789976A (en) The player method of media file, service end, client and system
CN105049931A (en) Method and system for converting video with non-supporting format in mobile terminal
WO2016077072A1 (en) Delivering partially received segments of streamed media data
WO2017196980A1 (en) Real-time control interface for broadcast object streaming
WO2014196335A1 (en) Transmission device, transmission method, receiving device, and receiving method
CA2964721C (en) Reception apparatus, transmission apparatus, and data processing method
KR101805424B1 (en) Manifest mechanism in broadcast involved system
CN109587517A (en) A kind of playback method and device, server and storage medium of multimedia file
WO2016174959A1 (en) Reception device, transmission device, and data processing method
US20110078727A1 (en) Systems and methods for handling advertisements in conjunction with network-based bookmarking

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