Intermittent Failures with RTMP Sink
We are running into some intermittent failures with the RTMP sink. What we notice is that sometimes a given pipeline will stream all the way through and sometimes the RTMP sink will raise when writing frames and crash the pipeline.
this one crashed ~20 seconds into a 1 hour long stream, so I don't understand how it could have been the end of file. Additionally, in the error log I see an error handling a video buffer, however, the crash is in the write audio frame path.
2 Replies
Any ideas on how to debug or fix this? Is there a constraint on the protocol which makes the element raise/crash on an error writing a frame? In our use case, I think we would rather drop the frame than crash the stream. However, I can understand there can be problems with dropping a keyframe.
After some additional testing today, we notice there seems to be some correlation between the chunk size passed to the file source we are reading the h264/aac from and the file size.
I also noticed that on each crash the buffer starts with the binary
<<0, 0, ....>>
-- is there maybe some correlation/ratio between the file size, chunk size, bit/sample rate we need to be concerned with?Hi nick,
unfortunately I am not sure what could be causing your issue.
The error you get is thrown by ffmpeg's function
av_write_frame
in the native code.
You can get the error codes from the messages that were printed here: https://github.com/FFmpeg/FFmpeg/blob/512bba3d1bd404627fb2799191605258654b693e/libavutil/error.c#L108 .
So "Invalid argument" corresponds to EINVAL error in the ffmpeg, and "End of file" to AVERROR_EOF.
Another step would be looking at the definition of av_write_frame
in the ffmpeg code: https://github.com/FFmpeg/FFmpeg/blob/512bba3d1bd404627fb2799191605258654b693e/libavformat/mux.c#LL1198C6-L1198C6
You can try to figure out where those errors come from.
I would assume that one of the errors you get is causing the other one, presumably the error with writing video frame causes error with audio. But that's just a guess.GitHub
FFmpeg/mux.c at 512bba3d1bd404627fb2799191605258654b693e · FFmpeg/F...
Mirror of https://git.ffmpeg.org/ffmpeg.git. Contribute to FFmpeg/FFmpeg development by creating an account on GitHub.
GitHub
FFmpeg/error.c at 512bba3d1bd404627fb2799191605258654b693e · FFmpeg...
Mirror of https://git.ffmpeg.org/ffmpeg.git. Contribute to FFmpeg/FFmpeg development by creating an account on GitHub.