Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
laurfb opened this issue Oct 27, 2024 · 4 comments · May be fixed by #4217
Open

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

laurfb opened this issue Oct 27, 2024 · 4 comments · May be fixed by #4217
Labels
EnglishNative This issue is conveyed exclusively in English.

Comments

@laurfb
Copy link
Contributor

laurfb commented Oct 27, 2024

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

@winlinvip winlinvip added the EnglishNative This issue is conveyed exclusively in English. label Oct 27, 2024
@laurfb laurfb changed the title Incorrect display of stream parameters in console page API - Incorrect display of stream AV parameters (left over restrictions from flv legacy specs) Oct 28, 2024
@duiniuluantanqin duiniuluantanqin linked a pull request Oct 30, 2024 that will close this issue
@duiniuluantanqin
Copy link
Member

duiniuluantanqin commented Oct 31, 2024

This PR(fix sample_rate error in statistic) is experimental and not recommended for merging into the main branch.
Many scenarios haven't been considered, such as the MP3 format. This would add a lot of code without much benefit.

Of course, if you don't need to consider more formats, you can merge it into your own branch. It is functional.

@laurfb
Copy link
Contributor Author

laurfb commented Oct 31, 2024

Hi.
Did some test with srt streams with aac, mp3 and ogg audio codecs.
The results:

srt/rtmp streams with aac audio, sampling 48000: statistics displayed for both, but with default 44100 sampling frequncy instead of 48000
display_srt_aac

srt/rtmp streams with mp3 audio, sampling 48000: statistics displayed only for rtmp, again with default 44100 sampling frequncy instead of 48000, only video for srt
display_srt_mp3

srt/rtmp streams with ogg audio, sampling 48000: the same, statistic displayed only for rtmp, default 44100 sampling frequncy displayed instead of 48000, only video for srt, audio detected as AAC
display_srt_ogg

Anyway, it's an (important) step ahead! :)
Thx!

regards,
Laur

@duiniuluantanqin
Copy link
Member

OK, I will recheck the SRT streaming

@duiniuluantanqin
Copy link
Member

image

I re-tested pushing rtmp and pushing srt with AAC@48000, shown as picture, it works well.
perhaps you made a mistake somewhere.

This PR does not currently support MP3 and OGG formats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
EnglishNative This issue is conveyed exclusively in English.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants