Skip to content

Commit

Permalink
fix compatibility with AVOID encoders (bluenviron/mediamtx#4183) (#688)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 authored Feb 1, 2025
1 parent 07039eb commit e963544
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
40 changes: 40 additions & 0 deletions pkg/format/format_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1194,6 +1194,46 @@ var casesFormat = []struct {
"TP-LINK/90000",
nil,
},
{
"audio aac from AVOIP (issue mediamtx/4183)",
"v=0\r\n" +
"o=- 1634883673031268 1 IN IP4 127.0.0.1\r\n" +
"s=H265 Video, streamed by the LIVE555 Media Server\r\n" +
"i=test.265\r\n" +
"t=0 0\r\n" +
"a=tool:LIVE555 Streaming Media v2016.10.11\r\n" +
"a=type:broadcast\r\n" +
"a=control:*\r\n" +
"a=range:npt=0-\r\n" +
"a=x-qt-text-nam:H.265 Video, streamed by the LIVE555 Media Server\r\n" +
"a=x-qt-text-inf:test.265\r\n" +
"m=audio 0 RTP/AVP 100\r\n" +
"a=rtpmap:100 mpeg4-generic/48000/2\r\n" +
"a=fmtp:100 streamtype=5; sizeLength=13; indexLength=3; indexDeltaLength=3; mode=AAC_hbr; config=1190\r\n" +
"a=control:track1\r\n",
&MPEG4Audio{
PayloadTyp: 100,
Config: &mpeg4audio.AudioSpecificConfig{
Type: 2,
SampleRate: 48000,
ChannelCount: 2,
},
SizeLength: 13,
IndexLength: 3,
IndexDeltaLength: 3,
},
100,
"mpeg4-generic/48000/2",
map[string]string{
"config": "1190",
"indexdeltalength": "3",
"indexlength": "3",
"mode": "AAC-hbr",
"profile-level-id": "1",
"sizelength": "13",
"streamtype": "5",
},
},
}

func TestUnmarshal(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/format/mpeg4_audio.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (f *MPEG4Audio) unmarshal(ctx *unmarshalContext) error {
}

case "mode":
if strings.ToLower(val) != "aac-hbr" {
if strings.ToLower(val) != "aac-hbr" && strings.ToLower(val) != "aac_hbr" {
return fmt.Errorf("unsupported AAC mode: %v", val)
}

Expand Down

0 comments on commit e963544

Please sign in to comment.