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

Can't play video when player starts after publisher #5

Closed
SpecterFire opened this issue Jan 31, 2023 · 6 comments
Closed

Can't play video when player starts after publisher #5

SpecterFire opened this issue Jan 31, 2023 · 6 comments
Assignees
Labels
TransByAI Translated by AI/GPT.

Comments

@SpecterFire
Copy link

SpecterFire commented Jan 31, 2023

Hello, I encountered a problem. I use SrsStreamer in the project for streaming. If I start the streaming end first and then start the RTC player, I cannot get the video stream. When I check in chrome://webrtc-internals/, there is indeed no video data. However, if I start the RTC player and click the play button first, and then start Unity SrsStreamer for streaming, the streaming is successful at this time. What could be the cause of this?

TRANS_BY_GPT4

@SpecterFire
Copy link
Author

SpecterFire commented Jan 31, 2023

Supplement: In both cases, audio can stream normally, but video cannot. The log contains the following warning:
[2023-01-31 17:59:55.511][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.528][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.552][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.570][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.586][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.601][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.617][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.634][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.651][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.668][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.687][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.702][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.719][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.735][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.752][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.767][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.787][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.802][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.817][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.836][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.851][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header
[2023-01-31 17:59:55.952][WARN][1772][pe60127j][11] avc ignore type=1 for no sequence header

TRANS_BY_GPT4

@SpecterFire
Copy link
Author

SpecterFire commented Feb 2, 2023

After testing, avc ignore type=1 for no sequence header is caused by enabling rtc_to_rtmp, which may not be related to this issue.

TRANS_BY_GPT4

@SpecterFire
Copy link
Author

SpecterFire commented Feb 2, 2023

Is it because Unity has set the AV_CODEC_FLAG_GLOBAL_HEADER, and SRS did not process the pps/sps obtained from stradata and put it before the keyframe?

TRANS_BY_GPT4

@winlinvip
Copy link
Member

winlinvip commented Feb 6, 2023

If player starts after publisher, it need to wait for next I frame from publisher, about 2~7s.

SRS wil send PLI to publisher to request I frame from publisher but it might not response.

It's not a bug and SRS can't fix it, I think Unity WebRTC sdk might couldn't fix it also. Just a different workflow of WebRTC.

@winlinvip winlinvip closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2023
@winlinvip winlinvip changed the title 先启动unity端Streamer推流,后使用SRS TRC播放器则无法获取到视频流,反之则可以 Can't play video when player starts after publisher Feb 6, 2023
@winlinvip winlinvip self-assigned this Feb 6, 2023
@stay-cnsj
Copy link

Hello, I also encountered the same problem. There is sound when the stream is published first and then played, but the video cannot work normally. So that we cannot use the normal live broadcast function. Is there any solution to this problem? Thanks!

@winlinvip winlinvip changed the title Can't play video when player starts after publisher Can't play video only get audio stream Aug 20, 2023
@winlinvip winlinvip changed the title Can't play video only get audio stream Can't play video when player starts after publisher Aug 20, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Aug 20, 2023
@winlinvip winlinvip pinned this issue Aug 20, 2023
@winlinvip
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

3 participants