编码时发生了
Application provided invalid, non monotonically increasing dts to muxer in stream 0: -9223372036854775806 >= -9223372036854775807
解决方法:pts默认为0,后面每次++。
AVFrame *frame = av_frame_alloc();
if (!frame) {
fprintf(stderr, "Could not allocate video frame\n");
exit(1);
}
frame->format = c->pix_fmt;
frame->width = c->width;
frame->height = c->height;
frame->pts = 0;
int ret = av_image_alloc(frame->data, frame->linesize, c->width, c->height, c->pix_fmt, 32);
if (ret < 0) {
fprintf(stderr, "Could not allocate raw picture buffer\n");
exit(1);
}
rtmp_tool->m_pYUVFrame = frame;