Ffmpeg pushes RTMP with error conversion failed #257
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR描述:
ffmpeg 长时间推送rtmp音视频流,导致ffmpeg 报错av_interleaved_write_frame(): End of file,进而导致程序退出 error conversion failed。
详细描述:
原因:ffmpeg 通过av_interleaved_write_frame将音视频数据通过librtmp库函数RTMP_Write将数据发送到rtmp服务器。RTMP_Write内部会检查buffer数据大小,当size小于11时,RTMP_Write返回false,进而导致av_interleaved_write_frame函数返回AVERROR_EOF,该bug出现。
解决方法:当RTMP_Write返回false时,如果因为size太小的原因导致,不再返回AVERROR_EOF,继续运行,忽略该错误。至于什么原因导致的此次传输buffer size太小,暂不细究。
关联issue:
fix #256