CN106603503B - The treating method and apparatus of live data - Google Patents

The treating method and apparatus of live data Download PDF

Info

Publication number
CN106603503B
CN106603503B CN201611048474.9A CN201611048474A CN106603503B CN 106603503 B CN106603503 B CN 106603503B CN 201611048474 A CN201611048474 A CN 201611048474A CN 106603503 B CN106603503 B CN 106603503B
Authority
CN
China
Prior art keywords
data streams
live data
live
obtains
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611048474.9A
Other languages
Chinese (zh)
Other versions
CN106603503A (en
Inventor
赵恒�
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201611048474.9A priority Critical patent/CN106603503B/en
Publication of CN106603503A publication Critical patent/CN106603503A/en
Application granted granted Critical
Publication of CN106603503B publication Critical patent/CN106603503B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling

Abstract

The invention discloses a kind for the treatment of method and apparatus of live data.Wherein, this method comprises: obtaining the first live data streams;First live data streams are carried out turning encapsulation operation, obtain the second live data streams, wherein include multiple live streaming segments in second live data streams;Obtain the target fragment in the multiple live streaming segment;Shot operation is carried out to the target fragment, obtains picture corresponding with first live data streams.The present invention solves the interception picture resource from live stream and consumes big technical problem.

Description

The treating method and apparatus of live data
Technical field
The present invention relates to field of information processing, in particular to a kind for the treatment of method and apparatus of live data.
Background technique
Personal live streaming is abnormal hot at present, and user usually uses mobile terminal to provide live stream and viewing, moves to save The flow and electricity of dynamic terminal, user decide whether to watch generally according to the title of live streaming and brief introduction.But the mark of some live streamings Topic and brief introduction can not the accurate description live streaming content in addition some titles it is unrelated with the content of live streaming.In order to solve this problem, Provide in the prior art it is a kind of the scheme of the picture about live content is provided, by the picture of live content, user can be with Under low discharge cost, it can be seen that live content, then according to the excellent degree of live content, further decide whether into Row viewing.
Optionally, the scheme for providing the picture of live content in the prior art is mainly to pass through directly to flow the flv of live streaming It is decoded, the interception of image data is then carried out using the library ffmpeg, finally upload to picture servers to covering.Live streaming is seen See that user obtains picture from picture servers.And flv stream is long connection in transmission, when executing decoding operate, is needed pair The entire file of transmission is decoded, and decoding process consumes a large amount of cpu resource.
Big problem is consumed for the above-mentioned picture resource that intercepts from live stream, not yet proposes effective solution side at present Case.
Summary of the invention
The embodiment of the invention provides a kind for the treatment of method and apparatus of live data, at least to solve to cut from live stream Picture resource is taken to consume big technical problem.
According to an aspect of an embodiment of the present invention, a kind of processing method of live data is provided, comprising: obtain first Live data streams;First live data streams are carried out turning encapsulation operation, obtain the second live data streams, wherein described It include multiple live streaming segments in two live data streams;Obtain the target fragment in the multiple live streaming segment;To the target patch Duan Jinhang shot operation obtains picture corresponding with first live data streams.
According to another aspect of an embodiment of the present invention, a kind of processing unit of live data is additionally provided, comprising: first obtains Unit is taken, for obtaining the first live data streams;Turn encapsulation unit, turns encapsulation behaviour for carrying out to first live data streams Make, obtain the second live data streams, wherein includes multiple live streaming segments in second live data streams;Second acquisition unit, For obtaining the target fragment in the multiple live streaming segment;Screenshot unit, for carrying out shot operation to the target fragment, Obtain picture corresponding with first live data streams.
In embodiments of the present invention, after getting the first live data streams, its turn is encapsulated as to include multiple live streamings Second live data streams of segment, and shot operation is carried out to the target fragment in multiple live streaming segments.In the above-described embodiments, When executing shot operation, without the screenshot from complete live data streams, that is, without being carried out to complete live data streams Coding and the operation recoded, resource occupation when substantially reducing the handling duration of coding and recodification, and reducing coding, Solve the problems, such as in the prior art from live stream intercept picture resource consume it is big, realize occupy fewer resource can be completed To the effect of the shot operation of live stream.
Detailed description of the invention
The drawings described herein are used to provide a further understanding of the present invention, constitutes part of this application, this hair Bright illustrative embodiments and their description are used to explain the present invention, and are not constituted improper limitations of the present invention.In the accompanying drawings:
Fig. 1 is the schematic diagram of the hardware environment of the processing method of live data according to an embodiment of the present invention;
Fig. 2 is a kind of flow chart one of the processing method of optional live data according to an embodiment of the present invention;
Fig. 3 is a kind of flowchart 2 of the processing method of optional live data according to an embodiment of the present invention;
Fig. 4 is a kind of flow chart 3 of the processing method of optional live data according to an embodiment of the present invention;
Fig. 5 is a kind of flow chart four of the processing method of optional live data according to an embodiment of the present invention;
Fig. 6 is a kind of schematic diagram of the processing unit of optional live data according to an embodiment of the present invention;
Fig. 7 is the schematic diagram of the processing unit of another optional live data according to an embodiment of the present invention;And
Fig. 8 is a kind of structural block diagram of terminal according to an embodiment of the present invention.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present invention Attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only The embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill people The model that the present invention protects all should belong in member's every other embodiment obtained without making creative work It encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein or Sequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that cover Cover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited to Step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, product Or other step or units that equipment is intrinsic.
Firstly, the part noun or term that occur during the embodiment of the present invention is described are suitable for as follows It explains:
Coding, decoding: from original non-compressed data (e.g., YUV video pixel format, the audio PCM lattice of multimedia file Formula) it has the certain significance binary word throttle data made of field combination by complicated coding compression algorithm production band, it is convenient for Storage or transmission, decoding are inverse process.Wherein, YUV is a kind of colour coding method, and Y indicates luminance signal, and U and V indicate coloration Signal.
FLV:adobe flash encapsulation format, the output format of mainstream live stream, generally compression video (H264) and pressure Contracting audio (AAC) is synthesized together by this encapsulation format agreement, and default plays in webpage web flash player, can also It is played with being decoded on the player at the end application program app, is live stream output format most general at present, what is formed is basic Unit is FLV tag.
Optionally, in the present embodiment, the processing method of above-mentioned live data can be applied to as shown in Figure 1 by servicing In the hardware environment that device 102, first terminal 104 and second terminal 106 are constituted.As shown in Figure 1, server 102 passes through network It is attached respectively with first terminal 104 and second terminal 106, above-mentioned network includes but is not limited to: wide area network, Metropolitan Area Network (MAN) or office Domain net, first terminal 104 and second terminal 106 are not limited to PC machine, mobile phone, tablet computer etc..The embodiment of the present invention it is straight The processing method of multicast data can be executed by server or first terminal 104 or second terminal 106, be also possible to by Server 102, first terminal 104 and second terminal 106 execute jointly.Wherein, first terminal 104 and second terminal 106 execute The processing method of the live information of the embodiment of the present invention is also possible to be executed by client mounted thereto.
Optionally, first terminal and/or second terminal can be mobile terminal, such as mobile phone, tablet computer.
Specifically, first terminal can be live streaming end, and second terminal can be to play end, and server can be direct broadcast service Device, live streaming end acquire video pictures using camera, and the information of the video pictures of acquisition is broadcast live by coding and encapsulation The live data streams are sent to direct broadcast server by data flow, and the information of the live streaming is delivered to shared platform by direct broadcast server On, live streaming request can be initiated, direct broadcast server receives live streaming by clicking the link of the live streaming in the shared platform by playing end Corresponding live data streams are sent to and play end by request, play end after decapsulalion, play the video pictures of the live streaming.
Optionally, which can be server cluster, which may include multiple for executing The server of different task, for example, the server cluster may include: that stream receives server, for receiving the transmission of live streaming end Live data streams;Capture server is used for the screenshot from live data streams;Picture servers are for executing storage picture.At one In optional embodiment, above-mentioned stream receives server, capture server and picture servers in the form of services at same It is realized on server, for example, screenshot service, for executing shot operation;The service of reception is flowed for receiving the straight of live streaming end transmission Broadcast flow data.
In an alternative embodiment, when live streaming is initiated at live streaming end, stream is sent by the live data streams that live streaming generates Server is received, stream receives server and monitors network input port in real time, monitoring that network input port has that data flow is fashionable, Determination perceives live data streams.In the case where stream receives server and perceived live data streams, stream receives server touching Dispatch service is sent out, dispatch service calling turns packing service, turns packing service and carries out turning encapsulation to the live data streams, is turned Data flow after encapsulation.Screenshot service pulls the data flow after turning encapsulation from packing service is turned, and obtains directly from the data flow Segment is broadcast, shot operation is carried out to live streaming segment, obtains picture, and the picture is uploaded to picture servers.
Above-mentioned live data streams can be FLV data flow, and the data flow after turning encapsulation can be HLS data flow, the HLS It may include multiple live streaming segments (i.e. TS file) in data flow.
In an alternative embodiment, it when live streaming is initiated at live streaming end, sends the live data FLV stream that live streaming generates to Stream receives server, and stream receives server and monitors network input port in real time, is monitoring that network input port has data inflow When, dispatch service is triggered, dispatch service calling turns packing service, turns packing service and carries out turning envelope to live data FLV stream Dress, obtains HLS data flow, includes index file and multiple live streaming segments in the HLS data flow.Screenshot service is from turning packing service HLS data flow is pulled, and obtains index file from the HLS data flow, is obtained in multiple live streaming segments based on the index file Target fragment, and to target fragment carry out shot operation, obtain picture, and the picture is uploaded to picture servers.
Inquiry request can be sent to server by playing end, which is used for the picture of some live streaming of request, After picture servers receive the inquiry request, picture corresponding with the inquiry request is obtained, and the picture is returned to and is broadcast Put end.
Wherein, since the variation with the time, the first live data streams also are not stopping to change, the second achievement data stream also can It changes, based on the above embodiment, the target fragment that different time determines can be different, and the picture intercepted can not yet Together, the different time differences for playing end and sending inquiry request, the available different pictures to same live streaming.It is alternatively possible to The segment of time the latest will be generated as target fragment, in this way, can obtain when playing the picture that end request is similarly broadcast live Get newest picture.
A kind of processing method of live data is provided according to embodiments of the present invention, and Fig. 2 is according to an embodiment of the present invention A kind of flow chart one of the processing method of optional live data, as shown in Fig. 2, this method application is on the server, this method It may comprise steps of:
Step S202 obtains the first live data streams;
Step S204 carries out the first live data streams to turn encapsulation operation, obtains the second live data streams, wherein second It include multiple live streaming segments in live data streams;
Step S206 obtains the target fragment in multiple live streaming segments;
Step S208 carries out shot operation to target fragment, obtains picture corresponding with the first live data streams.
Through the foregoing embodiment, its turn can be encapsulated as to include multiple straight after getting the first live data streams The second live data streams of segment are broadcast, and shot operation is carried out to the target fragment in multiple live streaming segments.In above-described embodiment In, when executing shot operation, without the screenshot from complete live data streams, that is, without to complete live data streams The operation for being encoded and being recoded, substantially reduces the handling duration of coding and recodification, and resource when reducing coding Occupy, solve the problems, such as in the prior art from live stream intercept picture resource consume it is big, realize occupy fewer resource i.e. The effect of the achievable shot operation to live stream.
In the technical solution of above-mentioned steps S202, server monitors the network port in real time, if the starting live streaming of live streaming end, clothes Business device can listen to the signal of the starting, and obtain the first live data streams that live streaming end is sent in real time.
In an alternative embodiment, monitoring service can be disposed on the server, and the monitoring service is for monitoring net Whether network port receives live data streams, and in the case where receiving the first live data streams, triggers dispatch service.
Optionally, which can be FLV data flow, and FLV data flow is long connection, and length connection refers to Multiple data packets can be continuously transmitted in a connection, transmit FLV data flow, when data are transmitted, connection is disconnected.
In the technical solution of above-mentioned steps S204, the first live data streams are carried out to turn encapsulation operation, it is straight to obtain second Multicast data stream, wherein include multiple live streaming segments in the second live data streams.
Optionally, dispatch service, which can be called, turns packing service (or turning package server), this turns package server can be with First live data streams are carried out to turn encapsulation operation, the circulation of the first live data is encapsulated as the comprising multiple live streaming segments Two live data streams.
Optionally, the second live data streams are HLS data flow, and HLS, that is, HTTP Live Stearming, is a kind of code Rate adaptive technique, index file, TS media slicing file and key in HLS data flow including a m3u8 encrypt illustration and text juxtaposed setting Part.Wherein, the file serial number of first TS file, each TS file indexed file be can recorde in the index file of m3u8 In have fixed unique sequence number;Can also be recorded in the index file first TS file absolute time and each file Duration.
For example, FLV stream compression is encapsulated as HLS data flow, which includes multiple TS files, each TS text Part records the content of a live streaming segment.
In this embodiment, the first live data streams are converted into the second live data streams comprising multiple live streaming segments, Multiple live streaming segments can be used short connection and be communicated.Wherein, when short connection refers to that communication two party has data interaction, one is established A connection after data are sent completely, then disconnect this connection, i.e., connects the transmission for only completing a business every time.
In the technical solution of above-mentioned steps S206, the target fragment in multiple live streaming segments is obtained.Different live streaming pieces Section can recorde content in different time periods, can obtain target fragment according to the content that need to be intercepted.
In the technical solution of above-mentioned steps S208, shot operation is carried out to target fragment, is obtained and the first live data Flow corresponding picture.
Optionally, after determining target fragment, screenshot service is called to be decoded operation to target fragment, and to decoding Obtained information carries out shot operation, obtains picture corresponding with the first live data streams.In this embodiment, to target fragment It is decoded operation, rather than the data in whole live data streams are decoded, reduces decoded workload, thus Decoded resource occupation amount can be reduced.
Wherein, screenshot service can be used to record for one section, converted digital audio, video, and be converted into opening for stream Ffmpeg realization can be used in source computer program, optionally, the screenshot service, and multimedia video handling implement ffmpeg can To realize the function of video acquisition function, video format conversion, video capture, watermarking.
Optionally, shot operation may is that for selected video here, intercept the thumbnail of specified time, here Figure can be static map and Dynamic Graph.
According to the abovementioned embodiments of the present invention, the target fragment obtained in multiple live streaming segments may include as shown in Figure 3 :
Step S302: index file is obtained from the second live data streams, wherein record there are segment column in index file Table.
Step S304: according to fragment list, target fragment is obtained from the second live data streams.
Step S202, S204 and S208 in the embodiment is consistent with the implementation in above-described embodiment, herein not It repeats again.
Optionally, include index file in the second live data streams, may include fragment list in the index file, the piece Documentary identification information and temporal information are recorded in Duan Liebiao.First live data streams can carried out to turn encapsulation operation, After obtaining the second live data streams, fragment list is determined using the index file in the second live data streams, according to the segment List obtains target fragment from the second live data streams, after obtaining target fragment, carries out shot operation to it, obtains Picture corresponding with the first live data streams.
Through the foregoing embodiment, it can use the fragment list recorded in index file and obtain target fragment, acquisition modes Simply, accurately.
Optionally, after getting the second live data streams, index file is downloaded from the second live streaming flow data, under It carries obtained index file to be parsed, obtains fragment list, mesh is obtained from the second live data streams according to the fragment list Standard film section.
In this embodiment it is possible to obtain the target fragments in multiple live streaming segments, the target fragment can for one or Multiple, which is the Partial Fragment in multiple live streaming segments, that is, record has the first live data streams in target fragment Partial content shot operation can be carried out based on the partial content of the first live data streams, in screenshot by the embodiment Without being decoded operation to all contents, reduces resource occupation, improve processing speed.
In an alternative embodiment, according to fragment list, target fragment is obtained from the second live data streams can be with Comprise determining that the current interception time for executing shot operation;From fragment list, segment corresponding with current interception time is read Information;Target fragment pointed by piece segment information is obtained from the second live data streams.
Wherein, which can be the current interception time for executing shot operation, can be true according to the interception time Stator segment information, piece segment information here can be the sequence number of segment or the identification information of segment.
Optionally, the first live data streams are being carried out to turn encapsulation operation, after obtaining the second live data streams, from second Index file is downloaded in live data streams, and parses fragment list from index file, and according to determining interception time, from Corresponding with interception time segment information (such as fragment sequence number or fragment identification) is read in fragment list, and according to the piece Segment information obtains target fragment from the second live data streams, after obtaining target fragment, carries out shot operation to it, obtains Picture corresponding with the first live data streams.
Wherein, different live streaming piece segment record contents in different time periods detects the interception after determining interception time The target time section that time falls into reads the fragment sequence number or segment for recording the target time section content from fragment list Mark.
For example, the interception time determined is 20s.The piece segment information recorded in fragment list is as shown in table 1:
Table 1
Piece segment information Period
1 0s-5s
2 5s-10s
3 10s-18s
4 18s-25s
It as shown in table 1, include four live streaming segments in second live data streams, the piece segment information in table 1 can be sequence Row information, e.g., the segment of sequence number 1 have recorded the content of 0s-5s, and the segment of sequence number 2 has recorded the content of 5s-10s, sequence The segment of row number 3 has recorded the content of 10s-18s, and the segment of sequence number 4 has recorded the content of 18s-25s.When determining interception Between when being 20s, can determine that the interception time falls into the target time section of 18s-25s, and determine that piece segment information is sequence number 4, the target fragment of sequence number direction can be obtained from the second live data streams, that is, obtaining from the second live data streams Take the 4th live streaming segment.
In an alternative embodiment, interception time includes: the time that last time obtains the first live data streams.It can Selection of land can will acquire the time of newest first live data streams as the interception time, that is, from recently received number According to middle screenshot, it can guarantee the real-time of the picture generated in this way.
Specifically, the first live data streams are being carried out to turn encapsulation operation, after obtaining the second live data streams, from second Index file is downloaded in live data streams, and parses fragment list from index file, determines that interception time is the first live streaming The newest renewal time of data flow reads the piece segment information of record latest time section content from fragment list, and according to this Piece segment information obtains the corresponding target fragment of latest time section from the second live data streams, after obtaining target fragment, Shot operation is carried out to it, obtains picture corresponding with the first live data streams.
In another alternative embodiment, interception time can for last interception time interval scheduled duration when Between.Optionally, scheduled duration can be pre-set time interval, which, which can be more than or equal to, executes shot operation Duration in this way can be in this embodiment it is possible to execute a shot operation to the first live data streams every scheduled duration The picture for guaranteeing that interception obtains is uniformly distributed as time goes by, so that the picture that interception obtains can accurately reflect first The live content of live data streams.
Optionally, the scheduled duration can for execute shot operation prearranged multiple, the prearranged multiple can for greater than etc. In 1 and being less than the multiple of predetermined threshold, optionally, which can be the number between 1 to 10, e.g., 1 times or 1.5 times Or 2 times, using the scheduled duration, the target fragment for the pending screenshot processing that do not overstock, such user is in inquiry picture When can inquire newest picture, and the target fragment to be processed not overstock it is also possible that caching pressure subtract It is small.
For example, executing the when a length of 5s of shot operation, then 5s can be determined for interval, to determine interception time, e.g., interception Time can be with are as follows: 1s, 6s, 11s, and so on.
For another example, the when a length of 5s for executing shot operation can then determine 10s for interval, to determine that interception time is e.g. cut Take the time can be with are as follows: 1s, 11s, 21s, and so on.
In order to further ensure the real-time of the picture of generation, in an alternative embodiment, the first live streaming number is obtained Include: to receive server every scheduled duration from stream and obtain the first live data streams according to stream, receives clothes from stream every scheduled duration The first live data streams are obtained in business device, and from picture is wherein intercepted, obtain a live data streams at regular intervals, it can be with According to newest data cutout picture, avoiding leads to the real-time of the picture generated because the live data streams got lag The problem of difference.
It is alternatively possible to which periodically receiving server from stream every 3 seconds obtains the first live data streams.
In another alternative embodiment, obtain the first live data streams include: executed a shot operation it Afterwards, server is received from stream obtain the first live data streams.In this embodiment, every to have executed a shot operation, it is returned to The operation for obtaining the first live data streams is executed, so that entire process flow is all very smooth, and one is formed and closes The environment of ring has considered not only the time of shot operation in this scenario, it is also considered that has arrived the real-time effective of live data streams Property, the process resource of processor and processing speed can be made to reach maximization.
According to the abovementioned embodiments of the present invention, step S204 carries out the first live data streams to turn encapsulation operation, obtains Two live data streams may include: to carry out decapsulation processing to the first live data streams, obtain decapsulation data;To decapsulation number According to formatting, change data is obtained;Change data is packaged, the second live data streams are obtained.
One multimedia file includes audio-frequency unit and video section, Video coding and audio coding be packaged into one it is complete Whole multimedia file can have different implementations, and implementation here is packaged type, different packaged types There is different suffix.Optionally, encapsulation is that the encoded video track compressed and video track are obtained format according to certain It is put into a file.During turning encapsulation, the first live data streams first can be subjected to decapsulation processing, then by it It is packaged according to the format of the second live data streams, the second live data streams can be obtained.
HLS data flow can be obtained for example, FLV data flow is packaged according to HLS format.
According to an embodiment of the invention, the embodiment may be used also after obtaining picture corresponding with the first live data streams To include following steps shown in Fig. 4:
Step S402, by picture uploading pictures server.
Step S404 is received and is played the inquiry request that end is sent, wherein number is broadcast live for request first in inquiry request According to the picture of stream.
Optionally, the network resources address URL of the first live data streams is carried in the inquiry request.
The picture corresponding with the first live data streams stored in picture servers is sent to and plays end by step S406.
Step S202 to S208 in the embodiment is consistent with the implementation in above-described embodiment, and details are not described herein.
Optionally, picture servers can store one or more pictures corresponding with the first live data streams.In picture In the case that server stores a picture, which can be the picture intercepted the latest;Multiple figures are stored in picture servers It may include the picture intercepted the latest in multiple picture in the case where piece, the corresponding intercept operation of multiple picture can be Continuously, it is also possible to discontinuous, can continuously refer to here is continuous on number of operations, e.g., does not connect in intercept operation In the case where continuous, multiple picture can be the picture intercepted for the first time, the picture of third time interception, the 5th picture intercepted (picture intercepted the latest);In the continuous situation of intercept operation, multiple picture can be the picture of interception, the 4th for the third time The picture of secondary interception, the 5th picture (picture intercepted the latest) intercepted.
In the discontinuous situation of the corresponding intercept operation of multiple pictures, can discontinuously be made a reservation for by interval here is secondary Number is to realize.
In an alternative embodiment, picture servers can be chosen from the picture of the first live data streams of storage The some or all of picture chosen is sent to and plays end by some or all of picture.
Through the foregoing embodiment, the dynamic realtime screenshot to live stream may be implemented, when user initiates to be broadcast live, to Background service livereceive service (i.e. stream receives service) plug-flow (flv data, i.e. the first live data streams), live streaming is broadcast live Dispatch service master perceives user and initiates live streaming, then carries out flv2hlscdn scheduling, and flv2hlscdn service (turns to seal Dress service) outputting standard HLS data flow (i.e. the second live data streams), finally be broadcast live screenshot service simulate player, downloading HLS data flow, and parse the data content in HLS data flow, and carry out screenshot using ffmpeg, finally by screenshot in real time on Pass to picture servers.Url in live streaming viewing app reference picture servers, can pull newest image content and carry out Front end is presented.
It is described in detail below with reference to an optional embodiment of Fig. 5 to the application, as shown in figure 5, the embodiment It may include steps of:
Step S501: it plays end and initiates live streaming.
Live streaming client can be installed, user is after live streaming end starting live streaming client, in live streaming visitor on live streaming end Enabled instruction is generated on the live streaming interface at family end, which can acquire live data streams, and will acquisition after start-up Live data streams (such as FLV data flow) be pushed in livereceive server (i.e. stream receive server).
Step S502: stream receives the dispatch service of server triggers server.
Stream receives the server real-time monitoring network port, is detecting that the network port has the case where live data streams inflow Under, triggering dispatch service master turn the scheduling of packing service.
Step S503: dispatch service calling turns packing service, to carry out turning encapsulation to live data streams.
Optionally, stream receives server livereceive and perceives some data flow, and triggering dispatch service master is carried out Flv2hlscdn scheduling, flv2hlscdn turn the hls data flow (i.e. the second live data streams) of packing service outputting standard.
Optionally, turn package server flv2hlscdn and receive the flv number that server livereceive pulls standard from stream According to stream (i.e. the first live data streams), then carry out turning encapsulation, the HLS data (i.e. the second live data streams) of outputting standard.
Step S504: live streaming screenshot service obtains target fragment from live data streams.
The second live data of the screenshot service cutPic meeting periodically slave flv2hlscdn service of (such as every three seconds) is broadcast live Index file (such as m3u8 file) is pulled in stream, and index file is parsed to obtain fragment list, remembers the fragment list Target fragment (such as ts file) is downloaded from the second live data streams.
Step S505: the picture uploading pictures server that live streaming screenshot service will be intercepted from target fragment.
Live streaming screenshot service pulls hls data flow from flv2hlscdn service, downloads m3u8 file, solves from m3u8 file It is precipitated ts listed files (i.e. fragment list);Ts file is downloaded from the second live data streams according to the fragment list, and is used Ffmpeg carries out screenshot to ts file;Picture is uploaded into picture servers.
Step S506: picture servers issue picture after receiving the request for playing end.
Web server or other services are disposed in picture servers, for handling the http request for obtaining certain picture (such as above-mentioned inquiry request), in this way when user, which carries out picture using identical url, to be pulled, whenever user carries out page brush Newly, newest picture can be got.
Through the foregoing embodiment, the image content got is reflection live content that can be relatively accurate in real time.Its In, the format of picture can be diversified;The type of picture servers and the naming rule of url are also multiplicity.
It should be noted that for the various method embodiments described above, for simple description, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, the present invention is not limited by the sequence of acts described because According to the present invention, some steps may be performed in other sequences or simultaneously.Secondly, those skilled in the art should also know It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules is not necessarily of the invention It is necessary.
Through the above description of the embodiments, those skilled in the art can be understood that according to above-mentioned implementation The method of example can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but it is very much In the case of the former be more preferably embodiment.Based on this understanding, technical solution of the present invention is substantially in other words to existing The part that technology contributes can be embodied in the form of software products, which is stored in a storage In medium (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, calculate Machine, server or network equipment etc.) execute method described in each embodiment of the present invention.
According to embodiments of the present invention, a kind of processing dress for implementing the processing method of above-mentioned live data is additionally provided It sets.Fig. 6 is a kind of schematic diagram of the processing unit of optional live data according to an embodiment of the present invention, as shown in fig. 6, the dress It sets and may include:
First acquisition unit 61, for obtaining the first live data streams;
Turn encapsulation unit 63, turn encapsulation operation for carrying out to the first live data streams, obtain the second live data streams, In, it include multiple live streaming segments in the second live data streams;
Second acquisition unit 65, for obtaining the target fragment in multiple live streaming segments;
Screenshot unit 67 obtains picture corresponding with the first live data streams for carrying out shot operation to target fragment.
Through the foregoing embodiment, its turn can be encapsulated as to include multiple straight after getting the first live data streams The second live data streams of segment are broadcast, and shot operation is carried out to the target fragment in multiple live streaming segments.In above-described embodiment In, when executing shot operation, without the screenshot from complete live data streams, that is, without to complete live data streams The operation for being encoded and being recoded, substantially reduces the handling duration of coding and recodification, and resource when reducing coding Occupy, solve the problems, such as in the prior art from live stream intercept picture resource consume it is big, realize occupy fewer resource i.e. The effect of the achievable shot operation to live stream.
According to the abovementioned embodiments of the present invention, as shown in fig. 7, second acquisition unit may include: the first acquisition module 81, For obtaining index file from the second live data streams, wherein record has fragment list in index file;Second obtains module 83, for obtaining target fragment from the second live data streams according to fragment list.
Optionally, the second acquisition module is specifically used for: determining the current interception time for executing shot operation;From fragment list In, read corresponding with interception time segment information;Target patch pointed by piece segment information is obtained from the second live data streams Section.
Wherein, interception time includes: the time that last time obtains the first live data streams, and/or, when with last interception Between be spaced scheduled duration time.
According to the abovementioned embodiments of the present invention, first acquisition unit is specifically used for: every scheduled duration, receiving service from stream Device obtains the first live data streams;Or after having executed a shot operation, server is received from stream and obtains the first live streaming number According to stream.
In an alternative embodiment, turn encapsulation unit to be specifically used for: the first live data streams are carried out at decapsulation Reason obtains decapsulation data;Decapsulation data are formatted, change data is obtained;Change data is packaged, is obtained To the second live data streams.
Still optionally further, the picture in above-described embodiment includes: static images and dynamic picture.
Herein it should be noted that above-mentioned module is identical as example and application scenarios that corresponding step is realized, but not It is limited to 1 disclosure of that of above-described embodiment.It should be noted that above-mentioned module as a part of device may operate in as In hardware environment shown in FIG. 1, hardware realization can also be passed through by software realization.
According to embodiments of the present invention, additionally provide a kind of server for implementing the processing method of above-mentioned live data or Terminal.
Fig. 8 is a kind of structural block diagram of terminal according to an embodiment of the present invention, as shown in figure 8, the terminal may include: one A or multiple (one is only shown in figure) processor 201, memory 203 and transmitting device 205 are (in such as above-described embodiment Sending device), as shown in figure 8, the terminal can also include input-output equipment 207.
Wherein, memory 203 can be used for storing software program and module, such as the live data in the embodiment of the present invention Corresponding program instruction/the module for the treatment of method and apparatus, the software journey that processor 201 is stored in memory 203 by operation Sequence and module realize the processing method of above-mentioned live data thereby executing various function application and data processing.It deposits Reservoir 203 may include high speed random access memory, can also include nonvolatile memory, as one or more magnetic storage fills It sets, flash memory or other non-volatile solid state memories.In some instances, memory 203 can further comprise relative to place The remotely located memory of device 201 is managed, these remote memories can pass through network connection to terminal.The example packet of above-mentioned network Include but be not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Above-mentioned transmitting device 205 is used to that data to be received or sent via network, can be also used for processor with Data transmission between memory.Above-mentioned network specific example may include cable network and wireless network.In an example, Transmitting device 205 includes a network adapter (Network Interface Controller, NIC), can pass through cable It is connected with other network equipments with router so as to be communicated with internet or local area network.In an example, transmission dress 205 are set as radio frequency (Radio Frequency, RF) module, is used to wirelessly be communicated with internet.
Wherein, specifically, memory 203 is for storing application program.
The application program that processor 201 can call memory 203 to store by transmitting device 205, to execute following steps It is rapid: to obtain the first live data streams;First live data streams are carried out to turn encapsulation operation, obtain the second live data streams, wherein It include multiple live streaming segments in second live data streams;Obtain the target fragment in multiple live streaming segments;Target fragment is carried out Shot operation obtains picture corresponding with the first live data streams.
Processor 201 is also used to execute following step: obtaining index file from the second live data streams, wherein index Record has fragment list in file;According to fragment list, target fragment is obtained from the second live data streams.
Processor 201 is also used to execute following step: determining the current interception time for executing shot operation;From fragment list In, read corresponding with interception time segment information;Target patch pointed by piece segment information is obtained from the second live data streams Section.
Optionally, interception time includes: the time that last time obtains the first live data streams, and/or, with last interception The time of time interval scheduled duration.
Processor 201 is also used to execute following step: every scheduled duration, receiving server from stream and obtains the first live streaming number According to stream;Or after having executed a shot operation, server is received from stream and obtains the first live data streams.
Processor 201 is also used to execute following step: carrying out decapsulation processing to the first live data streams, is decapsulated Data;Decapsulation data are formatted, change data is obtained;Change data is packaged, the second live streaming number is obtained According to stream.
Optionally, picture includes: static images and dynamic picture.
Using the embodiment of the present invention, its turn can be encapsulated as to include multiple after getting the first live data streams The second live data streams of segment are broadcast live, and shot operation is carried out to the target fragment in multiple live streaming segments.In above-mentioned implementation In example, when executing shot operation, without the screenshot from complete live data streams, that is, without to complete live data The operation that stream is encoded and recoded, substantially reduces the handling duration of coding and recodification, and money when reducing coding Source occupies, and solves the problems, such as that picture resource is intercepted from live stream in the prior art consumes big, realizes occupancy fewer resource The effect to the shot operation of live stream can be completed.
Optionally, the specific example in the present embodiment can be with reference to example described in above-described embodiment, the present embodiment Details are not described herein.
It will appreciated by the skilled person that structure shown in Fig. 8 is only to illustrate, terminal can be smart phone (such as Android phone, iOS mobile phone), tablet computer, palm PC and mobile internet device (Mobile Internet Devices, MID), the terminal devices such as PAD.Fig. 8 it does not cause to limit to the structure of above-mentioned electronic device.For example, terminal is also May include than shown in Fig. 8 more perhaps less component (such as network interface, display device) or have with shown in Fig. 8 Different configurations.
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can It is completed with instructing the relevant hardware of terminal device by program, which can store in a computer readable storage medium In, storage medium may include: flash disk, read-only memory (Read-Only Memory, ROM), random access device (Random Access Memory, RAM), disk or CD etc..
The embodiments of the present invention also provide a kind of storage mediums.Optionally, in the present embodiment, above-mentioned storage medium can With the program code of the processing method for executing live data.
Optionally, in the present embodiment, above-mentioned storage medium can be located at multiple in network shown in above-described embodiment On at least one network equipment in the network equipment.
Optionally, in the present embodiment, storage medium is arranged to store the program code for executing following steps:
Obtain the first live data streams;First live data streams are carried out to turn encapsulation operation, obtain the second live data streams, It wherein, include multiple live streaming segments in the second live data streams;Obtain the target fragment in multiple live streaming segments;To target fragment Shot operation is carried out, picture corresponding with the first live data streams is obtained.
Optionally, storage medium is also configured to store the program code for executing following steps: from the second live streaming number According to obtaining index file in stream, wherein record has fragment list in index file;According to fragment list, from the second live data Target fragment is obtained in stream.
Optionally, storage medium is also configured to store the program code for executing following steps: determining current execute The interception time of shot operation;From fragment list, corresponding with interception time segment information is read;From the second live data streams Target fragment pointed by middle acquisition piece segment information.
Optionally, interception time includes: the time that last time obtains the first live data streams, and/or, with last interception The time of time interval scheduled duration.
Optionally, storage medium is also configured to store the program code for executing following steps: every scheduled duration, Server, which is received, from stream obtains the first live data streams;Or after having executed a shot operation, server is received from stream and is obtained Take the first live data streams.
Optionally, storage medium is also configured to store the program code for executing following steps: to the first live streaming number Decapsulation processing is carried out according to stream, obtains decapsulation data;Decapsulation data are formatted, change data is obtained;To turn It changes data to be packaged, obtains the second live data streams.
Optionally, picture includes: static images and dynamic picture.
Optionally, the specific example in the present embodiment can be with reference to example described in above-described embodiment, the present embodiment Details are not described herein.
Optionally, in the present embodiment, above-mentioned storage medium can include but is not limited to: USB flash disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or The various media that can store program code such as CD.
The serial number of the above embodiments of the invention is only for description, does not represent the advantages or disadvantages of the embodiments.
If the integrated unit in above-described embodiment is realized in the form of SFU software functional unit and as independent product When selling or using, it can store in above-mentioned computer-readable storage medium.Based on this understanding, skill of the invention Substantially all or part of the part that contributes to existing technology or the technical solution can be with soft in other words for art scheme The form of part product embodies, which is stored in a storage medium, including some instructions are used so that one Platform or multiple stage computers equipment (can be personal computer, server or network equipment etc.) execute each embodiment institute of the present invention State all or part of the steps of method.
In the above embodiment of the invention, it all emphasizes particularly on different fields to the description of each embodiment, does not have in some embodiment The part of detailed description, reference can be made to the related descriptions of other embodiments.
In several embodiments provided herein, it should be understood that disclosed client, it can be by others side Formula is realized.Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, and only one Kind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine or It is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual it Between coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or module It connects, can be electrical or other forms.
The unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
It, can also be in addition, the functional units in various embodiments of the present invention may be integrated into one processing unit It is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated list Member both can take the form of hardware realization, can also realize in the form of software functional units.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (14)

1. a kind of processing method of live data characterized by comprising
Obtain the first live data streams;
First live data streams are carried out turning encapsulation operation, obtain the second live data streams, wherein the second live streaming number According in stream include multiple live streaming segments;
Obtain the target fragment in the multiple live streaming segment;
Shot operation is carried out to the target fragment, obtains picture corresponding with first live data streams.
2. the method according to claim 1, wherein obtaining the target fragment packet in the multiple live streaming segment It includes:
Index file is obtained from second live data streams, wherein record has fragment list in the index file;
According to the fragment list, the target fragment is obtained from second live data streams.
3. according to the method described in claim 2, it is characterized in that, according to the fragment list, from second live data The target fragment is obtained in stream includes:
Determine the current interception time for executing shot operation;
From fragment list, corresponding with interception time segment information is read;
The target fragment pointed by described segment information is obtained from second live data streams.
4. according to the method described in claim 3, it is characterized in that, the interception time includes: that last time obtains first directly The time of multicast data stream, and/or, the time with last interception time interval scheduled duration.
5. the method according to claim 1, wherein the first live data streams of acquisition include:
Every scheduled duration, server is received from stream and obtains first live data streams;Or
After having executed the primary shot operation, server is received from the stream and obtains first live data streams.
6. the method according to claim 1, wherein carry out turning encapsulation operation to first live data streams, Obtaining the second live data streams includes:
Decapsulation processing is carried out to first live data streams, obtains decapsulation data;
The decapsulation data are formatted, change data is obtained;
The change data is packaged, second live data streams are obtained.
7. the method according to claim 1, wherein the picture includes: static images and dynamic picture.
8. a kind of processing unit of live data characterized by comprising
First acquisition unit, for obtaining the first live data streams;
Turn encapsulation unit, for carrying out turning encapsulation operation to first live data streams, obtain the second live data streams, In, it include multiple live streaming segments in second live data streams;
Second acquisition unit, for obtaining the target fragment in the multiple live streaming segment;
Screenshot unit obtains figure corresponding with first live data streams for carrying out shot operation to the target fragment Piece.
9. device according to claim 8, which is characterized in that the second acquisition unit includes:
First obtains module, for obtaining index file from second live data streams, wherein remember in the index file Record has fragment list;
Second obtains module, for obtaining the target fragment from second live data streams according to the fragment list.
10. device according to claim 9, which is characterized in that the second acquisition module is specifically used for:
Determine the current interception time for executing shot operation;
From fragment list, corresponding with interception time segment information is read;
The target fragment pointed by described segment information is obtained from second live data streams.
11. device according to claim 10, which is characterized in that the interception time includes: that last time obtains first The time of live data streams, and/or, the time with last interception time interval scheduled duration.
12. device according to claim 8, which is characterized in that the first acquisition unit is specifically used for:
Every scheduled duration, server is received from stream and obtains first live data streams;Or
After having executed the primary shot operation, server is received from the stream and obtains first live data streams.
13. device according to claim 8, which is characterized in that the encapsulation unit that turns is specifically used for:
Decapsulation processing is carried out to first live data streams, obtains decapsulation data;
The decapsulation data are formatted, change data is obtained;
The change data is packaged, second live data streams are obtained.
14. device according to claim 8, which is characterized in that the picture includes: static images and dynamic picture.
CN201611048474.9A 2016-11-22 2016-11-22 The treating method and apparatus of live data Active CN106603503B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611048474.9A CN106603503B (en) 2016-11-22 2016-11-22 The treating method and apparatus of live data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611048474.9A CN106603503B (en) 2016-11-22 2016-11-22 The treating method and apparatus of live data

Publications (2)

Publication Number Publication Date
CN106603503A CN106603503A (en) 2017-04-26
CN106603503B true CN106603503B (en) 2019-01-08

Family

ID=58593168

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611048474.9A Active CN106603503B (en) 2016-11-22 2016-11-22 The treating method and apparatus of live data

Country Status (1)

Country Link
CN (1) CN106603503B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107318044A (en) * 2017-06-30 2017-11-03 武汉斗鱼网络科技有限公司 A kind of live content intercept method and system
CN107438175B (en) * 2017-08-14 2019-08-30 武汉微创光电股份有限公司 For the rapid screenshot method and system of extensive video
CN107610036B (en) * 2017-09-26 2021-09-07 武汉斗鱼网络科技有限公司 Method and device for outputting live broadcast identification picture and computer equipment
CN108377429A (en) * 2018-04-24 2018-08-07 中国广播电视网络有限公司 A kind of demolition of video flowing and take out frame method
CN109871496A (en) * 2019-01-30 2019-06-11 重庆神指奇动网络有限公司 A kind of information-pushing method, information display method, server and display equipment
CN110636337B (en) * 2019-08-20 2021-08-17 腾讯科技(深圳)有限公司 Video image intercepting method, device and system
CN114679598B (en) * 2022-03-24 2023-11-21 上海哔哩哔哩科技有限公司 Live broadcast pushing method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105828169A (en) * 2016-03-25 2016-08-03 深圳市九洲电器有限公司 Television program video fragment sharing method and system
CN106034240A (en) * 2015-03-13 2016-10-19 小米科技有限责任公司 Video detection method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101951512B (en) * 2010-08-24 2012-11-28 中国科学院深圳先进技术研究院 Fragmentation transcoding method and system of live video and real-time video
JP6257197B2 (en) * 2013-07-18 2018-01-10 キヤノン株式会社 Information processing apparatus, control method therefor, program, and storage medium
CN104506967B (en) * 2015-01-05 2017-11-21 百视通网络电视技术发展有限责任公司 The live real time conversion methods and system for flowing to HLS live TV streams of UDP
CN104540004A (en) * 2015-01-27 2015-04-22 深圳市中兴移动通信有限公司 Video screenshot method and video screenshot device
CN105828146A (en) * 2016-03-21 2016-08-03 乐视网信息技术(北京)股份有限公司 Video image interception method, terminal and server

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106034240A (en) * 2015-03-13 2016-10-19 小米科技有限责任公司 Video detection method and device
CN105828169A (en) * 2016-03-25 2016-08-03 深圳市九洲电器有限公司 Television program video fragment sharing method and system

Also Published As

Publication number Publication date
CN106603503A (en) 2017-04-26

Similar Documents

Publication Publication Date Title
CN106603503B (en) The treating method and apparatus of live data
WO2016150317A1 (en) Method, apparatus and system for synthesizing live video
CN103763626B (en) A kind of information-pushing method, equipment and system
CN102685597B (en) Device, mobile terminal and method of content reappearing
CN108200447B (en) Live broadcast data transmission method and device, electronic equipment, server and storage medium
CN103581698B (en) Terminal device and video data releasing method
CN104602133A (en) Multimedia file shearing method and terminal as well as server
US10911809B2 (en) Communication apparatus, communication method, and program
CN103491431A (en) Method, terminal and system for audio and video sharing of digital television
CN112019905A (en) Live broadcast playback method, computer equipment and readable storage medium
CN105451071A (en) Video stream processing method, device and system
KR102110623B1 (en) Transmission device, information processing method, program, reception device, and application linking system
KR20220165693A (en) Method and apparatus for digital broadcast services
CN109714622A (en) A kind of video data handling procedure, device and electronic equipment
CN104834649B (en) It can realize the smart machine and multiple-equipment team working method of more equipment collaborations
CN110139123A (en) The broadcasting of files in stream media, transmission, treating method and apparatus
CN108632642A (en) Streaming Media method for pushing and device
EP3007449B1 (en) Protected storage of content with two complementary memories
CN110113298B (en) Data transmission method, device, signaling server and computer readable medium
CN109640105B (en) Game live broadcast method and device, storage medium and electronic device
CN106331763A (en) Method of playing slicing media files seamlessly and device of realizing the method
CN106792125A (en) A kind of video broadcasting method and its terminal, system
CN107948685B (en) Information promotion method and information promotion device
CN102904891A (en) Multimedia data sharing method and device and multimedia playing equipment
CN109587517B (en) Multimedia file playing method and device, server and storage medium

Legal Events

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