mirror of
https://github.com/ossrs/srs.git
synced 2025-11-23 19:34:05 +08:00
**Introduce** This pull request builds upon the foundation laid in https://github.com/ossrs/srs/pull/4289 . While the previous work solely implemented unidirectional HEVC support from RTMP to RTC, this submission further enhances it by introducing support for the RTC to RTMP direction. **Usage** Launch SRS with `rtc2rtmp.conf` ```bash ./objs/srs -c conf/rtc2rtmp.conf ``` **Push with WebRTC** Upgrade browser to Chrome(136+) or Safari(18+), then open [WHIP encoder](http://localhost:8080/players/whip.html?schema=http&&codec=hevc), push stream with URL that enables HEVC by query string `codec=hevc`: ```bash http://localhost:1985/rtc/v1/whip/?app=live&stream=livestream&codec=hevc ``` This query string `codec=hevc` is used to select the video codec, and generate lines in the answer SDP. ``` m=video 9 UDP/TLS/RTP/SAVPF 49 123 a=rtpmap:49 H265/90000 ``` The encoder log also show the codec: ``` Audio: opus, 48000HZ, channels: 2, pt: 111 Video: H265, 90000HZ, pt: 49 ``` **Play with RTMP** Play HEVC stream via RTMP. ```bash ffplay -i rtmp://localhost/live/livestream ``` You will see the codec in logs: ``` Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp Stream #0:1: Video: hevc (Main), yuv420p(tv, bt709), 320x240, 30 fps, 30 tbr, 1k tbn ``` You can also use [WHEP player](http://localhost:8080/players/whep.html?schema=http&&codec=hevc) to play the stream. Important refactor with AI: * [AI: Refactor packet cache for RTC frame builder.](b8ffa1630e) * [AI: Refactor the packet copy and free for SrsRtcFrameBuilder](f3487b45d7) * [AI: Refactor the frame detector for SrsRtcFrameBuilder](4ffc1526b9) * [AI: Refactor the packet_video_rtmp for SrsRtcFrameBuilder](81f6aef4ed) * [AI: Add utests for SrsCodecPayload.codec](61eb1c0bfc) * [AI: Add utests for VideoPacketCache in SrsRtcFrameBuilder.](fd25480dfa) * [AI: Add utests for VideoFrameDetector in SrsRtcFrameBuilder.](b4aa977bbd) * [AI: Add regression test for RTC2RTMP with HEVC.](5259a2aac3) --------- Co-authored-by: Jacob Su <suzp1984@gmail.com> Co-authored-by: winlin <winlinvip@gmail.com>
56 lines
997 B
Plaintext
56 lines
997 B
Plaintext
.idea/
|
|
/*.conf
|
|
/*.txt
|
|
/*.flv
|
|
/*.mp4
|
|
/doc/frozen*.flv
|
|
/doc/kungfupanda*.flv
|
|
/doc/time*.flv
|
|
/doc/source*.mp4
|
|
/html
|
|
/ide/srs_xcode/srs_xcode.xcodeproj/project.xcworkspace/xcshareddata/
|
|
/ide/srs_xcode/srs_xcode.xcodeproj/project.xcworkspace/xcuserdata/
|
|
/ide/srs_xcode/srs_xcode.xcodeproj/xcuserdata/
|
|
/research/aac/
|
|
/research/api-server/static-dir/mse
|
|
/research/api-server/static-dir/crossdomain.xml
|
|
/research/bat/
|
|
/research/big/
|
|
/research/bitch/
|
|
/research/bott/
|
|
/research/cgo/
|
|
/research/dns/
|
|
/research/empty/
|
|
/research/golang/golang
|
|
/research/golang/temp.flv
|
|
/research/librtmp/720p.h264.raw
|
|
/research/librtmp/test.h264
|
|
/research/licenser/
|
|
/research/players/fls_player/
|
|
/research/players/mic/
|
|
/research/proxy/
|
|
/research/redis-ocluster/
|
|
/research/rtmfp/
|
|
/research/snap/
|
|
/research/speex/
|
|
/test/
|
|
.DS_Store
|
|
./srs
|
|
*.dSYM/
|
|
*.gcov
|
|
*.gcno
|
|
*.ts
|
|
*.h264
|
|
*.264
|
|
/webrtc
|
|
/configure.sh
|
|
/janus
|
|
*.dump
|
|
bug
|
|
/research/thread-model/thread-local
|
|
*.gcp
|
|
*.svg
|
|
/3rdparty/st-srs/srs
|
|
/3rdparty/st-srs/.circleci
|
|
/test_detail.xml
|