CN110139157A - A kind of accurate positioning playback method, device, equipment and medium - Google Patents

A kind of accurate positioning playback method, device, equipment and medium Download PDF

Info

Publication number
CN110139157A
CN110139157A CN201910405488.9A CN201910405488A CN110139157A CN 110139157 A CN110139157 A CN 110139157A CN 201910405488 A CN201910405488 A CN 201910405488A CN 110139157 A CN110139157 A CN 110139157A
Authority
CN
China
Prior art keywords
target
time stamp
time point
positioning
presentation time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910405488.9A
Other languages
Chinese (zh)
Other versions
CN110139157B (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 CN201910405488.9A priority Critical patent/CN110139157B/en
Publication of CN110139157A publication Critical patent/CN110139157A/en
Application granted granted Critical
Publication of CN110139157B publication Critical patent/CN110139157B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47202End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for requesting content on demand, e.g. video on demand
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/472End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content
    • H04N21/47217End-user interface for requesting content, additional data or services; End-user interface for interacting with content, e.g. for content reservation or setting reminders, for requesting event notification, for manipulating displayed content for controlling playback functions for recorded or on-demand content, e.g. using progress bars, mode or play-point indicators or bookmarks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/8547Content authoring involving timestamps for synchronizing content

Abstract

The invention discloses a kind of accurate positioning playback method, device, equipment and media, and the method includes obtaining positioning time point and the mean bit rate for being accurately positioned file destination pointed by play instruction;The target offset position in file destination relative to initial position is calculated according to the positioning time point and the mean bit rate, the Presentation Time Stamp of first frame image and the spacing of the positioning time point are less than preset threshold behind the target offset position;The data of the file destination are read forward up to finding first object image from the target offset position;It is decoded since first object image position, until being decoded to the second target image, second target image is its Presentation Time Stamp I frame, P frame or B frame image nearest apart from the positioning time point;It is played from second target image.The present invention has taken into account the speed and precision of positioning playing, can be obviously improved user's viscosity.

Description

A kind of accurate positioning playback method, device, equipment and medium
Technical field
The present invention relates to files in stream media process field more particularly to a kind of accurate positioning playback method, device, equipment and Medium.
Background technique
Transmitting stream file (Transport Stream, TS) is in current TV programme, Streaming Media, network direct broadcasting, net Network program request etc. plays widely used a kind of files in stream media transformat under scene.It include three kinds of frames in the transfer stream file Type, respectively I frame, P frame and B frame.I frame can independent encoding and decoding, P frame need before to encoding and decoding before reference go out I Frame or P frame image complete encoding and decoding, and B frame needs front and back that could complete to the P frame image completed with reference to two encoding and decoding Encoding and decoding.
For the positioning playing of transmission stream file, there are following problems in the prior art:
If by searching for arriving before Distance positioning time point to a nearest I frame image, and being broadcast since the I frame image It puts to realize positioning playing, then positioning playing precision is lower;If by searching for before Distance positioning time point to nearest I frame, P frame Or B frame, and started to play to nearest I frame, P frame or B frame before the Distance positioning time point, then search the Distance positioning To nearest I frame before time point, the process of P frame or B frame is taken a long time.
Summary of the invention
The technical issues of in order to solve the rapidity and accuracy that cannot be considered in terms of positioning playing in the prior art, the present invention are real It applies example and a kind of accurate positioning playback method, device, equipment and medium is provided.
On the one hand, the present invention provides a kind of accurate positioning playback methods, which comprises
In response to being accurately positioned play instruction, obtain pointed by positioning time point and the accurate positioning play instruction The mean bit rate of file destination;
The target in file destination relative to initial position is calculated according to the positioning time point and the mean bit rate Deviation post, the spacing of the Presentation Time Stamp of first frame image and the positioning time point is less than pre- behind the target offset position If threshold value;
The data of the file destination are read forward up to finding first object image, institute from the target offset position Stating first object image is preceding to the I frame image nearest apart from the target offset positional distance;
It is decoded since first object image position, until being decoded to the second target image, second mesh Logo image is its Presentation Time Stamp I frame, P frame or B frame image nearest apart from the positioning time point;
It is played from second target image.
On the other hand, the present invention provides a kind of accurate positioning playing device, and described device includes:
Positioning time point and mean bit rate determining module, for obtaining positioning in response to being accurately positioned play instruction Time point and the mean bit rate for being accurately positioned file destination pointed by play instruction;
Target offset value obtains module, for calculating file destination according to the positioning time point and the mean bit rate In target offset position relative to initial position, behind the target offset position Presentation Time Stamp of first frame image with it is described The spacing of positioning time point is less than preset threshold;
First object image collection module, for reading the data of the file destination forward from the target offset position Until finding first object image, the first object image is preceding to the I nearest apart from the target offset positional distance Frame image;
Second target image obtains module, for decoding since first object image position, until decoding To the second target image, second target image is its Presentation Time Stamp I frame nearest apart from the positioning time point, P frame Or B frame image;
Playing module, for playing from second target image.
On the other hand, the present invention provides a kind of equipment, which is characterized in that and the equipment includes processor and memory, It is stored at least one instruction, at least a Duan Chengxu, code set or instruction set in the memory, at least one instruction, An at least Duan Chengxu, the code set or instruction set are loaded by the processor and are executed to realize that a kind of accurate positioning is broadcast Put method.
On the other hand, the present invention provides a kind of computer storage mediums, which is characterized in that stores in the storage medium There are at least one instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, at least a Duan Chengxu, code Collection or instruction set are loaded by processor and execute a kind of accurate positioning playback method.
The present invention provides a kind of accurate positioning playback method, device, equipment and media.By to finding in the present invention Its Presentation Time Stamp Distance positioning time point nearest I frame, P frame or B frame image, and broadcast from the I frame, P frame or B frame figure It puts, to ensure that the precision of positioning playing;Further, by being patrolled before optimum position time point to the lookup of related I frame Volume, when shortening for obtaining its Presentation Time Stamp I frame nearest apart from the positioning time point, P frame or the decoding of B frame image Between, so as to shorten positioning time, achieve the effect that quickly to play, therefore, the present invention taken into account positioning playing speed and precisely Degree, can be obviously improved user's viscosity.
Detailed description of the invention
It in order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology and advantage, below will be to implementation Example or attached drawing needed to be used in the description of the prior art are briefly described, it should be apparent that, the accompanying drawings in the following description is only It is only some embodiments of the present invention, for those of ordinary skill in the art, without creative efforts, It can also be obtained according to these attached drawings other attached drawings.
Fig. 1 is the difference schematic diagram provided by the invention for being accurately positioned and playing with common positioning playing;
Fig. 2 is a kind of schematic diagram of implementation environment provided by the invention;
Fig. 3 is a kind of accurate positioning playback method flow chart provided by the invention;
Fig. 4 is the text of target pointed by acquisition positioning time point provided by the invention and the accurate positioning play instruction The mean bit rate method flow diagram of part;
Fig. 5 is variable bit rate fluctuation situation schematic diagram during practical audio and video playing provided by the invention;
Fig. 6 is provided by the invention according to opposite in the positioning time point and mean bit rate calculating file destination Target offset position flow chart in initial position;
Fig. 7 is provided by the invention according to the target Presentation Time Stamp, positioning time point and the current offset position It sets to obtain the second deviation post flow chart;
Fig. 8 is a kind of accurate positioning playing device block diagram provided by the invention;
Fig. 9 is that target offset value provided by the invention obtains module frame chart;
Figure 10 is a kind of hardware knot of equipment for realizing method provided by the embodiment of the present invention provided by the invention Structure schematic diagram.
Specific embodiment
Following will be combined with the drawings in the embodiments of the present invention, and technical solution in the embodiment of the present invention carries out clear, complete Site preparation description, it is clear that described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.It is based on Embodiment in the present invention, those of ordinary skill in the art without making creative work it is obtained it is all its His embodiment, shall fall within the protection scope of the present invention.
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, containing the process, method of a series of steps or units, system, product or server need not limit In step or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, produce The other step or units of product or equipment inherently.
In order to which objects, technical solutions and advantages disclosed by the embodiments of the present invention are more clearly understood, below in conjunction with attached drawing And embodiment, the embodiment of the present invention is further elaborated.It should be appreciated that specific embodiment described herein is only used To explain the embodiment of the present invention, it is not intended to limit the present invention embodiment.In in order to illustrate the embodiments of the present invention more clearly Technical solution and its acquired technological progress, the embodiment of the present invention is first to skill use in the embodiment of the present invention or realization Art term and technical background do following elaborations:
Transmission stream file (Transport Stream, TS): a feature of TS file format is exactly to require from video flowing Any segment start all be can be independent decoded.The basic composition of TS stream file is with packet (packet) for unit, one Packet generally comprises 188 bytes (bytes), and the first character section of paceket is fixed as 0x47, and 0x47 may be considered this The index of a packet, commonly referred to as synchronous head (sync header).Entire TS file is exactly by packet series connection one by one Get up.These packet combine, and just contain audio (audio) data, video (video) data and some other needs The description information used.It include three kinds of frame types, respectively I frame, P frame and B frame in TS file.I frame can independent encoding and decoding, P Encoding and decoding are completed before frame needs to the I frame or P frame image that go out with reference to front encoding and decoding, B frame needs front and back to reference to two Encoding and decoding could be completed by opening the P frame image that encoding and decoding are completed.
Fixed bit rate: the bit rate output (or input bit rate of decoder) of fixed bit rate presentation code device is continuing Time in be fixed value, this value is substantially invariable in compression/playing process.
Variable bit rate: variable bit rate with fixed bit rate on the contrary, the bit rate output of encoder or decoder it is defeated Enter code rate to be not fixed, be worth either large or small.For example in a time point bit rate be 240Kbps, bit rate may be within next second 1Mbps.Current audio-video document, such as TS, MP4 file, RM etc. are mostly variable bit rate files.MP4 is a set of is used for The compression and coding standard of audio, video information.RM format is a kind of streaming media video file of RealNetworks company exploitation Format can formulate different compression ratios according to the different rates of network data transmission, thus realize low rate it is online into The real-time transmission and broadcasting of row video file.
Mean bit rate: i.e. the average bit rate of file destination whithin a period of time, when being equal to file total size divided by file The long value calculated.
Presentation Time Stamp: Presentation Time Stamp (PTS), this timestamp are used to indicate player assorted When show the data of this frame.The size of this value has reacted the precedence relationship that the frame figure is shown.
Decoded time stamp: when Decoding Time Stamp (DTS), this timestamp are used to indicate player Decode the data of this frame.The size of this value has reacted the decoded sequencing of frame figure.
Common positioning playing: common positioning playing is usually used among the broadcasting scene of audio-video.By dragging progress bar or Person generates a positioning time point in means such as some specific location clicks of progress bar, and audio-video is jumped to apart from institute It states before positioning time point to a nearest I frame image, is played since the position of this I frame image.
It is accurately positioned and plays: being accurately positioned and play among the broadcasting scene that can be used for audio-video.By dragging progress Item or progress bar some specific location click etc. means generate a positioning time point, and make audio-video jump to away from From, to a nearest I frame, P frame or B frame image, being opened from the position of this I frame, P frame or B frame image before the positioning time point Begin to play.
As shown in Figure 1, it illustrates be accurately positioned the difference schematic diagram played with common positioning playing.In Fig. 1, user It needs to play at the time point (positioning time point) for deviating 20 seconds relative to broadcasting start time point, but this file is corresponding There is no I frame nearby in the image of positioning time point, nearest forward direction I frame is deviated 16 seconds relative to broadcasting start time point Position (point A), then common positioning playing can only just be broadcast since relative to playing the position that start time point deviates 16 seconds It puts.And position before time point at two seconds, i.e., it deviates 18 seconds positions (point B) there are P frame relative to playing start time point, then It is accurately positioned and plays and can be played since deviating 18 seconds positions relative to broadcasting start time point, it is seen then that be accurately positioned The actual play time point B of broadcasting can be closer to positioning time point than the actual play time point A of common positioning playing, To reach pinpoint effect.
Fig. 2 is a kind of schematic diagram of implementation environment provided in an embodiment of the present invention, and referring to fig. 2, which includes: sound Video playing server 01, at least one audio and video playing terminal 02, the audio and video playing server 01 and the audio-video Playback terminal 02 communicates to connect.
The audio and video playing terminal 02 can be based on Browser/Server Mode (Browser/Server, B/S) or visitor Family end/server mode (Client/Server, C/S) is communicated with audio and video playing server 01.The audio and video playing Terminal 02 may include: smart phone, tablet computer, laptop, digital assistants, intelligent wearable device, car-mounted terminal Etc. types entity device, also may include the software run in entity device, such as application program etc..For example, described push away Audio/video player software can be run by recommending terminal, the social software with audio and video playing function.
The audio and video playing server 01 can be used for decoding audio-video document and be transmitted to each audio and video playing end End 02.Audio and video playing server 01 may include an independently operated server perhaps distributed server or by more The server cluster of a server composition.
Referring to FIG. 3, it illustrates a kind of accurate positioning playback method provided in an embodiment of the present invention, the method can be with It is broadcast with the audio and video playing server in above-mentioned implementation environment, audio and video playing terminal or audio and video playing server, audio-video Put the generally subject of implementation of terminal composition, which comprises
S101. in response to being accurately positioned play instruction, positioning time point and accurate positioning play instruction institute are obtained The mean bit rate of the file destination of direction.
Specifically, the positioning time point can drag progress bar based on user or in some specific location of progress bar Click etc. triggering commands and generate.The positioning time point is the desired file destination of user i.e. by the time point of redirect broadcasting. File destination is the file that the accurate positioning play instruction is directed toward, and object where can dragging progress bar for user is corresponding The corresponding file of object that file or user click.The file destination is specifically as follows TS transmission stream file.
Specifically, as shown in figure 4, mesh pointed by the acquisition positioning time point and the accurate positioning play instruction Mark the mean bit rate of file, comprising:
S1011. the end-of-file of the corresponding start frame of file header and the file destination that obtain the file destination is corresponding Ending frame.
When S1013. obtaining the corresponding starting Presentation Time Stamp of the start frame and the ending frame corresponding ending display Between stab.
When S1015. calculating the display of file destination according to the starting Presentation Time Stamp and the ending Presentation Time Stamp It is long.
Specifically, the display duration Duration=end frame PTS- start frame PTS.
S1017. the average specific of the file destination according to the data volume of the file destination and the display duration calculation Special rate.
Specifically, the mean bit rate AverageBitrate=size_total/Duration of the file destination, Middle size_total is the data volume of file destination.
S103. it is calculated in file destination according to the positioning time point and the mean bit rate relative to initial position Target offset position, the spacing of the Presentation Time Stamp and the positioning time point of first frame image is small behind the target offset position In preset threshold.
Specifically, the spacing can by the Presentation Time Stamp of first frame image behind the target offset position with it is described The absolute value of the difference of positioning time point characterizes.
The preset threshold can be set according to actual needs, for example the preset threshold can be 2 seconds, 4 seconds etc..
It is played to realize to be accurately positioned, it, can be by being obtained in file destination in a feasible embodiment One is estimated deviation post, is simply indicated using positioning time point and the mean bit rate product, and estimate described Deviation post is as target offset position.It is simple that it has the advantages that target offset position calculates, but there is also certain limitations Property.
The reason is that after obtaining target offset position, it is also necessary to according to before the target offset position to finding the One target image (I frame), and decode until finding the second target image (I frame, P frame or the B for meeting and being accurately positioned broadcast request Frame) after just start to play.But the target offset position obtained according to this embodiment and the second target image are in target text Position potential range in part farther out, therefore, will increase the decoding time-consuming being decoded to find the second target image, and And it is affected by variable bit rate fluctuation situation.
Referring to FIG. 5, it illustrates variable bit rates during practical audio and video playing to fluctuate situation schematic diagram.It is got the bid The lines for being denoted as 1 correspond to TS file mean bit rate, correspond to TS file actual bit rate labeled as 2 lines.As it can be seen that TS file Bit rate variation it is very big, in different document time points, bit rate differs greatly.In scene shown in Fig. 5, it is possible to go out Existing such a case: positioning time point is 20 seconds, since variable bit rate fluctuation is larger, is caused based on according to mean bit rate The Presentation Time Stamp for the I frame that calculated target offset position obtains is 4 seconds, and practical and positioning time point immediate second The corresponding Presentation Time Stamp of target image is 18 seconds, then the second target image can just be found by needing to decode 14 seconds data, this Obviously time-consuming more long, influence user experience.
In order to further enhance the precision of target offset position, shorten decoding time-consuming, in a preferred embodiment institute State the target offset position calculated in file destination relative to initial position according to the positioning time point and the mean bit rate It sets, as shown in Figure 6, comprising:
S1031. initial offset position is calculated according to the positioning time point and the mean bit rate, and will be described initial Deviation post is as current offset position.
Specifically, the initial offset position OffSet=SeekPoint*AverageBirate, wherein SeekPoint For positioning time point, AverageBirate is mean bit rate.
S1033. target Presentation Time Stamp is obtained, the target Presentation Time Stamp is first frame image behind current offset position Presentation Time Stamp.
S1035. judge whether the target Presentation Time Stamp and the spacing of the positioning time point are less than preset threshold.
Specifically, the spacing of the target Presentation Time Stamp and the positioning time point passes through target Presentation Time Stamp and institute State the absolute value representation of the difference of positioning time point.
S1037. if so, current offset position is determined as target offset position position.
S1039. if it is not, then being obtained according to the target Presentation Time Stamp, positioning time point and the current offset position The current offset position is updated to the second deviation post, and according to second deviation post, repeats step S1033.
Specifically, described to be obtained according to the target Presentation Time Stamp, positioning time point and the current offset position Second deviation post, as shown in fig. 7, comprises:
S10. reference offset position is obtained according to the target Presentation Time Stamp and positioning time point.
Specifically, if the target Presentation Time Stamp is less than the positioning time point, the reference offset position is institute State the middle position of current offset position and file destination ending;If the target Presentation Time Stamp is greater than the positioning Between point, then the reference offset position be the current offset position and the file destination starting middle position.
If SeekPoint > PTScurrent, wherein PTScurrentFor target Presentation Time Stamp, then it represents that forward direction bit rate Bigger than normal, file reduces by half position as reference offset position after finding current offset position.I.e.Wherein, Offsetref,OffsetcurrentRespectively with reference to inclined Pan position and current offset position;, whereas if SeekPoint < PTScurrent, it is less than normal to bit rate before indicating, it finds current Position of reducing by half before deviation post is as reference offset position, i.e.,
S20. obtain reference offset Presentation Time Stamp, according to the reference offset Presentation Time Stamp, target Presentation Time Stamp, Current reference position and reference offset reference position calculation mean bit rate, the reference offset Presentation Time Stamp are reference offset The Presentation Time Stamp of first frame image behind position.
Specifically, with reference to mean bit rateWherein AverageBitrateref,PTSrefRespectively refer to mean bit rate and reference offset Presentation Time Stamp.
S30. the time is shown according to the current reference position, the reference mean bit rate, positioning time point and target Stamp calculates the second deviation post.
Specifically, the second deviation post Offset '=Offsetcurrent+(SeekPoint-PTScurrent)* AverageBitrateref
In this preferred embodiment, it is approached by way of loop iteration and file position corresponding to positioning time point Distance target offset position close enough is set, passes through decoding to can reduce to the maximum extent compared to a upper embodiment Mode search the time-consuming of the second target image, promote speed.
The purpose of the setting of preset threshold described in step S103 is by finding such a target offset position, institute The Presentation Time Stamp Distance positioning time point for stating first frame image behind target offset position is close enough, so as to shorten the mesh is based on Mark the time-consuming of the subsequent decoding link of deviation post.
S105. the data of the file destination are read forward up to finding first object figure from the target offset position Picture, the first object image are preceding to the I frame image nearest apart from the target offset positional distance.
S107. it is decoded since first object image position, until be decoded to the second target image, described the Two target images are its Presentation Time Stamp I frame, P frame or B frame image nearest apart from the positioning time point.
S109. from second target image play.
The embodiment of the present invention provides a kind of accurate positioning playback method, can reach more smart compared to common positioning playing Quasi- result of broadcast, and by the lookup logic of the first object image near optimum position time point, shorten positioning time, To achieve the effect that quickly to play, user's viscosity is promoted.
The embodiment of the invention also provides a kind of accurate positioning playing devices, as shown in figure 8, described device includes:
Positioning time point and mean bit rate determining module 201, in response to being accurately positioned play instruction, it to be fixed to obtain Position time point and the mean bit rate for being accurately positioned file destination pointed by play instruction;
Target offset value obtains module 203, for calculating target according to the positioning time point and the mean bit rate Target offset position in file relative to initial position, behind the target offset position Presentation Time Stamp of first frame image with The spacing of the positioning time point is less than preset threshold;
First object image collection module 205, for reading the file destination forward from the target offset position For data until finding first object image, the first object image is preceding to nearest apart from the target offset positional distance I frame image;
Second target image obtains module 207, for decoding since first object image position, until solution For code to the second target image, second target image is its Presentation Time Stamp I frame nearest apart from the positioning time point, P Frame or B frame image;
Playing module 209, for playing from second target image.
Further, it is as shown in Figure 9 to obtain module 203 for the target offset value, comprising:
Initial offset position acquisition unit 2031, for being calculated just according to the positioning time point and the mean bit rate Beginning deviation post, and using the initial offset position as current offset position;
Target Presentation Time Stamp acquiring unit 2033, for obtaining target Presentation Time Stamp, the target Presentation Time Stamp For the Presentation Time Stamp of first frame image behind current offset position;
Judging unit 2035, for judging whether the target Presentation Time Stamp and the spacing of the positioning time point are less than Preset threshold;
Updating unit 2037, for according to the target Presentation Time Stamp, positioning time point and the current offset position It sets to obtain the second deviation post, and the current offset position is updated according to second deviation post;
Target position output unit 2039, for current offset position to be determined as target offset position.
Specifically, a kind of accurate positioning playing device and embodiment of the method described in the embodiment of the present invention are based on identical invention Design.
The embodiment of the invention also provides a kind of computer storage medium, the computer storage medium can store more Item instruction, described instruction are suitable for being loaded as processor and being executed a kind of accurate positioning playback method described in the embodiment of the present invention Various steps, specific implementation procedure include:
A kind of accurate positioning playback method, which comprises
In response to being accurately positioned play instruction, obtain pointed by positioning time point and the accurate positioning play instruction The mean bit rate of file destination;
The target in file destination relative to initial position is calculated according to the positioning time point and the mean bit rate Deviation post, the spacing of the Presentation Time Stamp of first frame image and the positioning time point is less than pre- behind the target offset position If threshold value;
The data of the file destination are read forward up to finding first object image, institute from the target offset position Stating first object image is preceding to the I frame image nearest apart from the target offset positional distance;
It is decoded since first object image position, until being decoded to the second target image, second mesh Logo image is its Presentation Time Stamp I frame, P frame or B frame image nearest apart from the positioning time point;
It is played from second target image.
Further, described to obtain positioning time point and described be accurately positioned file destination pointed by play instruction Mean bit rate, comprising:
It is described to obtain positioning time point and the average bit for being accurately positioned file destination pointed by play instruction Rate;
Obtain the corresponding starting Presentation Time Stamp of the start frame and the corresponding ending Presentation Time Stamp of the ending frame;
The display duration of file destination is calculated according to the starting Presentation Time Stamp and the ending Presentation Time Stamp;
According to the mean bit rate of file destination described in the data volume of the file destination and the display duration calculation.
Further, described to be calculated in file destination according to the positioning time point and the mean bit rate relative to rising The target offset position of beginning position, comprising:
Initial offset position is calculated according to the positioning time point and the mean bit rate, and by the initial offset position It sets as current offset position;
Target Presentation Time Stamp is obtained, the target Presentation Time Stamp is the display of first frame image behind current offset position Timestamp;
Judge whether the target Presentation Time Stamp and the spacing of the positioning time point are less than preset threshold;
If so, current offset position is determined as target offset position position.
Further, further includes:
If it is not, then obtaining second according to the target Presentation Time Stamp, positioning time point and the current offset position Deviation post, and the current offset position is updated according to second deviation post, it repeats step: obtaining target and show Timestamp, the target Presentation Time Stamp are the Presentation Time Stamp of first frame image behind current offset position.
Further, described to be obtained according to the target Presentation Time Stamp, positioning time point and the current offset position To the second deviation post, comprising:
Reference offset position is obtained according to the target Presentation Time Stamp and positioning time point;
Reference offset Presentation Time Stamp is obtained, according to the reference offset Presentation Time Stamp, target Presentation Time Stamp, current Reference position and reference offset reference position calculation mean bit rate, the reference offset Presentation Time Stamp are reference offset position The Presentation Time Stamp of first frame image afterwards;
According to the current reference position, the reference mean bit rate, positioning time point and target Presentation Time Stamp meter Calculate the second deviation post.
It is further, described that reference offset position is obtained according to the target Presentation Time Stamp and positioning time point, Include:
If the target Presentation Time Stamp is less than the positioning time point, the reference offset position is described current inclined The middle position of pan position and file destination ending;If the target Presentation Time Stamp is greater than the positioning time point, The reference offset position is the middle position of the current offset position and file destination starting.
Further, Figure 10 shows a kind of hardware knot of equipment for realizing method provided by the embodiment of the present invention Structure schematic diagram, the equipment can participate in constituting or comprising device provided by the embodiment of the present invention.As shown in Figure 10, equipment 10 It may include that (processor 102 can be with for one or more (using 102a, 102b ... ... in figure, 102n to show) processors 102 The including but not limited to processing unit of Micro-processor MCV or programmable logic device FPGA etc.), memory for storing data 104 and for communication function transmitting device 106.It in addition to this, can also include: display, input/output interface (I/ O Interface), the port universal serial bus (USB) (a port that can be used as in the port of I/O interface is included), network connect Mouth, power supply and/or camera.It will appreciated by the skilled person that structure shown in Fig. 10 is only to illustrate, not to upper The structure for stating electronic device causes to limit.For example, equipment 10 may also include the more or less component than shown in Figure 10, or Person has the configuration different from shown in Figure 10.
It is to be noted that said one or multiple processors 102 and/or other data processing circuits lead to herein Can often " data processing circuit " be referred to as.The data processing circuit all or part of can be presented as software, hardware, firmware Or any other combination.In addition, data processing circuit can set for single independent processing module or all or part of be integrated to In any one in other elements in standby 10 (or mobile devices).As involved in the embodiment of the present application, the data Processing circuit controls (such as the selection for the variable resistance end path connecting with interface) as a kind of processor.
Memory 104 can be used for storing the software program and module of application software, as described in the embodiment of the present invention Corresponding program instruction/the data storage device of method, the software program that processor 102 is stored in memory 104 by operation And module realizes a kind of above-mentioned accurate positioning playback method thereby executing various function application and data processing.It deposits Reservoir 104 may include high speed random access memory, may 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 104 can further comprise relative to place The remotely located memory of device 102 is managed, these remote memories can pass through network connection to equipment 10.The example of above-mentioned network Including but not limited to internet, intranet, local area network, mobile radio communication and combinations thereof.
Transmitting device 106 is used to that data to be received or sent via a network.Above-mentioned network specific example may include The wireless network that the communication providers of equipment 10 provide.In an example, transmitting device 106 includes a network adapter (NetworkInterfaceController, NIC), can be connected by base station with other network equipments so as to internet It is communicated.In an example, transmitting device 106 can be radio frequency (RadioFrequency, RF) module, be used to pass through Wireless mode is communicated with internet.
Display can such as touch-screen type liquid crystal display (LCD), the liquid crystal display aloow user with The user interface of equipment 10 (or mobile device) interacts.
It should be understood that embodiments of the present invention sequencing is for illustration only, do not represent the advantages or disadvantages of the embodiments. And above-mentioned this specification specific embodiment is described.Other embodiments are within the scope of the appended claims.One In a little situations, the movement recorded in detail in the claims or step can be executed according to the sequence being different from embodiment and Still desired result may be implemented.In addition, process depicted in the drawing not necessarily requires the particular order shown or company Continuous sequence is just able to achieve desired result.In some embodiments, multitasking and parallel processing it is also possible or It may be advantageous.
All the embodiments in this specification are described in a progressive manner, same and similar portion between each embodiment Dividing may refer to each other, and each embodiment focuses on the differences from other embodiments.Especially for device and For server example, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to side The part of method embodiment illustrates.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely presently preferred embodiments of the present invention, is not intended to limit the invention, it is all in spirit of the invention and Within principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.

Claims (10)

1. a kind of accurate positioning playback method, which is characterized in that the described method includes:
In response to being accurately positioned play instruction, target pointed by positioning time point and the accurate positioning play instruction is obtained The mean bit rate of file;
The target offset in file destination relative to initial position is calculated according to the positioning time point and the mean bit rate Position, the spacing of the Presentation Time Stamp of first frame image and the positioning time point is less than default threshold behind the target offset position Value;
From the target offset position data of the file destination are read forward up to finding first object image, described One target image is preceding to the I frame image nearest apart from the target offset positional distance;
It is decoded since first object image position, until being decoded to the second target image, the second target figure As being its Presentation Time Stamp I frame, P frame or B frame image nearest apart from the positioning time point;
It is played from second target image.
2. the method according to claim 1, wherein the acquisition positioning time point and the accurate positioning are broadcast Put the mean bit rate of the pointed file destination of instruction, comprising:
It is described to obtain positioning time point and the mean bit rate for being accurately positioned file destination pointed by play instruction;
Obtain the corresponding starting Presentation Time Stamp of the start frame and the corresponding ending Presentation Time Stamp of the ending frame;
The display duration of file destination is calculated according to the starting Presentation Time Stamp and the ending Presentation Time Stamp;
According to the mean bit rate of file destination described in the data volume of the file destination and the display duration calculation.
3. the method according to claim 1, wherein described according to the positioning time point and the average bit Rate calculates the target offset position in file destination relative to initial position, comprising:
Initial offset position is calculated according to the positioning time point and the mean bit rate, and the initial offset position is made For current offset position;
Target Presentation Time Stamp is obtained, the target Presentation Time Stamp is the display time of first frame image behind current offset position Stamp;
Judge whether the target Presentation Time Stamp and the spacing of the positioning time point are less than preset threshold;
If so, current offset position is determined as target offset position position.
4. according to the method described in claim 3, it is characterized by further comprising:
If it is not, then obtaining the second offset according to the target Presentation Time Stamp, positioning time point and the current offset position Position, and the current offset position is updated according to second deviation post, it repeats step: obtaining target and show the time Stamp, the target Presentation Time Stamp are the Presentation Time Stamp of first frame image behind current offset position.
5. according to the method described in claim 4, it is characterized in that, described according to the target Presentation Time Stamp, positioning time Point and the current offset position obtain the second deviation post, comprising:
Reference offset position is obtained according to the target Presentation Time Stamp and positioning time point;
Reference offset Presentation Time Stamp is obtained, according to the reference offset Presentation Time Stamp, target Presentation Time Stamp, current reference Position and reference offset reference position calculation mean bit rate, the reference offset Presentation Time Stamp are the behind reference offset position The Presentation Time Stamp of one frame image;
According to the current reference position, described the is calculated with reference to mean bit rate, positioning time point and target Presentation Time Stamp Two deviation posts.
6. according to the method described in claim 5, it is characterized in that, described according to the target Presentation Time Stamp and the positioning Time point obtains reference offset position, comprising:
If the target Presentation Time Stamp is less than the positioning time point, the reference offset position is the current offset position Set the middle position with file destination ending;If the target Presentation Time Stamp is greater than the positioning time point, described Reference offset position is the middle position of the current offset position and file destination starting.
7. a kind of accurate positioning playing device, which is characterized in that described device includes:
Positioning time point and mean bit rate determining module, for obtaining positioning time in response to being accurately positioned play instruction Point and the mean bit rate for being accurately positioned file destination pointed by play instruction;
Target offset value obtains module, for calculating phase in file destination according to the positioning time point and the mean bit rate For the target offset position of initial position, the Presentation Time Stamp of first frame image and the positioning behind the target offset position The spacing at time point is less than preset threshold;
First object image collection module, for read forward from the target offset position data of the file destination up to First object image is found, the first object image is preceding to the I frame figure nearest apart from the target offset positional distance Picture;
Second target image obtains module, for decoding since first object image position, until being decoded to the Two target images, second target image are its Presentation Time Stamp I frame, P frame or B frame nearest apart from the positioning time point Image;
Playing module, for playing from second target image.
8. device according to claim 7, which is characterized in that the target offset value obtains module, comprising:
Initial offset position acquisition unit, for calculating initial offset position according to the positioning time point and the mean bit rate It sets, and using the initial offset position as current offset position;
Target Presentation Time Stamp acquiring unit, for obtaining target Presentation Time Stamp, the target Presentation Time Stamp is current inclined The Presentation Time Stamp of first frame image after pan position;
Judging unit, for judging whether the target Presentation Time Stamp and the spacing of the positioning time point are less than default threshold Value;
Updating unit, for obtaining according to the target Presentation Time Stamp, positioning time point and the current offset position Two deviation posts, and the current offset position is updated according to second deviation post;
Target position output unit, for current offset position to be determined as target offset position.
9. a kind of equipment, which is characterized in that the equipment includes processor and memory, and at least one is stored in the memory Item instruction, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code Collection or instruction set are loaded by the processor and are executed to realize that a kind of accurate positioning as claimed in any one of claims 1 to 6 is broadcast Put method.
10. a kind of computer storage medium, which is characterized in that be stored at least one instruction, at least one in the storage medium Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, code set or instruction set are added by processor It carries and executes a kind of accurate positioning playback method as claimed in any one of claims 1 to 6.
CN201910405488.9A 2019-05-16 2019-05-16 Accurate positioning playing method, device, equipment and medium Active CN110139157B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910405488.9A CN110139157B (en) 2019-05-16 2019-05-16 Accurate positioning playing method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910405488.9A CN110139157B (en) 2019-05-16 2019-05-16 Accurate positioning playing method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN110139157A true CN110139157A (en) 2019-08-16
CN110139157B CN110139157B (en) 2021-03-16

Family

ID=67574356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910405488.9A Active CN110139157B (en) 2019-05-16 2019-05-16 Accurate positioning playing method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN110139157B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126599A1 (en) * 2001-12-27 2003-07-03 Digeo, Inc. Method and system for distributing personalized editions of media programs using bookmarks
CN101287107A (en) * 2008-05-29 2008-10-15 腾讯科技(深圳)有限公司 Demand method, system and device of media file
CN102325244A (en) * 2011-08-26 2012-01-18 杭州海康威视数字技术股份有限公司 Method for rapidly positioning videos by time, video storage control device and positioning device
CN103024561A (en) * 2011-09-28 2013-04-03 深圳市快播科技有限公司 Method and device for displaying dragging progress bar
KR20130084345A (en) * 2012-01-17 2013-07-25 (주)피타소프트 Mp4 file configuring device and restoring device, mp4 file configuring method and restoring method
CN104994340A (en) * 2015-06-25 2015-10-21 广东工业大学 Precise positioning playback method for audio/video storage mode
CN108737908A (en) * 2018-05-21 2018-11-02 腾讯科技(深圳)有限公司 A kind of media playing method, device and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030126599A1 (en) * 2001-12-27 2003-07-03 Digeo, Inc. Method and system for distributing personalized editions of media programs using bookmarks
CN101287107A (en) * 2008-05-29 2008-10-15 腾讯科技(深圳)有限公司 Demand method, system and device of media file
CN102325244A (en) * 2011-08-26 2012-01-18 杭州海康威视数字技术股份有限公司 Method for rapidly positioning videos by time, video storage control device and positioning device
CN103024561A (en) * 2011-09-28 2013-04-03 深圳市快播科技有限公司 Method and device for displaying dragging progress bar
KR20130084345A (en) * 2012-01-17 2013-07-25 (주)피타소프트 Mp4 file configuring device and restoring device, mp4 file configuring method and restoring method
CN104994340A (en) * 2015-06-25 2015-10-21 广东工业大学 Precise positioning playback method for audio/video storage mode
CN108737908A (en) * 2018-05-21 2018-11-02 腾讯科技(深圳)有限公司 A kind of media playing method, device and storage medium

Also Published As

Publication number Publication date
CN110139157B (en) 2021-03-16

Similar Documents

Publication Publication Date Title
US11438637B2 (en) Computerized system and method for automatic highlight detection from live streaming media and rendering within a specialized media player
US11899637B2 (en) Event-related media management system
US10320876B2 (en) Media production system with location-based feature
US9590932B2 (en) Apparatus, method and computer readable recording medium for sharing real time video through chatting window of messenger service
US20150189401A1 (en) Advertisement scheme
CN105580013A (en) Browsing videos by searching multiple user comments and overlaying those into the content
US10021433B1 (en) Video-production system with social-media features
US20130133000A1 (en) Video Interaction System
US8984561B2 (en) Moving-image playing apparatus and method
EP3571848A1 (en) Content streaming system and method
CN110198494A (en) A kind of video broadcasting method, device, equipment and storage medium
US20190327531A1 (en) Video Production System with Content Extraction Feature
CN110139157A (en) A kind of accurate positioning playback method, device, equipment and medium
US20170289500A1 (en) Synchronization of Media Rendering in Heterogeneous Networking Environments
CN108028968A (en) Video editor server, video editing method, client terminal device and the method for controlling client terminal device

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