The application requires in the rights and interests of in May, the 2013 10-2013-0057957 korean patent application that 22 Korea S Department of Intellectual Property submits to, and the open of this application is all herein incorporated by reference.
Summary of the invention
One or more embodiment of the present invention comprises such method: when for storing while being monitored between the media server of the image that camera catches and building automation system (BAS) server transmitting image, show the time of using the image of implementing the broadcasting of host-host protocol (RTP) bag, thereby in building automation system (BAS) server, calculate and show the correct time of the image that uses the broadcasting of RTP bag.
Will be in the following description partly set forth additional aspect, and this part will be clearly from this description, or can learn by the practice of the embodiment that presents.
According to one or more embodiment of the present invention, a kind of method that shows the time of image, wherein, as RTP (RTP) bag that is sent the method for image by media server according to the request of client, play described image, described media server stores is by the image that monitors that camera catches, described method comprises: by client, to media server requested image, play; Between client and media server, exchange real-time streaming protocol (RTSP) bag; By media server, a RTP bag that comprises very first time stamp is sent to client, in very first time stamp, record the very first time of the first picture frame; The very first time of being read from very first time stamp by client is set to current time, and current time is presented on the first picture frame; By media server, the 2nd RTP bag that comprises the second timestamp is sent to client, in the second timestamp, record the indication time of the second picture frame and the second time of the time difference between the very first time; By client, the addition result of the very first time and second time of reading from the second timestamp is set to current time, and current time is presented on the second picture frame.
The one RTP bag can be from media server, to send to for the first time the picture frame of client.
Media server can be based on changing the very first time second and the very first time based on second being recorded in very first time stamp.
Client can be set to current time the very first time based on being stored in second in very first time stamp, and shows current time on the first picture frame.
The one RTP bag can be to send to the current image frame a plurality of picture frames of client from media server.
Media server can be based on the second time of frequency inverted, and be recorded on the second timestamp to the time of second persond eixis the second picture frame and the time difference between the very first time the second time based on frequency.
Client can be converted to the second time based on second by the second time being stored in based on frequency in the second timestamp, and the additive value of the very first time and the second time is set to the current time of the second picture frame, and on the second picture frame, shows this current time.
Described method also can comprise: if the second time was less than, be the capacity of the second time stamp setting, the extended field in media server the 2nd RTP bag is set to null value; If it is the capacity of the second time stamp setting that the second time surpassed, by media server, determines and overlap; When overlapping, by media server, produce the second time after proofreading and correct; By media server, determining that whether the second time after proofreading and correct surpasses is the capacity of the second time stamp setting, is the capacity of the second time stamp setting if the second time after proofreading and correct surpasses, and produces the second time after again proofreading and correct; By media server, the 2nd RTP bag that comprises the second timestamp is sent to client, in the second timestamp, record the second time after correction or again proofread and correct after the second time.
The second time after correction can be the result that the second time deducted the capacity that is the second time stamp setting, the second time after again proofreading and correct can be that to deduct the second time after proofreading and correct be the capacity of the second time stamp setting, until the second time after proofreading and correct is less than the result of the capacity that is the second time stamp setting.
Described method also can comprise: if the second time after proofreading and correct is less than, be the capacity of the second time stamp setting, by the extended field in media server the 2nd RTP bag, be set to the first value; By media server, the 2nd RTP bag that comprises the second timestamp is sent to client, in the second timestamp, record the second time after correction.
Described method also can comprise: if the extended field that client detects in the 2nd RTP bag is not null value, and by client, definite overlapping; By client, confirm that the extended field in the 2nd RTP bag is set to the first value; By client, be that capacity, the second time after correction and the addition result of the very first time of the second time stamp setting is set to current time, and show current time on the second picture frame.
Described method also can comprise: if the second time after proofreading and correct surpasses, be the capacity of the second time stamp setting, the extended field in media server the 2nd RTP bag is set to the second value; By media server, produce the second time after again proofreading and correct; By media server, the 2nd RTP bag that comprises the second timestamp is sent to client, in the second timestamp, record the second time after again proofreading and correct.
The second time after again proofreading and correct can be deduct the second time after proofreading and correct be the second time stamp setting capacity until the second time after proofreading and correct be less than the result of the capacity that is the second time stamp setting.
Described method also can comprise: by media server, the final number of times of subtraction is recorded in the extended field in the 2nd RTP bag.
Described method also can comprise: if the extended field that client detects in the 2nd RTP bag is not null value, by client, is determined and overlapped; By client, confirm that the extended field in the 2nd RTP bag is set to the second value; By client, the extended field from the 2nd RTP bag reads the final number of times of subtraction; By the final number of times of client and subtraction be the capacity of the second time stamp setting accordingly, the second time after proofreading and correct and the addition result of the very first time are set to current time again, and current time is presented on the second picture frame.
Embodiment
The present invention can allow various types of changes or modification and pro forma various change, will be shown specifically in the accompanying drawings and describe in detail in specification specific embodiment.However, it should be understood that specific embodiment does not limit the invention to specific open form, but be included in the various modifications in spirit of the present invention and technical scope, the form that is equal to or replaces.In the following description, be not described in detail known function or structure, in order to avoid because unnecessary details makes the present invention fuzzy.
Although the term such as " first " and " second " can be used to describe various elements, these elements are not limited by term.Term can be used to particular element and another part classification to come.
The term using is in this application only for describing specific embodiment, and with any intention restriction the present invention.The expression of singulative comprises the expression of plural form, unless they are obviously different each other in context.In this application, the existence that is used to refer to feature, quantity, step, operation, element, part or its combination of enforcement such as the term of " comprising " and " having " be should understand, and existence or the interpolation of one or more other features, quantity, step, operation, element, part or its combination do not got rid of in advance.
In order to understand the present invention, open label in exemplary embodiment illustrated in the accompanying drawings, and by particular term, exemplary embodiment of the present invention is described.Yet the present invention is not limited by these particular term, and the present invention can comprise all component that those of ordinary skills can expect conventionally.Can utilize functional block and various treatment step to represent the present invention.These functions soon can be by configuring to realize for carrying out hardware and/or the software of the various quantity of specific function.For example, the present invention can adopt the direct circuit structure of realizing various functions under the control of one or more processors or other control device, for example, and memory, processing logic, look-up table etc.With the component class of the present invention that can carry out various functions with software programming or software element seemingly, can utilization and the various algorithms realized of the combination of data structure, processing, thread and/or other programming assembly, by programming or script (such as C, C++, Java or compilation), realize the present invention.Can utilize the algorithm of carrying out in one or more processors to come aspect practical function.In addition, the present invention can adopt the prior art for electronic environment setting, signal processing and/or data processing.Term such as " machinery ", " element ", " device " and " structure " can be widely used, and is not limited to machinery and physique.Term can comprise the meaning of a series of software threads that are associated with processor.
Now will be in detail with reference to embodiment, the example of embodiment is shown in the drawings, and the same numeral in accompanying drawing represents similar elements all the time.To this, the present embodiment can have different forms, and should not be construed as being limited to description set forth herein.Therefore, only by reference, embodiment is described to explain various aspects of the present invention below.As used herein, term "and/or" comprises any and all combinations of one or more relevant projects of listing.
Fig. 1 is for showing the block diagram of the system of the time of using the image that RTP (RTP) bag plays.With reference to Fig. 1, system can comprise at least one monitor camera 100, as the media server 200 of safety device and as building automation system (BAS) server of client, wherein, media server 200 comprises that storage monitors digital video recorder (DVR) or the network video recorder (NVR) of the image that camera 100 catches by least one.At least one monitors that camera 100, media server 200 and BAS server 300 are connected to each other by network with wired and/or wireless mode, with executing data communication.
At least one monitors that camera 100 is installed in around facility, to take surrounding environment and the image of seizure is sent to media server 200.BAS server 300 can be play to media server 200 requested image, and monitors the image being caught by least one supervision camera 100 receiving in real time from media server 200.
Now, media server 200 and BAS server 300 are according to RTP communication procedure sending and receiving view data.When media server 200 sends to BAS server 300 in real time by view data, RTP is used to smoothly need the real-time Transmission of the view data of wide bandwidth.
At media server 200, RTP bag was sent to before the BAS server 300 of client to media server 200 and BAS server 300 exchange real-time streaming protocol (RTSP) bags.The control information (description, setting, broadcasting etc.) of RTSP bag indication exchange between media server 200 and BAS server 300 is communicated by letter with initialization RTP.By exchange, RTSP wraps, and BAS server 300 is authenticated by media server 200, and wraps sending and receiving needed information before receiving view data from media server 200 by RTSP.Finally, before receiving RTP bag, from BAS server 300, PLAY order is sent to media server 200, wherein, BAS server 300 sends to media server 200 by PLAY order by the image request time.Media server 200 can send by the view data of the time of BAS server 300 requests or with the view data of the immediate time of time of asking and wrap as RTP.That is to say, BAS server 300 can not receive the view data of the time of request.
Fig. 2 illustrates the configuration of RTP bag.With reference to Fig. 2, RTP comprises 32 bit time stamps 21, and this 32 bit time stamp 21 has reacted the sampling moment of RTP data octets.Whenever having sent a picture frame, media server 200 just calculates last (first) picture frame and current (second) image time difference between true, to be converted to frequency (Hz) time difference, frequency (Hz) is recorded in the timestamp 21 of each RTP bag, RTP bag is sent to BAS server 300.BAS server 300 wraps to form a picture frame by receiving each RTP, wherein, BAS server 300 calculates the time difference between previous image frame and current image frame based on picture frame, frequency (Hz) is converted to the Coordinated Universal Time(UTC) (UTC: indication absolute time or current time), and in progress image, shows elapsed time value.That is to say, when using the timestamp 21 of each RTP bag, can perceive elapsed time between RTP bag or between the picture frame being formed by a plurality of RTP bags elapsed time.
Yet in order to obtain the correct time value of picture frame, BAS server 300 should receive RTCP Real-time Transport Control Protocol (RTCP) bag from media server 200.RTCP bag provides the method for sending and receiving or the control external information relevant to RTP image streams.More particularly, as the function of RTCP bag, first, notice is by the total quantity of the image bag of the absolute time of the image streams being sent out (UTC) information and RTP timestamp and transmission.Secondly, the communication delay value of the shake of the image streams receiving, packet loss and estimation is sent to transmit leg.The 3rd, the information such as title, e-mail address etc. of notice image streams transmit leg.The 4th, when source of media is left session, this fact is notified to the opposing party.The 5th, provide the RTCP of expansion to wrap.RTCP bag is not actual image information, but for controlling the additional information of RTP data, and because RTP bag needs wide bandwidth, therefore only to account for 0.5% amount of whole transmission data volume, sends RTCP bag.This percentage can according to circumstances change, and media server 200 is controlled the transmission percentage of RTCP bag.As mentioned above, RTCP bag carries RTP timestamp and absolute time (UTC).If client (comprising 300) periodically receives absolute time, this client can obtain the correct time of current just played picture frame.Yet a lot of media servers (comprising 200) may seldom provide RTCP bag due to the restriction of bandwidth etc., under this environment, client is not easy to obtain the correct time of picture frame.
Therefore, according to embodiments of the invention, in order to overcome this restriction, first, when BAS server 300 request media servers 200 send image, media server 200, based on changing current time second, records the current time based on second in the timestamp 21 of a RTP bag, and a RTP bag is sent to BAS server 300.According to RTP communication procedure, random value is inserted in the timestamp 21 of a RTP bag.Because random value is replaced by current time value, therefore meet RTP communication procedure.Therefore the timestamp 21 that, BAS server 300 can wrap from a RTP who receives, obtain current time.
Second, when sending next RTP bag, media server 200 time difference that the very first time based on sending is stabbed 21 conversions and previous image frame based on frequency, the time difference based on frequency is recorded in the timestamp 21 of next picture frame, and next picture frame is sent to BAS server 300.
When receiving RTP bag from media server 200 at every turn, BAS server 300 is all the time difference based on second between previous image frame and current image frame by the frequency inverted being recorded in the timestamp 21 of each RTP bag, continue to add the time difference of conversion to current time in the timestamp that is recorded in the RTP bag receiving, thereby obtain current time accurately.
According to RTP communication procedure, because the capacity arranging for timestamp 21 is 32 bits (2
32-1=4294967295), thus the expression of time certainly there is restriction.That is to say, the value of the timestamp 21 receiving from media server 200, may occur overlapping phenomenon.The value that in other words, the timestamp 21 of each RTP bag may occur continues to increase the phenomenon then reducing rapidly.When overlapping, BAS server 300 carrys out the time value increasing between calculating chart picture frame by the algorithm with in BAS server 300.
Yet problem is, media server 200 may not record any image in the given time, rather than continues document image in all time.When the non-registering time interval, be 47721 seconds or when longer, overlap.When the non-registering time interval, be 95443 seconds or when longer, also overlap.This is because the capacity arranging for timestamp 21 is 32 bits.BAS server 300 can not be known the value that causes overlapping not writing time of interval.Therefore,, by what describe according to the embodiment of the present invention, by media server 200, to BAS server 300, notify intra-record slack byte accurately now, in BAS server 300, show exactly the method for image player time.
Fig. 3 is according to the signal flow graph of the method for the time of the image of the demonstration use RTP bag broadcasting of the embodiment of the present invention.At this, do not repeat the description that sees figures.1.and.2 and carry out.
With reference to Fig. 3, at operation S100, BAS server 300 request media servers 200 are with image player.
At operation S110 and S120, between media server 200 and BAS server 300, exchange RTSP bag, as the control information of the RTP communication between initial media server 200 and BAS server 300.
After completing the exchange of RTSP bag, at operation S130, media server 200 sends to BAS server 300, the very first time of having recorded the first picture frame in very first time stamp by a RTP bag that comprises very first time stamp.The one RTP bag can be from first server 200, to send to for the first time the picture frame of BAS server 300.In the case, media server 200 is based on changing the very first time second, and the very first time based on second is recorded in the timestamp 21 of a RTP bag.The one RTP bag can be to send to the current image frame a plurality of picture frames of BAS server 300 from media server 200.In the case, the very first time can be the time difference between the time of current image frame and the time of previous image frame, media server 200 can be changed the very first time based on frequency (Hz), and the very first time based on frequency is recorded in the timestamp 21 of a RTP bag.
At operation S140, from media server 200, receive the very first time that the BAS server 300 of a RTP bag reads from very first time stamp and be set to current time, and current time is presented on the first picture frame.The one RTP bag can be the picture frame being received from media server 200 for the first time by BAS server 300.In the case, the very first time of BAS server 300 based on being stored in second in very first time stamp is set to current time and shows current time on the first picture frame.The one RTP bag can be the current image frame a plurality of picture frames that received from media server 200 by BAS server 300.In the case, the very first time can be time of current image frame of being converted based on frequency and the time difference between the time of previous image frame, BAS server 300 can be converted to the very first time very first time based on second, the additive value of last time and this very first time is set to current time, and shows current time on the first picture frame.
At operation S150, media server 200 sends to BAS server 300 by the 2nd RTP bag that comprises the second timestamp, records the indication time of the second picture frame and the second time of the time difference between the very first time in the second timestamp.The 2nd RTP bag can be from media server 200, to send to for the second time the picture frame of BAS server 300.In the case, media server 200 is indicated the second time of the time difference between the time of the second picture frame and the time of the first picture frame based on frequency inverted, and is recorded in to the timestamp 21 of the 2nd RTP bag the second time based on frequency.The 2nd RTP bag can be to send to the current image frame a plurality of picture frames of BAS server 300 from media server 200.In the case, the second time can be the time difference between the time of current image frame and the time of previous image frame, media server 200 can change for the second time based on frequency (Hz), and the second time based on frequency was recorded in the timestamp 21 of the 2nd RTP bag.
At operation S160, from media server 200, receive the second time that the BAS server 300 of the 2nd RTP bag reads from the second timestamp and the addition result of the very first time is set to current time, and current time is presented on the second picture frame.The 2nd RTP bag can be the picture frame being received from media server 200 for the second time by BAS server 300.In the case, BAS server 300 is converted to the second time based on second by the second time based on frequency being stored in the second timestamp, the second time based on second and the addition result of the very first time are set to current time, and current time is presented on the second picture frame.The 2nd RTP bag can be the current image frame a plurality of picture frames that received from media server 200 by BAS server 300.In the case, the second time can be the time difference between the time of the current image frame based on frequency inverted and the time of previous image frame, BAS server 300 can be converted to for the second time the second time based on second, the additive value of last time and the second time based on second is set to current time, and shows current time on the second picture frame.
Fig. 4 is the flow chart of the countermeasure of media server 200 when overlapping in Fig. 3.At this, do not repeat the description of carrying out referring to figs. 1 through Fig. 3.
With reference to Fig. 4, at operation S160, media server 200 determines that whether the second time in the second timestamp that is recorded in the 2nd RTP bag is greater than is the capacity of the second time stamp setting.According to RTP communication procedure, the capacity arranging for timestamp 21 is 32 bits (2
32-1=4294967295).In addition the time difference between current (second) picture frame of the second persond eixis and last (first) picture frame.
If the second time is larger than the capacity that is the second time stamp setting, at operation S170, media server 200 is definite to overlap.If the second time is less than the capacity that is the second time stamp setting, expansion (X) field in media server 200 the 2nd RTP bag is set to null value.
At operation S180, as being the capacity (2 of the second time stamp setting by deducting from the second time
32-1=4294967295) result, the second time that media server 200 produces after proofreading and correct.
After the generation of the second time after completing correction, media server 200 determines that at operation S190 whether the time after proofreading and correct is larger than the capacity that is the second time stamp setting.
If it is the capacity of the second time stamp setting that the second time after proofreading and correct is less than, expansion (X) field of media server 200 in operation S200 the 2nd RTP bag is set to the first value (for example, zero (0)).With reference to Fig. 2, RTP pack arrangement comprises X field 22, and when X field 22 is set to the second value, X field 22 indications record additional information in an extended field 23.
After the X field 22 in the 2nd RTP bag is set to the first value, media server 200 sends to BAS server 300 at operation S210 by the 2nd RTP bag that comprises the second timestamp, records the second time after correction in the second timestamp.
On the contrary, if the second time after proofreading and correct is still greater than, be the capacity of the second time stamp setting, media server 200 is for example arranged on X field 22 in the 2nd RTP bag, as the second value (, 1) at operation S220.When X field 22 is set to the second value, X field 22 indications record additional information in an extended field 23.
At operation S230, it is the capacity (2 of the second time stamp setting that media server 200 deducted by the second time from proofreading and correct
32-1=4294967295) producing second time of again proofreading and correct, is the capacity of the second time stamp setting until the second time after proofreading and correct is less than.It is the result once of capacity of the second time stamp setting that the second persond eixis after correction deducted from the second time, and it is twice of the capacity of the second time stamp setting or result more frequently that the second persond eixis of again proofreading and correct deducted from the second time.
After completing the generation of second time of again proofreading and correct, media server 200 is recorded in the final number of times that deducts the capacity that is the second time stamp setting from the second time an extended field 23 of the 2nd RTP bag at operation S240.
Complete the final number of times of subtraction is recorded in to an extended field 23 in after, media server 200 sends to BAS server 300 at operation S250 by the 2nd RTP bag that comprises the second timestamp, records the second time after again proofreading and correct in the second timestamp.
Fig. 5 is as the flow chart of the countermeasure of the BAS server 300 of client when overlapping in Fig. 3.At this, do not repeat the description of carrying out referring to figs. 1 through Fig. 4.
With reference to Fig. 5, at operation S260, BAS server 300 determines whether the extended field the 2nd RTP bag receiving from media server 200 is null value.
If the extended field in the 2nd RTP bag is not null value, BAS server 300 is determined and is overlapped at operation S270.As mentioned above, if the time of current (second) picture frame receiving is less than the time of last (first) picture frame, BAS server 300 is definite overlaps.
If overlapped, BAS server 300, at operation S280 by checking the value of the X field 22 in the 2nd RTP bag, determines that X field 22 is set to the first value or the second value.
If X field 22 is set to the first value, BAS server 300 is operating S290 by the capacity (2 that is the second time stamp setting
32-1=4294967295) the second time, after proofreading and correct and the addition result of the very first time are set to current time, and show current time on the second picture frame.
On the contrary, if X field 22 is set to the second value, at operation S300, the extended field 23 from the 2nd RTP bag reads the final number of times of subtraction to BAS server 300.
Afterwards, BAS server 300 is the capacity ((2 of the second time stamp setting by the final number of times with subtraction at operation S310 accordingly
32the final number of times of-1=4294967295) * subtraction) the second time, after proofreading and correct and the addition result of the very first time are set to current time, and current time is presented on the second picture frame.
According to the present embodiment of the present invention, when sending images to BAS server 300 from media server 200, even without RTCP bag is provided from media server 200 to BAS server 300, BAS server 300 also can be by being used RTP bag (wrapping only the easily time difference between perceptual map picture frame by this RTP) to show the reproduction time accurately of each image.
As mentioned above, and prior art is (when transmitting image between media server and BAS server, the RTP that use is received by BAS server only wraps the easily time difference between perceptual map picture frame) compare, one or more according to the embodiments of the present invention, even if do not provide RTCP bag to BAS server, also can only with the RTP receiving, wrap to calculate and show the correct time of just played image.
The present invention also can be implemented as the computer-readable code on computer readable recording medium storing program for performing.Computer readable recording medium storing program for performing is can be by any data storage device of the data of computer system reads after can storing.The example of computer readable recording medium storing program for performing comprises read-only memory (ROM), random access memory (RAM), CD-ROM, tape, floppy disk, optical data storage device and carrier wave (such as by the transfer of data of the Internet).Computer readable recording medium storing program for performing also can be distributed in the computer system of networking, thereby computer-readable code is stored and carries out with distribution mode.In addition for completing function program of the present invention, code and code segment, can be explained simply by the programming personnel who belongs to the technology of the present invention field.
In addition, other embodiment of the present invention for example also can pass through, in medium (, computer-readable medium)/on the computer readable code/instructions that realizes above-mentioned any embodiment for controlling at least one treatment element realize.Medium can be corresponding to any medium/media that allows the transmission of memory and/or computer-readable code.
Utilization comprises that recording medium (such as magnetic storage medium (for example, ROM, floppy disk, hard disk etc.), optical recording media (for example, CD-ROM or DVD), such as the transmission medium of internet transmission medium) the example of media, computer-readable code can be recorded in many ways on medium or pass through medium transmission.Therefore,, according to one or more embodiment of the present invention, media can be such definition and measurable structures that comprises or carry signal or information, such as the device that carries bit stream.Medium can also be distributed network, thereby computer-readable code is stored/transmits and carry out with distribution mode.In addition, treatment element can comprise processor or computer processor, and treatment element can distribute and/or be included in single assembly.
Should be understood that it is only describing significance that the exemplary embodiment of describing in the present invention should be regarded as, rather than the object in order to limit.To the description of the feature in each embodiment or aspect, should be generally considered as can be used for other similar characteristics or the aspect in other embodiment.
Although described one or more embodiment of the present invention with reference to the accompanying drawings, but those of ordinary skills should understand, in the situation that do not depart from the spirit and scope of the present invention that are defined by the claims, can carry out the various changes in form and details to the present invention.
Can be incorporated in separately and particularly illustrating and being totally incorporated in the identical mode that illustrates in the present invention by the document that each is quoted in the present invention with the document with by each is quoted, the all references document of quoting in the present invention is merged in the present invention, and citing document comprises document, patent application and the patent of delivering.