WO2019185048A1 - 一种计算视频码率的方法、装置及存储介质 - Google Patents

一种计算视频码率的方法、装置及存储介质 Download PDF

Info

Publication number
WO2019185048A1
WO2019185048A1 PCT/CN2019/080560 CN2019080560W WO2019185048A1 WO 2019185048 A1 WO2019185048 A1 WO 2019185048A1 CN 2019080560 W CN2019080560 W CN 2019080560W WO 2019185048 A1 WO2019185048 A1 WO 2019185048A1
Authority
WO
WIPO (PCT)
Prior art keywords
video
bit rate
calculating
time
player
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.)
Ceased
Application number
PCT/CN2019/080560
Other languages
English (en)
French (fr)
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.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New 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 Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Publication of WO2019185048A1 publication Critical patent/WO2019185048A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440281Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream or rendering scenes according to encoded video stream scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the temporal resolution, e.g. by frame skipping
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/4424Monitoring of the internal components or processes of the client device, e.g. CPU or memory load, processing speed, timer, counter or percentage of the hard disk space used

Definitions

  • the invention relates to a video online playing technology, in particular to a method, a device and a storage medium for calculating a video bit rate.
  • the Content Delivery Network is a content distribution network.
  • the CDN offloads the video server.
  • it is necessary to collect the load and health status of the relevant nodes, and it is necessary to know the bit rate of the video of each user system.
  • judging and locating the video CDN problem also requires the video bit rate of the user system.
  • the existing method usually adopts the method of network traffic monitoring, but this method needs to be monitored in the background, which is a great overhead for memory and CPU resources.
  • the network card captures the data at the system level to represent the video traffic, and then divides the time to get the video bit rate. This method can only get a rough estimate. The value, and the system needs to run continuously, it also needs to occupy more system resources.
  • the present invention provides a method for calculating a video bit rate by solving the defects and deficiencies of the prior art, by obtaining a video traffic value when the video player starts playing and after the video player plays a pause.
  • the difference is divided by the length of time that the playback has been used to obtain the bit rate of the video, which avoids the video player continuously obtaining relevant parameters during the playing process, occupies system resources, and improves the accuracy of the video bit rate.
  • a method for calculating a video bit rate for improving accuracy in video bit rate calculation and reducing use of system resources including the following steps:
  • the video playback card reads the current traffic value of the video player and records the length of the currently completed playback time
  • the calculating the video bit rate in the step C in combination with the completed playing time length is specifically: the video code rate is equal to the video playing card, and the video player is read. The difference between the current traffic value and the current traffic value of the video player when the video starts playing is divided by the length of the completed playback time.
  • the time consumed by the video player to complete the video playback is the length of the currently completed playback time. The length of time to go to the video search.
  • the time of each video search is 5 seconds.
  • the method further includes the following steps.
  • the video player does not detect the card, the video player needs to wait for the video to finish playing to obtain the current traffic value of the video player.
  • the length of the completed play time is the video playing time.
  • the video code rate is: the video code rate is: the current traffic value of the video player recorded when the video is played, and the video played when the video starts playing. The difference between the current traffic value of the device divided by the difference between the length of time the video has completed and the length of time the video is searched.
  • the video code rate is: the current traffic value of the recorded video player at the end of the video playback and the time recorded when the video starts playing. The difference between the current traffic value of the video player divided by the duration of the video playback.
  • step C the method further includes the following steps:
  • the step D specifically includes:
  • the present invention also provides an apparatus for calculating a video bit rate for calculation of a video bit rate in video playback, including a memory, a processor, and a computer program stored in the memory and operable on the processor, The method steps of calculating the video bit rate described above are implemented when the processor executes the computer program.
  • the present invention also provides a storage medium storing a program for calculating a video bit rate, the program for calculating a video bit rate being executed by a processor to implement the above-described method of calculating a video bit rate.
  • the present invention obtains the start of playing by the video player.
  • the video traffic value, the video traffic value after the video player pauses, and the length of time that the video player has finished playing after the pause is played, to calculate the bit rate of the captured video, thereby avoiding the video player constantly going during the playback process.
  • FIG. 1 is a flow chart of a preferred embodiment 1 of a method for calculating a video bit rate according to the present invention.
  • FIG. 2 is a block diagram showing the principle structure of a preferred embodiment of a device for calculating a video bit rate according to the present invention.
  • the full name of the CDN is the Content Delivery Network, the content distribution network.
  • the basic idea is to avoid the bottlenecks and links on the Internet that may affect the speed and stability of data transmission, so that the content transmission is faster and more stable.
  • the CDN system can real-time based on network traffic and connection, load status, and distance and response time to users.
  • the integrated information redirects the user's request to the service node closest to the user.
  • the purpose is to enable users to obtain the required content in the vicinity, solve the congestion of the Internet network, and improve the response speed of users visiting the website.
  • the Content Distribution Network is a strategically deployed overall system that includes distributed storage, load balancing, network request redirection and content management, and content management and global network traffic management (Traffic). Management) is the core of the CDN.
  • CDN Content Distribution Network
  • the CDN's judgment of the server load and global traffic management (Traffic Management) necessarily involve an understanding of the actual bit rate of each user. Real-time mastery of the actual code rate of the user system becomes a necessity.
  • Video is the most bandwidth-intensive transmission method in the Internet. Therefore, the video website has a very high demand for video server bandwidth. The amount of access that a server can withstand and the bandwidth that can provide support is limited, so the video CDN has been widely used. usage of.
  • a video CDN is generally composed of a cache server and a content distribution server.
  • Cache servers CDN nodes
  • content distribution servers distribute video content on video servers to various cache servers according to certain policies.
  • it is necessary to redirect the user's request to the nearest service node according to the network traffic and the connection and load status of each node, and the distance to the user and the response time.
  • Accurate user-real-time video bit rate information, locating and resolving video CDN issues also requires accurate user-real-time video bit rate information.
  • Calculating the real-time code rate of video is usually based on network traffic monitoring.
  • this method requires the system to continuously monitor in the background. It is a relatively large overhead for memory and CPU resources, or it is captured by the network card.
  • the traffic in order to represent the video traffic, and divide by the time, to get the video bit rate, this method can only get a rough value, and also need to constantly run the system, taking up more system resources.
  • the present invention provides a method for calculating a video bit rate
  • FIG. 1 shows a method for calculating a video bit rate according to a preferred embodiment of the present invention. flow chart.
  • Step S100 recording the current flow value of the video player when the video starts playing.
  • the current traffic value d1 of the video player APP is recorded.
  • the acquisition of the traffic value of the video player APP is already a mature technology, and will not be described here.
  • step S200 when the video playback occurs, the current traffic value of the video player is read, and the length of time currently played is recorded.
  • the playback time length position of the currently completed video is obtained, and the current traffic value d2 of the video player APP is read again;
  • Step S300 Calculate the video bit rate according to the current traffic value when the acquired video starts playing and the current traffic value when the video is played, and the length of time that has been played.
  • the current traffic value d1 when the video player APP starts playing the current traffic value d2 when the video player APP plays the card, and the length of time that the video player APP is played.
  • Position calculate the video bitrate rate according to the following formula:
  • the basic principle of the preferred embodiment 2 is implemented based on the above-mentioned preferred embodiment 1.
  • the calculation of the video bit rate is implemented when the video playback occurs, and the video search is performed. The following implementation steps are included:
  • the current traffic value d1 of the video player APP is recorded.
  • the acquisition of the traffic value of the video player APP is already a mature technology, and will not be described here.
  • the playing time of the currently completed video is obtained for a long position, and at this time, the current traffic value d2 of the video player APP is read again.
  • the time t of the video search needs to be calculated at this time.
  • the time of each video search is 5s, so in the case of fast forward, each video The search time t needs to be added by 5 s; in the case of fast rewind, the time t of each video search needs to be reduced by 5 s.
  • the calculation of the video bit rate is relatively simple, and specifically includes the following implementation method steps.
  • the preferred embodiment specifically includes the following method steps:
  • the current traffic value d1 of the current video player APP is obtained.
  • the acquisition of the traffic value of the video player APP is mature technology, and is not described here.
  • the video playback duration is obtained, and the current traffic value d2 of the video player APP is acquired again.
  • the video bit rate can be calculated according to the following formula 3:
  • the video download code rate (cdn_speed) and the user measured bandwidth (download_speed) are combined, if the condition is met:
  • the video bit rate parameter is also needed to locate the video CDN, which is provided by the present invention.
  • the method of calculating the video bit rate can calculate the video bit rate more accurately and can be applied to multiple scenes.
  • FIG. 2 is a schematic structural block diagram of a preferred embodiment of a device for calculating a video bit rate according to the present invention.
  • the present invention provides an apparatus for calculating a video bit rate for calculating a video bit rate in video playback, including a memory 21, a processor 20, and being stored in the memory 21 and operable on the processor 20.
  • the computer program 22 can be partitioned into one or more modules/units that are stored in the memory 21 and executed by the processor 20 to complete the present invention.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing a particular function for describing the execution of the computer program 22 in the router configuration device.
  • the processor 20 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 21 may be an internal storage unit of the device for calculating a video bit rate, such as a hard disk or a memory of a device that calculates a video bit rate.
  • the memory 21 may also be an external storage device of the device for calculating a video bit rate, for example, a plug-in hard disk equipped with a device for calculating a video bit rate, a smart memory card (SMC), and a secure digital device. (Secure Digital, SD) card, flash card, etc.
  • the memory 21 may also include both an internal storage unit of the device for calculating a video bit rate and an external storage device.
  • the memory 21 is for storing the computer program and other programs and data required by the device for calculating a video bit rate.
  • the memory 21 can also be used to temporarily store data that has been output or is about to be output.
  • the present invention also provides a storage medium, which is a computer readable storage medium, the storage medium storing a program for calculating a video bit rate, and the program for calculating a video bit rate is implemented by the processor to implement the above calculated video bit rate. The steps of the method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Databases & Information Systems (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

提供一种计算视频码率的方法、装置及存储介质,用于在视频码率计算中,提高准确率并且减少系统资源的使用。本发明通过记录视频开始播放的时候视频播放器的当前流量数值,视频播放停顿的时候视频播放器的当前流量数值,并结合视频播放器当前已播放完成的时间长度来计算视频码率。本发明大大提高了计算视频码率的准确率,同时,由于避免了视频播放器在播放中间读取和监测与播放无关的数据,减少了对系统资源的使用及对CPU的占用。利用本发明所提供的视频码率计算方法得出的视频码率,在网络视频播放卡顿的问题定位中,还可以有效地区分是带宽原因还是视频CDN原因。

Description

一种计算视频码率的方法、装置及存储介质 技术领域
涉及一种视频在线播放技术,尤其涉及一种计算视频码率的方法、装置及存储介质。
背景技术
随着网络技术的发展,在线观看各种网络视频已经成为人们娱乐和获取资讯的重要方式。但在视频播放过程中,经常会遇到视频卡顿现象,视频卡顿已成为最为常见的一个问题,这很影响人们的用户体验。造成视频卡顿的原因有很多种,比如带宽问题,电脑运行速度问题等等,但根据对收集的数据整理分析,发现视频CDN(Content Delivery Network)的问题是造成视频卡顿的主要原因之一。
CDN(Content Delivery Network),即是内容分发网络,通过在网络各处放置节点服务器构成在现有互联网基础上的智能虚拟网络,使访客就近取得服务器上所需内容,有效解决网络拥挤等问题。视频是互联网中最耗带宽的传输形式,由此,视频网站对带宽的需求是非常高的,但一台服务器能够承受的访问量、能够提供支撑的带宽是有限的,因而,视频网站必须使用CDN对视频服务器进行分流减负。视频CDN有效的运行,必需搜集相关节点的负载及健康状态,就需要知道各用户系统的视频的码率情况。同时判断和定位视频CDN问题,也需要用户系统的视频码率。
现有的方法通常是采用网络流量监控的方式,但这种方法需要在后台不停监控,对于内存和CPU资源是很大的开销。
另外还有一种计算视频码率的做法,通过网卡抓包,计算系统层面的流量,以此来代表视频的流量,再除以时间,得出视频的码率,这种方法只能得到一个大概的数值,并且需要系统不断运行,也需要占用比较多的系统资源。
因此,现有技术还有待于改进和发展。
发明内容
鉴于上述现有技术的不足之处,本发明为解决现有技术缺陷和不足,提供一种计算视频码率的方法,通过获取视频播放器播放开始时和视频播放器播放停顿后的视频流量数值的差值,再除以播放已消耗的时间长度来获取视频的码率,避免了视频播放器在播放过程中不断去获取相关参数,占用系统资源,也提高了视频码率的精确度。
本发明解决技术问题所采用的技术方案如下:
一种计算视频码率的方法,用于在视频码率计算中,提高准确率并且减少系统资源的使用,包括如下步骤:
A、记录视频开始播放时视频播放器的当前流量数值;
B、视频播放卡顿时读取所述视频播放器的当前流量数值,并记录当前已完成的播放时间长度;
C、根据所获取的视频开始播放时的当前流量数值和视频播放卡顿时的当前流量数值,结合所述已完成的播放时间长度计算视频码率。
作为进一步的改进技术方案,上述步骤中,所述步骤B中当视频播放出现卡顿的时候,在有视频搜索的情况下,除读取所述视频播放器的流量数值、记录当前已完成的播放时间长度外,还需要计算视频搜索的时间长度。
作为进一步的改进技术方案,上述步骤中,所述步骤C中结合所述已完成的播放时间长度计算视频码率具体为:视频码率等于所述视频播放卡顿时读取所述视频播放器的当前流量数值与所述视频开始播放时视频播放器的当前流量数值之差除以所述已完成的播放时间长度。
作为进一步的改进技术方案,上述步骤中,当视频播放出现卡顿的时候,在有视频搜索的情况下,视频播放器所完成的视频播放的流量的耗时为当前已完成的播放时间长度减去所述视频搜索的时间长度。
作为进一步的改进技术方案,上述步骤中,每次视频搜索的时间为5秒。
作为进一步的改进技术方案,上述步骤中,在快进的情况下,每次视频搜索的时间加5秒。
作为进一步的改进技术方案,上述步骤中,在快退的情况下,每次视频搜索的时间减5秒。
作为进一步的改进技术方案,还包括如下步骤,当视频播放器没有检测到卡 顿时,需等待视频播放完毕才获取所述视频播放器的当前流量数值,已完成的播放时间长度为视频播放时长。
作为进一步的改进技术方案,上述步骤中,所述视频码率为:所述视频码率为:视频播放卡顿的时候记录的视频播放器的当前流量数值与视频开始播放的时候记录的视频播放器的当前流量数值之差除以视频已完成的播放时间长度与视频搜索的时间长度之差。
作为进一步的改进技术方案,上述步骤中,当视频播放器没有检测到卡顿时,所述视频码率为:视频播放结束的时候记录的视频播放器的当前流量数值与视频开始播放的时候记录的视频播放器的当前流量数值之差除以视频播放时长。
作为进一步的改进技术方案,上述步骤中,步骤C之后还包括步骤:
D、根据计算出的视频码率判断视频卡顿原因。
作为进一步的改进技术方案,上述步骤中,步骤D具体包括:
获取计算出的视频码率;
获取视频下载码率和用户实测带宽;
将所述视频下载码率、所述用户实测带宽、所述视频码率进行比较,判断视频卡顿原因。
作为进一步的改进技术方案,上述步骤中,当所述用户实测带宽大于所述视频码率大于所述视频下载码率时,判断视频卡端原因是由视频CDN的问题造成的。
本发明还提供一种计算视频码率的装置,用于在视频播放中视频码率的计算,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述的计算视频码率的方法步骤。
本发明还提供一种存储介质,所述存储介质存储有计算视频码率的程序,该计算视频码率的程序被处理器执行时实现上述的计算视频码率的方法的步骤。
与现有技术需要系统在后台不停运行,从而需较多的占用内存和CPU等系统资源,同时所得到的视频码率精确度不高相比较,本发明通过获取视频播放器播放开始时的视频流量数值、视频播放器播放停顿后的视频流量数值、以及视频播放器播放停顿时已完成播放所耗时间长度,来计算获取视频的码率,避免了视 频播放器在播放过程中因为不断去读取相关参数,占用内存和CPU等系统资源,而影响系统运行速度,同时也大幅提高了视频码率的精确度。
附图说明
下面结合附图对本发明的具体实施方式作进一步的说明,其中:
图1是本发明一种计算视频码率的方法优选实施例一的流程图。
图2是本发明一种计算视频码率的装置优选实施例的原理结构框图。
具体实施方式
为使本发明的目的、技术方案及优点更加清楚、明确,以下参照附图并举实施例对本发明进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
CDN的全称是Content Delivery Network,即内容分发网络。其基本思路是尽可能避开互联网上有可能影响数据传输速度和稳定性的瓶颈和环节,使内容传输的更快、更稳定。通过在网络各处放置节点服务器所构成的在现有的互联网基础之上的一层智能虚拟网络,CDN系统能够实时地根据网络流量和各节点的连接、负载状况以及到用户的距离和响应时间等综合信息将用户的请求重新导向离用户最近的服务节点上。其目的是使用户可就近取得所需内容,解决Internet网络拥挤的状况,提高用户访问网站的响应速度。简单地说,内容分发网络(CDN)是一个策略性部署的整体系统,包括分布式存储、负载均衡、网络请求的重定向和内容管理4个要件,而内容管理和全局的网络流量管理(Traffic Management)是CDN的核心所在。通过用户就近性和服务器负载的判断,CDN确保内容以一种极为高效的方式为用户的请求提供服务。CDN对服务器负载的判断和对全局的网络流量管理(Traffic Management),必然就涉及到对各用户的实际码率情况的了解。对用户系统的实际码率的实时掌握就成为了必需。
视频是互联网中最耗带宽的传输形式,因此,视频网站对视频服务器带宽的需求是非常高的,一台服务器能够承受的访问量、能够提供支撑的带宽是有限的,于是视频CDN得到了广泛的使用。
视频CDN一般是由缓存服务器与内容分发服务器两种服务器构成。缓存服务器(CDN节点)分布于世界各地,通过策略存储相关的视频内容;内容分发 服务器则是将视频服务器上的视频内容根据一定策略分发到各个缓存服务器上。为使视频CDN系统能够正常作用,实时地根据网络流量和各节点的连接、负载状况以及到用户的距离和响应时间等综合信息将用户的请求重新导向离用户最近的服务节点上,就需要有准确的用户的实时视频的码率信息,定位和解决视频CDN问题也需要有准确的用户的实时视频的码率信息。
计算视频实时码率此前通常是采用网络流量监控的方式,但这种方法需要系统在后台不停监控,对于内存和CPU资源是一种比较大的开销,或者是通过网卡抓包,计算系统层面的流量,以此来代表视频的流量,再除以时间,得出视频的码率,这种方法只能得到一个大概的数值,并且也需要不断运行系统,占用较多的系统资源。
考虑到视频码率就是每秒钟所播放视频的流量的特点,本发明提供了一种计算视频码率的方法,图1所示是本发明一种计算视频码率的方法优选实施例一的流程图。
本发明优选实施例一:
步骤S100,记录视频开始播放时视频播放器的当前流量数值。在视频开始播放的时候,记录视频播放器APP的当前流量数值d1,在android系统中,视频播放器APP的流量数值的获取已经是成熟技术,此处不赘述。
步骤S200,在视频播放出现卡顿的时候,读取所述视频播放器的当前流量数值,并记录当前已播放的时间长度。
在检测到视频卡顿的情况下,获取当前已完成的视频的播放时间长度position,此时再次读取所述视频播放器APP的当前流量数值d2;
步骤S300,根据所获取的视频开始播放时的当前流量数值和视频播放卡顿时的当前流量数值,结合已播放完成的所述时间长度计算视频码率。
具体而言,根据获取的所述视频播放器APP播放开始时的当前流量数值d1和所述视频播放器APP播放卡顿时的当前流量数值d2,以及所述视频播放器APP所播放完成的时间长度position,按以下公式一计算出视频码率rate:
rate=(d2–d1)/position    公式一
本发明优选实施例二:
本优选实施例二的基本原理是基于上述优选实施例一的基础上实现的,是在 视频播放出现卡顿的时候,以及进行视频搜索(seek)的情况下实现对视频码率的计算,具体包括如下实现方法步骤:
在视频开始播放的时候,记录视频播放器APP的当前流量数值d1,在android系统中,视频播放器APP的流量数值的获取已经是成熟技术,此处不赘述。
在检测到视频卡顿的情况下,获取当前已完成的视频的播放时间长position,此时再次读取所述视频播放器APP的当前流量数值d2。
在进行视频搜索(seek)的情况下,此时需要计算视频搜索(seek)的时间t,经过验证,每次视频搜索(seek)的时间为5s,所以在快进的情况下,每次视频搜索的时间t需要加5s;在快退的情况下,每次视频搜索的时间t需要减5s。
根据获取的所述视频播放器APP播放开始时的当前流量数值d1和所述视频播放器APP播放卡顿时的当前流量数值d2,所述视频播放器APP已播放完成的时间长度position,以及视频搜索(seek)的时间t,按以下公式二计算出视频码率rate:
rate=(d2–d1)/(position–t)    公式二
没有seek操作时,t=0。
本发明优选实施例三:
视频播放过程也存在不出现卡顿的情况,在未检测到卡顿的情况下,视频码率的计算相对简单,具体包括如下实现方法步骤。
由于视频播放器在播放视频的过程中会有预下载,在这种情况下,只能当视频播放完毕才能准确计算视频的码率。因此,本优选实施方式具体包括如下实现方法步骤:
在视频播放开始时,获取当前视频播放器APP的当前流量数值d1,在android系统中,视频播放器APP的流量数值的获取已经时成熟技术,此处不赘述。
当视频播放结束时,获取视频播放时长duration,同时再次获取视频播放器APP的当前流量数值d2。
根据获取的当前流量数值d1、d2和所播放完成的视频播放时长duration,按以下公式三可计算出视频码率rate:
rate=(d2–d1)/duration     公式三
根据以上计算视频码率的方法优选实施例,再结合视频下载码率 (cdn_speed)和用户实测带宽(download_speed),如果满足条件:
download_speed>rate>cdn_speed
就可以准确判断卡顿的原因主要是视频CDN的问题造成的,这在实际的卡顿诊断中具有很大的价值;同时片源码率也可以作为其他视频质量判断的一个重要参数。
在一些需要定位卡顿等问题的场景中,例如在网络感知中需要采集用户观看视频码率上报,以及在网络诊断中也需要视频码率参数来定位视频CDN的问题,通过本发明所提供的计算视频码率的方法,可以较为准确地计算出视频码率,能够适用于多个场景。
请参阅图2,图2为本发明一种计算视频码率的装置优选实施例原理结构框图。本发明提供的一种计算视频码率的装置,用于在视频播放中视频码率的计算,包括存储器21、处理器20以及存储在所述存储器21中并可在所述处理器20上运行的计算机程序22,所述处理器20执行所述计算机程序22时实现如上述各计算视频码率的方法优选实施例中的步骤。
示例性的,所述计算机程序22可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器21中,并由所述处理器20执行以完成本发明。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机程序指令段,该指令段用于描述所述计算机程序22在所述路由器配置装置中的执行过程。
所述处理器20可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器21可以是所述计算视频码率的装置的内部存储单元,例如计算视频码率的装置的硬盘或内存。所述存储器21也可以是所述计算视频码率的装置的外部存储设备,例如所述计算视频码率的装置上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash  Card)等。进一步地,所述存储器21还可以既包括所述计算视频码率的装置的内部存储单元也包括外部存储设备。所述存储器21用于存储所述计算机程序以及所述计算视频码率的装置所需的其他程序和数据。所述存储器21还可以用于暂时地存储已经输出或者将要输出的数据。
本发明还提供一种存储介质,存储介质为计算机可读存储介质,所述存储介质存储有计算视频码率的程序,该计算视频码率的程序被处理器执行时实现上述的计算视频码率的方法的步骤。
应当理解的是,以上所述仅为本发明的较佳实施例而已,并不足以限制本发明的技术方案,对本领域普通技术人员来说,在本发明的精神和原则之内,可以根据上述说明加以增减、替换、变换或改进,而所有这些增减、替换、变换或改进后的技术方案,都应属于本发明所附权利要求的保护范围。

Claims (15)

  1. 一种计算视频码率的方法,用于在视频播放中视频码率的计算,其特征在于,包括如下步骤:
    A、记录视频开始播放时视频播放器的当前流量数值;
    B、视频播放卡顿时读取所述视频播放器的当前流量数值,并记录当前已完成的播放时间长度;
    C、根据所获取的视频开始播放时的当前流量数值和视频播放卡顿时的当前流量数值,结合所述已完成的播放时间长度计算视频码率。
  2. 根据权利要求1所述的一种计算视频码率的方法,其特征在于,所述步骤C中结合所述已完成的播放时间长度计算视频码率具体为:视频码率等于所述视频播放卡顿时读取所述视频播放器的当前流量数值与所述视频开始播放时视频播放器的当前流量数值之差除以所述已完成的播放时间长度。
  3. 根据权利要求1所述的一种计算视频码率的方法,其特征在于,所述步骤B中当视频播放出现卡顿的时候,在有视频搜索的情况下,除读取所述视频播放器的流量数值、记录当前已完成的播放时间长度外,还需要计算视频搜索的时间长度。
  4. 根据权利要求3所述的一种计算视频码率的方法,其特征在于,当视频播放出现卡顿的时候,在有视频搜索的情况下,视频播放器所完成的视频播放的流量的耗时为当前已完成的播放时间长度减去所述视频搜索的时间长度。
  5. 根据权利要求3所述的一种计算视频码率的方法,其特征在于,每次视频搜索的时间为5秒。
  6. 根据权利要求5所述的一种计算视频码率的方法,其特征在于,在快进的情况下,每次视频搜索的时间加5秒。
  7. 根据权利要求5所述的一种计算视频码率的方法,其特征在于,在快退的情况下,每次视频搜索的时间减5秒。
  8. 根据权利要求1所述的一种计算视频码率的方法,其特征在于,还包括如下步骤,当视频播放器没有检测到卡顿时,需等待视频播放完毕才获取所述视频播放器的当前流量数值,已完成的播放时间长度为视频播放时长。
  9. 根据权利要求3至7任一项所述的一种计算视频码率的方法,其特征在于,所述视频码率为:视频播放卡顿的时候记录的视频播放器的当前流量数值与 视频开始播放的时候记录的视频播放器的当前流量数值之差除以视频已完成的播放时间长度与视频搜索的时间长度之差。
  10. 根据权利要求8所述的一种计算视频码率的方法,其特征在于,当视频播放器没有检测到卡顿时,所述视频码率为:视频播放结束的时候记录的视频播放器的当前流量数值与视频开始播放的时候记录的视频播放器的当前流量数值之差除以视频播放时长。
  11. 根据权利要求1所述的一种计算视频码率的方法,其特征在于,所述步骤C之后还包括步骤:
    D、根据计算出的视频码率判断视频卡顿原因。
  12. 根据权利要求11所述的一种计算视频码率的方法,所述步骤D具体包括:
    获取计算出的视频码率;
    获取视频下载码率和用户实测带宽;
    将所述视频下载码率、所述用户实测带宽、所述视频码率进行比较,判断视频卡顿原因。
  13. 根据权利要求12所述的一种计算视频码率的方法,其特征在于,当所述用户实测带宽大于所述视频码率大于所述视频下载码率时,判断视频卡端原因是由视频CDN的问题造成的。
  14. 一种计算视频码率的装置,用于在视频播放中视频码率的计算,其特征在于,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1至13任一项所述的计算视频码率的方法步骤。
  15. 一种存储介质,其特征在于,所述存储介质存储有计算视频码率的程序,该计算视频码率的程序被处理器执行时实现权利要求1至13任一项所述计算视频码率的方法的步骤。
PCT/CN2019/080560 2018-03-30 2019-03-29 一种计算视频码率的方法、装置及存储介质 Ceased WO2019185048A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810292991.3 2018-03-30
CN201810292991.3A CN110324710A (zh) 2018-03-30 2018-03-30 一种计算视频码率的方法、装置及存储介质

Publications (1)

Publication Number Publication Date
WO2019185048A1 true WO2019185048A1 (zh) 2019-10-03

Family

ID=68060943

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/080560 Ceased WO2019185048A1 (zh) 2018-03-30 2019-03-29 一种计算视频码率的方法、装置及存储介质

Country Status (2)

Country Link
CN (1) CN110324710A (zh)
WO (1) WO2019185048A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110830809B (zh) * 2019-11-20 2021-12-07 咪咕动漫有限公司 视频内容热度确定方法、电子设备及存储介质
CN112637631B (zh) * 2020-12-17 2022-04-26 清华大学 码率确定方法、装置、电子设备和存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010067992A2 (en) * 2008-12-09 2010-06-17 Lg Electronics Inc. Method for receiving and displaying service guide in broadcast receiver
CN104333781A (zh) * 2014-10-31 2015-02-04 百视通网络电视技术发展有限责任公司 一种在cdn网络中预取直播节目信息的方法与设备
CN106911927A (zh) * 2015-12-23 2017-06-30 中国移动通信集团公司 评估网络视频用户体验质量的方法、装置和dpi设备
CN107529065A (zh) * 2017-08-31 2017-12-29 广州酷狗计算机科技有限公司 多媒体数据缓存方法、装置及计算机可读存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9020039B2 (en) * 2011-01-06 2015-04-28 Sonic Ip, Inc. Systems and methods for encoding alternative streams of video for use in adaptive bitrate streaming
CN102883193A (zh) * 2012-10-09 2013-01-16 乐视网信息技术(北京)股份有限公司 内容分发流量控制方法
CN103686346A (zh) * 2013-12-26 2014-03-26 乐视网信息技术(北京)股份有限公司 视频播放卡顿切换的方法和系统
CN105100876B (zh) * 2015-08-28 2019-04-12 北京奇艺世纪科技有限公司 一种流媒体的播放方法及装置
US10530825B2 (en) * 2016-06-01 2020-01-07 Amazon Technologies, Inc. Catching up to the live playhead in live streaming

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010067992A2 (en) * 2008-12-09 2010-06-17 Lg Electronics Inc. Method for receiving and displaying service guide in broadcast receiver
CN104333781A (zh) * 2014-10-31 2015-02-04 百视通网络电视技术发展有限责任公司 一种在cdn网络中预取直播节目信息的方法与设备
CN106911927A (zh) * 2015-12-23 2017-06-30 中国移动通信集团公司 评估网络视频用户体验质量的方法、装置和dpi设备
CN107529065A (zh) * 2017-08-31 2017-12-29 广州酷狗计算机科技有限公司 多媒体数据缓存方法、装置及计算机可读存储介质

Also Published As

Publication number Publication date
CN110324710A (zh) 2019-10-11

Similar Documents

Publication Publication Date Title
CN108966012B (zh) 一种视频播放速率确定方法、装置及电子设备
CN104486649B (zh) 视频内容评级方法及装置
WO2018076952A1 (zh) 一种视频文件的存储、定位播放方法及装置
JP5980430B2 (ja) コンピュータ・システムのためのデータ・キャッシュを管理するための方法、装置、コンピュータ・プログラム製品、およびコンピュータ・プログラム(コンピュータ・システムのためのデータ・キャッシュの管理)
CN101674492A (zh) 一种流媒体服务器性能测试方法及装置
CN106911927B (zh) 评估网络视频用户体验质量的方法、装置和dpi设备
CN109672936B (zh) 一种视频评估集的确定方法、装置及电子设备
US11743148B2 (en) Method for measuring end-to-end internet application performance
TWI629899B (zh) Method and device for evaluating quality of multimedia resources
CN111695962B (zh) 云产品推荐方法和装置、计算设备和存储介质
WO2017124800A1 (zh) 一种视频补录方法和装置
EP4211832B1 (en) Detecting a network-induced contribution to a quality of experience degradation
JP2017519406A (ja) ネットワークビデオ再生方法及び装置
CN105337891A (zh) 用于分布式缓存系统的流量控制方法和装置
WO2019185048A1 (zh) 一种计算视频码率的方法、装置及存储介质
JP6678167B2 (ja) 記憶デバイスに記憶されたデータに関連付けられたメディア情報を特定する方法及び装置
CN113903389A (zh) 一种慢盘检测方法、装置及计算机可读写存储介质
CN104104895B (zh) 对视频数据进行录像回放的方法及硬盘录像机
CN109992458A (zh) 一种upi带宽检测方法、装置、设备及可读存储介质
CN111565335B (zh) 视频质量评价方法、装置、计算机设备及存储介质
CN106899843B (zh) 一种视频业务质量评估方法及装置
KR101928410B1 (ko) 동영상 재생 트래킹 방법 및 컴퓨터 프로그램
CN114845164A (zh) 一种数据处理方法、装置及设备
CN113420182A (zh) 视频片头片尾识别方法、装置、电子设备及可读存储介质
CN115811483B (zh) 一种网络状态监测方法、装置、电子设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19778183

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19778183

Country of ref document: EP

Kind code of ref document: A1