Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
galene
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
galene
Commits
3e00bb42
Commit
3e00bb42
authored
Apr 25, 2021
by
Juliusz Chroboczek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
AV1 support.
parent
25b70bb7
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
80 additions
and
2 deletions
+80
-2
README
README
+3
-2
group/group.go
group/group.go
+8
-0
rtpconn/codec.go
rtpconn/codec.go
+69
-0
No files found.
README
View file @
3e00bb42
...
...
@@ -232,8 +232,9 @@ following fields are allowed:
Supported video codecs include:
- `"vp8"` (compatible with all supported browsers);
- `"vp9"` (better video quality than `"vp8"`, but incompatible with
older versions of Mac OS);
- `"vp9"` (better video quality, but incompatible with Safari);
- `"av1"` (even better video quality, only supported by some browsers,
recording is not supported);
- `"h264"` (incompatible with Debian, Ubuntu, and some Android devices,
recording is not supported).
...
...
group/group.go
View file @
3e00bb42
...
...
@@ -145,6 +145,12 @@ func codecFromName(name string) (webrtc.RTPCodecCapability, error) {
"profile-id=0"
,
nil
,
},
nil
case
"av1"
:
return
webrtc
.
RTPCodecCapability
{
"video/AV1X"
,
90000
,
0
,
""
,
nil
,
},
nil
case
"h264"
:
return
webrtc
.
RTPCodecCapability
{
"video/H264"
,
90000
,
0
,
...
...
@@ -186,6 +192,8 @@ func payloadType(codec webrtc.RTPCodecCapability) (webrtc.PayloadType, error) {
return
96
,
nil
case
"video/vp9"
:
return
98
,
nil
case
"video/av1x"
:
return
104
,
nil
case
"video/h264"
:
return
102
,
nil
case
"audio/opus"
:
...
...
rtpconn/codec.go
View file @
3e00bb42
...
...
@@ -43,6 +43,75 @@ func isKeyframe(codec string, packet *rtp.Packet) (bool, bool) {
return
(
vp9
.
Payload
[
0
]
&
0xC
)
==
0
,
true
}
return
(
vp9
.
Payload
[
0
]
&
0x6
)
==
0
,
true
}
else
if
strings
.
EqualFold
(
codec
,
"video/av1x"
)
{
if
len
(
packet
.
Payload
)
<
2
{
return
false
,
true
}
if
(
packet
.
Payload
[
0
]
&
0x88
)
!=
0x08
{
return
false
,
true
}
w
:=
(
packet
.
Payload
[
0
]
&
0x30
)
>>
4
getObu
:=
func
(
data
[]
byte
)
([]
byte
,
int
)
{
offset
:=
0
length
:=
0
for
{
if
len
(
data
)
<=
offset
{
return
nil
,
0
}
l
:=
data
[
offset
]
length
=
length
*
128
+
int
(
l
&
0x7f
)
offset
++
if
(
l
&
0x80
)
==
0
{
break
}
}
if
len
(
data
)
<
offset
+
length
{
return
nil
,
0
}
return
data
[
offset
:
offset
+
length
],
offset
+
length
}
var
obu1
,
obu2
[]
byte
if
w
==
1
{
obu1
=
packet
.
Payload
[
1
:
]
}
else
{
var
o
int
obu1
,
o
=
getObu
(
packet
.
Payload
[
1
:
])
if
len
(
obu1
)
==
0
{
return
false
,
false
}
if
w
==
2
{
obu2
=
packet
.
Payload
[
1
+
o
:
]
}
else
{
obu2
,
_
=
getObu
(
packet
.
Payload
[
1
+
o
:
])
}
}
if
len
(
obu1
)
<
1
{
return
false
,
false
}
header
:=
obu1
[
0
]
tpe
:=
(
header
&
0x38
)
>>
3
if
tpe
!=
1
{
return
false
,
true
}
if
w
==
1
{
return
false
,
false
}
if
len
(
obu2
)
<
1
{
return
false
,
false
}
header2
:=
obu2
[
0
]
tpe2
:=
(
header2
&
0x38
)
>>
3
if
tpe2
!=
6
{
return
false
,
false
}
if
len
(
obu2
)
<
2
{
return
false
,
false
}
if
(
obu2
[
1
]
&
0x80
)
!=
0
{
return
false
,
true
}
return
(
obu2
[
1
]
&
0x60
)
==
0
,
false
}
else
if
strings
.
EqualFold
(
codec
,
"video/h264"
)
{
if
len
(
packet
.
Payload
)
<
1
{
return
false
,
false
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment