ossrs/srs

The statistics module returns the resolution of the video.

haofz opened this issue · 4 comments

haofz commented

Question: I have tried streaming with OBS and SRS publishers, but the video resolution parsed by codec.video_avc_demux() is inaccurate (tried several times with SRS 2.0, all resolutions are larger than the actual resolution, while SRS 1.0 shows 0x0).

Log (SRS 2.0): [2015-08-28 11:38:19.753][trace][2823][117] start publish mr=0/350, p1stpt=20000, pnt=20000, tcp_nodelay=0, rtcid=120
[2015-08-28 11:38:21.074][trace][2823][117] got metadata, width=854, height=480
[2015-08-28 11:38:21.166][trace][2823][117] 46B video sh, codec(7, profile=Main, level=5.1, 1280x640, 0kbps, 0fps, 0s)
Note: The original video resolution is 854x480, but the resolution parsed by the codec is 1280x640.

Additionally, the statistic module (SrsStatisticStream) does not include the video resolution. Can this be considered?

TRANS_BY_GPT3

This seems to have a bug, but I'm not sure how to parse the width and height from the 264 raw bitstream.

TRANS_BY_GPT3

srs will not change the resolution of the video. The video resolution is written in the sequence header, which is generated by the encoder. Srs will not modify this value. I have always used OBS for streaming, and VLC and other players can play it normally. The resolution in the metadata is useless for the decoder, and only the value in the sequence header is considered.

TRANS_BY_GPT3

Analyzing the resolution issue, Jie is more knowledgeable about it. He said there is no problem, so I will close it.
Regarding the resolution returned by the statistics module, I have changed the title and included it in SRS3 for support.

TRANS_BY_GPT3

Fixed