当前位置:网站首页>Implementation of code rate and frame rate statistics in easyplayer RTSP player
Implementation of code rate and frame rate statistics in easyplayer RTSP player
2022-06-24 06:26:00 【Tsingsee green rhino video】
EasyPlayer As an open and flexible video streaming media player , It has more than just video playback , Many functions can be rewritten or added code 、 Call the interface to get , For example, add watermark 、 Time statistics and other functions , It also includes bit rate 、 Statistics or display of resolution .
Because a user inquired about the statistics of code rate and resolution , So in this article, we put EasyPlayer To share the relevant code , After realizing Statistics , You can see the relevant information about the code rate and resolution in the upper left corner .
Rate statistics implementation code :
// Statistical code rate
if (frameinfo.type == 0x01)
{
struct timeval tv = {0,0};
gettimeofday(&tv, NULL);
unsigned int uiTimes = (tv.tv_sec*1000 + tv.tv_usec/1000) - (sinkParams.tv_bps.tv_sec*1000 + sinkParams.tv_bps.tv_usec/1000);
if (uiTimes > 0U)
{
sinkParams.video_bps = (float)(sinkParams.video_bps_total / (float)uiTimes * 8.0f);// / 1024.0f;
}
sinkParams.video_bps_total = (float)iFrameSize;
gettimeofday(&sinkParams.tv_bps, NULL);
}
else
{
sinkParams.video_bps_total += (float)iFrameSize;
}Frame rate statistics implementation code :
// Statistical frame rate
if (uiCurrTime - sinkParams.video_timestamp_total >= 2)
{
//if (sinkParams.fpsInSps==0)
{
sinkParams.video_fps = sinkParams.video_fps_total / (uiCurrTime - sinkParams.video_timestamp_total);
sinkParams.video_fps_total = 1;
}
sinkParams.video_timestamp_total = uiCurrTime;
}
else
{
//if (mediainfo.fpsInSps==0)
sinkParams.video_fps_total ++;
}expand
EasyPlayer The player series project uses high performance EasyRTSPClient Components , Its low delay control is in the leading position in the industry , Provides a very simple and easy to use SDK And API Interface , User pass API Call can be very fast to develop their own applications , Second development
边栏推荐
- SAP hum unbinds Hu from delivery order
- Introduction to QWidget attribute table in QT Designer
- What is the difference between level 1, level 2 and level 3 domain names? How to register domain names
- The gadgets developed by freshmen are popular. Netizen: my food is good
- How to record the domain name reliably? What are the consequences of not filing a domain name?
- Text classification and fine tuning using transformer Bert pre training model
- How is a Clickhouse query completed?
- Rhel8 series update image Yum source is Tencent cloud Yum source
- MySQL forgets root password cracking root password cracking all user passwords, shell script
- What are the common network protocols
猜你喜欢
![[fault announcement] one stored procedure brings down the entire database](/img/7c/e5adda73a077fe4b8f04b59d1e0e1e.jpg)
[fault announcement] one stored procedure brings down the entire database

Enter the software test pit!!! Software testing tools commonly used by software testers software recommendations

Manual for automatic testing and learning of anti stepping pits, one for each tester

One line of keyboard

The product layout is strengthened, the transformation of digital intelligence is accelerated, and FAW Toyota has hit 2022million annual sales

Solution to the 39th weekly game of acwing

Technology is a double-edged sword, which needs to be well kept

What is the difference between a white box test and a black box test

ServiceStack. Source code analysis of redis (connection and connection pool)

A cigarette of time to talk with you about how novices transform from functional testing to advanced automated testing
随机推荐
How to recover data by splicing database fragments
What is the difference between a white box test and a black box test
Nature Neuroscience: challenges and future directions of functional brain tissue characterization
MySQL forgets root password cracking root password cracking all user passwords, shell script
SQL server memory management on cloud
WordPress pill applet build applet from zero to one [pagoda panel environment installation]
Use of SAP QM inspection points
Easynvr is optimized when a large number of videos are not online or unstable due to streaming failure
TRTC applet custom message
Coding and codesign: make design and development easier
What are the common network protocols
Vscode1.58 version update record Previous + related article summary
Network review
Word cannot copy and paste processing method
[in depth sharing] Devops evolution path -- Realizing R & D digital transformation based on four vertical and four horizontal Devops system
The product layout is strengthened, the transformation of digital intelligence is accelerated, and FAW Toyota has hit 2022million annual sales
Project deployment for learning 3D visualization from scratch
Analysis of DDoS attack methods
How to register a domain name? What are the benefits of building a website?
Could not read username for xxxxx