-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathframes.Rmd
53 lines (41 loc) · 1.24 KB
/
frames.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
title: "5 min. Zoom Test Trace: Frames"
date: "`r Sys.Date()`"
output:
html_document:
df_print: paged
params:
input_file: "frames.csv"
fig_path: "fig/"
---
```{R setup, include=FALSE}
source("setup.R")
knitr::opts_chunk$set(dev = c("png", "pdf"), fig.width = 9, fig.height = 4.5,
fig.align = "center", fig.keep = "high", fig.path = params$fig_path)
timeval_to_ms <- function(s, us, off = 0) { (s - off) * 1000 + us / 1000 }
```
```{R import}
frames <- read_csv(params$input_file, col_types = "fcicinffnnnnniiinn")
```
```{r}
frames %>%
filter(media_type != 0) %>%
group_by(media_type, rtp_ext1) %>%
summarize(n = n(), .groups='drop')
```
```{r}
video <- frames %>% filter(media_type == 16)
video %<>%
mutate(min_ts_ms = timeval_to_ms(min_ts_s, min_ts_us, video$min_ts_s %>% min())) %>%
mutate(max_ts_ms = timeval_to_ms(max_ts_s, max_ts_us, video$min_ts_s %>% min())) %>%
select(-c(min_ts_s, min_ts_us, max_ts_s, max_ts_us))
```
```{r video-fps, fig.width = 5.2, fig.height = 2.0}
video %>% filter(pkts_seen == pkts_hint) %>%
arrange(max_ts_ms) %>%
mutate(max_ts_s = max_ts_ms / 1000) %>%
ggplot(aes(x=max_ts_s, y=fps)) +
labs(x="Time [s]", y="Frame Rate [fps]") +
geom_line(color="steelblue4") +
theme_om()
```