[FFmpeg-trac] #8573(avfilter:new): The output pts of audio filter 'atempo' seems to be wrong.
FFmpeg
trac at avcodec.org
Tue Mar 17 11:28:46 EET 2020
#8573: The output pts of audio filter 'atempo' seems to be wrong.
-----------------------------------+--------------------------------------
Reporter: elite_jwp | Type: defect
Status: new | Priority: normal
Component: avfilter | Version: git-master
Keywords: atempo | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-----------------------------------+--------------------------------------
At libavfilter/af_atempo.c:1061, the code is as below:
{{{
atempo->dst_buffer->pts = atempo->start_pts +
av_rescale_q(atempo->nsamples_out,
(AVRational){ 1, outlink->sample_rate },
outlink->time_base);
}}}
According to tempo factor, the number of output samples may be different
with that of input samples, but they are equal in time duration.
Generally, inlink->sample_rate is same with outlink->sample_rate. So it
seems that the duration of '''nsamples_out''' can't be computed like above
code. It should take count of tempo factor, and can be fixed like below?
{{{
atempo->dst_buffer->pts = atempo->start_pts +
av_rescale_q(atempo->nsamples_out,
(AVRational){ 1,
(int)(outlink->sample_rate/atempo->tempo) },
outlink->time_base);
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/8573>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list