-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
RTMP data channel caues ffmpeg analyzeduration very slow. #3767
Comments
Hi. regards, |
It's a bit strange, I found that with the audio on, even if the analyzeduration is set to 5s, it will quickly finish analyzing and start rendering and playing. But if there is no audio, the analyzeduration will keep looping until it stops after 5s and starts playing.
|
Please advise, how did you solve this problem? This issue affects the analysis of analyzeduration. In fact, it can be solved by reducing the analyzeduration on the playback side (this has been verified with ffplay), but there are too many playback sides in production, it's impossible to ask them all to make changes.
|
Hi. |
Generally, an RTMP stream includes a video stream, an audio stream that represents audio, and an optional data stream that contains AMF0 metadata. The data stream should be generated by your encoder, however I think we can disable it if make FFmpeg stuck. Need more research about the source of the data channel. BTW: I believe the HLS streaming does not have this bug, because HLS protocol doesn't incorporate the concept of AMF0 data. Both RTMP and HTTP-FLV should have this bug. |
If SRS responds with this empty data packet, FFmpeg will receive an empty stream, like `Stream #0:0: Data: none` in following logs: ```bash ffmpeg -i rtmp://localhost:11935/live/livestream ``` This won't cause the player to fail, but it will inconvenience the user significantly. It may also cause FFmpeg slower to analysis the stream, see #3767 --------- Co-authored-by: Jacob Su <[email protected]>
Description
The srs develop branch is used here, and it was found that the initial loading of RTMP is always particularly slow. After troubleshooting, it was found that this is because there is always an extra channel in RTMP, but this channel does not output. Looking at the ffpmeg source code, it will cause analyzeduration to be stuck in a loop until it reaches the maximum value, which makes the initial loading particularly slow.
SRS Version:
develop
SRS Config:
Replay
This is a recurring issue. After deployment, pulling RTMP can reproduce it, there will be an extra channel which is
Stream #0:0: Data: none, and an error will be reported below: Unsupported codec with id 0 for input stream 0.
Expect
Do not affect the analyzeduration, let it quickly complete the analysis and return the data. I know many people would say that it's fine to reduce this time, but this requires constraints on the playback end, and many times, constraining others is uncontrollable.
TRANS_BY_GPT4
The text was updated successfully, but these errors were encountered: