srs icon indicating copy to clipboard operation
srs copied to clipboard

API - Incorrect display of stream AV parameters (left over restrictions from flv legacy specs)

Open laurfb opened this issue 1 year ago • 4 comments

In Stream (console) page srs report always 44100 as sampling frequency for audio regardless of real value. At the moment srs can manage/recognize only four sampling frequency (5512, 11025, 22050, 44100). Any other sampling feequency, apart from the four mentioned, are displayed as 44100.

Version srs docker v6.x/5.x

To Reproduce push some rtmp stream to srs (OBS/ffmpeg, etc,) like:

ffmpeg -re -i input.mp4 -c:v libx264 -profile:v high -preset:v ultrafast -b:v 8M -c:a aac -ar 48000 -ac 2 -b:a 256k -f flv rtmp://192.168.1.1:1935/live/test

or with any other sampling frequency (48000, 96000, whatever)

Checking outputed stream with ffmpeg/ffprobe/ffplay we got corectly the expected audio sampling frequency: 48000 96000

but srs always display 44100 srs_report

Expected behavior Display real (detected) value (48000, 96000...).

Additional context Related to this issue: srs doen't display any info about received streams if "srt_to_rtmp" option is set to "off". If "srt_to_rtmp" is set to "on" srs display altered info for video and always "44100" as sampling frequency for audio regardless real input values. sshot-351

Don't know in this case if this is the expected behavior (no info if "srt_to_rtmp" is set to "off")

To Reproduce Push srt stream to srs:

ffmpeg -re -i input.mp4 -c:v libx264 -profile:v high -preset:v ultrafast -b:v 8M -c:a aac -ar 48000 -ac 2 -b:a 256k -f mpegts srt://192.168.1.1:10080?streamid=#!::r=live/test,m=publish

Check output stream data with:

ffplay srt://192.168.1.1:10080?streamid=#!::r=live/test,m=request or with ffprobe srt://192.168.1.1:10080?streamid=#!::r=live/test,m=request

and compare with info reported by srs

regards, Laur

laurfb avatar Oct 27 '24 17:10 laurfb