CN109729314B - Video processing method and device, electronic equipment and storage medium - Google Patents

Video processing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN109729314B
CN109729314B CN201811584294.1A CN201811584294A CN109729314B CN 109729314 B CN109729314 B CN 109729314B CN 201811584294 A CN201811584294 A CN 201811584294A CN 109729314 B CN109729314 B CN 109729314B
Authority
CN
China
Prior art keywords
monitoring channel
monitoring
channel
preset
heat value
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
CN201811584294.1A
Other languages
Chinese (zh)
Other versions
CN109729314A (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.)
Zhejiang Dahua Technology Co Ltd
Original Assignee
Zhejiang Dahua Technology 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 Zhejiang Dahua Technology Co Ltd filed Critical Zhejiang Dahua Technology Co Ltd
Priority to CN201811584294.1A priority Critical patent/CN109729314B/en
Publication of CN109729314A publication Critical patent/CN109729314A/en
Application granted granted Critical
Publication of CN109729314B publication Critical patent/CN109729314B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a video processing method, a video processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: when the current time point is a preset video pre-drawing time point, determining a preset first pre-drawing time length of each first monitoring channel, and performing pre-drawing processing on video code stream slices of the first monitoring channels within the first pre-drawing time length corresponding to the first monitoring channels aiming at each first monitoring channel; each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level. When the preset video prestretching time point is reached, the video code stream slice of the first monitoring channel is prestretched within the first prestretching time length corresponding to the first monitoring channel, the video code stream slice of the first monitoring channel is cached in the memory, when a user requests the video code stream of the first monitoring channel within the first prestretching time length, the cached video code stream can be directly played, and the picture achieves the effect of second opening.

Description

Video processing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of video processing technologies, and in particular, to a video processing method and apparatus, an electronic device, and a storage medium.
Background
As shown in fig. 1, a conventional video monitoring system needs to use real-time streaming media protocols such as RTSP/RTMP to perform live broadcasting and video-on-demand, and a specific playing client or decoding control is required to play the RTSP/RTMP code stream, so that there is a great limitation in use.
With the requirement of traditional video monitoring internet, HLS (http Live streaming) protocol should be applied, which is a http protocol-based streaming media network transmission protocol proposed by apple inc, and because it has the advantages of simplicity, self-adaptation, and the like, it can implement plug-in-free playing, and is one of the most widely used network transmission protocols in the world at present, and is particularly suitable for the field of mobile internet streaming media. The HLS protocol capable of realizing plug-in free play is undoubtedly the best choice for live broadcast and on-demand broadcast on the web or mobile terminal of the video monitoring system, and the video monitoring system adopting the HLS protocol is shown in fig. 2.
However, due to the implementation mechanism of the HLS protocol, the real-time code stream needs to be cut into slices, which also brings higher delay and first screen time, and if the number of slice buffers is set to 3, and the duration of each slice is set to 2 seconds, the first screen time of each live broadcast channel needs at least 6 seconds.
In order to improve user experience and reduce the first screen time of a live channel of a video monitoring system performing real-time preview based on an HLS protocol, the prior technical scheme mainly comprises the steps of reducing the cutting time of each slice and reducing the cache number of the slices. By reducing the cutting time of each slice and reducing the number of slices cached, the scheme is limited by the size of the code stream GOP (GOP means the period of a key frame, that is, the interval between two I frames), the cutting time of each slice is at least equal to 1 GOP time, and in order to resist network jitter, the number of ts file slices cached in practical use is at least not less than 2, so that the minimum waiting time for a user to open a certain path for live broadcasting for the first time is also greater than 2 GOP times, if a GOP is equal to 2 seconds, at least 4 seconds of first screen time exist, and thus the scheme still has long first screen time.
Disclosure of Invention
The embodiment of the invention provides a video processing method and device, electronic equipment and a storage medium, which are used for solving the problem that the video playing time of the first screen is long in the prior art.
The embodiment of the invention provides a video processing method, which comprises the following steps:
judging whether the current time point is a preset video pre-streaming time point or not;
if yes, determining a preset first prestretching time length of each first monitoring channel, performing prestretching processing on the video code stream slice of the first monitoring channel in the first prestretching time length corresponding to the first monitoring channel aiming at each first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory; and each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level.
Further, the determining the preset first pre-pumping duration of each first supervisory channel includes:
determining the monitoring level of each second monitoring channel installed in the scene according to the importance of the monitored position of the second monitoring channel; the higher the importance of the monitored position is, the higher the monitoring level of the second monitoring channel is;
selecting a preset number of second monitoring channels with monitoring levels from high to low as a preset first monitoring channel; and determining the preset first pre-tensioning flow duration of each first monitoring channel.
Further, the method further comprises:
for each first monitoring channel, if the video code stream of the first monitoring channel is requested to be played, when the video code stream of the first monitoring channel is identified to stop requesting to be played, determining a second prestretching stream duration corresponding to the first monitoring channel;
and aiming at each first monitoring channel, performing pre-drawing processing on the video code stream slice of the first monitoring channel within a second pre-drawing time length corresponding to the first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory.
Further, the determining a second prestretching current duration corresponding to the first monitoring channel includes:
determining the heat value of the first monitoring channel according to the number of times of the first monitoring channel requested to be played within a preset time length;
and for each first monitoring channel, taking the product of the heat value of the first monitoring channel and preset keep-alive basic time as second pre-pull flow time corresponding to the first monitoring channel.
Further, the determining the heat value of the first monitoring channel according to the number of times the first monitoring channel is requested to be played within the preset time length includes:
taking the ratio of the first number of times of the first monitoring channel requested to be played within a preset hour to the preset hour as a first heat value, and taking the first heat value as the heat value of the first monitoring channel; or
Taking the ratio of the second number of times of the first monitoring channel requested to be played in a preset number of days to the preset number of days as a second heat value, and taking the second heat value as the heat value of the first monitoring channel; or
Taking the ratio of the third number of times of requested playing in the using time of the first monitoring channel to the number of using days of the first monitoring channel as a third heat value, and taking the third heat value as the heat value of the first monitoring channel; or
And taking the sum of the first heat value, the second heat value and the third heat value as the heat value of the first monitoring channel.
Further, after determining the first prestretching time length of each first monitoring channel and before prestretching the video code stream slice, the method further includes:
and for each first monitoring channel, determining the weight duration of the first monitoring channel according to the monitoring level of the first monitoring channel, and updating the first pre-drawing duration of the first monitoring channel according to the weight duration of the first monitoring channel, wherein the higher the monitoring level is, the larger the weight duration is.
Further, after determining the second pre-drawing duration of each first monitoring channel and before performing pre-drawing processing on the video code stream slices, the method further includes:
and for each first monitoring channel, determining the weight duration of the first monitoring channel according to the monitoring level of the first monitoring channel, and updating the second pre-drawing duration of the first monitoring channel according to the weight duration of the first monitoring channel, wherein the higher the monitoring level is, the larger the weight duration is.
In another aspect, an embodiment of the present invention provides a video processing apparatus, where the apparatus includes:
the judging module is used for judging whether the current time point is a preset video pre-streaming time point or not;
the first processing module is configured to determine a preset first prestretching stream duration of each first monitoring channel if the determination result of the determination module is yes, perform prestretching processing on the video code stream slice of the first monitoring channel within the first prestretching stream duration corresponding to the first monitoring channel for each first monitoring channel, and cache the video code stream slice of the first monitoring channel in a memory; and each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level.
Further, the apparatus further comprises:
the determining module is used for determining the monitoring level of each second monitoring channel installed in the scene according to the importance of the monitored position of the second monitoring channel; the higher the importance of the monitored position is, the higher the monitoring level of the second monitoring channel is; selecting a preset number of second monitoring channels with monitoring levels from high to low as a preset first monitoring channel; and determining the preset first pre-tensioning flow duration of each first monitoring channel.
Further, the apparatus further comprises:
a second processing module, configured to determine, for each first monitoring channel, a second prestretching stream duration corresponding to the first monitoring channel when it is identified that the video code stream of the first monitoring channel stops requesting to play if the video code stream of the first monitoring channel is requested to be played; and aiming at each first monitoring channel, performing pre-drawing processing on the video code stream slice of the first monitoring channel within a second pre-drawing time length corresponding to the first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory.
Further, the second processing module is specifically configured to determine a heat value of the first monitoring channel according to the number of times that the first monitoring channel is requested to be played within a preset time length; and for each first monitoring channel, taking the product of the heat value of the first monitoring channel and preset keep-alive basic time as second pre-pull flow time corresponding to the first monitoring channel.
Further, the second processing module is specifically configured to use a ratio of a first number of times that the first monitoring channel is requested to be played within a preset hour to the preset hour as a first heat value, and use the first heat value as the heat value of the first monitoring channel; or taking the ratio of the second number of times that the first monitoring channel is requested to be played within a preset number of days to the preset number of days as a second heat value, and taking the second heat value as the heat value of the first monitoring channel; or taking the ratio of the third number of times of requested playing in the using time of the first monitoring channel to the number of using days of the first monitoring channel as a third heat value, and taking the third heat value as the heat value of the first monitoring channel; or taking the sum of the first heat value, the second heat value and the third heat value as the heat value of the first monitoring channel.
Further, the apparatus further comprises:
and the updating module is used for determining the weight duration of each first monitoring channel according to the monitoring grade of the first monitoring channel, and updating the first prestretching flow duration of the first monitoring channel according to the weight duration of the first monitoring channel, wherein the higher the monitoring grade is, the greater the weight duration is.
Further, the updating module is further configured to determine, for each first monitoring channel, a weight duration of the first monitoring channel according to the monitoring level of the first monitoring channel, and update the second prestretching duration of the first monitoring channel according to the weight duration of the first monitoring channel, where the higher the monitoring level is, the larger the weight duration is.
The invention provides electronic equipment which comprises a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for finishing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps as claimed in any one of the above when executing a program stored in the memory.
The invention provides a computer-readable storage medium having stored therein a computer program which, when executed by a processor, performs the method steps of any of the above.
The embodiment of the invention provides a video processing method, a video processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: judging whether the current time point is a preset video pre-streaming time point or not; if yes, determining a first prestretching time length of each preset first monitoring channel, and carrying out prestretching processing on the video code stream slice of each first monitoring channel in the first prestretching time length corresponding to the first monitoring channel aiming at each first monitoring channel; and each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level.
In the embodiment of the invention, when the preset video pre-drawing time point is reached, for each first monitoring channel with higher monitoring level, the pre-drawing processing is performed on the video code stream slice of the first monitoring channel within the first pre-drawing time duration corresponding to the first monitoring channel, and the video code stream slice of the first monitoring channel is cached in the memory, so that when a user requests the video code stream of the first monitoring channel within the first pre-drawing time duration, the cached video code stream in the memory can be directly played, the request can be quickly responded, and the picture can achieve the effect of opening in seconds.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a schematic diagram of a video monitoring system using RTSP/RTMP protocol in the prior art;
FIG. 2 is a schematic diagram of a video surveillance system using an HLS protocol in the prior art;
FIG. 3 is a schematic diagram of a video processing process according to an embodiment of the present invention;
FIG. 4 is a flow chart illustrating a pre-throttling process of a first supervisory channel according to an embodiment of the present invention;
fig. 5 is a schematic pre-streaming flow diagram of the first monitoring channel after the play request is disconnected according to the embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention;
fig. 7 is a schematic diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the attached drawings, and it should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Fig. 3 is a schematic diagram of a video processing process according to an embodiment of the present invention, where the process includes the following steps:
s101: and judging whether the current time point is a preset video pre-streaming time point or not, and if so, performing S102.
S102: determining a preset first prestretching time length of each first monitoring channel, performing prestretching processing on a video code stream slice of the first monitoring channel in the first prestretching time length corresponding to the first monitoring channel aiming at each first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory; and each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level.
The video processing method provided by the embodiment of the invention is applied to electronic equipment, and the electronic equipment can be equipment such as a PC (personal computer), a tablet computer and the like.
The electronic equipment stores a preset video pre-streaming time point, and the preset video pre-streaming time point is set by a user according to needs and is used for representing a monitoring time point concerned by the user. For example, in a traffic monitoring scene, the preset video pre-streaming time points are 8 am and 6 pm of each day, that is, the time points of the commute peak. A timer may be set in the electronic device to determine whether the current time point is a preset video pre-streaming time point.
Each preset first monitoring channel is stored in the electronic equipment, and each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level. For example, a company video monitoring system is a monitoring channel positioned at the front door of a company, a monitoring channel of a company key department and the like are divided into monitoring channels with higher grades; for example, a video monitoring system of a traffic department can divide a monitoring channel of a crossroad with large flow, a monitoring channel of an accident-prone place, a monitoring channel around an area where a government organization and the like are located, and the like into monitoring channels with higher levels.
A preset first pre-draw duration, e.g. 20 minutes, 25 minutes, etc., may be saved in the electronic device. In addition, a preset keep-alive basic time duration may also be stored in the electronic device, and when the current time point is a preset video pre-pull time point, the electronic device determines a preset first pre-pull time duration of each first monitoring channel according to the preset keep-alive basic time duration, for example, the preset keep-alive basic time duration may be directly used as the preset first pre-pull time duration of each first monitoring channel, and for each first monitoring channel, a video code stream slice of the first monitoring channel is pre-pulled within the first pre-pull time duration corresponding to the first monitoring channel, that is, the video code stream slice of the first monitoring channel is cached in the memory. Wherein, the preset keep-alive basic time length can be 20 minutes, 30 minutes and the like. The video stream slice in the embodiment of the present invention may be a ts slice or an hls slice, and the type of the video stream slice is not limited.
In the embodiment of the invention, when the preset video pre-drawing time point is reached, for each first monitoring channel with higher monitoring level, the pre-drawing processing is performed on the video code stream slice of the first monitoring channel within the first pre-drawing time duration corresponding to the first monitoring channel, and the video code stream slice of the first monitoring channel is cached in the memory, so that when a user requests the video code stream of the first monitoring channel within the first pre-drawing time duration, the cached video code stream in the memory can be directly played, the request can be quickly responded, and the picture can achieve the effect of opening in seconds.
On the basis of the foregoing embodiment, in an embodiment of the present invention, the determining a preset first prestretching time duration of each first supervisory channel includes:
determining the monitoring level of each second monitoring channel installed in the scene according to the importance of the monitored position of the second monitoring channel; the higher the importance of the monitored position is, the higher the monitoring level of the second monitoring channel is;
selecting a preset number of second monitoring channels with monitoring levels from high to low as a preset first monitoring channel; and determining the preset first pre-tensioning flow duration of each first monitoring channel.
In the embodiment of the invention, the monitoring channel installed in the scene is used as the second monitoring channel, and the monitoring channel with higher monitoring level in the second monitoring channel is used as the first monitoring channel.
When each preset first monitoring channel is determined, for each second monitoring channel installed in a scene, the monitoring level of the second monitoring channel is determined according to the importance of the monitored position of the second monitoring channel, and the higher the importance of the monitored position is, the higher the monitoring level of the second monitoring channel is.
For example, a company video monitoring system has the highest importance of a monitoring channel located in a main department of the company, the monitoring channel of the main department of the company can be used as a primary monitoring channel, the importance of a monitoring channel at the front of the company is the second order, the monitoring channel at the front of the company can be used as a secondary monitoring channel, and the monitoring level of each monitoring channel of the company video monitoring system is determined in sequence; for example, the traffic department video monitoring system can make the monitoring channel of the accident-prone place have the highest importance, the monitoring channel of the accident-prone place can be used as a first-level monitoring channel, the monitoring channels around the area where the government organization and the like are located have the second importance, the monitoring channels around the area where the government organization and the like are located can be used as a second-level monitoring channel, the monitoring channels of the crossroad with large flow rate have the second importance, and the monitoring channels of the crossroad with large flow rate can be used as third-level monitoring channels.
After determining the monitoring level of each second monitoring channel, the electronic device may sort each second monitoring channel according to the level of the monitoring level, where it is to be noted that the monitoring level is highest by one level. And then selecting a preset number of second monitoring channels as preset first monitoring channels according to the sequence of the monitoring levels from high to low. The preset number may be 3, 4, etc. And further determining a preset first pre-tensioning flow time length of each first monitoring channel. In terms of probability, the probability that the monitoring channel with higher monitoring level is played is higher, pre-tensioning stream processing is carried out on certain high-level monitoring channels, and the integral first screen time of the system live channel can be reduced with higher probability. And moreover, pre-stream-pulling processing is carried out on certain high-level monitoring channels, and the problem of system overhead caused by pre-stream-pulling processing on all the monitoring channels is avoided.
Fig. 4 is a schematic flow chart of a pre-throttling flow of a first monitoring channel according to an embodiment of the present invention, and as shown in fig. 4, a user first adds a second monitoring channel to a video monitoring platform and divides a monitoring level of each second monitoring channel. Judging whether the pre-tensioned video stream belongs to a first monitoring channel of the pre-tensioned stream according to the monitoring level, if so, judging whether a preset video pre-tensioned stream time point is reached, if not, continuing to wait, if so, performing pre-tensioned stream processing on a video stream slice of the first monitoring channel according to the first pre-tensioned stream time length, then judging whether the first pre-tensioned stream time length is reached, if not, continuing to perform pre-tensioned stream processing on the video stream slice of the first monitoring channel, and if so, finishing pre-tensioned stream.
When a user requests to play the video code stream of the first monitoring channel, after the user stops requesting to play the video code stream of the first monitoring channel, the user may request to play the video code stream of the first monitoring channel again because of the content of the played video code stream. On the basis of the foregoing embodiments, in an embodiment of the present invention, the method further includes:
for each first monitoring channel, if the video code stream of the first monitoring channel is requested to be played, when the video code stream of the first monitoring channel is identified to stop requesting to be played, determining a second prestretching stream duration corresponding to the first monitoring channel;
and aiming at each first monitoring channel, performing pre-drawing processing on the video code stream slice of the first monitoring channel within a second pre-drawing time length corresponding to the first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory.
In this embodiment of the present invention, for each first monitoring channel, the determined second pre-pull stream duration corresponding to the first monitoring channel may be a preset duration, or may be the same as the first pre-pull stream duration corresponding to the first monitoring channel.
In order to make the determination of the second pre-pull stream duration more accurate, in an embodiment of the present invention, the determining the second pre-pull stream duration corresponding to the first supervisory channel includes:
determining the heat value of the first monitoring channel according to the number of times of the first monitoring channel requested to be played within a preset time length;
and for each first monitoring channel, taking the product of the heat value of the first monitoring channel and preset keep-alive basic time as second pre-pull flow time corresponding to the first monitoring channel.
For each first monitoring channel, the video code stream of the first monitoring channel may be requested to be played by multiple users, and when the video code stream of the first monitoring channel stops requesting to be played, that is, the last user request is disconnected, the electronic device may determine the heat value of the first monitoring channel according to the number of times the first monitoring channel is requested to be played within a preset time length. Specifically, the electronic device may store a corresponding relationship between the number of times the first monitoring channel is requested to be played and the heat value of the first monitoring channel within a preset time length, wherein the greater the number of times the first monitoring channel is requested to be played within the preset time length, the higher the heat value of the first monitoring channel is.
And for each first monitoring channel, after the heat value of the first monitoring channel is determined, taking the product of the heat value of the first monitoring channel and the preset keep-alive basic time length as the second pre-tensioned flow time length corresponding to the first monitoring channel. And continuously updating the slice within a second prestretching time length corresponding to the first monitoring channel by taking the time point of identifying that the video code stream of the first monitoring channel stops requesting playing as a reference, prestretching the video code stream slice of the first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory, so that when a user requests the video code stream of the first monitoring channel within the first prestretching time length, the cached video code stream in the memory can be directly played, the request can be quickly responded, and the picture achieves the effect of opening in seconds.
In order to accurately determine the heat value of the first monitoring channel, on the basis of the foregoing embodiments, in an embodiment of the present invention, the determining the heat value of the first monitoring channel according to the number of times that the first monitoring channel is requested to be played within the preset time length includes:
taking the ratio of the first number of times of the first monitoring channel requested to be played within a preset hour to the preset hour as a first heat value, and taking the first heat value as the heat value of the first monitoring channel; or
Taking the ratio of the second number of times of the first monitoring channel requested to be played in a preset number of days to the preset number of days as a second heat value, and taking the second heat value as the heat value of the first monitoring channel; or
Taking the ratio of the third number of times of requested playing in the using time of the first monitoring channel to the number of using days of the first monitoring channel as a third heat value, and taking the third heat value as the heat value of the first monitoring channel; or
And taking the sum of the first heat value, the second heat value and the third heat value as the heat value of the first monitoring channel.
The electronic device may count a first number of times that the first monitoring channel is requested to be played within a preset hour, where the preset hour may be 3 hours, 5 hours, and the like, and after counting the first number of times that the first monitoring channel is requested to be played within the preset hour, a ratio of the first number of times to the preset hour is calculated, where the ratio is a first heat value, and the electronic device may directly use the first heat value as the heat value of the first monitoring channel.
Or, the electronic device may count the second number of times that the first monitoring channel is requested to be played within a preset number of days, where the preset number of days may be 2 days, 3 days, and the like, and after counting the second number of times that the first monitoring channel is requested to be played within the preset number of days, calculate a ratio between the second number of times and the preset number of days, where the ratio is a second heat value, and the electronic device may directly use the second heat value as the heat value of the first monitoring channel.
Still alternatively, the electronic device may count a third number of times that the playing is requested from the date of use of the first monitoring channel to the present, for example, 50 days from the date of use of the first monitoring channel to the present, after counting the third number of times that the playing is requested from the date of use of the first monitoring channel to the present, calculate a ratio of the third number of times to the number of days of use of the first monitoring channel, that is, a ratio to 50 days, where the ratio is a third heat value, and the electronic device may directly use the third heat value as the heat value of the first monitoring channel.
Preferably, the electronic device may determine the first heat value, the second heat value and the third heat value according to the above method, and then use the sum of the first heat value, the second heat value and the third heat value as the heat value of the first monitoring channel.
Fig. 5 is a schematic diagram of a prestretching flow of a first monitoring channel after a play request is disconnected according to an embodiment of the present invention, as shown in fig. 5, an electronic device first identifies that a user requests a video code stream of a certain first monitoring channel on a video monitoring platform, calculates a heat value and a second prestretching duration of the first monitoring channel when a last user disconnection request is identified, and then continues prestretching a video code stream slice of the first monitoring channel within the second prestretching duration, during which, when the user requests the video code stream of the first monitoring channel, a second opening of a picture can be realized. And then judging whether the second prestretching time length is reached, if not, continuing prestretching the video code stream slice of the first monitoring channel, and if so, finishing prestretching the stream.
In order to make the determination of the pre-pull stream duration more accurate, on the basis of the foregoing embodiments, in an embodiment of the present invention, after determining the first pre-pull stream duration of each first monitoring channel, before performing pre-pull stream processing on a video stream slice, the method further includes:
and for each first monitoring channel, determining the weight duration of the first monitoring channel according to the monitoring grade of the first monitoring channel, and updating the prestretching duration of the first monitoring channel according to the weight duration of the first monitoring channel, wherein the higher the monitoring grade is, the greater the weight duration is.
After the second prestretching stream duration of each first monitoring channel is determined, before prestretching stream processing is performed on the video stream slices, the method further comprises the following steps:
and for each first monitoring channel, determining the weight duration of the first monitoring channel according to the monitoring level of the first monitoring channel, and updating the second pre-drawing duration of the first monitoring channel according to the weight duration of the first monitoring channel, wherein the higher the monitoring level is, the larger the weight duration is.
The electronic device may store a frequent correspondence table between the monitoring level of the first monitoring channel and the weight, wherein the higher the monitoring level is, the longer the weight duration is. The corresponding relation table is as follows:
monitoring grade Class 1 Class 2 Class 3 …… Grade n
Weight duration Weight 1 Weight 2 Weight 3 …… Weight n
And the electronic equipment can determine the weight duration of the first monitoring channel according to the corresponding relation after determining the safety level of the first monitoring channel aiming at each first monitoring channel. And then updating the first prestretching flow time length or the second prestretching flow time length of the first monitoring channel according to the weight time length of the first monitoring channel.
Specifically, after the electronic device determines a preset first pre-pull duration of each first monitoring channel according to a preset keep-alive basic duration, for each first monitoring channel, a sum of the first pre-pull duration of the first monitoring channel and a corresponding weight duration is used as a first pre-pull duration updated by the first monitoring channel. And for each first monitoring channel, the electronic equipment takes the product of the heat value of the first monitoring channel and the preset keep-alive basic time length as a second pre-pulling time length corresponding to the first monitoring channel, and then takes the sum of the second pre-pulling time length of the first monitoring channel and the corresponding weight time length as a second pre-pulling time length updated by the first monitoring channel.
Fig. 6 is a schematic structural diagram of a video processing apparatus according to an embodiment of the present invention, where the apparatus includes:
the judging module 61 is configured to judge whether the current time point is a preset video pre-streaming time point;
a first processing module 62, configured to determine a preset first prestretching time duration of each first monitoring channel if the determination result of the determining module 61 is yes, perform prestretching processing on the video code stream slice of the first monitoring channel within the first prestretching time duration corresponding to the first monitoring channel for each first monitoring channel, and cache the video code stream slice of the first monitoring channel in a memory; and each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level.
The device further comprises:
a determining module 63, configured to determine, for each second monitoring channel installed in the scene, a monitoring level of the second monitoring channel according to importance of a monitored position of the second monitoring channel; the higher the importance of the monitored position is, the higher the monitoring level of the second monitoring channel is; selecting a preset number of second monitoring channels with monitoring levels from high to low as a preset first monitoring channel; and determining the preset first pre-tensioning flow duration of each first monitoring channel.
The device further comprises:
a second processing module 64, configured to determine, for each first monitoring channel, a second pre-pull stream duration corresponding to the first monitoring channel when it is identified that the video code stream of the first monitoring channel stops requesting to play if the video code stream of the first monitoring channel is requested to be played; and aiming at each first monitoring channel, performing pre-drawing processing on the video code stream slice of the first monitoring channel within a second pre-drawing time length corresponding to the first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory.
The second processing module 64 is specifically configured to determine a heat value of the first monitoring channel according to the number of times that the first monitoring channel is requested to be played within a preset time length; and for each first monitoring channel, taking the product of the heat value of the first monitoring channel and preset keep-alive basic time as second pre-pull flow time corresponding to the first monitoring channel.
The second processing module 64 is specifically configured to use a ratio of a first number of times that the first monitoring channel is requested to be played within a preset hour to the preset hour as a first heat value, and use the first heat value as the heat value of the first monitoring channel; or taking the ratio of the second number of times that the first monitoring channel is requested to be played within a preset number of days to the preset number of days as a second heat value, and taking the second heat value as the heat value of the first monitoring channel; or taking the ratio of the third number of times of requested playing in the using time of the first monitoring channel to the number of using days of the first monitoring channel as a third heat value, and taking the third heat value as the heat value of the first monitoring channel; or taking the sum of the first heat value, the second heat value and the third heat value as the heat value of the first monitoring channel.
The device further comprises:
an updating module 65, configured to determine, for each first monitoring channel, a weight duration of the first monitoring channel according to the monitoring level of the first monitoring channel, and update the first pre-pull duration of the first monitoring channel according to the weight duration of the first monitoring channel, where the higher the monitoring level is, the larger the weight duration is.
The updating module 65 is further configured to determine, for each first monitoring channel, a weight duration of the first monitoring channel according to the monitoring level of the first monitoring channel, and update the second prestretching duration of the first monitoring channel according to the weight duration of the first monitoring channel, where the higher the monitoring level is, the larger the weight duration is.
On the basis of the foregoing embodiments, an embodiment of the present invention further provides an electronic device, as shown in fig. 7, including: the system comprises a processor 301, a communication interface 302, a memory 303 and a communication bus 304, wherein the processor 301, the communication interface 302 and the memory 303 complete mutual communication through the communication bus 304;
the memory 303 has stored therein a computer program which, when executed by the processor 301, causes the processor 301 to perform the steps of:
judging whether the current time point is a preset video pre-streaming time point or not;
if yes, determining a preset first prestretching time length of each first monitoring channel, performing prestretching processing on the video code stream slice of the first monitoring channel in the first prestretching time length corresponding to the first monitoring channel aiming at each first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory; and each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level.
Based on the same inventive concept, the embodiment of the present invention further provides an electronic device, and as the principle of the electronic device for solving the problem is similar to the video processing method, the implementation of the electronic device may refer to the implementation of the method, and repeated details are not repeated.
The electronic device provided by the embodiment of the invention can be a desktop computer, a portable computer, a smart phone, a tablet computer, a Personal Digital Assistant (PDA), a network side device and the like.
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 302 is used for communication between the above-described electronic apparatus and other apparatuses.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like.
In the embodiment of the present invention, when the processor executes the program stored in the memory, it is implemented that when a preset video pre-pull time point is reached, for each first monitoring channel with a higher monitoring level, the video code stream slice of the first monitoring channel is pre-pulled within a first pre-pull duration corresponding to the first monitoring channel, and the video code stream slice of the first monitoring channel is cached in the memory, so that when a user requests the video code stream of the first monitoring channel within the first pre-pull duration, the cached video code stream in the memory can be directly played, so that the request can be quickly responded, and the picture can achieve the effect of opening in seconds.
On the basis of the foregoing embodiments, an embodiment of the present invention further provides a computer storage readable storage medium, in which a computer program executable by an electronic device is stored, and when the program is run on the electronic device, the electronic device is caused to execute the following steps:
judging whether the current time point is a preset video pre-streaming time point or not;
if yes, determining a preset first prestretching time length of each first monitoring channel, performing prestretching processing on the video code stream slice of the first monitoring channel in the first prestretching time length corresponding to the first monitoring channel aiming at each first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory; and each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level.
Based on the same inventive concept, embodiments of the present invention further provide a computer-readable storage medium, and since a principle of solving a problem when a processor executes a computer program stored in the computer-readable storage medium is similar to that of a video processing method, implementation of the computer program stored in the computer-readable storage medium by the processor may refer to implementation of the method, and repeated details are not repeated.
The computer readable storage medium may be any available medium or data storage device that can be accessed by a processor in an electronic device, including but not limited to magnetic memory such as floppy disks, hard disks, magnetic tape, magneto-optical disks (MOs), etc., optical memory such as CDs, DVDs, BDs, HVDs, etc., and semiconductor memory such as ROMs, EPROMs, EEPROMs, non-volatile memory (NAND FLASH), Solid State Disks (SSDs), etc.
In the computer-readable storage medium provided in the embodiment of the present invention, a computer program is stored, and when the computer program is executed by a processor, when a preset video pre-drawing time point is reached, for each first monitoring channel with a higher monitoring level, a video code stream slice of the first monitoring channel is pre-drawn within a first pre-drawing time duration corresponding to the first monitoring channel, and the video code stream slice of the first monitoring channel is cached in a memory, so that when a user requests the video code stream of the first monitoring channel within the first pre-drawing time duration, the cached video code stream in the memory can be directly played, a fast response can be obtained to the request, and a picture can achieve an effect of opening in seconds.
The embodiment of the invention provides a video processing method, a video processing device, electronic equipment and a storage medium, wherein the method comprises the following steps: judging whether the current time point is a preset video pre-streaming time point or not; if yes, determining a first prestretching time length of each preset first monitoring channel, and carrying out prestretching processing on the video code stream slice of each first monitoring channel in the first prestretching time length corresponding to the first monitoring channel aiming at each first monitoring channel; and each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring level.
In the embodiment of the invention, when the preset video pre-drawing time point is reached, for each first monitoring channel with higher monitoring level, the pre-drawing processing is performed on the video code stream slice of the first monitoring channel within the first pre-drawing time duration corresponding to the first monitoring channel, and the video code stream slice of the first monitoring channel is cached in the memory, so that when a user requests the video code stream of the first monitoring channel within the first pre-drawing time duration, the cached video code stream in the memory can be directly played, the request can be quickly responded, and the picture can achieve the effect of opening in seconds.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (8)

1. A method of video processing, the method comprising:
judging whether the current time point is a preset video pre-streaming time point or not;
if yes, determining a preset first prestretching time length of each first monitoring channel, performing prestretching processing on the video code stream slice of the first monitoring channel in the first prestretching time length corresponding to the first monitoring channel aiming at each first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory; each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring grade;
for each first monitoring channel, if the video code stream of the first monitoring channel is requested to be played, when the video code stream of the first monitoring channel is identified to stop requesting to be played, determining a second prestretching stream duration corresponding to the first monitoring channel;
for each first monitoring channel, performing prestretching processing on the video code stream slice of the first monitoring channel within a second prestretching duration corresponding to the first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory;
the determining the second prestretching flow duration corresponding to the first monitoring channel includes:
determining the heat value of the first monitoring channel according to the number of times of the first monitoring channel requested to be played within a preset time length;
and for each first monitoring channel, taking the product of the heat value of the first monitoring channel and preset keep-alive basic time as second pre-pull flow time corresponding to the first monitoring channel.
2. The method of claim 1, wherein the determining a preset first pre-pull flow duration for each first supervisory channel comprises:
determining the monitoring level of each second monitoring channel installed in the scene according to the importance of the monitored position of the second monitoring channel; the higher the importance of the monitored position is, the higher the monitoring level of the second monitoring channel is;
selecting a preset number of second monitoring channels with monitoring levels from high to low as a preset first monitoring channel; and determining the preset first pre-tensioning flow duration of each first monitoring channel.
3. The method as claimed in claim 1, wherein the determining the heat value of the first supervisory channel according to the number of times the first supervisory channel is requested to be played within the predetermined time period comprises:
taking the ratio of the first number of times of the first monitoring channel requested to be played within a preset hour to the preset hour as a first heat value, and taking the first heat value as the heat value of the first monitoring channel; or
Taking the ratio of the second number of times of the first monitoring channel requested to be played in a preset number of days to the preset number of days as a second heat value, and taking the second heat value as the heat value of the first monitoring channel; or
Taking the ratio of the third number of times of requested playing in the using time of the first monitoring channel to the number of using days of the first monitoring channel as a third heat value, and taking the third heat value as the heat value of the first monitoring channel; or
And taking the sum of the first heat value, the second heat value and the third heat value as the heat value of the first monitoring channel.
4. The method of claim 1, wherein after determining the first pre-drawing duration of each first supervisory channel and before performing pre-drawing processing on the video bitstream slices, the method further comprises:
and for each first monitoring channel, determining the weight duration of the first monitoring channel according to the monitoring level of the first monitoring channel, and updating the first pre-drawing duration of the first monitoring channel according to the weight duration of the first monitoring channel, wherein the higher the monitoring level is, the larger the weight duration is.
5. The method of claim 1, wherein after determining the second pre-drawing duration of each first supervisory channel and before performing pre-drawing processing on the video bitstream slices, the method further comprises:
and for each first monitoring channel, determining the weight duration of the first monitoring channel according to the monitoring level of the first monitoring channel, and updating the second pre-drawing duration of the first monitoring channel according to the weight duration of the first monitoring channel, wherein the higher the monitoring level is, the larger the weight duration is.
6. A video processing apparatus, characterized in that the apparatus comprises:
the judging module is used for judging whether the current time point is a preset video pre-streaming time point or not;
the first processing module is configured to determine a preset first prestretching stream duration of each first monitoring channel if the determination result of the determination module is yes, perform prestretching processing on the video code stream slice of the first monitoring channel within the first prestretching stream duration corresponding to the first monitoring channel for each first monitoring channel, and cache the video code stream slice of the first monitoring channel in a memory; each preset first monitoring channel is a monitoring channel which is divided in advance and has a higher monitoring grade;
a second processing module, configured to determine, for each first monitoring channel, a second prestretching stream duration corresponding to the first monitoring channel when it is identified that the video code stream of the first monitoring channel stops requesting to play if the video code stream of the first monitoring channel is requested to be played; for each first monitoring channel, performing prestretching processing on the video code stream slice of the first monitoring channel within a second prestretching duration corresponding to the first monitoring channel, and caching the video code stream slice of the first monitoring channel in a memory;
the second processing module is specifically configured to determine a heat value of the first monitoring channel according to the number of times that the first monitoring channel is requested to be played within a preset time length; and for each first monitoring channel, taking the product of the heat value of the first monitoring channel and preset keep-alive basic time as second pre-pull flow time corresponding to the first monitoring channel.
7. An electronic device 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 realizing 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 5 when executing a program stored in the memory.
8. 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-5.
CN201811584294.1A 2018-12-24 2018-12-24 Video processing method and device, electronic equipment and storage medium Active CN109729314B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811584294.1A CN109729314B (en) 2018-12-24 2018-12-24 Video processing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811584294.1A CN109729314B (en) 2018-12-24 2018-12-24 Video processing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109729314A CN109729314A (en) 2019-05-07
CN109729314B true CN109729314B (en) 2021-02-02

Family

ID=66297065

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811584294.1A Active CN109729314B (en) 2018-12-24 2018-12-24 Video processing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109729314B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111666516A (en) * 2020-04-24 2020-09-15 北京奇艺世纪科技有限公司 Page loading method and device, electronic equipment and storage medium
CN113382278B (en) * 2021-06-11 2022-09-09 天翼云科技有限公司 Video pushing method and device, electronic equipment and readable storage medium
CN114363303B (en) * 2021-12-31 2023-06-02 上海网达软件股份有限公司 Streaming media transcoding method for realizing rapid playing of surveillance video

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017026991A1 (en) * 2015-08-07 2017-02-16 Hitachi, Ltd. Dynamic caching and predictive maintenance for video streaming
CN106227883B (en) * 2016-08-05 2019-09-13 北京数码视讯科技股份有限公司 A kind of the temperature analysis method and device of multimedia content
CN106331642B (en) * 2016-08-31 2020-05-26 浙江大华技术股份有限公司 Data processing method and device in video cloud system
CN106412505A (en) * 2016-09-29 2017-02-15 浙江大华技术股份有限公司 Video display method and apparatus in P2P mode
CN108259839A (en) * 2018-03-16 2018-07-06 深圳市乐唯科技开发有限公司 A kind of equipment real time remote manipulation and video frequency showing system and method

Also Published As

Publication number Publication date
CN109729314A (en) 2019-05-07

Similar Documents

Publication Publication Date Title
CN109729314B (en) Video processing method and device, electronic equipment and storage medium
US10972561B2 (en) Methods and apparatus for adjusting model threshold levels
US9979862B1 (en) Buffering method for video playing, storage medium and device
US10924577B2 (en) Fractional pre-delivery of content to user devices for uninterrupted playback
CN109190070B (en) Data processing method, device and system and application server
CN109685144B (en) Method and device for evaluating video model and electronic equipment
CN110809167B (en) Video playing method and device, electronic equipment and storage medium
US20150350369A1 (en) Method For Reducing Pre-Fetching Of Multimedia Streaming Data With Minimal Impact On Playback User Experience
US20210120292A1 (en) Video playback quality detection method and apparatus
CN107690093B (en) Video playing method and device
US10200433B2 (en) Client device, a method for receiving a streaming media data and a streaming media data transmission system
CN108259998B (en) Player, play control method and device, electronic equipment and play system
CN105245562A (en) Method for operating a cache arranged along a transmission path between client terminals and at least one server, and corresponding cache
CN109783337B (en) Model service method, system, apparatus and computer readable storage medium
CN106303563B (en) Streaming media online playing method and device, execution terminal and storage medium
CN114786055A (en) Preloading method, preloading device, electronic equipment and medium
CN107786371B (en) Data acceleration method and device and storage medium
CN109816350B (en) Processing method, device, equipment and storage medium of live broadcast report information
CN105516746A (en) Video pre-downloading system and method
US10250938B1 (en) Pre-fetching supplemental content for a media stream
US11848841B2 (en) Metrics collecting method and apparatus for media streaming service, medium, and electronic device
CN111355970A (en) Live broadcast management method and device and electronic equipment
CN112702227B (en) Heartbeat event detection method, device, equipment and computer readable storage medium
CN111741335B (en) Data processing method and device, mobile terminal and computer readable storage medium
CN114710692B (en) Multimedia file processing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant