Open HunterTang opened 1 year ago
When pushing an AAC mono stream, FFmpeg recognizes it as a mono stream, but SRS mistakenly recognizes it as a stereo stream. This seems to be an error in SRS, possibly related to metadata parsing, which causes flv.js to be unable to play the stream due to incorrect audio channel information.
Description
There is an older system with a Chrome kernel (compatible with XP) that can only recognize mono audio streams. A mono audio stream was pushed to SRS, and when using flv.js to play the FLV stream, it could not be played. The backend showed that it was recognized as stereo. Currently, this issue is temporarily resolved by using libmp3lame for transcoding.
2.1 Transcoding test with FFMPEG Push to SRS after transcoding with FFMPEG (version 4.4), the ffmpeg command is as follows:
ffmpeg -i rtmp://127.0.0.1/live/livestream -vn -ac 1 -ar 22050 -c:a libfdk_aac -f flv rtmp://IP/live/livestream
FFmpeg prints the following information:
Using ffprob to view the stream information, it correctly recognizes mono:
The following stream information is received through the SRS backend web page:
2.2 Pushing mono stream directly with OBS Pushing a mono audio stream directly to SRS with OBS, the stream information in ffporb is as follows:
The following stream information is received through the SRS backend web page:
SRS version:
SRS configuration file:
Replay
Push a mono audio stream to SRS with OBS, and then view the received stream information on the SRS backend page. You can also preview and view the playback log in the console, which will show that the received audio stream is mp4a 40.5 instead of mp4a 40.2.
Expect
Correctly recognize mono audio streams.