/// 课程代码
pkt.pts = av_rescale_q_rnd(pkt.pts, in_stream->time_base, out_stream->time_base, (AV_ROUND_NEAR_INF|AV_ROUND_PASS_MINMAX));
pkt.dts = pkt.pts;
pkt.duration = av_rescale_q(pkt.duration, in_stream->time_base, out_stream->time_base);
疑问1: 如果in_stream, out_stream的采样率是一样的,那pts、dts、duration是不是就不用重新设置了?
疑问2: 假设in_stream, out_stream的采样率是不一样的, 那这三个数据不为何使用统一的av_rescale设置,比如下面
packet->pts = av_rescale_q(packet->pts, in_stream->time_base, out_stream->time_base);
packet->dts = av_rescale_q(packet->dts, in_stream->time_base, out_stream->time_base);
packet->duration = av_rescale_q(packet->duration, in_stream->time_base, out_stream->time_base);
疑问3: 采样率不同的时候,课程代码中pts,duration 都要重新依据time_base重新计算,为什么dts 直接等于了pts, 而不是依照time_base重新计算?
packet->dts = av_rescale_q(packet->dts, in_stream->time_base, out_stream->time_base);
抱歉啊老师,疑问有些多