diff --git a/av/audio/resampler.pyx b/av/audio/resampler.pyx index b1c6c0aad..359a4a5bc 100644 --- a/av/audio/resampler.pyx +++ b/av/audio/resampler.pyx @@ -72,10 +72,14 @@ cdef class AudioResampler(object): # handle resampling with aformat filter # (similar to configure_output_audio_filter from ffmpeg) self.graph = av.filter.Graph() + extra_args = {} + if frame.time_base is not None: + extra_args["time_base"] = str(frame.time_base) abuffer = self.graph.add("abuffer", sample_rate=str(frame.sample_rate), sample_fmt=AudioFormat(frame.format).name, - channel_layout=frame.layout.name) + channel_layout=frame.layout.name, + **extra_args) aformat = self.graph.add("aformat", sample_rates=str(self.rate), sample_fmts=self.format.name,