CN115665483B - Video playing method and device and hard disk video recorder - Google Patents

Video playing method and device and hard disk video recorder Download PDF

Info

Publication number
CN115665483B
CN115665483B CN202211679256.0A CN202211679256A CN115665483B CN 115665483 B CN115665483 B CN 115665483B CN 202211679256 A CN202211679256 A CN 202211679256A CN 115665483 B CN115665483 B CN 115665483B
Authority
CN
China
Prior art keywords
time
playing
video frame
current system
calculating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211679256.0A
Other languages
Chinese (zh)
Other versions
CN115665483A (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.)
Beijing BlueSky Technologies Co Ltd
Original Assignee
Beijing BlueSky Technologies 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 Beijing BlueSky Technologies Co Ltd filed Critical Beijing BlueSky Technologies Co Ltd
Priority to CN202211679256.0A priority Critical patent/CN115665483B/en
Publication of CN115665483A publication Critical patent/CN115665483A/en
Application granted granted Critical
Publication of CN115665483B publication Critical patent/CN115665483B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The video playing method, the video playing device and the hard disk video recorder are applied to the technical field of information, and the video frame playing time of a target video frame in a video to be played and the current system time of the hard disk video recorder are obtained, wherein the current system time represents the time when the target video frame is transmitted to a sending module; calculating the playing waiting time of the target video frame according to the video frame playing time and the current system time; and waiting according to the playing waiting time, and sending the target video frame to a player through the sending module after the waiting is finished so that the player plays the target video frame according to the video frame playing time. According to the scheme of the embodiment of the application, the player can play the target video frame according to the video frame playing time, so that the playing effect is improved.

Description

Video playing method and device and hard disk video recorder
Technical Field
The present application relates to the field of information technology, and in particular, to a video playing method and apparatus, and a hard disk video recorder.
Background
At present, the hard disk video recorder has wide application in the fields of monitoring and the like. The hard disk video recorder is accessed to the camera of the local area network, and the video collected by the camera can be stored, so that the user can conveniently manage, preview, store and play back the video in the hard disk video recorder.
However, when a video in a hard disk recorder is played, the playing is too slow or frames are dropped due to system errors, which results in poor playing effect. For example, frame rate control is performed such that each time a frame is transmitted, 40ms is waited for, and then the next frame is transmitted, and due to system errors, the actual waiting time is often 41ms, so that with long-time playing, the playing is too slow due to deviation accumulation, or frames are dropped, and the playing effect is poor.
Disclosure of Invention
An object of the embodiment of the application is to provide a video playing method and device and a hard disk video recorder, so as to improve the playing effect of the hard disk video recorder. The specific technical scheme is as follows:
in a first aspect of the embodiments of the present application, a video playing method is first provided, where the method is applied to a hard disk video recorder, and the method includes:
acquiring video frame playing time of a target video frame in a video to be played and current system time of a hard disk video recorder, wherein the current system time represents time when the target video frame is transmitted to a sending module;
according to the video frame playing time and the current system time, the playing waiting time of the target video frame is calculated;
and waiting according to the playing waiting time, and sending the target video frame to a player through the sending module after the waiting is finished so that the player plays the target video frame according to the video frame playing time.
In a possible implementation, the calculating the play waiting time of the target video frame according to the video frame play time and the current system time includes:
and calculating the difference value between the video frame playing time and the current system time to obtain the playing waiting time of the target video frame.
In a possible implementation, the calculating the play waiting time of the target video frame according to the video frame play time and the current system time includes:
acquiring first reference time corresponding to a hard disk video recorder and second reference time corresponding to the target video frame, wherein the first reference time is earlier than the current system time;
calculating the difference value between the current system time and the first reference time to obtain a first time difference; calculating the difference value between the video frame playing time and the second reference time to obtain a second time difference;
and calculating the difference value of the first time difference and the second time difference to obtain the playing waiting time of the target video frame.
In a possible implementation, the acquiring a first reference time corresponding to a hard disk recorder and a second reference time corresponding to the target video frame includes:
acquiring the current system time of the hard disk video recorder corresponding to a first frame in the video to be played to obtain the first reference time; and acquiring the video frame playing time of the first frame in the video to be played to obtain the second reference time.
In a possible implementation, the calculating the play waiting time of the target video frame according to the video frame play time and the current system time includes:
acquiring the playing speed of the player during fast playing, and calculating the ratio of the video frame playing time to the playing speed of the player during fast playing to obtain fast playing time;
and calculating the difference value between the current system time and the fast playing time to obtain the playing waiting time of the target video frame.
In a possible implementation, the calculating the play waiting time of the target video frame according to the video frame play time and the current system time includes:
acquiring the playing speed of the player during slow playing, and calculating the product of the video frame playing time and the playing speed to obtain slow playing time;
and calculating the difference value between the current system time and the slow playing time to obtain the playing waiting time of the target video frame.
In a second aspect of the embodiments of the present application, a video playing apparatus is provided, which is applied to a hard disk video recorder, the apparatus includes:
the time acquisition module is used for acquiring the video frame playing time of a target video frame in a video to be played and the current system time of the hard disk video recorder, wherein the current system time represents the time when the target video frame is transmitted to the sending module;
the waiting time calculation module is used for calculating the playing waiting time of the target video frame according to the video frame playing time and the current system time;
and the video frame sending module is used for waiting according to the playing waiting time and sending the target video frame to a player through the sending module after the waiting is finished so that the player plays the target video frame according to the video frame playing time.
In a possible implementation manner, the waiting time calculating module is specifically configured to calculate a difference between the video frame playing time and the current system time to obtain the playing waiting time of the target video frame.
In one possible implementation, the latency calculation module includes:
the reference time acquisition submodule is used for acquiring first reference time corresponding to the hard disk video recorder and second reference time corresponding to the target video frame, wherein the first reference time is earlier than the current system time;
the time difference obtaining submodule is used for calculating the difference value between the current system time and the first reference time to obtain a first time difference; calculating the difference value between the video frame playing time and the second reference time to obtain a second time difference;
and the time difference calculation submodule is used for calculating the difference value of the first time difference and the second time difference to obtain the playing waiting time of the target video frame.
In a possible implementation manner, the reference time obtaining sub-module is specifically configured to obtain a current system time of the hard disk video recorder corresponding to a first frame in the video to be played, so as to obtain the first reference time; and acquiring the video frame playing time of a first frame in the video to be played to obtain the second reference time.
In one possible implementation, the latency calculation module includes:
the fast playing time acquisition submodule is used for acquiring the playing speed of the player during fast playing and calculating the ratio of the video frame playing time to the playing speed of the player during fast playing to obtain the fast playing time;
and the fast playing time calculation submodule is used for calculating the difference value between the current system time and the fast playing time to obtain the playing waiting time of the target video frame.
In one possible implementation, the latency calculation module includes:
the slow playing time acquisition submodule is used for acquiring the playing speed of the player during slow playing and calculating the product of the video frame playing time and the playing speed to obtain slow playing time;
and the slow playing time calculation submodule is used for calculating the difference value between the current system time and the slow playing time to obtain the playing waiting time of the target video frame.
The embodiment of the application also provides a hard disk video recorder which is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete mutual communication through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing any one of the video playing methods when executing the program stored in the memory.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements any of the video playing methods described above.
The embodiment of the present application further provides a computer program product containing instructions, which when run on a computer, causes the computer to execute any of the video playing methods described above.
The embodiment of the application has the following beneficial effects:
according to the video playing method and device and the hard disk video recorder provided by the embodiment of the application, the video frame playing time of a target video frame in a video to be played and the current system time of the hard disk video recorder are obtained, wherein the current system time represents the time when the target video frame is transmitted to a sending module; calculating the playing waiting time of the target video frame according to the video frame playing time and the current system time; and waiting according to the playing waiting time, and sending the target video frame to a player through the sending module after the waiting is finished so that the player plays the target video frame according to the video frame playing time. According to the scheme of the embodiment of the application, the playing time of the video frame and the time when the video frame is transmitted to the sending module can be obtained, the waiting time of the video frame is dynamically determined through the playing time and the time when the video frame is transmitted to the sending module, the video frame is sent after waiting according to the waiting time, therefore, accumulation of deviation caused by system errors is prevented, the player plays the target video frame according to the playing time of the video frame, and the playing effect is improved.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and it is also obvious for a person skilled in the art to obtain other embodiments according to the drawings.
Fig. 1 is a schematic flowchart of a video playing method according to an embodiment of the present application;
fig. 2 is a diagram illustrating an example of a method for calculating a playing waiting time according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a playing latency calculation method according to an embodiment of the present application;
fig. 4 is a diagram illustrating an example of a method for calculating a playing waiting time during normal playing according to an embodiment of the present application;
fig. 5 is another schematic flowchart of a playing waiting time calculation method according to an embodiment of the present application;
fig. 6 is a diagram illustrating an example of a method for calculating a playing waiting time during fast playing according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another method for calculating a playing waiting time according to an embodiment of the present application;
fig. 8 is a diagram illustrating an example of a method for calculating a play waiting time during slow play according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a video recording and playing apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a hard disk recorder according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described clearly and completely with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, and not all embodiments. All other embodiments that can be derived by one of ordinary skill in the art from the description herein are intended to be within the scope of the present disclosure.
In order to solve the problem of poor playing effect caused by deviation accumulation when video playing is performed through frame rate control in the prior art, embodiments of the present application provide a video playing method and apparatus, and a hard disk video recorder, which are described below with reference to specific embodiments.
In a first aspect of the embodiment of the present application, a video playing method is first provided, where the video playing method is applied to a hard disk video recorder, referring to fig. 1, fig. 1 is a schematic flow diagram of the video playing method provided in the embodiment of the present application, and the method includes:
and S11, acquiring the video frame playing time of a target video frame in the video to be played and the current system time of the hard disk video recorder.
Wherein the current system time represents a time when the target video frame is transmitted to the transmitting module. The video frame playing Time may be a PTS (Presentation Time Stamp) of the video frame itself, and the video frame playing Time may be used to measure when the video frame is displayed, obtain the video frame playing Time of the target video frame in the video to be played, and identify the video frame playing Time of the target video frame itself. The method of the embodiment of the application is applied to the hard disk video recorder, the video collected by the camera can be stored through the hard disk video recorder, and further a user can manage, play back and the like the video stored in the hard disk video recorder. In an example, the video to be played may be a video collected by a camera stored in a hard disk recorder, or a video received by the hard disk recorder and acquired in advance by another terminal. The target video frame may be any video frame in the video to be played.
And S12, calculating the playing waiting time of the target video frame according to the video frame playing time and the current system time.
The playing waiting time of the target video frame is calculated according to the playing time of the video frame and the current system time, and may be calculated by various methods, for example, calculating a difference between the two and taking the calculated difference as the playing waiting time of the target video frame, or calculating a difference between the playing time of the video frame and the current system time and a corresponding reference time, and then calculating a difference between the calculated differences to obtain the playing waiting time of the target video frame, or calculating a time corresponding to the playing time of the video frame when fast playing or slow playing is performed, and then calculating a difference to obtain the playing waiting time of the target video frame.
In one possible implementation, calculating the play waiting time of the target video frame according to the video frame play time and the current system time includes: and calculating the difference value between the video frame playing time and the current system time to obtain the playing waiting time of the target video frame.
For example, referring to fig. 2, in the same time dimension, the current system time and the playing time of a video frame corresponding to a certain video frame are obtained, and then the playing waiting time corresponding to the video frame is obtained by subtracting the current system time from the playing time of the video frame corresponding to the video frame.
And S13, waiting according to the playing waiting time, and sending the target video frame to the player through the sending module after the waiting is finished so that the player plays the target video frame according to the video frame playing time.
In the embodiment of the application, after the playing waiting time of the target video frame is obtained through calculation, the hard disk video recorder can wait according to the waiting time, and when the waiting time is over, the target video frame is transmitted to the sending module, then the target video frame is sent to the player through the sending module, and the player plays the target video frame according to the playing time of the video frame of the target video frame.
The method provided by the embodiment of the application is applied to the hard disk video recorder, particularly can be applied to a sending module in the hard disk video recorder, the sending module is used for calculating the playing waiting time of the target video frame, waiting is carried out according to the calculation result, and after the waiting is finished, the target video frame is sent to the player for playing through the sending module.
Therefore, by the method of the embodiment of the application, the playing time of the video frame and the time when the video frame is transmitted to the sending module can be obtained, the waiting time of the video frame is dynamically determined through the playing time of the video frame and the time when the video frame is transmitted to the sending module, the video frame is sent after waiting according to the waiting time, accumulation of deviation caused by system errors is prevented, the player plays the target video frame according to the playing time of the video frame, and the playing effect is improved.
In one possible implementation, referring to fig. 3, the step S12 of calculating the playing waiting time of the target video frame according to the video frame playing time and the current system time includes:
step S121, acquiring a first reference time corresponding to the hard disk video recorder and a second reference time corresponding to the target video frame, wherein the first reference time is earlier than the current system time;
step S122, calculating the difference value between the current system time and the first reference time to obtain a first time difference; calculating the difference value between the video frame playing time and the second reference time to obtain a second time difference;
step S123, calculating a difference between the first time difference and the second time difference to obtain the playing waiting time of the target video frame.
The first reference time corresponding to the hard disk video recorder and the second reference time corresponding to the target video frame are obtained, and the first reference time corresponding to the hard disk video recorder and the second reference time corresponding to the player at the moment can be calculated by taking the time of sending the previous video frame to the player as a reference. After the first reference time and the second reference time are obtained, the difference value between the current system time and the first reference time and the difference value between the video frame playing time and the second reference time are respectively calculated, so that the calculated difference values can be unified to a unified time dimension, and the accuracy of the playing waiting time of the target video frame obtained through calculation is improved.
In one possible implementation, acquiring a first reference time corresponding to a hard disk recorder and a second reference time corresponding to a target video frame includes: acquiring the current system time of a hard disk video recorder corresponding to a first frame in a video to be played to obtain first reference time; and acquiring the video frame playing time of the first frame in the video to be played to obtain second reference time.
In the actual use process, the video to be played often includes a plurality of video frames, so that when the first reference time corresponding to the hard disk video recorder is obtained, the system time of the hard disk video recorder corresponding to the first frame in the video to be played when the first frame reaches the sending module can be obtained, the first reference time is obtained, and the video frame playing time corresponding to the first frame in the video to be played is obtained, and the second reference time is obtained.
In one example, referring to fig. 4, the following description is given by taking normal double speed playback as an example, and includes:
1. the sending Time of each frame is based on the t2 Time axis, the playing Time of the first frame is obtained and is used as the frame Base Time (the reference Time of the video frame), and the video frame playing Time frame2Ts and frame3Ts corresponding to the second frame and the third frame;
2. when a first frame in a video to be played reaches a sending module, recording the current system time systemBaseTime (system reference time), and unifying two time axes by the frameBaseTime;
3. for the next video frame, video frame play time frameTs = video frame play time-frameBaseTime of the current frame;
4. system time for the next video frame cTime = system time for this frame systembabletime;
5. the sleepTime of the video frame is calculated to be = frames ts-cTime, for example, for the second frame and the third frame, the respective playing waiting time is the playing time of the video frame of the frame minus the time of the frame when the frame arrives at the sending module.
In one possible implementation, referring to fig. 5, the step S12 of calculating the playing waiting time of the target video frame according to the video frame playing time and the current system time includes:
step S124, acquiring the playing speed of the player during fast playing, and calculating the ratio of the video frame playing time to the playing speed during fast playing to obtain the fast playing time;
step S125, calculating the difference value between the current system time and the fast playing time to obtain the playing waiting time of the target video frame.
In the actual playing process, if the user performs fast playing at multiple speed, such as twice speed, four times speed, eight times speed, etc., the playing time of the corresponding video frame is reduced, and the reduced multiple corresponds to the multiple of fast playing. The fast play time frame = video frame play time frame/playSpeed, where playSpeed is a value of double speed playback. For example, in the case of double-rate playing, the size is reduced to half of the original size, and in the case of quadruple-rate playing, the size is reduced to one quarter of the original size. Therefore, when the user plays the fast playing, the reduced video frame time can be subtracted from the current system time to obtain the corresponding playing waiting time.
In an example, referring to fig. 6, a description is given by using double-speed fast playback, when the double-speed fast playback is performed, the playback Time of a first frame is obtained and is used as a double-speed fast playback frame Base Time (reference Time of a video frame), the playback Time of the video frame corresponding to each video frame is half of the original playback Time, that is, the playback Time of the video frame of a second frame, a third frame, a fourth frame, and a fifth frame is reduced to f2Ts/2, f3Ts/2, f4Ts/2, and f5Ts/2, when a first frame in a video to be played reaches a sending module, a current system Time systemdasetime (system reference Time) is recorded, and then a corresponding playback waiting Time is calculated to be sleepTime = fast playback Time frame Ts — current system Time c. For example, for the second frame and the third frame, the respective playing waiting time is the video frame playing time f2Ts/2, f3Ts/2 of the frame, minus the time of the frame when it reaches the sending module.
In one possible implementation, referring to fig. 7, the step S12 of calculating the playing waiting time of the target video frame according to the video frame playing time and the current system time includes:
step S126, obtaining the playing speed of the player during slow playing, and calculating the product of the video frame playing time and the playing speed to obtain the slow playing time;
and step S127, calculating the difference value between the current system time and the slow playing time to obtain the playing waiting time of the target video frame.
In the actual playing process, if the user performs slow playing at a multiple speed, for example, at a double speed, a quadruple speed, an octal speed, etc., the playing time of the corresponding video frame will be increased, and the increased multiple corresponds to the slow playing multiple. Slow play time frame ts = video frame play time frame ts playSpeed, where playSpeed is a value of double speed playback. For example, in the case of double-time slow-playing, the zoom size is twice that of the original zoom size, and in the case of quadruple slow-playing, the zoom size is four times that of the original zoom size. Therefore, when the user performs slow playing, the increased video frame time can be subtracted from the current system time to obtain the corresponding playing waiting time.
In an example, referring to fig. 8, the description is given by using double-speed slow playback, when the double-speed slow playback is performed, the playback Time of the first frame is obtained and is used as a double-speed slow playback frame Base Time (reference Time of a video frame), the playback Time of the video frame corresponding to each video frame is twice as long as the original playback Time, that is, the playback times of the video frames of the second frame and the third frame are frame2Ts, frame3Ts, frame4Ts, and frame5Ts, and are increased to f2Ts 2 and f3Ts 2, when the first frame in the video to be played reaches the sending module, the current system Time systemtbasetime is recorded, and then the corresponding playback waiting Time is calculated as slaeptime Ts = slow playback Time frame — current system Time c. For example, for the second frame and the third frame, the respective playing waiting time is the video frame playing time f2Ts × 2, f3Ts × 2 of the frame, minus the time when the frame reaches the sending module.
In a second aspect of the embodiments of the present application, there is provided a video recording and playing apparatus for use in a hard disk recorder, with reference to fig. 9, the apparatus includes:
a time obtaining module 901, configured to obtain video frame playing time of a target video frame in a video to be played and current system time of the hard disk video recorder, where the current system time represents time when the target video frame is transmitted to the sending module;
a waiting time calculation module 902, configured to calculate the playing waiting time of the target video frame according to the video frame playing time and the current system time;
and the video frame sending module 903 is configured to wait according to the playing waiting time, and send the target video frame to the player through the sending module after the waiting is finished, so that the player plays the target video frame according to the video frame playing time.
In a possible implementation manner, the waiting time calculation module is specifically configured to calculate a difference between the video frame playing time and the current system time to obtain the playing waiting time of the target video frame.
In one possible implementation, the latency calculation module includes:
the reference time acquisition submodule is used for acquiring first reference time corresponding to the hard disk video recorder and second reference time corresponding to the target video frame, wherein the first reference time is earlier than the current system time;
the time difference obtaining submodule is used for calculating the difference value between the current system time and the first reference time to obtain a first time difference; calculating the difference value between the video frame playing time and the second reference time to obtain a second time difference;
and the time difference calculating submodule is used for calculating the difference value of the first time difference and the second time difference to obtain the playing waiting time of the target video frame.
In a possible implementation manner, the reference time obtaining submodule is specifically configured to obtain a current system time of the hard disk video recorder corresponding to a first frame in a video to be played, and obtain a first reference time; and acquiring the video frame playing time of the first frame in the video to be played to obtain second reference time.
In one possible implementation, a latency calculation module includes:
the fast playing time obtaining submodule is used for obtaining the playing speed of the player during fast playing and calculating the ratio of the video frame playing time to the playing speed during fast playing to obtain the fast playing time;
and the fast playing time calculation submodule is used for calculating the difference value between the current system time and the fast playing time to obtain the playing waiting time of the target video frame.
In one possible implementation, the latency calculation module includes:
the slow playing time acquisition submodule is used for acquiring the playing speed of the player during slow playing and calculating the product of the video frame playing time and the playing speed to obtain slow playing time;
and the slow playing time calculation submodule is used for calculating the difference value between the current system time and the slow playing time to obtain the playing waiting time of the target video frame.
Therefore, the device of the embodiment of the application can acquire the playing time of the video frame and the time when the video frame is transmitted to the sending module, dynamically determine the waiting time of the video frame through the playing time and the time when the video frame is transmitted to the sending module, send the video frame after waiting according to the waiting time, prevent the accumulation of deviation caused by system errors, realize that a player plays a target video frame according to the playing time of the video frame, and improve the playing effect.
The embodiment of the present application further provides a hard disk video recorder, as shown in fig. 10, which includes a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002 and the memory 1003 complete mutual communication through the communication bus 1004,
a memory 1003 for storing a computer program;
the processor 1001 is configured to implement the following steps when executing the program stored in the memory 1003:
acquiring video frame playing time of a target video frame in a video to be played and current system time of the hard disk video recorder, wherein the current system time represents time when the target video frame is transmitted to a sending module in the hard disk video recorder;
calculating the playing waiting time of the target video frame according to the video frame playing time and the current system time;
and waiting according to the playing waiting time, and transmitting the target video frame to the sending module after the waiting is finished so that the sending module sends the target video frame to the player and plays the target video frame according to the video frame playing time through the player.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the video playback methods described above.
In another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the video playback methods in the above embodiments.
In the above embodiments, all or part of the implementation may be realized by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described in accordance with the embodiments of the application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It should be noted that, in this document, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the storage medium, and the computer program product embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to the partial description of the method embodiments for relevant points.
The above description is only for the preferred embodiment of the present application and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the scope of protection of the present application.

Claims (14)

1. A video playing method is characterized in that the method is applied to a hard disk video recorder, and the method comprises the following steps:
acquiring video frame playing time of a target video frame in a video to be played and current system time of a hard disk video recorder, wherein the current system time represents time when the target video frame is transmitted to a sending module;
according to the video frame playing time and the current system time, the playing waiting time of the target video frame is calculated;
waiting according to the playing waiting time, and sending the target video frame to a player through the sending module after the waiting is finished so that the player plays the target video frame according to the video frame playing time;
wherein, the calculating the playing waiting time of the target video frame according to the playing time of the video frame and the current system time comprises: and obtaining the playing waiting time of the target video frame based on the difference between the playing time of the video frame and the current system time, or based on the difference between the playing time of the video frame and the current system time and the respective corresponding reference time and the difference between the difference values, or based on the difference between the current system time and the time corresponding to the playing time of the video frame during fast playing or slow playing.
2. The method of claim 1, wherein said calculating the play latency of the target video frame according to the video frame play time and the current system time comprises:
and calculating the difference value between the video frame playing time and the current system time to obtain the playing waiting time of the target video frame.
3. The method of claim 1, wherein said calculating a play latency of the target video frame based on the video frame play time and the current system time comprises:
acquiring first reference time corresponding to a hard disk video recorder and second reference time corresponding to a target video frame, wherein the first reference time is earlier than the current system time;
calculating the difference value between the current system time and the first reference time to obtain a first time difference; calculating the difference value between the video frame playing time and the second reference time to obtain a second time difference;
and calculating the difference value of the first time difference and the second time difference to obtain the playing waiting time of the target video frame.
4. The method of claim 3, wherein obtaining a first reference time corresponding to a hard disk video recorder and a second reference time corresponding to the target video frame comprises:
acquiring the current system time of the hard disk video recorder corresponding to a first frame in the video to be played to obtain the first reference time; and acquiring the video frame playing time of the first frame in the video to be played to obtain the second reference time.
5. The method of claim 1, wherein said calculating a play latency of the target video frame based on the video frame play time and the current system time comprises:
acquiring the playing speed of the player during fast playing, and calculating the ratio of the video frame playing time to the playing speed of the player during fast playing to obtain fast playing time;
and calculating the difference value between the current system time and the fast playing time to obtain the playing waiting time of the target video frame.
6. The method of claim 1, wherein said calculating a play latency of the target video frame based on the video frame play time and the current system time comprises:
acquiring the playing speed of the player during slow playing, and calculating the product of the video frame playing time and the playing speed to obtain slow playing time;
and calculating the difference value between the current system time and the slow playing time to obtain the playing waiting time of the target video frame.
7. A video playing device is characterized in that the device is applied to a hard disk video recorder, and the device comprises:
the system comprises a time acquisition module, a sending module and a display module, wherein the time acquisition module is used for acquiring video frame playing time of a target video frame in a video to be played and current system time of the hard disk video recorder, and the current system time represents time when the target video frame is transmitted to the sending module;
the waiting time calculation module is used for calculating the playing waiting time of the target video frame according to the video frame playing time and the current system time;
the video frame sending module is used for waiting according to the playing waiting time and sending the target video frame to a player through the sending module after the waiting is finished so that the player can play the target video frame according to the video frame playing time;
the waiting time calculation module is specifically configured to obtain the playing waiting time of the target video frame based on a difference between the video frame playing time and the current system time, or based on a difference between the video frame playing time and the current system time and respective corresponding reference time and a difference between the difference and the difference, or based on a difference between the current system time and a time corresponding to the video frame playing time during fast playing or slow playing.
8. The apparatus of claim 7,
the waiting time calculating module is specifically configured to calculate a difference between the video frame playing time and the current system time to obtain the playing waiting time of the target video frame.
9. The apparatus of claim 7, wherein the latency calculation module comprises:
the reference time acquisition submodule is used for acquiring first reference time corresponding to the hard disk video recorder and second reference time corresponding to the target video frame, wherein the first reference time is earlier than the current system time;
the time difference obtaining submodule is used for calculating the difference value between the current system time and the first reference time to obtain a first time difference; calculating the difference value between the video frame playing time and the second reference time to obtain a second time difference;
and the time difference calculation submodule is used for calculating the difference value of the first time difference and the second time difference to obtain the playing waiting time of the target video frame.
10. The apparatus of claim 9,
the reference time obtaining submodule is specifically configured to obtain a current system time of the hard disk video recorder corresponding to a first frame in the video to be played, and obtain the first reference time; and acquiring the video frame playing time of the first frame in the video to be played to obtain the second reference time.
11. The apparatus of claim 7, wherein the latency calculation module comprises:
the fast playing time acquisition submodule is used for acquiring the playing speed of the player during fast playing and calculating the ratio of the video frame playing time to the playing speed of the player during fast playing to obtain the fast playing time;
and the fast playing time calculation submodule is used for calculating the difference value between the current system time and the fast playing time to obtain the playing waiting time of the target video frame.
12. The apparatus of claim 7, wherein the latency calculation module comprises:
the slow playing time acquisition submodule is used for acquiring the playing speed of the player during slow playing and calculating the product of the video frame playing time and the playing speed to obtain slow playing time;
and the slow playing time calculation submodule is used for calculating the difference value between the current system time and the slow playing time to obtain the playing waiting time of the target video frame.
13. The hard disk video recorder is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for completing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 6 when executing a program stored in a memory.
14. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 6.
CN202211679256.0A 2022-12-27 2022-12-27 Video playing method and device and hard disk video recorder Active CN115665483B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211679256.0A CN115665483B (en) 2022-12-27 2022-12-27 Video playing method and device and hard disk video recorder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211679256.0A CN115665483B (en) 2022-12-27 2022-12-27 Video playing method and device and hard disk video recorder

Publications (2)

Publication Number Publication Date
CN115665483A CN115665483A (en) 2023-01-31
CN115665483B true CN115665483B (en) 2023-03-31

Family

ID=85022683

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211679256.0A Active CN115665483B (en) 2022-12-27 2022-12-27 Video playing method and device and hard disk video recorder

Country Status (1)

Country Link
CN (1) CN115665483B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271720A (en) * 2008-04-22 2008-09-24 中兴通讯股份有限公司 Synchronization process for mobile phone stream media audio and video
JP2013012265A (en) * 2011-06-28 2013-01-17 Sony Computer Entertainment Inc Reproduction device and reproduction method
CN104822008A (en) * 2014-04-25 2015-08-05 腾讯科技(北京)有限公司 Video synchronizing method and device
CN108600803A (en) * 2018-04-10 2018-09-28 普联技术有限公司 Back method, device, terminal device and the storage medium of multi-channel video code stream
CN114143486A (en) * 2021-09-16 2022-03-04 浙江大华技术股份有限公司 Video stream synchronization method and device, computer equipment and storage medium
CN114650448A (en) * 2020-12-18 2022-06-21 北京安云世纪科技有限公司 Video recording speed and speed action adjusting method and system, storage medium and computer

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101271720A (en) * 2008-04-22 2008-09-24 中兴通讯股份有限公司 Synchronization process for mobile phone stream media audio and video
JP2013012265A (en) * 2011-06-28 2013-01-17 Sony Computer Entertainment Inc Reproduction device and reproduction method
CN104822008A (en) * 2014-04-25 2015-08-05 腾讯科技(北京)有限公司 Video synchronizing method and device
CN108600803A (en) * 2018-04-10 2018-09-28 普联技术有限公司 Back method, device, terminal device and the storage medium of multi-channel video code stream
CN114650448A (en) * 2020-12-18 2022-06-21 北京安云世纪科技有限公司 Video recording speed and speed action adjusting method and system, storage medium and computer
CN114143486A (en) * 2021-09-16 2022-03-04 浙江大华技术股份有限公司 Video stream synchronization method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN115665483A (en) 2023-01-31

Similar Documents

Publication Publication Date Title
CN108495164B (en) Audio and video synchronization processing method and device, computer device and storage medium
CN107509107A (en) Detection method, device and the equipment of video playback failure, computer-readable recording medium
CN109996117B (en) Method and device for acquiring streaming media playing time
US8179789B2 (en) System and method for timestamps for media stream data
WO2023197933A1 (en) Signal processing method and apparatus, and electronic device and medium
CN111541927A (en) Video playing method and device
CN115665483B (en) Video playing method and device and hard disk video recorder
CN110234029B (en) Playing processing method, device, equipment and storage medium of multi-sensor data
CN110324707B (en) Video playing time consumption testing method and device
CN116737084A (en) Queue statistics method and device, electronic equipment and storage medium
EP3598738A1 (en) Video synthesis method, apparatus and device, and video playing method, apparatus and device
CN111309693A (en) Data synchronization method, device and system, electronic equipment and storage medium
CN112463746B (en) File storage and generation method and device and electronic equipment
CN111083497B (en) Video screenshot method and device
CN111683215B (en) Video playback method and device, electronic equipment and computer readable storage medium
CN111432283B (en) Video playback time determination method and device
CN110557660B (en) Live video processing method and device
CN113923481A (en) Multimedia content playing method and device, electronic equipment and storage medium
US11463493B2 (en) Method and apparatus for playing media file
CN113727167A (en) Video resource playing method, device, equipment and readable storage medium
CN114387981B (en) Clock asynchronism compensation method, device, storage medium and electronic equipment
WO2023231416A1 (en) Method and apparatus for determining base station in-service rate, electronic device and storage medium
CN111984866B (en) Ranking list generation method and device for data
CN117729364A (en) Red envelope display method and device, electronic equipment and storage medium
TWI745763B (en) Schedule management method for playing device and schedule management system

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