data playback method and device, terminal equipment and storage medium

文档序号:1721446 发布日期:2019-12-17 浏览:35次 中文

阅读说明:本技术 数据回放方法、装置、终端设备及存储介质 (data playback method and device, terminal equipment and storage medium ) 是由 王震 蓝威涛 于 2019-09-30 设计创作,主要内容包括:本申请适用于视频监控技术领域,提供了数据回放方法、装置、终端设备及存储介质,方法应用于客户端,所述客户端连接目标设备,客户端通过将目标设备中的视频码流缓存至回放通道中,并对应标记每个回放数据帧的时间戳,设置计时器的时间,根据计时器的时间对应读取回放数据,消除各个视频发送源发送数据不同步及网络干扰带来的问题,实现同步回放多设备、多码流的视频数据。(The method is applied to a client, the client is connected with target equipment, the client caches video code streams in the target equipment into a playback channel, correspondingly marks a timestamp of each playback data frame, sets the time of a timer, correspondingly reads playback data according to the time of the timer, eliminates the problems caused by data asynchrony and network interference of each video sending source, and realizes synchronous playback of video data of multiple devices and multiple code streams.)

1. A data playback method is applied to a client, the client is connected with a target device, and the data playback method comprises the following steps:

acquiring playback data sent by the target equipment; the playback data comprises a plurality of playback data frames;

caching the playback data into a corresponding playback channel, and marking the time stamp of each playback data frame;

Establishing a channel time stamp for each playback channel according to the time stamp of the playback data frame;

setting a timer, and acquiring a target playback data frame meeting a time condition according to the time of the timer and the channel time stamp of each playback channel;

And sequentially playing the target playback data frames according to the time stamps of the target playback data frames.

2. The data playback method according to claim 1, wherein the obtaining of the playback data transmitted by the target device; the playback data includes a plurality of playback data frames, including:

acquiring a storage ratio of a storable space to a storage space in each playback channel;

when the storage ratio is in a first threshold range, executing a first acquisition instruction; the first obtaining instruction is used for controlling the client to obtain the playback data at a first rate;

when the storage ratio is in a second threshold range, executing a second acquisition instruction; the second obtaining instruction is used for controlling the client to obtain the playback data at a second rate;

When the storage ratio is in a third threshold range, executing a third acquisition instruction; the third obtaining instruction is used for controlling the client to obtain the playback data at a third rate.

3. the data playback method according to claim 1, wherein the client is connected with a plurality of target devices, respectively, the client including a plurality of the playback channels;

The caching the playback data into a corresponding playback channel and marking a timestamp of each playback data frame includes:

selecting a corresponding playback channel according to the target equipment;

and sequentially caching the playback data frames of each piece of playback data into corresponding playback channels according to the time stamps of the playback data frames.

4. The data playback method of claim 1, wherein said establishing a channel timestamp for each of said playback channels based on timestamps of said playback data frames comprises:

Querying a first playback data frame in each of the playback channels;

Obtaining a time stamp of the first playback data frame;

Updating the time stamp of the first playback data frame to the channel time stamp of the playback channel.

5. The data playback method of claim 1, wherein the setting a timer and acquiring a target playback data frame satisfying a time condition according to a time of the timer and a channel time stamp of each of the playback channels comprises:

setting the starting time of the timer;

And increasing the first preset time to the time of a timer every other first preset time, and updating the time of the timer.

6. the data playback method of claim 4, wherein the setting of a timer and the obtaining of the target playback data frame satisfying a time condition from the time of the timer and the channel time stamp of each of the playback channels further comprises:

querying a first timestamp of the first playback data frame in all of the playback channels;

Judging the first timestamp with the earliest time in all first timestamps as a minimum timestamp;

judging whether the time of the timer is earlier than the minimum timestamp and the difference between the time of the timer and the minimum timestamp is greater than or equal to a second preset time length;

And if the time of the timer is less than the minimum time stamp and the difference between the time of the timer and the minimum time stamp is greater than or equal to a second preset time length, updating the minimum time stamp to the time of the timer.

7. the data playback method of claim 5, wherein the playing the target playback data frames in order according to their timestamps, comprises:

Receiving a playback control instruction; the playback control instruction comprises a pause playback instruction;

And when the instruction of pausing the playback is received, stopping updating the time of the timer.

8. A data playback apparatus, comprising:

the acquisition module is used for acquiring playback data sent by target equipment; the playback data comprises a plurality of playback data frames;

The buffer module is used for buffering the playback data into a corresponding playback channel and marking the time stamp of each playback data frame;

The establishing module is used for establishing a channel time stamp of each playback channel according to the time stamp of the playback data frame;

The timing module is used for setting the time of the timer;

and the playing module is used for acquiring target playback data frames meeting a time condition according to the time of the timer and the channel time stamps of the playback channels, and sequentially playing the target playback data frames according to the time stamps of the target playback data frames.

9. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.

10. a computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.

Technical Field

The application belongs to the technical field of video monitoring, and particularly relates to a data playback method and device, terminal equipment and a storage medium.

background

In order to implement reasonable playback control on multiple Video streams, all Video streams of multiple Network Camera (IP Camera, IPC) devices are usually stored in a single Network Video Recorder (NVR) in advance, and then the NVR can synchronously play back multiple IPC videos stored locally. But the NVR cannot play back multiple IPC videos stored on multiple NVRs simultaneously. In addition, the client acquires the video recordings stored in the plurality of NVRs through the network, and there are problems that the transmission rate and the transmission start time may be inconsistent and the network delay may be different when the playback data is transmitted in each NVR. Therefore, the problem that the playback time of the multi-path video code stream is not synchronized by the client through the network is caused.

In summary, the problem that the synchronous playback of multiple video code streams cannot be accurately realized exists at present.

disclosure of Invention

The embodiment of the application provides a data playback method, a data playback device, terminal equipment and a storage medium, and can solve the problem that the synchronous playback cannot be accurately realized by a plurality of paths of video code streams at present.

In a first aspect, an embodiment of the present application provides a data playback method, which is applied to a client, where the client is connected to a target device, and the method includes:

acquiring playback data sent by the target equipment; the playback data comprises a plurality of playback data frames;

caching the playback data into a corresponding playback channel, and marking the time stamp of each playback data frame;

establishing a channel time stamp for each playback channel according to the time stamp of the playback data frame;

Setting a timer, and acquiring a target playback data frame meeting a time condition according to the time of the timer and the channel time stamp of each playback channel;

and sequentially playing the target playback data frames according to the time stamps of the target playback data frames.

further, the playback data sent by the target device is obtained; the playback data includes a plurality of playback data frames, including:

Acquiring a storage ratio of a storable space to a storage space in each playback channel;

When the storage ratio is in a first threshold range, executing a first acquisition instruction; the first obtaining instruction is used for controlling the client to obtain the playback data at a first rate;

When the storage ratio is in a second threshold range, executing a second acquisition instruction; the second obtaining instruction is used for controlling the client to obtain the playback data at a second rate;

When the storage ratio is in a third threshold range, executing a third acquisition instruction; the third obtaining instruction is used for controlling the client to obtain the playback data at a third rate.

further, the client is respectively connected with a plurality of target devices, and the client comprises a plurality of playback channels;

the caching the playback data into a corresponding playback channel and marking a timestamp of each playback data frame includes:

Selecting a corresponding playback channel according to the target equipment;

and sequentially caching the playback data frames of each piece of playback data into corresponding playback channels according to the time stamps of the playback data frames.

Further, the establishing a channel timestamp for each playback channel according to the timestamp of the playback data frame includes:

querying a first playback data frame in each of the playback channels;

Obtaining a time stamp of the first playback data frame;

updating the time stamp of the first playback data frame to the channel time stamp of the playback channel.

Further, the setting a timer and obtaining a target playback data frame satisfying a time condition according to the time of the timer and the channel timestamp of each playback channel includes:

Setting the starting time of the timer;

and increasing the first preset time to the time of a timer every other first preset time, and updating the time of the timer.

Further, the setting a timer, and obtaining a target playback data frame satisfying a time condition according to the time of the timer and the channel timestamp of each playback channel, further includes:

querying a first timestamp of the first playback data frame in all of the playback channels;

judging the first timestamp with the earliest time in all first timestamps as a minimum timestamp;

Judging whether the time of the timer is earlier than the minimum timestamp and the difference between the time of the timer and the minimum timestamp is greater than or equal to a second preset time length;

and if the time of the timer is less than the minimum time stamp and the difference between the time of the timer and the minimum time stamp is greater than or equal to a second preset time length, updating the minimum time stamp to the time of the timer.

further, after the target playback data frames are played in sequence according to the timestamps of the target playback data frames, the method includes:

Receiving a playback control instruction; the playback control instruction comprises a pause playback instruction;

and when the instruction of pausing the playback is received, stopping updating the time of the timer.

in a second aspect, an embodiment of the present application provides a data playback apparatus, including:

the acquisition module is used for acquiring playback data sent by the target equipment; the playback data comprises a plurality of playback data frames;

the buffer module is used for buffering the playback data into a corresponding playback channel and marking the time stamp of each playback data frame;

The establishing module is used for establishing a channel time stamp of each playback channel according to the time stamp of the playback data frame;

the timing module is used for setting the time of the timer;

And the playing module is used for acquiring target playback data frames meeting a time condition according to the time of the timer and the channel time stamps of the playback channels, and sequentially playing the target playback data frames according to the time stamps of the target playback data frames.

in a third aspect, an embodiment of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the data playback method described in any one of the above first aspects when executing the computer program.

in a fourth aspect, the present application provides a computer-readable storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the data playback method of any one of the first aspect.

In a fifth aspect, the present application provides a computer program product, which when run on a terminal device, causes the terminal device to execute the data playback method described in any one of the above first aspects.

It is understood that the beneficial effects of the second aspect to the fifth aspect can be referred to the related description of the first aspect, and are not described herein again.

Compared with the prior art, the embodiment of the application has the advantages that: the client caches the video code stream in the target device in the playback channel, correspondingly marks the timestamp of each playback data frame, sets the time of the timer, and correspondingly reads the playback data according to the time of the timer, so that the problems caused by asynchronous data transmission and network interference of each video transmission source are solved, and the synchronous playback of the video data of multiple devices and multiple code streams is realized.

drawings

in order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.

fig. 1 is a schematic flow chart of an implementation of a data playback method provided by an embodiment of the present application;

FIG. 2 is a schematic flow chart of another implementation of a data playback method provided in an embodiment of the present application;

FIG. 3 is a schematic flowchart of another implementation of a data playback method provided by an embodiment of the present application;

FIG. 4 is a schematic flow chart of still another implementation of a data playback method provided by an embodiment of the present application;

Fig. 5 is a schematic structural diagram of a data playback device provided in an embodiment of the present application;

Fig. 6 is a schematic structural diagram of another data playback device provided in an embodiment of the present application;

fig. 7 is a schematic structural diagram of a terminal device according to an embodiment of the present application.

Detailed Description

In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.

It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

it should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

Furthermore, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used for distinguishing between descriptions and not necessarily for describing or implying relative importance.

Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise.

the application provides a data playback method, which is applied to a client, wherein the client is connected with a target device, the client is a playing client and is used for playing playback data, such as playing video data or audio data, and the like, the target device includes but is not limited to a network video recorder, a computer device, a mobile phone terminal and the like, and playback data such as video data or audio data and the like are respectively stored in the device.

As shown in fig. 1, the present embodiment provides a data playback method, including:

S101, obtaining playback data sent by the target equipment; the playback data includes a plurality of playback data frames.

in an embodiment, the playback data includes, but is not limited to, video data, audio data, and the like, specifically, the playback is performed for video data, and both the video data and the audio data can be in units of frames or bytes.

S102, caching the playback data into a corresponding playback channel, and marking the time stamp of each playback data frame.

In application, the one-path video only corresponds to one playback channel, one or more paths of videos exist on one playback device (NVR), and the one-path video only corresponds to one or more playback channels, that is, one client can play back multiple paths of video data at the same time, wherein the playback channel is a client channel, each playback channel has a certain buffer space for temporarily buffering part of video data in the network hard disk recorder, the client can read data frames in the playback channel and simultaneously acquire video data of the network hard disk recorder for buffering, that is, the first playback data frame of the video data in the playback channel is played and consumed, and simultaneously the client acquires video data of the network hard disk recorder and writes the video data in the tail part of the client channel. The time stamp of the playback data may be time information marked in the playback channel from the buffer of the playback data frame, specifically, a piece of header information is filled in front of each frame of video data, the header information includes information such as the data length of the video frame, the time stamp of the frame of video, and the like, and each frame of video data is filled with the header information.

S103, establishing a channel time stamp of each playback channel according to the time stamp of the playback data frame.

in an application, the channel timestamp is determined according to the playback data frame in the client channel, and the channel timestamp may be a playing time point of each playback data frame, specifically, the channel timestamp is a timestamp of a first playback data frame in the playback channel, and if the first playback data frame in the first playback channel is 9:00:00S, the current channel timestamp is 9:00: 00S.

and S104, setting a timer, and acquiring a target playback data frame meeting a time condition according to the time of the timer and the channel time stamp of each playback channel.

In an application, the timer may be a timing device provided inside the client, the time of the timer is the playback start time, and then the timer time will gradually increase as time passes. For example, every 20ms, the timer updates its own time, i.e. 20ms is added to the original playback start time, which is not limited.

In application, the target playback data frame satisfying the time condition may specifically be a time when the channel timestamp is less than the timer, that is, the time condition is satisfied. Illustratively, the channel timestamp is 9:00:00S, the start time of the timer is 8:59:59S, i.e., the playback time is started from 8:59:59S for the video data, and when the time of the timer is updated to 9:00:01S, the playback data frame within 9:00:00S-9:00:01S in the playback channel is the target playback data frame.

in application, when facing video data transmitted by multiple paths of equipment, a client channel can establish a channel time stamp corresponding to each path of video data when caching each path of video data frame, and traverse all client channels according to the time of a timer to acquire a target playback data frame of each path of video data meeting a time condition.

And S105, sequentially playing the target playback data frames according to the time stamps of the target playback data frames.

In application, each target playback data frame corresponds to a respective timestamp, and the target playback data frames are played continuously according to a time sequence. For example, the video data is movie data, frames of the movie data are 1S continuously playable 25 frames of playback data in the actual playing process, if the video data is television data, such as a tv series, the frames of the playback data may be 1S continuously playable 24 frames, and the animation film may be 1S continuously playable 12 frames, which is not limited herein.

In application, when the client acquires multiple paths of video data, the client correspondingly displays multiple windows for playing. For example, the client acquires two paths of video data, where the two paths of video data may be two paths of video data sent by one target device or two paths of video data sent by two target devices, and without limitation, the client acquires target playback data frames meeting a time condition in two playback channels by using a timer, and continuously plays the target playback data frames according to timestamps of the video data frames.

in this embodiment, when the client faces multiple paths of video data, multiple playback channels may be generated, each playback channel has a corresponding channel timestamp, a timer is set, the timer traverses each playback channel, and when the channel timestamp is less than the time of the timer, the client reads a playback data frame in the playback channel that is less than the time of the timer, thereby eliminating the problems caused by data transmission asynchronism of each video transmission source and network interference, and realizing synchronous playback of video data of multiple devices and multiple code streams.

Referring to fig. 2, in an embodiment, step S101 includes:

S201, obtaining a storage ratio of a storable space to a storage space in each playback channel.

In application, the storage space is specifically a memory space of a client channel, the storable space is a space in which video data can be written in the playback channel, the storage ratio is a ratio between the storable space and the storage space, if the storage space is 1G and the remaining storable space is 0.1G, the storage ratio is 0.1, the range of the storage ratio is greater than or equal to 0 and less than or equal to 1, and a large storage ratio indicates that the storable space is large, and video data in the network hard disk video recorder can be continuously acquired for caching.

S202, when the storage ratio is in a first threshold range, executing a first acquisition instruction; the first obtaining instruction is used for controlling the client to obtain the playback data through a first speed.

in application, the storage ratio may be considered as X, where X changes with the change of the storable space, and the first threshold range may specifically be 0.75 ≦ X ≦ 1, and then it is considered that a large amount of storable space remains in the client channel. The first obtaining instruction is an instruction for instructing the playing client to obtain the playback data from the network hard disk video recorder through the first speed.

Illustratively, the rate at which the playback data is normally acquired is 1S to acquire 25 frames of video data, while the first acquisition instruction is an acquisition acceleration instruction, i.e., the first rate may be an integer multiple of the normal acquisition playback data rate, such as 1S to acquire 50 frames of video data.

s203, when the storage ratio is in a second threshold range, executing a second acquisition instruction; the second obtaining instruction is used for controlling the client to obtain the playback data at a second rate.

in an application, the second threshold range may be specifically 0.25 ≦ X <0.75, and the remaining storable space of the client channel is considered to be insufficient. The second obtaining instruction is an instruction to obtain the playback data at the second rate, specifically, the rate of obtaining the playback data under the normal condition is 1S to obtain 25 frames of video data, and the second obtaining instruction may be a normal obtaining instruction, that is, the second rate may be a normal obtaining playback data rate, that is, 1S obtains 25 frames of video data.

S204, when the storage ratio is in a third threshold range, executing a third acquisition instruction; the third obtaining instruction is used for controlling the client to obtain the playback data at a third rate.

in application, the third threshold range may be specifically 0 ≦ X <0.25, and the remaining storage space of the client channel is considered to be small. The third obtaining instruction may be an instruction for suspending obtaining of the playback data, that is, stopping obtaining of the video data from the network hard disk recorder, or an instruction for obtaining the playback data at a slow speed. Illustratively, the third rate may be 1S to acquire 5 frames of video data, where the first rate > the second rate > the third rate.

In this embodiment, a timer is set at the client, and is used for receiving playback data sent by the network hard disk recorder, and when the playback start time of the timer reaches the channel timestamp of the client channel, the data can be directly taken out from the memory without acquiring video data of the time from the network, so that the problems that the sending times of the sending data of multiple video data sending sources are asynchronous, and synchronization caused by network interference is caused can be avoided, and a more flow playback effect can be achieved.

Referring to fig. 3, in this embodiment, the client is connected to a plurality of target devices, and the client includes a plurality of playback channels; step S102 includes:

S301, selecting a corresponding playback channel according to the target equipment.

s302, sequentially caching the playback data frames of each piece of playback data into corresponding playback channels according to the time stamps of the playback data frames.

In application, the client may be connected to a plurality of target devices, each client channel corresponds to one path of video data, and one target device may provide multiple paths of video data. During playing, the client can correspondingly and simultaneously display video data in a plurality of client channels, if the client obtains four paths of video data, four playing windows are displayed on a playing interface, and video data frames at the same time point in the four paths of video data are simultaneously played. The playback data frames contained in each path of video data correspond to the time stamps and are sequentially written into the corresponding playback channels according to the time sequence so that the video data frames can be continuously and smoothly read when the path of video data is read, and the video data frames in the plurality of client channels are synchronously acquired to be synchronously played when each client channel meets the time condition in cooperation with the time of the timer. The problems that a plurality of network video recorders are required to be added for synchronously playing multi-channel video data, but video data sending time is asynchronous and network interference exists among the added network video recorders can be solved, and the situation that the multi-channel video cannot be synchronously played when a client channel plays the multi-channel video is avoided.

referring to fig. 4, in this embodiment, step S103 includes:

S401, inquiring a first playback data frame in each playback channel.

S402, acquiring the time stamp of the first playback data frame.

S403, updating the timestamp of the first playback data frame to the channel timestamp of the playback channel.

In application, the client may query header information of stored video data frames through a playback channel, where a header of each video data frame carries a time stamp, the first playback data frame is a first video data frame in the playback channel, and the time stamp in the playback channel is specifically a time stamp of the first playback data frame. If the time stamp of the first playback data frame in the first playback channel is 9:00:00S and the time stamp of the second video data frame is 9:00:01S, the current playback channel time stamp is 9:00:00S, when the first video data frame is consumed, the second video data frame is used as a new first playback data frame, the channel time stamp is also changed into the time stamp of the new first playback data frame, namely 9:00:01S, and the time of the first playback data frame can be used for being matched with the timer to be sequentially read by the client side and play the video data frames.

in one embodiment, step S104 includes:

setting a starting time of the timer.

And increasing the first preset time to the time of a timer every other first preset time, and updating the time of the timer.

In the application, the start time of the timer is the video data start playing time point in the client channel, and the start time of the timer is 8:59:59S, that is, the playback time of the video data is 8:59: 59S. The first preset time is set by the system or preset by the user. In this embodiment, the first preset duration may be every 20ms, the time of the timer is 8:59:59S, and the first preset duration is increased by 20ms after 20ms to the time of the original timer (8:59: 59S). Therefore, the time of the updated timer is 8:59:59S +20 ms. The client reads the video data frames with the time stamps between 8:59:59S-8:59:59S +20ms in each client channel for playing, the video data frames with the time stamps before 9:00:00S in the client channel are all consumed, and the client channel acquires the time stamp of the next video data frame to be played as a new channel time stamp. The client updates the timer every 20ms, the time of the timer can be updated for 50 times in 1S, and after the time of the timer is updated each time, the client traverses all client channels to read the video data frames meeting the time condition, so that the video data can be played more continuously and smoothly.

in this embodiment, an effect of playing multiple channels of video playback data synchronously can be achieved, and even if the arrival time of each channel of video data at the client channel is inconsistent, the multiple channels of video data can be played synchronously.

In one embodiment, step S104 further includes:

Querying a first timestamp of the first playback data frame in all of the playback channels.

In an embodiment, the first time stamp of the first playback data frame in the multiple playback channels may be consistent, or the multiple first time stamps may not be consistent due to network interference, inconsistent transmission time, and other problems.

Deciding the first timestamp with the earliest time among all the first timestamps as the minimum timestamp.

In an application, the minimum timestamp is the earliest one of the plurality of first timestamps, i.e. the video data frame written in the playback channel first in the plurality of first timestamps is considered. If there are A, B two client channels, the first timestamp of the first playback data frame corresponding to the a client channel is 9:00:00S, and the first timestamp of the first playback data frame corresponding to the B client channel is 10:00:00S, then the minimum timestamp corresponds to 9:00: 00S.

And judging whether the time of the timer is less than the minimum time stamp or not, and the difference between the time of the timer and the minimum time stamp is greater than or equal to a second preset time length.

The second preset time period may be a system preset time period or a time period set by a user, for example, the second preset time period is 3S, the minimum timestamp is 9:00:00S, and if the initial playback start time is set to 8:00:00S, it indicates that no client channel has playback data between 8:00:00S and 9:00: 00S.

and if the time of the timer is less than the minimum time stamp and the difference between the time of the timer and the minimum time stamp is greater than or equal to a second preset time length, updating the minimum time stamp to the time of the timer.

In application, if the time of the timer is less than the minimum time stamp, in order to save the playing time and improve the playing efficiency, the client may automatically modify the time of the timer to the minimum time stamp, that is, update the time of the timer to be 8:00:00S to 9:00:00S as the time of the timer, and then repeat the above steps every first preset time period, increase the first preset time period to the time, and update the time of the timer, which is not described in detail herein.

In this embodiment, the time interval between the time of the timer and the minimum timestamp is queried to quickly locate valid video data frames in multiple client channels, thereby saving playing time.

In an embodiment, after step S105, the method includes:

Receiving a playback control instruction; the playback control instruction comprises a pause playback instruction;

And when the instruction of pausing the playback is received, stopping updating the time of the timer.

in an embodiment, the playback control instruction includes, but is not limited to, a pause playback instruction, a fast rewind playback instruction, and a resume playback instruction. The pause playback instruction is specifically to stop playing the video data frame, and the time of the corresponding timer is also stopped to be updated when the video data frame is stopped to be played.

In another embodiment, the fast playback command is specifically to increase the rate of playing frames of video data, for example, the normal playing rate is 1S for playing 25 frames of video data, and may be changed to 1S for playing 30 frames of video data; the fast rewind playback instruction is to start playing in a rewind mode from a video data frame corresponding to the starting time of the playing timer, for example, if the channel timestamp of the channel of the client a is 9:00:00S, the channel timestamp of the channel of the client B is 10:00:00S, and if the starting playing time of the set timer is 11:00:00S, under normal conditions, the client starts playing in a playback time starting from 11:00:00S and the update time after the timer is 1S is 11:00:01S, the client plays the video data frame between 11:00:00S and 11:00: 01S. If the initial playing time of the set timer is 11:00:00S, and at this time, a fast-backward playback instruction is received, the timer may gradually start to fast-backward play the video data frames in the two client channels by updating the time interval of 1S to 10:59:59S until the video data frames in the two client channels are played to 9:00:00S, which is not limited.

referring to fig. 5, in a specific embodiment, the client 5 has A, B, C client channels, and the corresponding target device has three 1, 2, and 3, and the first timestamp of the first playback data frame corresponding to the a client channel is 9:00:00S, the first timestamp of the first playback data frame corresponding to the B client channel is 10:00:00S, and the first timestamp of the first playback data frame corresponding to the C client channel is 9:30: 00S. If the starting time of the timer 4 is 9:30:00S, the first preset time length and the first preset time length are both 1S, and the time update of the timer after 1S is 9:30:01S, the timer 4 traverses the video data frames meeting the time condition in the three client channels to perform read playing, if the video data frame of 9:30:00S-9:30:01S in a is read as D, that is, D is the target playback data frame meeting the time condition in the a channel, the target playback data frames meeting the time period have 9 frames in total, and the 9 target playback data frames are all arranged according to the time stamp sequence, wherein the foremost video data frame is the first playback data frame in the a client channel, and it can be known from the figure that the a client channel and the C client channel (not shown in the figure) meet the time condition, b does not satisfy the time condition and cannot read out the video data frame. If the starting time of the timer is 8:00:00S and the second preset duration is 1min, the client acquires that the channel timestamp corresponding to the channel of the client A is the minimum timestamp, the time for updating the timer is 9:00:00S, and then the steps are repeated.

in this embodiment, the playing client caches the video stream in the network hard disk recorder to the playback channel, correspondingly marks the timestamp of each video data frame, sets the time of the timer, and correspondingly reads the playback data according to the time of the timer, thereby eliminating the problems caused by data asynchronism and network interference sent by each video sending source, and realizing synchronous playback of the playback video data of multiple devices and multiple streams.

as shown in fig. 6, an embodiment of the present application further provides a data playback apparatus, including:

an obtaining module 10, configured to obtain playback data sent by the target device; the playback data includes a plurality of playback data frames.

and the buffer module 20 is configured to buffer the playback data into a corresponding playback channel, and mark a timestamp of each playback data frame.

an establishing module 30, configured to establish a channel timestamp of each playback channel according to the timestamp of the playback data frame.

And the timing module 40 is used for setting the time of the timer.

And the playing module 50 is configured to obtain target playback data frames meeting a time condition according to the time of the timer and the channel time stamps of the playback channels, and sequentially play the target playback data frames according to the time stamps of the target playback data frames.

In an embodiment, the obtaining module 10 is further configured to:

acquiring a storage ratio of a storable space to a storage space in each playback channel;

when the storage ratio is in a first threshold range, executing a first acquisition instruction; the first obtaining instruction is used for controlling the client to obtain the playback data at a first rate;

When the storage ratio is in a second threshold range, executing a second acquisition instruction; the second obtaining instruction is used for controlling the client to obtain the playback data at a second rate;

When the storage ratio is in a third threshold range, executing a third acquisition instruction; the third obtaining instruction is used for controlling the client to obtain the playback data at a third rate.

in one embodiment, the client is respectively connected with a plurality of target devices, and the client comprises a plurality of playback channels; the cache module 20 is further configured to:

Selecting a corresponding playback channel according to the target equipment;

And sequentially caching the playback data frames of each piece of playback data into corresponding playback channels according to the time stamps of the playback data frames.

In one embodiment, the establishing module 30 is further configured to:

Querying a first playback data frame in each of the playback channels;

Obtaining a time stamp of the first playback data frame;

updating the time stamp of the first playback data frame to the channel time stamp of the playback channel.

In one embodiment, the timing module 40 is further configured to:

setting the starting time of the timer;

And increasing the first preset time to the time of a timer every other first preset time, and updating the time of the timer.

in one embodiment, the timing module 40 is further configured to:

Querying a first timestamp of the first playback data frame in all of the playback channels;

Judging the first timestamp with the earliest time in all first timestamps as a minimum timestamp;

Judging whether the time of the timer is earlier than the minimum timestamp and the difference between the time of the timer and the minimum timestamp is greater than or equal to a second preset time length;

And if the time of the timer is less than the minimum time stamp and the difference between the time of the timer and the minimum time stamp is greater than or equal to a second preset time length, updating the minimum time stamp to the time of the timer.

In an embodiment, the data playback apparatus 100 further includes:

The receiving module is used for receiving a playback control instruction; the playback control instruction includes a pause playback instruction.

And the stopping module is used for stopping updating the time of the timer when the playback pause instruction is received.

In this embodiment, the playing client caches the video stream in the network hard disk recorder to the playback channel, correspondingly marks the timestamp of each video data frame, sets the time of the timer, and correspondingly reads the playback data according to the time of the timer, thereby eliminating the problems caused by data asynchronism and network interference sent by each video sending source, and realizing synchronous playback of the playback video data of multiple devices and multiple streams.

An embodiment of the present application further provides a terminal device, where the terminal device includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.

the embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the computer program implements the steps in the above-mentioned method embodiments.

the embodiments of the present application provide a computer program product, which when running on a mobile terminal, enables the mobile terminal to implement the steps in the above method embodiments when executed.

fig. 7 is a schematic diagram of a terminal device 80 according to an embodiment of the present application. As shown in fig. 7, the terminal device 80 of this embodiment includes: a processor 803, a memory 801 and a computer program 802 stored in the memory 801 and executable on the processor 803. The processor 803 implements the steps in the various method embodiments described above, such as the steps S101 to S105 shown in fig. 1, when executing the computer program 802. Alternatively, the processor 803 realizes the functions of the modules/units in the above-described device embodiments when executing the computer program 802.

illustratively, the computer program 802 may be partitioned into one or more modules/units that are stored in the memory 801 and executed by the processor 803 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution process of the computer program 802 in the terminal device 80. For example, the computer program 802 may be divided into an acquisition module, a cache module, an establishment module, a timing module, and a play module, and the specific functions of each module are as follows:

The acquisition module is used for acquiring playback data sent by the target equipment; the playback data includes a plurality of playback data frames.

And the buffer module is used for buffering the playback data into a corresponding playback channel and marking the time stamp of each playback data frame.

And the establishing module is used for establishing a channel time stamp of each playback channel according to the time stamp of the playback data frame.

And the timing module is used for setting the time of the timer.

And the playing module is used for acquiring target playback data frames meeting a time condition according to the time of the timer and the channel time stamps of the playback channels, and sequentially playing the target playback data frames according to the time stamps of the target playback data frames.

the terminal device 80 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The terminal device may include, but is not limited to, a processor 803 and a memory 801. Those skilled in the art will appreciate that fig. 7 is merely an example of a terminal device 80, and does not constitute a limitation of terminal device 80, and may include more or fewer components than shown, or some components in combination, or different components, e.g., the terminal device may also include input-output devices, network access devices, buses, etc.

the Processor 803 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.

The storage 801 may be an internal storage unit of the terminal device 80, such as a hard disk or a memory of the terminal device 80. The memory 801 may also be an external storage device of the terminal device 80, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the terminal device 80. In one embodiment, the memory 801 may also include both internal and external memory units of the terminal device 80. The memory 801 is used to store the computer programs and other programs and data required by the terminal device. The memory 801 may also be used to temporarily store data that has been output or is to be output.

It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.

in the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.

those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.

The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.

in addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.

The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

18页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:人脸画面改进方法、用户终端和计算机可读存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类