srs/trunk/research/players
OSSRS-AI bfb91f9b82
AI: WebRTC: Support G.711 (PCMU/PCMA) audio codec for WebRTC. v7.0.124 (#4075) (#4568)
This PR adds G.711 (PCMU/PCMA) audio codec support for WebRTC in SRS,
enabling relay-only streaming of G.711 audio between WebRTC clients via
WHIP/WHEP. G.711 is a widely-used, royalty-free audio codec with
excellent compatibility across VoIP systems, IP cameras, and legacy
telephony equipment.

Fixes #4075

Many IP cameras, VoIP systems, and IoT devices use G.711 (PCMU/PCMA) as
their default audio codec. Previously, SRS only supported Opus for
WebRTC audio, requiring transcoding or rejecting G.711 streams entirely.
This PR enables direct relay of G.711 audio streams in WebRTC, similar
to how VP9/AV1 video codecs are supported.

Enhanced WHIP/WHEP players with URL-based codec selection:
```
# Audio codec only
http://localhost:8080/players/whip.html?acodec=pcmu
http://localhost:8080/players/whip.html?acodec=pcma

# Video + audio codecs
http://localhost:8080/players/whip.html?vcodec=vp9&acodec=pcmu
http://localhost:8080/players/whep.html?vcodec=h264&acodec=pcma

# Backward compatible (codec = vcodec)
http://localhost:8080/players/whip.html?codec=vp9
```

Testing

```bash
# Build and run unit tests
cd trunk
make utest -j && ./objs/srs_utest

# Test with WHIP player
# 1. Start SRS server
./objs/srs -c conf/rtc.conf

# 2. Open WHIP publisher with PCMU audio
http://localhost:8080/players/whip.html?acodec=pcmu

# 3. Open WHEP player to receive stream
http://localhost:8080/players/whep.html
```

## Related Issues

- Fixes #4075 - WebRTC G.711A Audio Codec Support
- Related to #4548 - VP9 codec support (similar relay-only pattern)
2025-11-09 12:08:03 -05:00
..
css remove the wizard control, too complex 2013-12-22 19:51:07 +08:00
img add fullscreen event and rescale 2013-12-21 01:04:29 +08:00
js AI: WebRTC: Support G.711 (PCMU/PCMA) audio codec for WebRTC. v7.0.124 (#4075) (#4568) 2025-11-09 12:08:03 -05:00
api-server_index.html Upgrade jquery from 1.10.2 to 1.12.2 (#3571) 2023-06-30 06:28:10 +08:00
crossdomain.xml add crossdomain.xml 2013-12-18 14:30:48 +08:00
index.html Upgrade jquery from 1.10.2 to 1.12.2 (#3571) 2023-06-30 06:28:10 +08:00
nginx_index.html refine the demo pages, move scripts after body. 2015-08-20 15:19:43 +08:00
rtc_player.html AI: Remove deprecated SrsRtcPublisherAsync and SrsRtcPlayerAsync use WHIP/WHEP. 2025-10-26 10:00:05 -04:00
rtc_publisher.html AI: Remove deprecated SrsRtcPublisherAsync and SrsRtcPlayerAsync use WHIP/WHEP. 2025-10-26 10:00:05 -04:00
srs_bwt.html Player: Fix empty img tag occupy 20px size in safari. v6.0.142 (#4029) 2024-07-24 11:20:56 +08:00
srs_chat.html Player: Fix empty img tag occupy 20px size in safari. v6.0.142 (#4029) 2024-07-24 11:20:56 +08:00
srs_gb28181.html AI: Remove deprecated SrsRtcPublisherAsync and SrsRtcPlayerAsync use WHIP/WHEP. 2025-10-26 10:00:05 -04:00
srs_player_deprecated.html Player: Fix empty img tag occupy 20px size in safari. v6.0.142 (#4029) 2024-07-24 11:20:56 +08:00
srs_player.html Player: Fix empty img tag occupy 20px size in safari. v6.0.142 (#4029) 2024-07-24 11:20:56 +08:00
srs_publisher_flash.html Player: Fix empty img tag occupy 20px size in safari. v6.0.142 (#4029) 2024-07-24 11:20:56 +08:00
srs_publisher.html Player: Fix empty img tag occupy 20px size in safari. v6.0.142 (#4029) 2024-07-24 11:20:56 +08:00
srs-http-server_index.html Upgrade jquery from 1.10.2 to 1.12.2 (#3571) 2023-06-30 06:28:10 +08:00
vlc.html Player: Fix empty img tag occupy 20px size in safari. v6.0.142 (#4029) 2024-07-24 11:20:56 +08:00
whep.html AI: WebRTC: Support G.711 (PCMU/PCMA) audio codec for WebRTC. v7.0.124 (#4075) (#4568) 2025-11-09 12:08:03 -05:00
whip.html AI: WebRTC: Support G.711 (PCMU/PCMA) audio codec for WebRTC. v7.0.124 (#4075) (#4568) 2025-11-09 12:08:03 -05:00