## Summary Removes the deprecated `hls_acodec` and `hls_vcodec` configuration options and implements automatic codec detection for HLS streams, fixing issues with video-only streams incorrectly showing audio information. ## Problem - When streaming video-only content via RTMP, HLS output incorrectly contained audio track information due to hardcoded default codec settings - The static `hls_acodec` and `hls_vcodec` configurations were inflexible and caused compatibility issues with some players - Users had to manually configure `hls_acodec an` to fix video-only streams ## Solution - **Remove deprecated configs**: Eliminates `hls_acodec` and `hls_vcodec` configuration options entirely - **Dynamic codec detection**: HLS muxer now automatically detects and uses actual stream codecs in real-time - **Improved defaults**: Changes from hardcoded AAC/H.264 defaults to disabled state, letting actual stream content determine codec information - **Real-time codec switching**: Supports codec changes during streaming with proper logging ## Changes - Remove `get_hls_acodec()` and `get_hls_vcodec()` from SrsConfig - Update HLS muxer to use `latest_acodec_`/`latest_vcodec_` for codec detection - Add codec detection logic in `write_audio()` and `write_video()` methods - Remove deprecated config options from all configuration files - Add comprehensive unit tests for codec detection functionality Fixes #4223 --------- Co-authored-by: Haibo Chen <495810242@qq.com> Co-authored-by: OSSRS-AI <winlinam@gmail.com>
32 lines
686 B
Plaintext
32 lines
686 B
Plaintext
listen 1935;
|
|
max_connections 1000;
|
|
daemon off;
|
|
srs_log_tank console;
|
|
http_server {
|
|
enabled on;
|
|
listen 8080;
|
|
dir ./objs/nginx/html;
|
|
}
|
|
rtc_server {
|
|
enabled on;
|
|
listen 8000; # UDP port
|
|
# @see https://ossrs.io/lts/en-us/docs/v7/doc/webrtc#config-candidate
|
|
candidate $CANDIDATE;
|
|
}
|
|
vhost __defaultVhost__ {
|
|
http_remux {
|
|
enabled on;
|
|
mount [vhost]/[app]/[stream].flv;
|
|
}
|
|
hls {
|
|
enabled on;
|
|
}
|
|
rtc {
|
|
enabled on;
|
|
# @see https://ossrs.io/lts/en-us/docs/v7/doc/webrtc#rtmp-to-rtc
|
|
rtmp_to_rtc on;
|
|
# @see https://ossrs.io/lts/en-us/docs/v7/doc/webrtc#rtc-to-rtmp
|
|
rtc_to_rtmp on;
|
|
}
|
|
}
|