CN111510703B - Video playing method, device and system - Google Patents

Video playing method, device and system Download PDF

Info

Publication number
CN111510703B
CN111510703B CN201910095798.5A CN201910095798A CN111510703B CN 111510703 B CN111510703 B CN 111510703B CN 201910095798 A CN201910095798 A CN 201910095798A CN 111510703 B CN111510703 B CN 111510703B
Authority
CN
China
Prior art keywords
image quality
sending end
target video
video
ratio
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
CN201910095798.5A
Other languages
Chinese (zh)
Other versions
CN111510703A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201910095798.5A priority Critical patent/CN111510703B/en
Publication of CN111510703A publication Critical patent/CN111510703A/en
Application granted granted Critical
Publication of CN111510703B publication Critical patent/CN111510703B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/004Diagnosis, testing or measuring for television systems or their details for digital television systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/60Network structure or processes for video distribution between server and client or between remote clients; Control signalling between clients, server and network components; Transmission of management data between server and client, e.g. sending from server to client commands for recording incoming content stream; Communication details between server and client 
    • H04N21/63Control signaling related to video distribution between client, server and network components; Network processes for video distribution between server and clients or between remote clients, e.g. transmitting basic layer and enhancement layers over different transmission paths, setting up a peer-to-peer communication via Internet between remote STB's; Communication protocols; Addressing
    • H04N21/647Control signaling between network components and server or clients; Network processes for video distribution between server and clients, e.g. controlling the quality of the video stream, by dropping packets, protecting content from unauthorised alteration within the network, monitoring of network load, bridging between two different networks, e.g. between IP and wireless
    • H04N21/64784Data processing by the network
    • H04N21/64792Controlling the complexity of the content stream, e.g. by dropping packets

Abstract

The application provides a video playing method, a video playing device and a video playing system, which belong to the technical field of computers, wherein the method is applied to a receiving end of a target video, and comprises the following steps: receiving video data of a target video sent by a sending end; in the process of playing the target video, judging whether the equipment meets the real-time playing condition or not according to a preset evaluation rule; and if the real-time playing condition is not met, sending an image quality reduction message to the sending end, wherein the image quality reduction message is used for informing the sending end to reduce the image quality of the obtained target video. By the method and the device, the real-time performance of video playing in video monitoring can be improved.

Description

Video playing method, device and system
Technical Field
The present application relates to the field of computer technologies, and in particular, to a video playing method, device and system.
Background
In video monitoring, a video sending end can package a shot video into a data packet, and send the data packet to a receiving end through a network, so that the receiving end analyzes the received data packet to obtain a video, and the video is played to a user in real time. The sending end can be a camera, and the receiving end can be a mobile phone.
The real-time performance of video playing is an important evaluation index for video monitoring, the sending end can reduce the amount of storage resources occupied by video data by reducing the image quality of the collected video, further reduce the packet loss rate of video data transmission, and reduce the system resources occupied by the receiving end when the receiving end analyzes the data packet, so that the real-time performance of video playing can be ensured. In the prior art, a process of adjusting image quality of a video by a sending end includes: the sending end determines the storage resource amount occupied by a data packet to be sent in a preset sending end cache region, calculates the ratio of the storage resource amount to the total storage resource amount of the sending end, then compares the ratio with a preset ratio threshold value, and if the ratio is smaller than a preset first ratio threshold value, the sending end increases the image quality of the acquired video; and if the ratio is larger than a preset second ratio threshold, the sending end reduces the image quality of the acquired video.
However, when the processing performance of the receiving end (for example, the system resources allocated for parsing the data packet) is insufficient, even if the sending end can send the data packet to the receiving end in time through the transmission network, the receiving end still cannot play the video in real time, and the real-time performance of video playing in video monitoring is poor.
Disclosure of Invention
An object of the embodiments of the present application is to provide a method, an apparatus, and a system for playing a video, so as to improve the real-time performance of video playing in video monitoring. The specific technical scheme is as follows:
in a first aspect, a video playing method is provided, where the method is applied to a receiving end of a target video, and the method includes:
receiving video data of a target video sent by a sending end;
in the process of playing the target video, judging whether the equipment meets the real-time playing condition or not according to a preset evaluation rule;
and if the real-time playing condition is not met, sending an image quality reduction message to the sending end, wherein the image quality reduction message is used for informing the sending end to reduce the image quality of the obtained target video.
Optionally, the determining, according to a preset evaluation rule, whether the device meets the real-time playing condition includes:
acquiring a plurality of first storage resource amounts occupied by data to be played of the target video according to a preset acquisition period;
judging whether the resource storage state of the equipment is an overload state or not according to the plurality of first storage resource quantities;
if the resource storage state of the equipment is an overload state, judging that the equipment does not meet the real-time playing condition;
and if the resource storage state of the equipment is not the overload state, judging that the equipment meets the real-time playing condition.
Optionally, the determining, according to the plurality of first storage resource amounts, whether the resource storage state of the device is an overload state includes:
respectively calculating a first ratio of each first storage resource quantity to a total pre-stored storage resource quantity;
comparing a first ratio corresponding to each first storage resource quantity with a pre-stored first ratio threshold, and determining the target number of the first ratio which is greater than the first ratio threshold;
if the target number is larger than a preset number threshold, judging that the resource storage state of the equipment is an overload state;
and if the target number is not greater than the preset number threshold, judging that the resource storage state of the equipment is not an overload state.
Optionally, the determining, according to the plurality of first storage resource amounts, whether the resource storage state of the device is an overload state includes:
calculating the average value of the plurality of first storage resource quantities to obtain the average storage resource quantity;
determining a second ratio of the average storage resource amount to a pre-stored total storage resource amount, and comparing the second ratio with a pre-stored second ratio threshold;
if the second ratio is larger than the second ratio threshold, judging that the resource storage state of the equipment is an overload state;
and if the second ratio is not greater than the second ratio threshold, judging that the resource storage state of the equipment is not an overload state.
Optionally, the method further includes:
and if the real-time playing condition is met, sending an image quality improving message to the sending end, wherein the image quality improving message is used for informing the sending end to improve the image quality of the obtained target video.
In a second aspect, a video playing method is provided, where the method is applied to a sending end of a target video, and the method includes:
acquiring a target video to be played, and sending video data of the target video to a preset receiving end;
when receiving an image quality reduction message sent by the receiving end, reducing the image quality parameter value of the sending end according to a preset adjustment rule of the image quality parameter;
and acquiring the target video according to the reduced image quality parameter value.
Optionally, the reducing, according to the preset adjustment rule of the image quality parameter, the image quality parameter value of the sending end includes:
determining a current image quality parameter value of the sending end;
determining a current image quality grade corresponding to the current image quality parameter value according to a pre-stored corresponding relation between the image quality parameter value and the image quality grade;
and determining a target image quality grade lower than the current image quality grade and a target image quality parameter value corresponding to the target image quality grade in the corresponding relation between the image quality parameter value and the image quality grade.
Optionally, the method further includes:
reading a third storage resource amount occupied by data to be sent in the sending end;
calculating a second ratio according to the third storage resource amount and the total pre-stored storage resource amount of the sending end;
and if the second ratio is larger than a preset second threshold, reducing the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to reduce the image quality of the obtained target video.
Optionally, the method further includes:
when receiving the image quality improvement message, executing the step of reading the third storage resource amount occupied by the data to be sent in the sending end;
and if the second ratio is smaller than the second threshold, improving the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to improve the image quality of the obtained target video.
Optionally, the method further includes:
calculating the packet loss rate of the video data sent by the sending end;
and if the packet loss rate is greater than a preset packet loss rate threshold, reducing the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to reduce the image quality of the obtained target video.
Optionally, the method further includes:
when receiving the image quality improvement message, executing the step of calculating the packet loss rate of the video data sent by the sending end;
and if the packet loss rate is smaller than the packet loss rate threshold, improving the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to improve the image quality of the obtained target video.
In a third aspect, a video playing apparatus is provided, where the apparatus is applied to a receiving end of a target video, and the apparatus includes:
the receiving module is used for receiving video data of a target video sent by a sending end;
the judging module is used for judging whether the equipment meets the real-time playing condition or not through a preset evaluation rule in the process of playing the target video;
a first sending module, configured to send an image quality reduction message to the sending end when the receiving end does not satisfy the real-time playing condition, where the image quality reduction message is used to notify the sending end to reduce image quality of obtaining the target video.
Optionally, the determining module includes:
the acquisition submodule is used for acquiring a plurality of first storage resource amounts occupied by the data to be played of the target video according to a preset acquisition cycle;
the judging submodule is used for judging whether the resource storage state of the equipment is an overload state or not according to the plurality of first storage resource quantities;
the first judgment submodule is used for judging that the equipment does not meet the real-time playing condition when the resource storage state of the equipment is an overload state;
the first judging submodule is further used for judging that the equipment meets the real-time playing condition when the resource storage state of the equipment is not the overload state.
Optionally, the determining sub-module includes:
the first calculation submodule is used for calculating a first ratio of each first storage resource quantity to the total pre-stored storage resource quantity respectively;
the determining submodule is used for comparing a first ratio corresponding to each first storage resource quantity with a pre-stored first ratio threshold and determining the target number of the first ratio which is greater than the first ratio threshold;
the second judging submodule is used for judging the resource storage state of the equipment to be an overload state when the target number is greater than a preset number threshold;
and the second judging submodule is also used for judging that the resource storage state of the equipment is not an overload state when the target number is not greater than the preset number threshold.
Optionally, the determining sub-module includes:
the second calculation submodule is used for calculating the average value of the plurality of first storage resource quantities to obtain the average storage resource quantity;
the comparison submodule is used for determining a second ratio of the average storage resource amount to the total pre-stored storage resource amount and comparing the second ratio with a pre-stored second ratio threshold;
the third judging submodule is used for judging that the resource storage state of the equipment is an overload state when the second ratio is larger than the second ratio threshold;
and the third judging submodule is also used for judging that the resource storage state of the equipment is not an overload state when the second ratio is not greater than the second ratio threshold.
Optionally, the apparatus further comprises:
and the second sending module is used for sending an image quality improving message to the sending end if the real-time playing condition is met, wherein the image quality improving message is used for informing the sending end of improving the image quality of the obtained target video.
In a fourth aspect, a video playing apparatus is provided, where the apparatus is applied to a sending end of a target video, and the apparatus includes:
the system comprises a sending module, a receiving module and a playing module, wherein the sending module is used for acquiring a target video to be played and sending video data of the target video to a preset receiving end;
the adjusting module is used for reducing the image quality parameter value of the sending end according to a preset adjusting rule of the image quality parameter when receiving the image quality reducing message sent by the receiving end;
and the acquisition module is used for acquiring the target video according to the reduced image quality parameter value.
Optionally, the adjusting module includes:
the first determining submodule is used for determining the current image quality parameter value of the sending end;
the second determining submodule is used for determining the current image quality grade corresponding to the current image quality parameter value according to the corresponding relation between the pre-stored image quality parameter value and the image quality grade;
and the third determining submodule is used for determining a target image quality grade lower than the current image quality grade and a target image quality parameter value corresponding to the target image quality grade in the corresponding relation between the image quality parameter value and the image quality grade.
Optionally, the apparatus further comprises:
the reading module is used for reading a third storage resource amount occupied by the data to be sent in the sending end;
the first calculating module is used for calculating a second ratio according to the third storage resource amount and the total pre-stored storage resource amount of the sending end;
and the adjusting module is further configured to reduce the image quality parameter value of the sending end according to an adjusting rule of the image quality parameter when the second ratio is greater than a preset second threshold, so as to reduce the image quality of the obtained target video.
Optionally, the apparatus further comprises:
a first executing module, configured to execute the step of reading a third amount of storage resources occupied by data to be sent at the sending end when an image quality improvement message is received;
and the adjusting module is further configured to, when the second ratio is smaller than the second threshold, improve the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter, so as to improve the image quality of the obtained target video.
Optionally, the apparatus further comprises:
the second calculation module is used for calculating the packet loss rate of the video data sent by the sending end;
and the adjusting module is further configured to reduce the image quality parameter value of the sending end according to the adjusting rule of the image quality parameter when the packet loss rate is greater than a preset packet loss rate threshold, so as to reduce the image quality of the obtained target video.
Optionally, the apparatus further comprises:
a second execution module, configured to execute the step of calculating a packet loss rate of video data sent by the sending end when receiving an image quality improvement message;
and the adjusting module is further configured to, when the packet loss rate is smaller than the packet loss rate threshold, improve the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter, so as to improve the image quality of the obtained target video.
In a fifth aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the first aspects when executing a program stored in the memory.
In a sixth aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when being executed by a processor, carries out the method steps of any of the first aspects.
In a seventh aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of the second aspects when executing the program stored in the memory.
In an eighth aspect, a computer-readable storage medium is provided, having stored thereon a computer program which, when being executed by a processor, carries out the method steps of any of the second aspects.
A ninth aspect provides a video playing system, the system comprising a transmitting end and a receiving end of a target video, the receiving end being configured to perform the method steps of any of the first aspects; the transmitting end is configured to perform the method steps of any of the second aspects.
The video playing method, the device and the system provided by the embodiment of the application can receive video data of a target video sent by a sending end, and judge whether the equipment meets a real-time playing condition or not through a preset evaluation rule in the process of playing the target video; when the real-time playing condition is not met, an image quality reduction message is sent to the sending end to inform the sending end of reducing the image quality of the obtained target video, so that system resources required by the receiving end when the target video is played are reduced, and the real-time performance of video playing is improved.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a video playing method according to an embodiment of the present application;
fig. 2 is a flowchart of a video playing method according to an embodiment of the present application;
fig. 3 is a flowchart of a video playing method according to an embodiment of the present application;
fig. 4 is a flowchart of a video playing method according to an embodiment of the present application;
fig. 5 is a flowchart of a video playing method according to an embodiment of the present application;
fig. 6 is a flowchart of a video playing method according to an embodiment of the present application;
fig. 7 is a flowchart of a video playing method according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a video playing apparatus according to an embodiment of the present application;
fig. 9 is a schematic structural diagram of a video playing apparatus according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, 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 application.
The embodiment of the application provides a video playing method, which is applied to a receiving end of a target video in a video monitoring system, wherein the receiving end can be an electronic device with a video playing function, for example, the receiving end can be a mobile phone or a computer. The video monitoring system further comprises a sending end, and the sending end and the receiving end are in communication connection so as to transmit video data. In a feasible implementation manner, the sending terminal may be an electronic device with a video data acquisition function, and the sending terminal may acquire video data of a target video; in another possible implementation manner, the sending end may be a server of a video monitoring system, and the sending end may be in communication connection with an electronic device having a video data acquisition function to acquire video data of a target video.
In the process of video monitoring, a sending end may obtain video data (or audio data) of a target video, and encode the obtained video data, for example, convert video data in a YUV (luminance, chrominance, and density) format into video data in an h.264 (highly compressed digital video codec standard) format. Then, the sending end may encapsulate the encoded video data to obtain a data packet, and store the data packet in a sending buffer of the sending end, and then the sending end may send the data packet of the target video to the receiving end. The video data of the target video at the sending end may be collected in real time or may be pre-stored, and the embodiment of the present application is not particularly limited.
The receiving end can receive a data packet of a target video sent by the sending end and store the data packet in a receiving buffer area of the receiving end, then the receiving end can read the data packet from the receiving buffer area to perform decapsulation, decode the decapsulated video data, and then the receiving end can play the decoded video data.
As shown in fig. 1, an embodiment of the present application provides a processing procedure for a receiving end to execute the video playing method, which specifically includes the following steps:
step 101, receiving video data of a target video sent by a sending end.
In implementation, the receiving end may receive the data packet sent by the sending end, store the received data packet in a receiving buffer of the receiving end, then, the receiving end may read the data packet from the receiving buffer to perform decapsulation, and decode the decapsulated video data to obtain the video data of the target video.
In the embodiment of the present application, the specific processes of decapsulating the data packet and decoding the video data at the receiving end are all the prior art, and are not described herein again.
And 102, judging whether the equipment meets the real-time playing condition or not through a preset evaluation rule in the process of playing the target video.
In implementation, the receiving end may be preset with an evaluation rule, and the evaluation rule may be set by a technician. For example, the evaluation rule may be to compare the current video data decoding speed of the receiving end with a preset decoding speed threshold, and if the current video data decoding speed is less than the decoding speed threshold, determine that the receiving end does not satisfy the real-time playing condition; the evaluation rule may also be comparing the time delay of the target video played by the receiving end with a preset playing time delay threshold, and if the time delay of the target video played is greater than the playing time delay threshold, determining that the receiving end does not satisfy the real-time playing condition.
The receiving end can judge whether the equipment meets the real-time playing condition through the evaluation rule in the process of playing the target video so as to judge whether the receiving end can play the target video in real time.
For example, the playing delay threshold may be 1s, and the receiving end may obtain that the delay of the current playing target video of the receiving end is 2s in the process of playing the target video. Because the time delay 2s for playing the target video is greater than the playing time delay threshold 1s, the receiving end can judge that the equipment does not meet the real-time playing condition.
And 103, if the real-time playing condition is not met, sending an image quality reduction message to the sending end.
The image quality reduction message is used for informing the sending end of reducing the image quality of the acquired target video.
In implementation, when the receiving end determines that the device does not satisfy the real-time playing condition, the receiving end may send an image quality reduction message to the sending end to notify the sending end to reduce the image quality of the acquired target video.
Due to the fact that performance differences among different electronic devices serving as receiving ends are huge, the electronic devices with poor performance cannot process video data with high image quality in time, the real-time performance of playing videos is poor, the phenomena of blocking, blue screen and the like are further caused when target videos are played, and the video playing effect is poor. Therefore, in the embodiment of the application, the performance of the receiving end is taken as a consideration factor for adjusting the image quality of the target video, and in the process of playing the target video, when the receiving end judges that the device cannot meet the real-time playing condition through the evaluation rule, that is, when the system resources for processing the video data in the receiving end are insufficient, and the target video cannot be played in real time, the receiving end can send the image quality reduction message to the sending end, so that the sending end reduces the image quality for acquiring the target video, and thus, the system resources required by the receiving end for processing the video data can be reduced, and the real-time performance can be improved.
Optionally, the receiving end may further perform the following operations:
and if the real-time playing condition is met, sending an image quality improvement message to the sending end.
The image quality improving message is used for informing the sending end to improve the image quality of the acquired target video.
In implementation, when the receiving end determines that the receiving end satisfies the real-time playing condition, the receiving end may send an image quality improvement message to the sending end to notify the sending end to improve the image quality of the acquired target video.
In the embodiment of the application, in the process of playing the target video, when the receiving end judges that the device can meet the real-time playing condition through the evaluation rule, namely when the receiving end can play the target video in real time, the receiving end can send the image quality improvement message to the sending end, so that the sending end improves the image quality for acquiring the target video, and thus, the receiving end can receive the video data with high image quality, and play the target video with high image quality for the user, and the user experience can be improved.
In a feasible implementation manner, after receiving the image quality reduction message or the image quality improvement message, the sending end needs a period of time to complete the operations of adjusting and obtaining the image quality of the target video, and sending the newly obtained target video to the receiving end, and the like, so that the receiving end can judge whether the device meets the real-time playing condition or not according to a preset processing cycle and through an evaluation rule.
For example, the preset processing period may be 30 seconds, and the receiving end may determine whether the device satisfies the real-time playing condition through the evaluation rule every 30 seconds.
Optionally, the receiving end may determine whether the device meets the real-time playing condition based on the amount of storage resources occupied by the video data, as shown in fig. 2, the specific processing procedure is as follows:
step 201, according to a preset obtaining period, obtaining a plurality of first storage resource amounts occupied by data to be played of a target video.
The receiving end may preset an obtaining period for obtaining the amount of storage resources occupied by the data to be played of the target video, where the obtaining period may be 500 ms.
In implementation, each time the acquisition period is reached, the receiving end may use, in a receiving buffer of the current receiving end, a data packet of the target video as data to be played of the target video, and read a first storage resource amount occupied by the data to be played as a first storage resource amount corresponding to the acquisition period, so that the receiving end may determine a plurality of first storage resource amounts corresponding to a plurality of acquisition periods. The first amount of storage resources is, for example, 1Gb (Gigabyte).
Step 202, according to the plurality of first storage resource amounts, determining whether the resource storage state of the device is an overload state.
In implementation, the receiving end may determine whether the resource storage state of the device is in an overload state according to a plurality of first storage resource amounts corresponding to a plurality of acquisition periods, that is, determine whether the device can process the data to be played in the receiving buffer in time. The specific processing procedure for the receiving end to determine whether the resource storage state of the device is an overload state according to the plurality of first storage resource amounts will be described in detail later.
If the resource storage state of the device is an overload state, the receiving end may execute step 203; if the resource storage status of the device is not the overload status, the receiving end may execute step 204.
Step 203, judging that the equipment does not meet the real-time playing condition.
And step 204, judging that the equipment meets the real-time playing condition.
In the embodiment of the application, when the receiving end can meet the real-time playing condition, the receiving end can process (including decapsulation, decoding, and playing) the data to be played in the receiving cache region in time, and a lot of video data cannot be retained in the receiving cache region. Based on this, the receiving end can judge whether the resource storage state of the device is an overload state according to the plurality of first storage resource amounts, and further determine whether the receiving end meets the real-time playing condition according to whether the resource storage state of the device is in the overload state. In addition, the receiving end only needs to acquire the first storage resource amount and perform simple calculation to judge whether the equipment meets the real-time playing condition, the system resource occupied by the receiving end in the judging process is extremely small, and the processing burden is avoided.
In this embodiment of the present application, the receiving end determines, according to the plurality of first storage resource amounts, whether the resource storage state of the device is an overload state in various ways, as shown in fig. 3, for an implementation manner provided in this embodiment of the present application, the method specifically includes the following steps:
step 301, respectively calculating a first ratio of each first storage resource amount to a total pre-stored storage resource amount.
In an implementation, the receiving end may use the maximum value of the resource amount that can be stored in the receiving buffer as the total pre-stored storage resource amount. Then, the receiving end may calculate, for the plurality of first storage resource amounts, first ratios of the first storage resource amounts to the total storage resource amount, respectively, to obtain first ratios corresponding to the first storage resource amounts.
For example, the total amount of memory resources may be 10Gb, and the receiving end may acquire, for 10 acquisition cycles (i.e., within a time range of 5 s), a first amount of memory resources corresponding to the 10 acquisition cycles, to obtain 1Gb, 2Gb, 6Gb, 3Gb, 6Gb, 4Gb, 7Gb, and 5 Gb. The receiving end may calculate a ratio of each first storage resource amount to the total storage resource amount 10Gb to obtain first ratios corresponding to each first storage resource amount, which are 0.1, 0.2, 0.6, 0.3, 0.6, 0.4, 0.7, and 0.5, respectively.
Step 302, comparing the first ratio corresponding to each first storage resource amount with a first ratio threshold value stored in advance, and determining a target number of the first ratio larger than the first ratio threshold value.
In an implementation, the receiving end may store the first ratio threshold and the number threshold in advance. The receiving end may compare each first ratio with the first ratio threshold based on the determined first ratios to obtain a comparison result corresponding to each first ratio, where the comparison result is greater than or not greater than the first ratio. Then, the receiving end may determine, in the comparison result corresponding to each first ratio, that the comparison result is a number greater than the first ratio, that is, the target number.
Then, the receiving end may compare the determined number of targets with the number threshold, and if the number of targets is greater than the number threshold, the receiving end may perform step 303; if the target number is not greater than the number threshold, the receiving end may perform step 304.
For example, the first ratio threshold may be 0.5, and the receiving end may compare each first ratio with the first ratio threshold based on the first ratios 0.1, 0.2, 0.6, 0.3, 0.6, 0.4, 0.7, and 0.5 corresponding to 10 acquisition periods, and determine a comparison result corresponding to each first ratio, where the number of comparison results is greater than 3, and the target number is 3.
The number threshold may be 5, the receiving end may compare the target number 3 with the number threshold 5, and the target number 3 is less than the number threshold 5, then the receiving end may perform step 304.
Step 303, determining that the resource storage state of the device is an overload state.
In implementation, the receiving end may determine that the resource storage status of the apparatus is an overload status, and execute step 203.
Step 304, determining that the resource storage state of the device is not an overload state.
In implementation, the receiving end may determine that the resource storage status of the device is not an overload status, and execute step 204.
In the embodiment of the application, the receiving end determines a first ratio corresponding to each first storage resource amount based on the acquired plurality of first storage resource amounts, and determines whether the resource storage state of the device is in an overload state or not in a mode of carrying out probability statistics on a comparison result of the first ratio and a first ratio threshold, and further determines whether the device meets a real-time playing condition or not, so that the accuracy of determining whether the receiving end meets the real-time playing condition or not can be improved.
Optionally, as shown in fig. 4, another implementation manner for determining whether the resource storage state of the device is an overload state provided in the embodiment of the present application includes:
step 401, calculating an average value of the plurality of first storage resource amounts to obtain an average storage resource amount.
In an implementation, the receiving end may calculate an average value of the plurality of first storage resource amounts based on the plurality of first storage resource amounts to obtain an average storage resource amount.
In a possible implementation manner, the average may be an arithmetic average, a geometric average, and a weighted average, and the embodiment of the present application is not particularly limited.
For example, the receiving end may calculate an average value of the plurality of first memory resource amounts based on the first memory resource amounts 1Gb, 2Gb, 6Gb, 3Gb, 6Gb, 4Gb, 7Gb, and 5Gb corresponding to 10 acquisition cycles, and obtain that the average memory resource amount is (1+2+6+3+ 6+4+4+7+5)/10 ═ 4.1 Gb.
Step 402, determining a second ratio of the average storage resource amount to the pre-stored total storage resource amount, and comparing the second ratio with a pre-stored second ratio threshold.
The receiving end may pre-store the second ratio threshold, and the receiving end may use the maximum value of the resource amount that can be stored in the receiving buffer as the total pre-stored resource amount.
In an implementation, the receiving end may calculate a second ratio of the average storage resource amount to the total storage resource amount, compare the second ratio with a second ratio threshold, if the second ratio is greater than the second ratio threshold, the receiving end may perform step 403, and if the second ratio is not greater than the second ratio threshold, the receiving end may perform step 404.
For example, the second ratio threshold may be 0.5. The receiving end may calculate that a second ratio of the average amount of the storage resources 4.1Gb to the total amount of the storage resources 10Gb is 0.41, the receiving end may compare the second ratio 0.41 with a second ratio threshold 0.5, and determine that the second ratio 0.41 is not greater than the second ratio threshold 0.5, then the receiving end may perform step 404.
Step 403, determining that the resource storage state of the device is an overload state.
In implementation, the receiving end may determine that the resource storage status of the apparatus is an overload status, and execute step 203.
Step 404, determining that the resource storage state of the device is not an overload state.
In implementation, the receiving end may determine that the resource storage status of the device is not an overload status, and execute step 204.
In the embodiment of the application, the receiving end determines the average storage resource amount based on the statistical average of the first storage resource amounts in the multiple acquisition periods, and then calculates the second ratio according to the average storage resource amount and the total storage resource amount. And then, judging whether the resource storage state of the equipment is an overload state or not according to the comparison result of the second ratio and the second ratio threshold, and further judging whether the equipment meets the real-time playing condition or not, so that the accuracy of judging whether the receiving end meets the real-time playing condition or not can be improved.
As shown in fig. 5, an embodiment of the present application provides a processing flow for a sending end to execute the video playing method, which specifically includes the following steps:
step 501, obtaining a target video to be played, and sending video data of the target video to a preset receiving end.
In implementation, a video acquisition component may be preset in the sending end, and the video acquisition component may be a camera. The sending end can shoot a preset object or scene through the video acquisition component, and the shot video data is used as the video data of the target video to be played. Then, the sending end may send the video data of the target video to a preset receiving end in the form of a data packet.
Step 502, when receiving the image quality reduction message sent by the receiving end, reducing the image quality parameter value of the sending end according to the preset adjustment rule of the image quality parameter.
The sending end can pre-store the adjustment rule of the image quality parameter, and can adjust the image quality parameter value selected by the sending end when the sending end obtains the video according to the adjustment rule of the image quality parameter, wherein the image quality parameter comprises resolution, frame rate and code rate. Specifically, the sending end can change the resolution and the frame rate when acquiring video data, can also change the code rate when encoding the acquired video data, and can also change the frame rate of the video in the data packet.
In implementation, when the sending end receives the image quality reduction message sent by the receiving end, the sending end may reduce the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter.
In a feasible implementation manner, when the sending end adjusts the image quality parameter value according to the adjustment rule of the image quality parameter, one or more of the image quality parameters may be adjusted.
And 503, acquiring the target video according to the reduced image quality parameter value.
In implementation, the sending end may set a corresponding image quality parameter according to the reduced image quality parameter value, and obtain the target video based on the set image quality parameter.
In the embodiment of the application, the sending end can determine that the receiving end does not meet the real-time playing condition when receiving the image quality reduction message sent by the receiving end, so that the image quality parameter value is reduced, the image quality of the obtained target video is reduced, further, the system resources required by the receiving end when the receiving end processes the video data of the target video can be reduced, and the real-time performance of video playing is improved.
Optionally, the sending end may store a corresponding relationship between the image quality parameter value and the image quality level, and at this time, as shown in fig. 6, a processing procedure of the sending end for reducing the image quality parameter value at the sending end includes:
step 601, determining a current image quality parameter value of a sending end.
In implementation, an image quality parameter configuration file may be stored in advance in the sending end, and a corresponding relationship between an image quality parameter value selected when the video is acquired and acquisition time is stored in the image quality parameter configuration file.
The sending end can determine the current acquisition time, and determine an image quality parameter value corresponding to the current acquisition time in an image quality parameter configuration file to obtain the current image quality parameter value.
Step 602, determining a current image quality grade corresponding to the current image quality parameter value according to a pre-stored correspondence between the image quality parameter value and the image quality grade.
In implementation, the sending end may determine, in the correspondence between the image quality parameter value and the image quality level, an image quality parameter value that is the same as the current image quality parameter value, and use the image quality level corresponding to the image quality parameter value as the current image quality level corresponding to the current image quality parameter value.
For example, when the image quality parameter is resolution, the correspondence of the image quality parameter value to the image quality level may be: 1080p (progressive scanning) corresponds to an image quality level of 3, 720p corresponds to an image quality level of 2, 480p corresponds to an image quality level of 1, and the larger the image quality level is, the better the image quality of the video is.
The sending end can obtain a current image quality parameter value to obtain 1080p, and then the sending end can determine that an image quality grade corresponding to 1080p is 3 in a corresponding relation between the image quality parameter value and the image quality grade, and then the sending end can determine that the current image quality grade is 3.
Step 603, in the corresponding relationship between the image quality parameter value and the image quality grade, determining a target image quality grade lower than the current image quality grade and a target image quality parameter value corresponding to the target image quality grade.
In an implementation, the transmitting end may determine the number of image quality levels lower than the current image quality level for a plurality of image quality levels included in the correspondence between the image quality parameter value and the image quality level. When the number is 1, the transmitting end may take the image quality level as a target image quality level. When the number is greater than 1, the transmitting end may determine, as the target image quality level, the largest image quality level among the image quality levels corresponding to the number.
The sending end can take the image quality parameter value corresponding to the target image quality grade in the corresponding relation between the image quality parameter value and the image quality grade as the target image quality parameter value, and set the corresponding image quality parameter according to the determined target image quality parameter value.
The embodiment of the application provides a mode for determining a target image quality grade, wherein a sending end can determine an expected image quality grade in a corresponding relation between an image quality parameter value and the image quality grade according to an adjusting direction of the image quality grade; then, the transmitting end may determine a target image quality level according to the current image quality level and the desired image quality level. Wherein adjusting the direction includes raising and lowering.
For example, the image quality ranks included in the correspondence relationship between the image quality parameter values and the image quality ranks may be represented by 1 to 10, and when the adjustment direction of the image quality ranks is to be increased, the transmitting end may determine that the desired image quality rank is 10 in the correspondence relationship between the image quality parameters and the image quality ranks. Then, the transmitting end may calculate an intermediate amount between the current image quality level 2 and the desired image quality level 10, resulting in an image quality level 6, and take the intermediate amount as a target image quality level.
In a possible implementation manner, the sending end may store the adjustment direction of the image quality level each time the image quality level is adjusted, then, the sending end may compare the current adjustment direction with the adjustment direction at the time of adjusting the image quality level last time when determining the target image quality level, if the adjustment directions are different, the sending end may take the image quality level at the time of adjusting last time as the desired image quality level, and determine the target image quality level according to the current image quality level and the desired image quality level.
If the adjustment directions are the same, the sending end can determine the expected image quality grade in the corresponding relation between the image quality parameter value and the image quality grade; then, the transmitting end may determine a target image quality level according to the current image quality level and the desired image quality level.
For example, the adjustment direction when the image quality level was adjusted last time is to be increased, the image quality level before adjustment is 5, and the image quality level after adjustment is 7, that is, the current image quality level is 7. If the current adjustment direction is decreasing, the transmitting end may compare the current adjustment direction (decreasing) with the adjustment direction (increasing) at the time of the last adjustment of the image quality level when determining the target image quality level, determine that the adjustment directions are different, then the transmitting end may set the image quality level 5 as the desired image quality level, and determine the target image quality level to be 6 according to the current image quality level 7 and the desired image quality level 5.
Optionally, the sending end may determine whether to adjust the image quality parameter value based on two conditions of determining whether the network state of the transmission network is good and whether the receiving end satisfies the real-time playing condition. Specifically, when the network state of the transmission network is good and the receiving end meets the real-time playing condition, the sending end can improve the image quality, and when the judgment result of any condition is negative, the sending end can reduce the image quality. Therefore, when receiving the image quality reduction message, the sending end reduces the image quality, and when receiving the image quality improvement message, the sending end can judge the network state of the transmission network, and when the network state is good, the image quality is improved.
In a feasible implementation manner, a specific processing flow for a sending end to adjust the image quality of a target video according to a network state of a transmission network includes:
step one, reading a third storage resource amount occupied by data to be sent in a sending end.
In implementation, the sending end may read the third storage resource amount occupied by the data to be sent in the sending buffer according to a preset processing cycle.
And step two, calculating a third ratio according to the third storage resource amount and the total pre-stored storage resource amount of the sending end.
The sending end may store a third ratio threshold in advance, where the third ratio threshold is, for example, 0.15. The sending end may use the maximum value of the resource amount that the sending buffer can store as the total stored resource amount of the sending end in advance.
In an implementation, the sender may calculate a third ratio of the third amount of storage resources to the total amount of storage resources of the sender. Then, the sending end may compare the third ratio with a third ratio threshold, and if the third ratio is greater than the third ratio threshold, the sending end may perform step three; if the third ratio is smaller than the third ratio threshold, the sending end can judge whether the receiving end meets the real-time playing condition, and if the receiving end meets the real-time playing condition, the fourth step is executed.
For example, the third storage resource amount occupied by the sending end reading the current data to be sent is 8Gb, the total storage resource amount of the sending end is 40Gb, and a third ratio of the third storage resource amount 8Gb to the total storage resource amount 40Gb of the sending end calculated by the sending end is 0.2. Then, the sending end may compare the third ratio 0.2 with the third ratio threshold 0.15, determine that the third ratio is greater than the third ratio threshold, and the sending end may perform step three.
And step three, reducing the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to reduce the image quality of the obtained target video.
And step four, improving the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to improve the image quality of the obtained target video.
In implementation, the specific process of the sending end for improving the image quality parameter value according to the adjustment rule of the image quality parameter is similar to the process of the sending end for reducing the image quality parameter of the sending end, and is not repeated here.
Optionally, when the image quality improvement message is received, the step of reading the third storage resource amount occupied by the data to be sent in the sending end is executed.
In implementation, when receiving the image quality improvement message, the sending end may determine that the receiving end satisfies the real-time playing condition, and at this time, the sending end may perform the first step and the second step to calculate a third ratio of the third storage resource amount to the total storage resource amount of the sending end, and compare the third ratio with a third ratio threshold, and if the third ratio is greater than the third ratio threshold, the sending end may perform the third step; if the third ratio is smaller than the third ratio threshold, the transmitting end may perform step four.
In the embodiment of the application, the sending end calculates the third ratio based on the third storage resource amount occupied by the data to be sent and the total storage resource amount of the sending end, and judges whether the network state of the transmission network is good or not according to the comparison result of the third ratio and the third ratio threshold, so that when the sending end judges whether the image quality of the acquired target video is adjusted or not, the network state of the transmission network of the sending end and the processing performance of the receiving end can be considered, the adjustment precision of the image quality can be improved, and the real-time performance of video playing is further improved.
Optionally, an embodiment of the present application further provides a processing flow for a sending end to determine a network state of a transmission network based on a packet loss rate, and adjust image quality of a target video according to the network state, which is specifically as follows:
step 1, calculating the packet loss rate of video data sent by a sending end.
In implementation, the sending end may calculate a packet loss rate of the video data sent by the sending end. Then, the sending end can compare the packet loss rate with a preset packet loss rate threshold, and if the packet loss rate is greater than the packet loss rate threshold, the sending end can execute step 2; if the packet loss rate is less than the packet loss rate threshold, the sending end may determine whether the receiving end satisfies the real-time playing condition, and if the receiving end satisfies the real-time playing condition, the sending end may execute step 3.
In this embodiment of the application, a specific process of calculating a packet loss rate of video data sent by a sending end is the prior art, and details are not repeated here.
And 2, reducing the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to reduce the image quality of the obtained target video.
And 3, improving the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to improve the image quality of the obtained target video.
For example, the preset threshold of the packet loss rate is 0.1, the packet loss rate of the transmitted video data calculated by the transmitting end is 0.15, and the transmitting end may compare the packet loss rate of 0.15 with the threshold of the packet loss rate of 0.1, and determine that the packet loss rate is greater than the threshold of the packet loss rate, and then the transmitting end should reduce the image quality parameter value of the transmitting end according to the adjustment rule of the image quality parameter, so as to reduce the image quality of the acquired target video.
Optionally, when the image quality improvement message is received, the step of calculating the packet loss rate of the video data sent by the sending end is executed.
In implementation, when receiving the image quality improvement message, the sending end may determine that the receiving end satisfies the real-time playing condition, and at this time, the sending end may perform step 1 to calculate a packet loss rate of video data sent by the sending end, and compare the packet loss rate with a packet loss rate threshold, and if the packet loss rate is greater than the packet loss rate threshold, the sending end may perform step 2; if the packet loss rate is less than the packet loss rate threshold, the transmitting end may perform step 3.
In the embodiment of the application, the sending end judges whether the network state of the transmission network is good or not based on the packet loss rate of the sent video data and according to the comparison result of the packet loss rate and the packet loss rate threshold, so that when the sending end judges whether the image quality of the obtained target video is adjusted, the network state of the transmission network of the sending end and the processing performance of the receiving end can be considered, the adjustment precision of the image quality can be improved, and the real-time performance of video playing is further improved.
An embodiment of the present application further provides a video playing method, as shown in fig. 7, a specific processing flow of the method is as follows:
step 701, a sending end obtains a target video to be played and sends video data of the target video to a preset receiving end.
In practice, the specific processing procedure of this step is the same as that of step 501.
In step 702, the receiving end receives video data of a target video sent by the sending end.
In practice, the specific processing procedure of this step is the same as that of step 101.
In step 703, the receiving end determines whether the device meets the real-time playing condition through a preset evaluation rule in the process of playing the target video.
In practice, the specific process of this step is the same as that of step 102.
Step 704, when the receiving end determines that the device does not satisfy the real-time playing condition, it sends an image quality reduction message to the sending end.
In practice, the specific processing procedure of this step is the same as that of step 103.
Step 705, when the sending end receives the image quality reduction message sent by the receiving end, the sending end reduces the image quality parameter value according to the preset adjustment rule of the image quality parameter.
In practice, the specific processing procedure of this step is the same as that of step 502.
And step 706, the sending end acquires the target video according to the reduced image quality parameter value.
In practice, the specific processing procedure of this step is the same as that of step 503.
Step 707, when the receiving end determines that the device satisfies the real-time playing condition, the receiving end sends an image quality improvement message to the sending end.
In practice, the specific processing procedure of this step can be seen in the related description of the above method embodiment.
Step 708, when receiving the image quality improvement message sent by the receiving end, reading a third storage resource amount occupied by the data to be sent in the sending end.
In practice, the specific processing procedure of this step is the same as that of step one.
And step 709, calculating a third ratio according to the third storage resource amount and the total pre-stored storage resource amount of the sending end.
In practice, the specific processing procedure of this step is the same as that of step two.
And step 710, reducing the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to reduce the image quality of the obtained target video.
In practice, the specific processing procedure of this step is the same as that of step three.
And 711, according to the adjustment rule of the image quality parameter, improving the image quality parameter value of the sending end so as to improve the image quality of the obtained target video.
In practice, the specific processing procedure of this step is the same as that of step four.
The embodiment of the present application further provides a video playing system, where the system includes a sending end and a receiving end of a target video, and the receiving end is configured to execute the method steps shown in fig. 1; the transmitting end is configured to perform the method steps shown in fig. 5.
An embodiment of the present application further provides a video playing apparatus, as shown in fig. 8, where the apparatus is applied to a receiving end of a target video, and the apparatus includes:
a receiving module 810, configured to receive video data of a target video sent by a sending end;
a judging module 820, configured to judge whether the device meets a real-time playing condition according to a preset evaluation rule in the process of playing the target video;
a first sending module 830, configured to send an image quality reduction message to the sending end when the receiving end does not satisfy the real-time playing condition, where the image quality reduction message is used to notify the sending end to reduce image quality of obtaining the target video.
Optionally, the determining module includes:
the acquisition submodule is used for acquiring a plurality of first storage resource amounts occupied by the data to be played of the target video according to a preset acquisition cycle;
the judging submodule is used for judging whether the resource storage state of the equipment is an overload state or not according to the plurality of first storage resource quantities;
the first judgment submodule is used for judging that the equipment does not meet the real-time playing condition when the resource storage state of the equipment is an overload state;
the first judging submodule is further used for judging that the equipment meets the real-time playing condition when the resource storage state of the equipment is not the overload state.
Optionally, the determining sub-module includes:
the first calculation submodule is used for calculating a first ratio of each first storage resource quantity to the total pre-stored storage resource quantity respectively;
the determining submodule is used for comparing a first ratio corresponding to each first storage resource quantity with a pre-stored first ratio threshold and determining the target number of the first ratio which is greater than the first ratio threshold;
the second judging submodule is used for judging the resource storage state of the equipment to be an overload state when the target number is greater than a preset number threshold;
and the second judging submodule is also used for judging that the resource storage state of the equipment is not an overload state when the target number is not greater than the preset number threshold.
Optionally, the determining sub-module includes:
the second calculation submodule is used for calculating the average value of the plurality of first storage resource quantities to obtain the average storage resource quantity;
the comparison submodule is used for determining a second ratio of the average storage resource amount to the total pre-stored storage resource amount and comparing the second ratio with a pre-stored second ratio threshold;
the third judging submodule is used for judging that the resource storage state of the equipment is an overload state when the second ratio is larger than the second ratio threshold;
and the third judging submodule is also used for judging that the resource storage state of the equipment is not an overload state when the second ratio is not greater than the second ratio threshold.
Optionally, the apparatus further comprises:
and the second sending module is used for sending an image quality improving message to the sending end if the real-time playing condition is met, wherein the image quality improving message is used for informing the sending end of improving the image quality of the obtained target video.
The video playing device provided by the embodiment of the application can receive video data of a target video sent by a sending end, and judge whether the equipment meets a real-time playing condition or not through a preset evaluation rule in the process of playing the target video; when the real-time playing condition is not met, an image quality reduction message is sent to the sending end to inform the sending end of reducing the image quality of the obtained target video, so that system resources required by the receiving end when the target video is played are reduced, and the real-time performance of video playing is improved.
An embodiment of the present application further provides a video playing apparatus, as shown in fig. 9, where the apparatus is applied to a sending end of a target video, and the apparatus includes:
a sending module 910, configured to obtain a target video to be played, and send video data of the target video to a preset receiving end;
an adjusting module 920, configured to reduce, when receiving an image quality reduction message sent by the receiving end, an image quality parameter value of the sending end according to a preset adjustment rule of the image quality parameter;
an obtaining module 930, configured to obtain the target video according to the reduced image quality parameter value.
Optionally, the adjusting module includes:
the first determining submodule is used for determining the current image quality parameter value of the sending end;
the second determining submodule is used for determining the current image quality grade corresponding to the current image quality parameter value according to the corresponding relation between the pre-stored image quality parameter value and the image quality grade;
and the third determining submodule is used for determining a target image quality grade lower than the current image quality grade and a target image quality parameter value corresponding to the target image quality grade in the corresponding relation between the image quality parameter value and the image quality grade.
Optionally, the apparatus further comprises:
the reading module is used for reading a third storage resource amount occupied by the data to be sent in the sending end;
the first calculating module is used for calculating a second ratio according to the third storage resource amount and the total pre-stored storage resource amount of the sending end;
and the adjusting module is further configured to reduce the image quality parameter value of the sending end according to an adjusting rule of the image quality parameter when the second ratio is greater than a preset second threshold, so as to reduce the image quality of the obtained target video.
Optionally, the apparatus further comprises:
a first executing module, configured to execute the step of reading a third amount of storage resources occupied by data to be sent at the sending end when an image quality improvement message is received;
and the adjusting module is further configured to, when the second ratio is smaller than the second threshold, improve the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter, so as to improve the image quality of the obtained target video.
Optionally, the apparatus further comprises:
the second calculation module is used for calculating the packet loss rate of the video data sent by the sending end;
and the adjusting module is further configured to reduce the image quality parameter value of the sending end according to the adjusting rule of the image quality parameter when the packet loss rate is greater than a preset packet loss rate threshold, so as to reduce the image quality of the obtained target video.
Optionally, the apparatus further comprises:
a second execution module, configured to execute the step of calculating a packet loss rate of video data sent by the sending end when receiving an image quality improvement message;
and the adjusting module is further configured to, when the packet loss rate is smaller than the packet loss rate threshold, improve the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter, so as to improve the image quality of the obtained target video.
The video playing device provided by the embodiment of the application can receive video data of a target video sent by a sending end, and judge whether the equipment meets a real-time playing condition or not through a preset evaluation rule in the process of playing the target video; when the real-time playing condition is not met, an image quality reduction message is sent to the sending end to inform the sending end of reducing the image quality of the obtained target video, so that system resources required by the receiving end when the target video is played are reduced, and the real-time performance of video playing is improved.
The embodiment of the present application further provides an electronic device, as shown in fig. 10, which includes a processor 1001, a communication interface 1002, a memory 1003 and a communication bus 1004, wherein the processor 1001, the communication interface 1002 and the memory 1003 complete mutual communication through the communication bus 1004,
a memory 1003 for storing a computer program;
the processor 1001 is configured to implement the following steps when executing the program stored in the memory 1003:
receiving video data of a target video sent by a sending end;
in the process of playing the target video, judging whether the equipment meets the real-time playing condition or not according to a preset evaluation rule;
and if the real-time playing condition is not met, sending an image quality reduction message to the sending end, wherein the image quality reduction message is used for informing the sending end to reduce the image quality of the obtained target video.
Optionally, the determining, according to a preset evaluation rule, whether the device meets the real-time playing condition includes:
acquiring a plurality of first storage resource amounts occupied by data to be played of the target video according to a preset acquisition period;
judging whether the resource storage state of the equipment is an overload state or not according to the plurality of first storage resource quantities;
if the resource storage state of the equipment is an overload state, judging that the equipment does not meet the real-time playing condition;
and if the resource storage state of the equipment is not the overload state, judging that the equipment meets the real-time playing condition.
Optionally, the determining, according to the plurality of first storage resource amounts, whether the resource storage state of the device is an overload state includes:
respectively calculating a first ratio of each first storage resource quantity to a total pre-stored storage resource quantity;
comparing a first ratio corresponding to each first storage resource quantity with a pre-stored first ratio threshold, and determining the target number of the first ratio which is greater than the first ratio threshold;
if the target number is larger than a preset number threshold, judging that the resource storage state of the equipment is an overload state;
and if the target number is not greater than the preset number threshold, judging that the resource storage state of the equipment is not an overload state.
Optionally, the determining, according to the plurality of first storage resource amounts, whether the resource storage state of the device is an overload state includes:
calculating the average value of the plurality of first storage resource quantities to obtain the average storage resource quantity;
determining a second ratio of the average storage resource amount to a pre-stored total storage resource amount, and comparing the second ratio with a pre-stored second ratio threshold;
if the second ratio is larger than the second ratio threshold, judging that the resource storage state of the equipment is an overload state;
and if the second ratio is not greater than the second ratio threshold, judging that the resource storage state of the equipment is not an overload state.
Optionally, the method further includes:
and if the real-time playing condition is met, sending an image quality improving message to the sending end, wherein the image quality improving message is used for informing the sending end to improve the image quality of the obtained target video.
The embodiment of the present application further provides an electronic device, as shown in fig. 11, including a processor 1101, a communication interface 1102, a memory 1103 and a communication bus 1104, where the processor 1101, the communication interface 1102 and the memory 1103 complete mutual communication through the communication bus 1104,
a memory 1103 for storing a computer program;
the processor 1101 is configured to implement the following steps when executing the program stored in the memory 1103:
acquiring a target video to be played, and sending video data of the target video to a preset receiving end;
when receiving an image quality reduction message sent by the receiving end, reducing the image quality parameter value of the sending end according to a preset adjustment rule of the image quality parameter;
and acquiring the target video according to the reduced image quality parameter value.
Optionally, the reducing, according to the preset adjustment rule of the image quality parameter, the image quality parameter value of the sending end includes:
determining a current image quality parameter value of the sending end;
determining a current image quality grade corresponding to the current image quality parameter value according to a pre-stored corresponding relation between the image quality parameter value and the image quality grade;
and determining a target image quality grade lower than the current image quality grade and a target image quality parameter value corresponding to the target image quality grade in the corresponding relation between the image quality parameter value and the image quality grade.
Optionally, the method further includes:
reading a third storage resource amount occupied by data to be sent in the sending end;
calculating a second ratio according to the third storage resource amount and the total pre-stored storage resource amount of the sending end;
and if the second ratio is larger than a preset second threshold, reducing the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to reduce the image quality of the obtained target video.
Optionally, the method further includes:
when receiving the image quality improvement message, executing the step of reading the third storage resource amount occupied by the data to be sent in the sending end;
and if the second ratio is smaller than the second threshold, improving the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to improve the image quality of the obtained target video.
Optionally, the method further includes:
calculating the packet loss rate of the video data sent by the sending end;
and if the packet loss rate is greater than a preset packet loss rate threshold, reducing the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to reduce the image quality of the obtained target video.
Optionally, the method further includes:
when receiving the image quality improvement message, executing the step of calculating the packet loss rate of the video data sent by the sending end;
and if the packet loss rate is smaller than the packet loss rate threshold, improving the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to improve the image quality of the obtained target video.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In yet another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any one of the above-mentioned video playing methods.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any one of the video playback methods in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
The video playing method, the device and the system provided by the embodiment of the application can receive video data of a target video sent by a sending end, and judge whether the equipment meets a real-time playing condition or not through a preset evaluation rule in the process of playing the target video; when the real-time playing condition is not met, an image quality reduction message is sent to the sending end to inform the sending end of reducing the image quality of the obtained target video, so that system resources required by the receiving end when the target video is played are reduced, and the real-time performance of video playing is improved.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (21)

1. A video playing method is applied to a receiving end of a target video, and the method comprises the following steps:
receiving video data of a target video sent by a sending end;
in the process of playing the target video, judging whether the equipment meets the real-time playing condition or not according to a preset evaluation rule;
if the real-time playing condition is not met, sending an image quality reduction message to the sending end, wherein the image quality reduction message is used for informing the sending end to reduce the image quality of the obtained target video;
the step of judging whether the equipment meets the real-time playing condition or not through a preset evaluation rule comprises the following steps:
acquiring a plurality of first storage resource amounts occupied by data to be played of the target video according to a preset acquisition cycle, wherein the data to be played of the target video is a data packet of the target video cached in a receiving cache region of the device;
judging whether the resource storage state of the equipment is an overload state or not according to the plurality of first storage resource quantities;
if the resource storage state of the equipment is an overload state, judging that the equipment does not meet the real-time playing condition;
and if the resource storage state of the equipment is not the overload state, judging that the equipment meets the real-time playing condition.
2. The method according to claim 1, wherein said determining whether the resource storage status of the device is an overload status according to the first storage resource amounts comprises:
respectively calculating a first ratio of each first storage resource quantity to a total pre-stored storage resource quantity;
comparing a first ratio corresponding to each first storage resource quantity with a pre-stored first ratio threshold, and determining the target number of the first ratio which is greater than the first ratio threshold;
if the target number is larger than a preset number threshold, judging that the resource storage state of the equipment is an overload state;
and if the target number is not greater than the preset number threshold, judging that the resource storage state of the equipment is not an overload state.
3. The method according to claim 1, wherein said determining whether the resource storage status of the device is an overload status according to the first storage resource amounts comprises:
calculating the average value of the plurality of first storage resource quantities to obtain the average storage resource quantity;
determining a second ratio of the average storage resource amount to a pre-stored total storage resource amount, and comparing the second ratio with a pre-stored second ratio threshold;
if the second ratio is larger than the second ratio threshold, judging that the resource storage state of the equipment is an overload state;
and if the second ratio is not greater than the second ratio threshold, judging that the resource storage state of the equipment is not an overload state.
4. The method of claim 1, further comprising:
and if the real-time playing condition is met, sending an image quality improving message to the sending end, wherein the image quality improving message is used for informing the sending end to improve the image quality of the obtained target video.
5. A video playing method is applied to a sending end of a target video, and the method comprises the following steps:
acquiring a target video to be played, and sending video data of the target video to a preset receiving end;
when receiving an image quality reduction message sent by the receiving end when determining that the resource storage state is the overload state according to a plurality of first storage resource amounts, reducing the image quality parameter value of the sending end according to a preset adjustment rule of an image quality parameter, wherein the first storage resource amounts are storage resource amounts occupied by data to be played of the target video, and the data to be played of the target video is a data packet of the target video cached in a receiving cache area of the receiving end;
and acquiring the target video according to the reduced image quality parameter value.
6. The method according to claim 5, wherein the reducing the value of the image quality parameter at the transmitting end according to the preset adjustment rule of the image quality parameter comprises:
determining a current image quality parameter value of the sending end;
determining a current image quality grade corresponding to the current image quality parameter value according to a pre-stored corresponding relation between the image quality parameter value and the image quality grade;
and determining a target image quality grade lower than the current image quality grade and a target image quality parameter value corresponding to the target image quality grade in the corresponding relation between the image quality parameter value and the image quality grade.
7. The method of claim 5, further comprising:
reading a third storage resource amount occupied by data to be sent in the sending end;
calculating a third ratio according to the third storage resource amount and the total pre-stored storage resource amount of the sending end;
and if the third ratio is larger than a preset third ratio threshold, reducing the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to reduce the image quality of the obtained target video.
8. The method of claim 7, further comprising:
when receiving the image quality improvement message, executing the step of reading the third storage resource amount occupied by the data to be sent in the sending end;
and if the third ratio is smaller than the third ratio threshold, improving the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to improve the image quality of the obtained target video.
9. The method of claim 5, further comprising:
calculating the packet loss rate of the video data sent by the sending end;
and if the packet loss rate is greater than a preset packet loss rate threshold, reducing the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to reduce the image quality of the obtained target video.
10. The method of claim 9, further comprising:
when receiving the image quality improvement message, executing the step of calculating the packet loss rate of the video data sent by the sending end;
and if the packet loss rate is smaller than the packet loss rate threshold, improving the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter so as to improve the image quality of the obtained target video.
11. A video playing apparatus, wherein the apparatus is applied to a receiving end of a target video, the apparatus comprising:
the receiving module is used for receiving video data of a target video sent by a sending end;
the judging module is used for judging whether the equipment meets the real-time playing condition or not through a preset evaluation rule in the process of playing the target video;
a first sending module, configured to send an image quality reduction message to the sending end when the receiving end does not satisfy the real-time playing condition, where the image quality reduction message is used to notify the sending end to reduce image quality of the obtained target video;
the judging module comprises:
the acquisition submodule is used for acquiring a plurality of first storage resource amounts occupied by data to be played of the target video according to a preset acquisition cycle, wherein the data to be played of the target video is a data packet of the target video cached in a receiving cache region of the equipment;
the judging submodule is used for judging whether the resource storage state of the equipment is an overload state or not according to the plurality of first storage resource quantities;
the first judgment submodule is used for judging that the equipment does not meet the real-time playing condition when the resource storage state of the equipment is an overload state;
the first judging submodule is further used for judging that the equipment meets the real-time playing condition when the resource storage state of the equipment is not the overload state.
12. The apparatus of claim 11, wherein the determining sub-module comprises:
the first calculation submodule is used for calculating a first ratio of each first storage resource quantity to the total pre-stored storage resource quantity respectively;
the determining submodule is used for comparing a first ratio corresponding to each first storage resource quantity with a pre-stored first ratio threshold and determining the target number of the first ratio which is greater than the first ratio threshold;
the second judging submodule is used for judging the resource storage state of the equipment to be an overload state when the target number is greater than a preset number threshold;
and the second judging submodule is also used for judging that the resource storage state of the equipment is not an overload state when the target number is not greater than the preset number threshold.
13. The apparatus of claim 11, wherein the determining sub-module comprises:
the second calculation submodule is used for calculating the average value of the plurality of first storage resource quantities to obtain the average storage resource quantity;
the comparison submodule is used for determining a second ratio of the average storage resource amount to the total pre-stored storage resource amount and comparing the second ratio with a pre-stored second ratio threshold;
the third judging submodule is used for judging that the resource storage state of the equipment is an overload state when the second ratio is larger than the second ratio threshold;
and the third judging submodule is also used for judging that the resource storage state of the equipment is not an overload state when the second ratio is not greater than the second ratio threshold.
14. The apparatus of claim 11, further comprising:
and the second sending module is used for sending an image quality improving message to the sending end if the real-time playing condition is met, wherein the image quality improving message is used for informing the sending end of improving the image quality of the obtained target video.
15. A video playing apparatus, wherein the apparatus is applied to a sending end of a target video, and the apparatus comprises:
the system comprises a sending module, a receiving module and a playing module, wherein the sending module is used for acquiring a target video to be played and sending video data of the target video to a preset receiving end;
an adjusting module, configured to reduce an image quality parameter value of the sending end according to a preset adjustment rule of an image quality parameter when receiving an image quality reduction message sent by the receiving end when determining that a resource storage state is an overload state according to a plurality of first storage resource amounts, where the first storage resource amounts are storage resource amounts occupied by data to be played of the target video, and the data to be played of the target video is a data packet of the target video cached in a receiving cache area of the receiving end;
and the acquisition module is used for acquiring the target video according to the reduced image quality parameter value.
16. The apparatus of claim 15, wherein the adjustment module comprises:
the first determining submodule is used for determining the current image quality parameter value of the sending end;
the second determining submodule is used for determining the current image quality grade corresponding to the current image quality parameter value according to the corresponding relation between the pre-stored image quality parameter value and the image quality grade;
and the third determining submodule is used for determining a target image quality grade lower than the current image quality grade and a target image quality parameter value corresponding to the target image quality grade in the corresponding relation between the image quality parameter value and the image quality grade.
17. The apparatus of claim 15, further comprising:
the reading module is used for reading a third storage resource amount occupied by the data to be sent in the sending end;
the first calculating module is used for calculating a third ratio according to the third storage resource amount and the total pre-stored storage resource amount of the sending end;
and the adjusting module is further configured to reduce the image quality parameter value of the sending end according to an adjusting rule of the image quality parameter when the third ratio is greater than a preset third ratio threshold, so as to reduce the image quality of the obtained target video.
18. The apparatus of claim 17, further comprising:
a first executing module, configured to execute the step of reading a third amount of storage resources occupied by data to be sent at the sending end when an image quality improvement message is received;
and the adjusting module is further configured to, when the third ratio is smaller than the third ratio threshold, improve the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter, so as to improve the image quality of the obtained target video.
19. The apparatus of claim 15, further comprising:
the second calculation module is used for calculating the packet loss rate of the video data sent by the sending end;
and the adjusting module is further configured to reduce the image quality parameter value of the sending end according to the adjusting rule of the image quality parameter when the packet loss rate is greater than a preset packet loss rate threshold, so as to reduce the image quality of the obtained target video.
20. The apparatus of claim 19, further comprising:
a second execution module, configured to execute the step of calculating a packet loss rate of video data sent by the sending end when receiving an image quality improvement message;
and the adjusting module is further configured to, when the packet loss rate is smaller than the packet loss rate threshold, improve the image quality parameter value of the sending end according to the adjustment rule of the image quality parameter, so as to improve the image quality of the obtained target video.
21. A video playing system, characterized in that the system comprises a transmitting end and a receiving end of a target video, the receiving end is used for executing the method steps of any one of claims 1-4; the transmitting end is configured to perform the method steps of any of claims 5-10.
CN201910095798.5A 2019-01-31 2019-01-31 Video playing method, device and system Active CN111510703B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910095798.5A CN111510703B (en) 2019-01-31 2019-01-31 Video playing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910095798.5A CN111510703B (en) 2019-01-31 2019-01-31 Video playing method, device and system

Publications (2)

Publication Number Publication Date
CN111510703A CN111510703A (en) 2020-08-07
CN111510703B true CN111510703B (en) 2022-04-05

Family

ID=71872433

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910095798.5A Active CN111510703B (en) 2019-01-31 2019-01-31 Video playing method, device and system

Country Status (1)

Country Link
CN (1) CN111510703B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112511881A (en) * 2020-10-27 2021-03-16 维沃移动通信有限公司 Video playing method and device and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100050879A (en) * 2008-11-06 2010-05-14 주식회사 엘지데이콤 Method of handling buffering process for vod service, and iptv settop box with adaptive buffering function
CN103607661A (en) * 2013-11-29 2014-02-26 广州华多网络科技有限公司 Method and device for transmitting multimedia data
CN105744342A (en) * 2016-01-28 2016-07-06 腾讯科技(深圳)有限公司 Data transmission method and device for mobile terminal
CN106921870A (en) * 2015-12-24 2017-07-04 北京奇虎科技有限公司 A kind of video broadcasting method and device
CN109819322A (en) * 2019-03-15 2019-05-28 网易(杭州)网络有限公司 Video transmission method, device, computer readable storage medium and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100050879A (en) * 2008-11-06 2010-05-14 주식회사 엘지데이콤 Method of handling buffering process for vod service, and iptv settop box with adaptive buffering function
CN103607661A (en) * 2013-11-29 2014-02-26 广州华多网络科技有限公司 Method and device for transmitting multimedia data
CN106921870A (en) * 2015-12-24 2017-07-04 北京奇虎科技有限公司 A kind of video broadcasting method and device
CN105744342A (en) * 2016-01-28 2016-07-06 腾讯科技(深圳)有限公司 Data transmission method and device for mobile terminal
CN109819322A (en) * 2019-03-15 2019-05-28 网易(杭州)网络有限公司 Video transmission method, device, computer readable storage medium and electronic equipment

Also Published As

Publication number Publication date
CN111510703A (en) 2020-08-07

Similar Documents

Publication Publication Date Title
CN107623851B (en) Video code stream transmission control device and control method
US9398488B2 (en) Video service buffer management in a mobile rate control enabled network
US20200162725A1 (en) Video Quality Assessment Method and Apparatus
WO2021244341A1 (en) Picture coding method and apparatus, electronic device and computer readable storage medium
WO2016131223A1 (en) Frame loss method for video frame and video sending apparatus
CN105163134A (en) Video coding parameter setting method, device and video coding device for live video
US11146606B2 (en) Data buffering method, network device, and storage medium
WO2020220902A1 (en) Method and apparatus for distributing transmission parameters of video resources
CN106688239A (en) Video downloading method, apparatus, and system
CN105991364B (en) User perception evaluation method and device
CN107155093B (en) Video preview method, device and equipment
CN113037697B (en) Video frame processing method and device, electronic equipment and readable storage medium
CN110944220B (en) Video screen projection playing method, device, equipment and system
CN111225209A (en) Video data plug flow method, device, terminal and storage medium
US11438645B2 (en) Media information processing method, related device, and computer storage medium
CN113490055A (en) Data processing method and device
CN111510703B (en) Video playing method, device and system
US11570228B2 (en) System and method for managing video streaming quality of experience
WO2022052566A1 (en) Video bitrate adjustment method and apparatus, and electronic device and machine-readable storage medium
CN108810468B (en) Video transmission device and method for optimizing display effect
CN110012315A (en) A kind of video broadcasting method, device and electronic equipment
CN107105317B (en) Video playing method and device
Zhang et al. A QOE-driven approach to rate adaptation for dynamic adaptive streaming over http
CN106254873B (en) Video coding method and video coding device
CN115190359A (en) Automatic conversion method and system for video playing format

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