CN109413371A - Video frame rate calculation method and device - Google Patents
Video frame rate calculation method and device Download PDFInfo
- Publication number
- CN109413371A CN109413371A CN201710708020.8A CN201710708020A CN109413371A CN 109413371 A CN109413371 A CN 109413371A CN 201710708020 A CN201710708020 A CN 201710708020A CN 109413371 A CN109413371 A CN 109413371A
- Authority
- CN
- China
- Prior art keywords
- frame
- present
- acquisition time
- present frame
- former
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/18—Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N7/00—Television systems
- H04N7/01—Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level
- H04N7/0127—Conversion of standards, e.g. involving analogue television standards or digital television standards processed at pixel level by changing the field or frame frequency of the incoming video signal, e.g. frame rate converter
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
Abstract
The embodiment of the present invention provides a kind of video frame rate calculation method and device.This method comprises: using the frame currently obtained as present frame, being decoded to the video monitoring code stream of present frame after the video monitoring code stream for getting a frame, rebuilding the single-frame images of present frame, and record the type and number of present frame;The acquisition time of present frame is obtained according to the single-frame images of present frame;According to the acquisition time of the acquisition time of present frame, type and number and former frame, video frame rate is calculated.The embodiment of the present invention obtains the acquisition time of present frame by obtaining the single-frame images of present frame according to reconstruction;According to the acquisition time of the acquisition time of present frame, type and number and former frame, calculate video frame rate, it realizes and frame per second is calculated according to the actual acquisition time of each frame, the frame per second being calculated is consistent with actual frame per second, the problem of can playing to avoid video fast forward broadcasting or video cardton, improve play quality.
Description
Technical field
The present embodiments relate to field of communication technology more particularly to a kind of video frame rate calculation method and devices.
Background technique
With the continuous improvement of people 's material life level, real-time video monitoring system is widely used in every field
In, the situation at user's checking monitoring scene can be facilitated, when scene when something goes wrong, user can take in time and arrange accordingly
It applies and loss is preferably minimized or live video can be stored, serve as evidence etc..
Real-time video monitoring system includes photographic device and playing device, and photographic device is used to shoot video data, according to
Real-time Transmission (Real-time Transport Protocol, abbreviation RTP) agreement is sealed after being encoded original video data
Program stream (Program Stream, the abbreviation PS) data packet for referring to that at least one has RTP timestamp is dressed up, and by each PS data
Packet is transmitted to playing device, and playing device calculates frame per second according to the RTP timestamp of each PS data packet received and plays out.
Since Real-time Transport Protocol is not strictly required the generating mode of the RTP timestamp of PS data packet, when photographic device generates RTP at present
Between stamp based on preset frame rate differ greatly, or even have part camera shooting dress using become frame per second carry out Video coding, therefore, PS number
It is inconsistent according to the corresponding frame per second of RTP timestamp and actual frame per second of packet.
In the prior art, the playing device of receiving end is typically directly calculated according to the RTP timestamp of PS data packet
Frame per second plays out, alternatively, playing device is broadcast according to the frame per second that the frame number being an actually-received in the unit time is calculated
It puts, still, the frame per second and actual frame per second being calculated by both methods lead to video occur when video playing there are difference
Not the problem of speed that broadcasting speed occurs with actual scene is not inconsistent, and plays so as to cause video fast forward broadcasting or video cardton,
Video playing quality is poor.
Summary of the invention
The embodiment of the present invention provides a kind of video frame rate calculation method and device, to solve in terms of the method by the prior art
Obtained frame per second and actual frame per second leads to occur what video playout speed occurred with actual scene when video playing there are difference
Speed is not inconsistent, and plays so as to cause video fast forward or video cardton plays, the problem of video playing quality difference.
The one aspect of the embodiment of the present invention is to provide a kind of video frame rate calculation method, comprising:
After the video monitoring code stream for getting a frame, using the frame currently obtained as present frame, to institute
The video monitoring code stream for stating present frame is decoded, and rebuilds the single-frame images of the present frame, and records the class of the present frame
Type and number;
According to the single-frame images of the present frame, the acquisition time of the present frame is obtained;
According to the acquisition time of the acquisition time of the present frame, type and number and former frame, video frame is calculated
Rate.
The other side of the embodiment of the present invention is to provide a kind of video frame rate computing device, comprising:
Module is rebuild, for after the video monitoring code stream for getting a frame, the frame currently obtained to be made
For present frame, the video monitoring code stream of the present frame is decoded, the single-frame images of the present frame is rebuild, and records institute
State the type and number of present frame;
It obtains module and obtains the acquisition time of the present frame for the single-frame images according to the present frame;
Computing module, when for according to the acquisition of the acquisition time of the present frame, type and number and former frame
Between, calculate video frame rate.
Video frame rate calculation method provided in an embodiment of the present invention and device, whenever the video monitoring code for getting a frame
After stream, using the frame currently obtained as present frame, the video monitoring code stream of present frame is decoded, the present frame is rebuild
Single-frame images, and record the type and number of the present frame;According to the single-frame images of the present frame, obtain described current
The acquisition time of frame;According to the acquisition time of the acquisition time of the present frame, type and number and former frame, view is calculated
Frequency frame per second realizes and calculates frame per second according to the actual acquisition time of each frame, and the frame per second being calculated is consistent with actual frame per second, thus
There is the speed that video playout speed occurs with actual scene when can be to avoid video playing not being inconsistent, be broadcast so as to cause video fast forward
Put or video cardton play the problem of, can be improved video playing quality.
Detailed description of the invention
Fig. 1 is the flow chart of video frame rate calculation method provided in an embodiment of the present invention;
Fig. 2 be another embodiment of the present invention provides video frame rate calculation method flow chart;
Fig. 3 is the structural schematic diagram of video frame rate computing device provided in an embodiment of the present invention;
Fig. 4 be another embodiment of the present invention provides video frame rate computing device structural schematic diagram.
Specific embodiment
To keep technical solution of the present invention and advantage clearer, following will be combined with the drawings in the embodiments of the present invention, right
Technical solution of the present invention is clearly and completely described, it is clear that and described embodiments are some of the embodiments of the present invention,
Instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art are not making creative labor
Every other embodiment obtained under the premise of dynamic, shall fall within the protection scope of the present invention.
Fig. 1 is the flow chart of video frame rate calculation method provided in an embodiment of the present invention.The embodiment of the present invention, which is directed to, to be passed through
The frame per second and actual frame per second that the method for the prior art is calculated lead to video playout speed occur when video playing there are difference
The speed occurred with actual scene is not inconsistent, and plays so as to cause video fast forward or video cardton plays, video playing quality is poor
The problem of, provide video frame rate calculation method.As shown in Figure 1, specific step is as follows for this method:
Step S101, after the video monitoring code stream for getting a frame, using the frame currently obtained as present frame,
The video monitoring code stream of present frame is decoded, the single-frame images of present frame is rebuild, and records the type and number of present frame.
In practical applications, photographic device, can be by the volume of each frame image setting after collecting video monitoring data
Code mode is encoded, and the video monitoring code stream of this frame image is generated, and then encapsulates the video monitoring code stream of every frame image
At one perhaps more than one PS data packet each PS data packet is transferred to the videos such as corresponding gateway or playback terminal
Receiving end.Reception terminates at receive each PS data packet after, decapsulation and integration processing can be carried out to each PS data packet, successively
To the video monitoring code stream of each frame image.
In the present embodiment, receiving end obtain the video monitoring code stream of each frame specifically can using in the prior art any one
The method of the video monitoring code stream of getting frame realizes that details are not described herein again for the present embodiment.
In the present embodiment, after the video monitoring code stream for getting a frame, using the frame currently obtained as current
Frame, receiving end are decoded the video monitoring code stream of this present frame got recently, rebuild the single-frame images of present frame,
And the type and number (Frame Num) of present frame are recorded in decoding process.
Wherein, the type of frame includes I frame and non-I frame.For example, non-I frame can be P frame or B frame etc..
In the present embodiment, the video monitoring code stream of present frame is decoded using corresponding with the coding mode of setting
Decoding process is decoded, the single-frame images of Lai Chongjian present frame, and the type and number of present frame are recorded in decoding process,
This process can using it is in the prior art any one the image come reconstructed frame is decoded to the video monitoring code stream of frame
The type of getting frame and the method for number realize that the present embodiment is repeated no more herein for decoded detailed process.
Step S102, according to the single-frame images of present frame, the acquisition time of present frame is obtained.
Include the acquisition time of the single-frame images in the present embodiment, on the single-frame images of each frame, passes through image recognition skill
Art can extract the actual acquisition time of the single-frame images from single-frame images.For example, usually the single-frame images upper right corner,
The upper left corner, the lower left corner or lower right corner record have the acquisition time of the single-frame images.
According to the single-frame images of present frame in the step, the acquisition time of present frame is obtained, it specifically can be using such as lower section
Formula is realized:
The acquisition time of present frame can be extracted from the single-frame images of present frame by image recognition technology.
In the present embodiment, the acquisition time of present frame is obtained according to the single-frame images of present frame, can specifically be used existing
Any one image recognition technology is realized in technology, and details are not described herein again the present embodiment.
Step S103, according to the acquisition time of the acquisition time of present frame, type and number and former frame, view is calculated
Frequency frame per second.
In the step, it can be led to according to the acquisition time of present frame, type and number in conjunction with the acquisition time of former frame
The frame number crossed in the accumulative units period calculates video frame rate, so that frame per second is calculated according to actual acquisition time of each frame, with
Make to carry out video playing according to the frame per second.
The embodiment of the present invention by after the video monitoring code stream for getting a frame, using the frame currently obtained as
Present frame is decoded the video monitoring code stream of present frame, rebuilds the single-frame images of present frame, and records the type of present frame
And number;According to the single-frame images of present frame, the acquisition time of present frame is obtained;According to the acquisition time of present frame, type and
The acquisition time of number and former frame calculates video frame rate by the frame number in the accumulative units period, realizes according to each
The actual acquisition time of frame calculates frame per second, and the frame per second being calculated is consistent with actual frame per second, when so as to avoid video playing
There is the speed that video playout speed occurs with actual scene not being inconsistent, is played so as to cause video fast forward or video cardton is broadcast
The problem of putting can be improved video playing quality.
Fig. 2 be another embodiment of the present invention provides video frame rate calculation method flow chart.In the base of above-described embodiment
On plinth, in the present embodiment, according to the acquisition time of the acquisition time of present frame, type and number and former frame, calculate current
Frame per second, comprising: determine whether present frame is first frame;If it is determined that present frame is not first frame, then according to present frame
The acquisition time of acquisition time, type and number and former frame passes through the frame in the frame number counter accumulative units period
Quantity, and current frame per second is determined according to the quantity of the frame in unit interval;If it is determined that present frame is first frame, then by frame
The value of counter is set as 1.As shown in Fig. 2, specific step is as follows for this method:
Step S201, after the video monitoring code stream for getting a frame, to the video monitoring code stream of present frame into
Row decoding, rebuilds the single-frame images of present frame, and record the type and number of present frame.
The step is consistent with above-mentioned steps S101, and details are not described herein again for the present embodiment.
Step S202, according to the single-frame images of present frame, the acquisition time of present frame is obtained.
The step is consistent with above-mentioned steps S102, and details are not described herein again for the present embodiment.
Step S203, determine whether present frame is first frame.
In the present embodiment, video frame rate is calculated by the frame number in the accumulative units period, in the step, is determined current
Whether frame is first frame, however, it is determined that present frame is first frame, thens follow the steps S205 and is set as the value of frame number counter
1, and continue to execute step S201 and continue to handle next frame.If it is determined that present frame is not first frame, then step is executed
The quantity that rapid S204 passes through the frame in the frame number counter accumulative units period.
Step S204, if it is determined that present frame is not first frame, then according to the acquisition time of present frame, type and number,
And the acquisition time of former frame, by the quantity of the frame in the frame number counter accumulative units period, and according to the unit time
The quantity of frame in section determines current frame per second.
In the present embodiment, the acquisition time of present frame is accurate to the second, and the length of unit interval is 1 second, unit interval
For one second where the acquisition time of former frame.Such as the acquisition time of former frame 53 divides 19 seconds when being 1 day 15 January in 2017,
53 time for dividing 19 second this second when then unit interval is 1 day 15 January in 2017.
In the step, by judge present frame acquisition time and former frame acquisition time it is whether consistent, to determine pair
Whether terminate in the accumulative of the quantity of frame in current unit interval.If when the acquisition of the acquisition time of present frame and former frame
Between it is inconsistent, it is determined that the accumulative end to the quantity of frame in current unit interval sets the value of frame number counter to
1, start to add up the quantity of frame in next unit interval.If when the acquisition of the acquisition time of present frame and former frame
Between it is consistent, it is determined that the accumulative of quantity of frame in current unit interval is not over, according to the type and volume of present frame
Number update frame number counter value.
In the step, however, it is determined that present frame is not first frame, then according to the acquisition time of present frame, type and number,
And the acquisition time of former frame, by the quantity of the frame in the frame number counter accumulative units period, and according to the unit time
The quantity of frame in section determines current frame per second, can specifically realize in the following way:
Whether the acquisition time of the acquisition time and former frame that judge present frame is consistent.
If the acquisition time of present frame and the acquisition time of former frame are inconsistent, are determined and regarded according to the value of frame number counter
Frequency frame per second, and 1 is set by the value of frame number counter.
Specifically, if determining that video frame rate includes: the acquisition time and former frame of present frame according to the value of frame number counter
Acquisition time between time interval be 1 second, then the value of frame number counter is determined as video frame rate, if the acquisition of present frame
Time interval between time and the acquisition time of former frame is greater than 1 second, then keeps existing video frame rate constant.
If the acquisition time of present frame is consistent with the acquisition time of former frame, updated according to the type of present frame and number
The value of frame number counter.
Specifically, include: according to the value that the type of present frame and number update frame number counter
If present frame is I frame, the value of frame number counter is added 1.
If present frame is non-I frame, judge whether the number of present frame is greater than the number of former frame.
If judging result is that the number of present frame is greater than the number of former frame, by the increase by first of the value of frame number counter
Incremental value.Wherein, the first incremental value is equal to the difference of the number of present frame and the number of former frame.
If judging result is that the number of present frame is less than or equal to the number of former frame, by the value of frame number counter
Increase by the second incremental value.Wherein, the second incremental value=present frame number+default maximum number-former frame number.
In the step, during updating the value of frame number counter according to the type and number of present frame, worked as by judgement
Whether the number of previous frame is greater than the number of former frame, when the number of present frame is greater than the number of former frame, then by the volume of present frame
The first incremental value number with the difference of the number of former frame as the value of, frame number counter, even if the frame before present frame has
It loses, it can also be by the accumulative actual frame number out of frame number counter, so as to avoid the loss because of frame in transmission process
Frame per second is caused to calculate the situation of inaccuracy, so that the frame per second being calculated is more nearly actual frame per second.
Step S205, if it is determined that present frame is first frame, then the value of frame number counter is set as 1.
In the present embodiment, however, it is determined that present frame is first frame, and the value of frame number counter is initialized as 1.
The embodiment of the present invention passes through the quantity of the frame in the frame number counter accumulative units period, and according to unit interval
The quantity of interior frame determines current frame per second, realizes and calculates frame per second according to the actual acquisition time of each frame, also, works as in basis
During the type and number of previous frame update the value of frame number counter, according to the big of the number of the number of present frame and former frame
It is small, the increment of the value of frame number counter is determined according to the difference of the number of present frame and the number of former frame, even if in present frame
Frame before has loss, can also add up the frame number of the actual acquisition in unit interval by frame number counter, so as to
Frame per second is caused to calculate inaccurate situation to avoid because of loss of the frame in transmission process, so that the frame per second being calculated is more just
Occur the speed that video playout speed occurs with actual scene when really, so as to avoid video playing not being inconsistent, so as to cause view
The problem of frequency fast-forward play or video cardton play, can be improved video playing quality.
On the basis of the above embodiments, in the embodiment of the present invention, receiving end can be playback terminal.This method is also wrapped
Include: playback terminal plays out each frame according to the frame per second being calculated, and can specifically be realized using any one following mode:
(1) playback terminal is playing a target unit period during receiving video data and playing video
The frame per second in the target unit period, and root is calculated in the method that can be provided through the foregoing embodiment while interior frame
It is played out according to frame of the frame per second to next unit interval of target unit period.For example, according to the target unit time
Frame per second in section is modified the timestamp of every frame video of next unit interval of target unit period, to guarantee
Result of broadcast.
(2) playback terminal is during receiving video data and playing video, according to preset quantity, playback terminal caching
Single-frame images in the unit interval of initial preset quantity is calculated in receiving end according to the method in above-described embodiment
After the frame per second of the unit interval of preceding preset quantity, according to preset calculating mean value rule, the unit of preset quantity before calculating
The mean value frame per second of the frame per second of period plays out each frame for the mean value frame per second as fixed frame per second.
Wherein, preset calculating mean value rule can be set according to actual needs by technical staff, for example, before calculating
The arithmetic mean of instantaneous value of the frame per second of the unit interval of preset quantity is as mean value frame per second etc., and the present embodiment is for preceding preset quantity
The calculation method of the mean value frame per second of the frame per second of unit interval is not specifically limited.
In practical applications, when real-time video monitoring system is networked by video gateway and third party's video monitoring platform,
If the video format that third party's video monitoring platform sends over is the PS data packet of RTP encapsulation, with real-time video monitoring system
When the video format of system mismatches, needs video gateway to carry out framing and beat the timestamp of PS data packet again.It is answered based on this
With scene, in the present embodiment, playback terminal can be by the frame per second Real-time Feedback in the target unit period being calculated to view
Frequency gateway, so that video gateway is modified according to timestamp of the frame per second in the target unit period to each PS data packet.
The embodiment of the present invention plays out each frame according to the frame per second being calculated by playback terminal, improves broadcasting matter
Amount.
Fig. 3 is the structural schematic diagram of video frame rate computing device provided in an embodiment of the present invention.The embodiment of the present invention provides
Video frame rate computing device can execute video frame rate calculation method embodiment offer process flow, as shown in figure 3, the dress
Setting 30 includes: to rebuild module 301, obtain module 302 and computing module 303.
Specifically, it rebuilds module 301 to be used for after the video monitoring code stream for getting a frame, by what is currently obtained
Frame is decoded the video monitoring code stream of present frame, rebuilds the single-frame images of present frame as present frame, and records present frame
Type and number.
Module 302 is obtained for the single-frame images according to present frame, obtains the acquisition time of present frame.
Computing module 303 is used for the acquisition time according to the acquisition time of present frame, type and number and former frame,
Calculate video frame rate.
Device provided in an embodiment of the present invention can be specifically used for executing embodiment of the method provided by above-mentioned Fig. 1, specifically
Details are not described herein again for function.
The embodiment of the present invention by after the video monitoring code stream for getting a frame, using the frame currently obtained as
Present frame is decoded the video monitoring code stream of present frame, rebuilds the single-frame images of present frame, and records the type of present frame
And number;According to the single-frame images of present frame, the acquisition time of present frame is obtained;According to the acquisition time of present frame, type and
The acquisition time of number and former frame calculates video frame rate by the frame number in the accumulative units period, realizes according to each
The actual acquisition time of frame calculates frame per second, and the frame per second being calculated is consistent with actual frame per second, when so as to avoid video playing
There is the speed that video playout speed occurs with actual scene not being inconsistent, is played so as to cause video fast forward or video cardton is broadcast
The problem of putting can be improved video playing quality.
Fig. 4 be another embodiment of the present invention provides video frame rate computing device structural schematic diagram.In above-described embodiment
On the basis of, in the present embodiment, computing module 303 comprises determining that submodule 3031, accumulative submodule 3032 and setting submodule
3033。
Wherein it is determined that submodule 3031 is for determining whether present frame is first frame.
Accumulative submodule 3032 is used for if it is determined that present frame is not first frame, then according to the acquisition time of present frame, class
The acquisition time of type and number and former frame, by the quantity of the frame in the frame number counter accumulative units period, and according to
The quantity of frame in unit interval determines current frame per second.
Submodule 3033 is set to be used to that the value of frame number counter to be then set as 1 if it is determined that present frame is first frame.
Specifically, the acquisition time of present frame is accurate to the second, and accumulative submodule 3032 is also used to:
Whether the acquisition time of the acquisition time and former frame that judge present frame is consistent;If the acquisition time of present frame is with before
The acquisition time of one frame is inconsistent, then determines video frame rate according to the value of frame number counter, and the value of frame number counter is arranged
It is 1;If the acquisition time of present frame is consistent with the acquisition time of former frame, frame number is updated according to the type of present frame and number
The value of counter.
Accumulative submodule 3032 is also used to:
If the time interval between the acquisition time of present frame and the acquisition time of former frame is 1 second, frame number is counted
The value of device is determined as video frame rate.
Accumulative submodule 3032 is also used to:
If present frame is I frame, the value of frame number counter is added 1;If present frame is non-I frame, the volume of present frame is judged
Number whether be greater than former frame number;If judging result is that the number of present frame is greater than the number of former frame, frame number is counted
The first incremental value of increase of the value of device;First incremental value is equal to the difference of the number of present frame and the number of former frame;If judgement
As a result it is less than or equal to the number of former frame for the number of present frame, then by the second increment of increase of the value of frame number counter
Value;Second incremental value=present frame number+default maximum number-former frame number.
Sending device provided in an embodiment of the present invention can be specifically used for executing embodiment of the method provided by above-mentioned Fig. 2,
Details are not described herein again for concrete function.
The embodiment of the present invention passes through the quantity of the frame in the frame number counter accumulative units period, and according to unit interval
The quantity of interior frame determines current frame per second, realizes and calculates frame per second according to the actual acquisition time of each frame, also, works as in basis
During the type and number of previous frame update the value of frame number counter, according to the big of the number of the number of present frame and former frame
It is small, the increment of the value of frame number counter is determined according to the difference of the number of present frame and the number of former frame, even if in present frame
Frame before has loss, can also add up the frame number of the actual acquisition in unit interval by frame number counter, so as to
Frame per second is caused to calculate inaccurate situation to avoid because of loss of the frame in transmission process, so that the frame per second being calculated is more just
Occur the speed that video playout speed occurs with actual scene when really, so as to avoid video playing not being inconsistent, so as to cause view
The problem of frequency fast-forward play or video cardton play, can be improved video playing quality.
In several embodiments provided by the present invention, it should be understood that disclosed device and method can pass through it
Its mode is realized.For example, the apparatus embodiments described above are merely exemplary, for example, the division of the unit, only
Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be tied
Another system is closed or is desirably integrated into, or some features can be ignored or not executed.Another point, it is shown or discussed
Mutual coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or logical of device or unit
Letter connection can be electrical property, mechanical 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 hardware adds SFU software functional unit.
The above-mentioned integrated unit being realized in the form of SFU software functional unit can store and computer-readable deposit at one
In storage media.Above-mentioned SFU software functional unit is stored in a storage medium, including some instructions are used so that a computer
It is each that equipment (can be personal computer, server or the network equipment etc.) or processor (processor) execute the present invention
The part steps of embodiment the method.And storage medium above-mentioned includes: USB flash disk, mobile hard disk, read-only memory (Read-
Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic or disk etc. it is various
It can store the medium of program code.
Those skilled in the art can be understood that, for convenience and simplicity of description, only with above-mentioned each functional module
Division progress for example, in practical application, can according to need and above-mentioned function distribution is complete by different functional modules
At the internal structure of device being divided into different functional modules, to complete all or part of the functions described above.On
The specific work process for stating the device of description, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention., rather than its limitations;To the greatest extent
Pipe present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that: its according to
So be possible to modify the technical solutions described in the foregoing embodiments, or to some or all of the technical features into
Row equivalent replacement;And these are modified or replaceed, various embodiments of the present invention technology that it does not separate the essence of the corresponding technical solution
The range of scheme.
Claims (10)
1. a kind of video frame rate calculation method characterized by comprising
After the video monitoring code stream for getting a frame, using the frame currently obtained as present frame, work as to described
The video monitoring code stream of previous frame is decoded, and rebuilds the single-frame images of the present frame, and record the present frame type and
Number;
According to the single-frame images of the present frame, the acquisition time of the present frame is obtained;
According to the acquisition time of the acquisition time of the present frame, type and number and former frame, video frame rate is calculated.
2. the method according to claim 1, wherein it is described according to the acquisition time of the present frame, type and
The acquisition time of number and former frame, calculates current frame per second, comprising:
Determine whether the present frame is first frame;
If it is determined that the present frame is not first frame, then according to the acquisition time of the present frame, type and number, Yi Jiqian
The acquisition time of one frame, by the quantity of the frame in the frame number counter accumulative units period, and according to the unit interval
The quantity of interior frame determines current frame per second;
If it is determined that the present frame is first frame, then the value of the frame number counter is set as 1.
3. according to the method described in claim 2, it is characterized in that, the acquisition time of the present frame is accurate to the second, if described
Determining the present frame not is first frame, then according to the acquisition time of the present frame, type and number and former frame
Acquisition time, by the quantity of the frame in the frame number counter accumulative units period, and according to the frame in the unit interval
Quantity determine current frame per second, comprising:
Whether the acquisition time for judging the present frame is consistent with the acquisition time of the former frame;
If the acquisition time of the present frame and the acquisition time of the former frame are inconsistent, according to the frame number counter
It is worth and determines video frame rate, and sets 1 for the value of the frame number counter;
If the acquisition time of the present frame is consistent with the acquisition time of the former frame, according to the type of the present frame and
Number updates the value of the frame number counter.
If 4. according to the method described in claim 3, it is characterized in that, the acquisition time of the present frame with it is described previous
The acquisition time of frame is inconsistent, then determines video frame rate according to the value of the frame number counter, comprising:
It, will be described if the time interval between the acquisition time of the present frame and the acquisition time of the former frame is 1 second
The value of frame number counter is determined as video frame rate.
If 5. according to the method described in claim 3, it is characterized in that, the acquisition time of the present frame with it is described previous
The acquisition time of frame is consistent, and the value of the frame number counter is updated according to the type of the present frame and number, comprising:
If the present frame is I frame, the value of the frame number counter is added 1;
If the present frame is non-I frame, judge whether the number of the present frame is greater than the number of former frame;
If judging result is that the number of the present frame is greater than the number of former frame, by the increase of the value of the frame number counter
First incremental value;First incremental value is equal to the difference of the number and the number of the former frame of the present frame;
If judging result is that the number of the present frame is less than or equal to the number of former frame, by the frame number counter
The second incremental value of increase of value;Second incremental value=present frame number+default maximum number-former frame
Number.
6. a kind of video frame rate computing device characterized by comprising
Module is rebuild, for after the video monitoring code stream for getting a frame, using the frame currently obtained as working as
Previous frame is decoded the video monitoring code stream of the present frame, rebuilds the single-frame images of the present frame, and work as described in record
The type and number of previous frame;
It obtains module and obtains the acquisition time of the present frame for the single-frame images according to the present frame;
Computing module, for the acquisition time according to the acquisition time of the present frame, type and number and former frame, meter
Calculate video frame rate.
7. device according to claim 6, which is characterized in that the computing module includes:
Submodule is determined, for determining whether the present frame is first frame;
Accumulative submodule, for if it is determined that the present frame is not first frame, then according to the acquisition time of the present frame, class
The acquisition time of type and number and former frame, by the quantity of the frame in the frame number counter accumulative units period, and according to
The quantity of frame in the unit interval determines current frame per second;
Submodule is set, for if it is determined that the present frame is first frame, then the value of the frame number counter being set as 1.
8. device according to claim 7, which is characterized in that the acquisition time of the present frame is accurate to the second, described tired
Meter submodule is also used to:
Whether the acquisition time for judging the present frame is consistent with the acquisition time of the former frame;
If the acquisition time of the present frame and the acquisition time of the former frame are inconsistent, according to the frame number counter
It is worth and determines video frame rate, and sets 1 for the value of the frame number counter;
If the acquisition time of the present frame is consistent with the acquisition time of the former frame, according to the type of the present frame and
Number updates the value of the frame number counter.
9. device according to claim 8, which is characterized in that the accumulative submodule is also used to:
It, will be described if the time interval between the acquisition time of the present frame and the acquisition time of the former frame is 1 second
The value of frame number counter is determined as video frame rate.
10. device according to claim 8, which is characterized in that the accumulative submodule is also used to:
If the present frame is I frame, the value of the frame number counter is added 1;
If the present frame is non-I frame, judge whether the number of the present frame is greater than the number of former frame;
If judging result is that the number of the present frame is greater than the number of former frame, by the increase of the value of the frame number counter
First incremental value;First incremental value is equal to the difference of the number and the number of the former frame of the present frame;
If judging result is that the number of the present frame is less than or equal to the number of former frame, by the frame number counter
The second incremental value of increase of value;Second incremental value=present frame number+default maximum number-former frame
Number.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710708020.8A CN109413371B (en) | 2017-08-17 | 2017-08-17 | Video frame rate calculation method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710708020.8A CN109413371B (en) | 2017-08-17 | 2017-08-17 | Video frame rate calculation method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109413371A true CN109413371A (en) | 2019-03-01 |
CN109413371B CN109413371B (en) | 2021-08-03 |
Family
ID=65455045
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710708020.8A Active CN109413371B (en) | 2017-08-17 | 2017-08-17 | Video frame rate calculation method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109413371B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110475124A (en) * | 2019-09-06 | 2019-11-19 | 广州虎牙科技有限公司 | Video cardton detection method and device |
CN110943997A (en) * | 2019-12-03 | 2020-03-31 | 北京奇艺世纪科技有限公司 | Video pushing method and device, electronic equipment and computer readable storage medium |
CN111031338A (en) * | 2019-12-17 | 2020-04-17 | 杭州当虹科技股份有限公司 | Method for improving on-line information source rate abnormity |
CN111385637A (en) * | 2020-03-18 | 2020-07-07 | Oppo广东移动通信有限公司 | Media data encoding method and device and electronic equipment |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102110459A (en) * | 2009-12-24 | 2011-06-29 | Tcl集团股份有限公司 | Playing terminal and multimedia file playing method and device thereof |
CN103024362A (en) * | 2012-12-28 | 2013-04-03 | 上海伟视清数字技术有限公司 | Method for decoding, displaying and adjusting for high-definition images with dynamic frame rates |
CN104053014A (en) * | 2013-03-13 | 2014-09-17 | 腾讯科技(北京)有限公司 | Live broadcast system and method based on mobile terminal, and mobile terminal |
CN104683866A (en) * | 2013-11-29 | 2015-06-03 | 成都鼎桥通信技术有限公司 | Playing processing method for received streaming video |
CN105578207A (en) * | 2015-12-18 | 2016-05-11 | 无锡天脉聚源传媒科技有限公司 | Video frame rate conversion method and device |
US20160373669A1 (en) * | 2015-06-17 | 2016-12-22 | Panasonic Intellectual Property Management Co., Ltd. | Imaging apparatus including light source that emits pulsed light, image sensor, and control circuit |
-
2017
- 2017-08-17 CN CN201710708020.8A patent/CN109413371B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102110459A (en) * | 2009-12-24 | 2011-06-29 | Tcl集团股份有限公司 | Playing terminal and multimedia file playing method and device thereof |
CN103024362A (en) * | 2012-12-28 | 2013-04-03 | 上海伟视清数字技术有限公司 | Method for decoding, displaying and adjusting for high-definition images with dynamic frame rates |
CN104053014A (en) * | 2013-03-13 | 2014-09-17 | 腾讯科技(北京)有限公司 | Live broadcast system and method based on mobile terminal, and mobile terminal |
CN104683866A (en) * | 2013-11-29 | 2015-06-03 | 成都鼎桥通信技术有限公司 | Playing processing method for received streaming video |
US20160373669A1 (en) * | 2015-06-17 | 2016-12-22 | Panasonic Intellectual Property Management Co., Ltd. | Imaging apparatus including light source that emits pulsed light, image sensor, and control circuit |
CN105578207A (en) * | 2015-12-18 | 2016-05-11 | 无锡天脉聚源传媒科技有限公司 | Video frame rate conversion method and device |
Cited By (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110475124A (en) * | 2019-09-06 | 2019-11-19 | 广州虎牙科技有限公司 | Video cardton detection method and device |
CN110475124B (en) * | 2019-09-06 | 2021-10-08 | 广州虎牙科技有限公司 | Video jamming detection method and device |
CN110943997A (en) * | 2019-12-03 | 2020-03-31 | 北京奇艺世纪科技有限公司 | Video pushing method and device, electronic equipment and computer readable storage medium |
CN110943997B (en) * | 2019-12-03 | 2022-05-31 | 北京奇艺世纪科技有限公司 | Video pushing method and device, electronic equipment and computer readable storage medium |
CN111031338A (en) * | 2019-12-17 | 2020-04-17 | 杭州当虹科技股份有限公司 | Method for improving on-line information source rate abnormity |
CN111031338B (en) * | 2019-12-17 | 2021-09-28 | 杭州当虹科技股份有限公司 | Method for improving on-line information source rate abnormity |
CN111385637A (en) * | 2020-03-18 | 2020-07-07 | Oppo广东移动通信有限公司 | Media data encoding method and device and electronic equipment |
CN111385637B (en) * | 2020-03-18 | 2022-05-20 | Oppo广东移动通信有限公司 | Media data encoding method and device and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN109413371B (en) | 2021-08-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP7320352B2 (en) | 3D model transmission method, 3D model reception method, 3D model transmission device, and 3D model reception device | |
JP7277372B2 (en) | 3D model encoding device, 3D model decoding device, 3D model encoding method, and 3D model decoding method | |
CN109413371A (en) | Video frame rate calculation method and device | |
CN104918133B (en) | A kind of playing method and device for regarding video flowing in networking | |
CN113225598B (en) | Method, device and equipment for synchronizing audio and video of mobile terminal and storage medium | |
CN107846633A (en) | A kind of live broadcasting method and system | |
CN109565620A (en) | Low latency HTTP real-time streaming transport | |
CN109089130A (en) | A kind of method and apparatus for the timestamp adjusting live video | |
CN106303329A (en) | Record screen live broadcasting method and device, mobile device and live broadcast system | |
JP6689514B2 (en) | Multimedia file stitching method and apparatus | |
EP4192020B1 (en) | Channel change method and apparatus | |
CN107659819B (en) | A kind of method and apparatus of video code conversion | |
CN109120974A (en) | A kind of method and device that audio-visual synchronization plays | |
CN104284135B (en) | Video transmission method and equipment | |
CN108347580A (en) | A kind of method and electronic equipment of processing video requency frame data | |
CN104243920A (en) | Image stitching method and device based on basic stream video data packaging | |
CN109756749A (en) | Video data handling procedure, device, server and storage medium | |
CN110740380A (en) | Video processing method and device, storage medium and electronic device | |
CN113852824A (en) | Video transcoding method and device, electronic equipment and storage medium | |
US20230045876A1 (en) | Video Playing Method, Apparatus, and System, and Computer Storage Medium | |
CN109714622A (en) | A kind of video data handling procedure, device and electronic equipment | |
CN107872669A (en) | Video code rate treating method and apparatus | |
JP2020521212A (en) | Method and apparatus for determining experience quality of VR multimedia | |
CN106454553A (en) | A precise time delay live video network transmission control method | |
RU2673102C2 (en) | Device and method of information processing and program |
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 |