-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathVideoStreams.pm
More file actions
152 lines (133 loc) · 9.16 KB
/
VideoStreams.pm
File metadata and controls
152 lines (133 loc) · 9.16 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
package VideoStreams;
use strict;
use warnings FATAL => 'all';
use Exporter qw(import);
=pod
# https://en.wikipedia.org/wiki/Standard-definition_television
# https://www.adobe.com/devnet/adobe-media-server/articles/dynstream_live/popup.html
# https://en.wikipedia.org/wiki/ISDB-T_International
# https://en.wikipedia.org/wiki/Frame_rate
# https://en.wikipedia.org/wiki/List_of_broadcast_video_formats
# https://blog.forret.com/2006/09/27/hd-720p-1080i-and-1080p/
Framerate is highly subjective in digital formats, because there are
variable frame rates dictated by min- and max-frame rate.
=cut
our @EXPORT_OK = qw(avail_stream_res stream_keys);
our %stream_keys = (
'w' => 0,
'width' => 0,
'x' => 0,
'h' => 1,
'height' => 1,
'y' => 1,
'i' => 2,
'interlaced' => 2,
'audio' => 3,
'audio_bps' => 3,
'video' => 4,
'video_bps' => 4,
'stream' => 5,
'stream_bps' => 5,
'fps' => 6,
'frames' => 6,
'framerate' => 6,
);
our %avail_stream_res = (
# nicname w, h, interlaced, audio, vid bps, tt bps framerate
"sqvga-4:3" => [ 160, 120, 0, 16000, 32000, 48000, 30],
"sqvga-16:9" => [ 160, 90, 0, 16000, 32000, 48000, 30],
"qvga-4:3" => [ 320, 240, 0, 16000, 32000, 48000, 30],
"qvga-16:9" => [ 320, 180, 0, 16000, 32000, 48000, 30],
"qcif-48k-4:3" => [ 144, 108, 0, 16000, 32000, 48000, 30],
"qcif-48k-16:9" => [ 192, 108, 0, 16000, 32000, 48000, 30],
"qcif-96k-4:3" => [ 192, 144, 0, 16000, 80000, 96000, 30],
"qcif-96k-16:9" => [ 256, 144, 0, 16000, 80000, 96000, 30],
"cif" => [ 352, 288, 0, 32000, 268000, 300000, 30],
"cif-300k-4:3" => [ 288, 216, 0, 32000, 268000, 300000, 30],
"cif-300k-16:9" => [ 384, 216, 0, 32000, 268000, 300000, 30],
"cif-500k-4:3" => [ 320, 240, 0, 32000, 468000, 500000, 30],
"cif-500k-16:9" => [ 384, 216, 0, 32000, 468000, 500000, 30],
"d1-800k-4:3" => [ 640, 480, 0, 32000, 768000, 800000, 30],
"d1-800k-16:9" => [ 852, 480, 0, 32000, 768000, 800000, 30],
"d1-1200k-4:3" => [ 640, 480, 0, 32000, 1168000, 1200000, 30],
"d1-1200k-16:9" => [ 852, 480, 0, 32000, 1168000, 1200000, 30],
"hd-1800k-16:9" => [ 1280, 720, 0, 64000, 1736000, 1800000, 59.94],
"hd-2400k-16:9" => [ 1280, 720, 0, 64000, 2272000, 2336000, 59.94],
"108p4:3" => [ 144, 108, 0, 16000, 32000, 48000, 30],
"144p16:9" => [ 192, 144, 0, 16000, 80000, 96000, 30],
"216p4:3" => [ 288, 216, 0, 32000, 268000, 300000, 30],
"216p16:9" => [ 384, 216, 0, 32000, 268000, 300000, 30],
"240p4:3" => [ 320, 240, 0, 32000, 468000, 500000, 30],
"360p4:3" => [ 480, 360, 0, 32000, 768000, 800000, 30],
"480i4:3" => [ 640, 480, 1, 32000, 768000, 800000, 30],
"480p4:3" => [ 640, 480, 0, 32000, 768000, 800000, 30],
"480p16:9" => [ 852, 480, 0, 32000, 1168000, 1200000, 30],
# unadopted standard
#"720i" => [ 1280, 720, 1, 64000, 1736000, 1800000, 30],
# 0.92 megapixels, 2.76MB per frame
"720p" => [ 1280, 720, 0, 64000, 1736000, 1800000, 59.94],
# https://support.google.com/youtube/answer/1722171?hl=en
# h.264 stream rates, SDR quality
"yt-sdr-360p30" => [ 640, 360, 0, 128000, 1000000, 1128000, 30],
"yt-sdr-480p30" => [ 852, 480, 0, 128000, 2500000, 2628000, 30],
"yt-sdr-720p30" => [ 1280, 720, 0, 384000, 5000000, 5384000, 30],
"yt-sdr-1080p30" => [ 1920, 1080, 0, 384000, 8000000, 8384000, 30],
"yt-sdr-1440p30" => [ 2560, 1440, 0, 512000, 16000000, 16512000, 30],
"yt-sdr-2160p30" => [ 3840, 2160, 0, 512000, 40000000, 40512000, 30],
"yt-sdr-360p60" => [ 640, 360, 0, 128000, 1500000, 1628000, 60],
"yt-sdr-480p60" => [ 852, 480, 0, 128000, 4000000, 4128000, 60],
"yt-sdr-720p60" => [ 1280, 720, 0, 384000, 7500000, 7884000, 60],
"yt-sdr-1080p60" => [ 1920, 1080, 0, 384000, 12000000, 12384000, 60],
"yt-sdr-1440p60" => [ 2560, 1440, 0, 512000, 24000000, 24512000, 60],
"yt-sdr-2160p60" => [ 3840, 2160, 0, 512000, 61000000, 61512000, 60],
#"yt-hdr-360p60" => [ 1280, 720, 0, 32000, 1000000, 1800000, 60], # yt unsupported
#"yt-hdr-480p60" => [ 1280, 720, 0, 32000, 1000000, 1800000, 60], # yt unsupported
"yt-hdr-720p30" => [ 1280, 720, 0, 384000, 6500000, 6884000, 30],
"yt-hdr-1080p30" => [ 1920, 1080, 0, 384000, 10000000, 10384000, 30],
"yt-hdr-1440p30" => [ 2560, 1440, 0, 512000, 20000000, 20512000, 30],
"yt-hdr-2160p30" => [ 3840, 2160, 0, 512000, 50000000, 50512000, 30],
"yt-hdr-720p60" => [ 1280, 720, 0, 384000, 9500000, 9884000, 60],
"yt-hdr-1080p60" => [ 1920, 1080, 0, 384000, 15000000, 15384000, 60],
"yt-hdr-1440p60" => [ 2560, 1440, 0, 512000, 30000000, 30512000, 60],
"yt-hdr-2160p60" => [ 3840, 2160, 0, 512000, 75500000, 76012000, 60],
"raw720p30" => [ 1280, 720, 0, 64000, 221120000, 221184000, 30],
"raw720p60" => [ 1280, 720, 0, 64000, 442304000, 442368000, 60],
# frame size 6.2MB
# 1080i60 1920x1080 186MBps
"raw1080i" => [ 1920, 540, 1, 128000, 1486384000, 1486512000, 59.94],
"raw1080i30" => [ 1920, 540, 1, 128000, 1487872000, 1488000000, 30],
"raw1080i60" => [ 1920, 540, 1, 128000, 1487872000, 1488000000, 60],
# 1080p60 1920x1080 373MBps, 6.2Mbps frame size
"raw1080p" => [ 1920, 1080, 0, 128000, 2975872000, 2976000000, 60],
# Skype requirements below as listed on https://support.skype.com/en/faq/FA1417/how-much-bandwidth-does-skype-need
# ^--- indicates there is a minimum TX requirement for stations
# group calls range from 128k up to 512k up, roughly HQ-recommended, maybe 1280x720x15
# https://www.quora.com/Does-Skype-support-1080p-HD-video-calls
# https://tomtalks.blog/2018/04/set-skype-for-business-to-record-meetings-at-1080p-and-30-fps/
# Transmission quality is fundamentally different than YouTube -- it is constant TX that varies by
# the amount of compression available. Variation between minimum required bandwidth and recommended
# bandwidth is visible in packet captures.
# Actual capture resolutions depend on your camera and can be manipulated via settings, esp frame rate:
# https://superuser.com/questions/180690/how-to-reduce-the-skype-video-settings-to-work-with-an-older-computer
# https://lifehacker.com/how-to-get-better-quality-out-of-your-video-chats-5836186
# https://docs.microsoft.com/en-us/skypeforbusiness/plan-your-deployment/clients-and-devices/video-resolutions
# ^--- This outlines a requirements for 4 core processors as requirement for Skype at 720p!
# Jed is roughly interpolating many of these values for this table
# nicname w, h, interlaced, audio, vid bps, tt bps framerate
"skype-vox-min" => [ 0, 0, 0, 30000, 0, 30000, 0 ],
"skype-vox-rcmd" => [ 0, 0, 0, 100000, 0, 100000, 0 ],
# screen sharing falls into min requirement
"skype-vid-min" => [ 424, 240, 0, 30000, 98000, 128000, 15 ],
"skype-vid-rcmd" => [ 640, 360, 0, 100000, 200000, 300000, 30 ],
"skype-vid-hq-min" => [ 960, 540, 0, 100000, 300000, 400000, 15 ],
"skype-vid-hq-rcmd" => [ 1280, 720, 0, 100000, 400000, 500000, 30 ],
"skype-vid-hd-min" => [ 1920, 1080, 0, 100000, 1100000, 1200000, 15 ],
"skype-vid-hd-rcmd" => [ 1920, 1080, 0, 100000, 1400000, 1500000, 30 ],
"skype-vid-grp3-min" => [ 640, 480, 0, 30000, 482000, 512000, 15 ],
"skype-vid-grp3-rcmd" => [ 1280, 720, 0, 100000, 900000, 2000000, 15 ],
"skype-vid-grp5-min" => [ 640, 360, 0, 30000, 1700000, 2000000, 15 ],
"skype-vid-grp5-rcmd" => [ 1280, 720, 0, 100000, 3700000, 4000000, 15 ],
"skype-vid-grp7-min" => [ 640, 360, 0, 30000, 3700000, 4000000, 15 ],
"skype-vid-grp7-rcmd" => [ 1280, 720, 0, 100000, 7700000, 8000000, 15 ],
);
1;