cleaner pts rescaling at packet write time. writing headers can change time_base by design so just adapt to it
This commit is contained in:
parent
ea771c8dd7
commit
ee9678af68
|
@ -253,14 +253,7 @@ static bool ffmpeg_init_config(struct ff_config_param *params,
|
|||
//if encoded_packet.size() > 0 {
|
||||
encoded_packet.set_stream(stream_index);
|
||||
eprintln!("📦 Writing packet, pts {:?} dts {:?} size {}", encoded_packet.pts(), encoded_packet.dts(), encoded_packet.size());
|
||||
if let EncoderToWriteFrom::Video = encoder{
|
||||
//encoded_packet.rescale_ts(Rational(1, 60), Rational(1, 44100)); // slow, ~30fps
|
||||
encoded_packet.rescale_ts(Rational(1, 60), Rational(1, 15360));
|
||||
}
|
||||
if let EncoderToWriteFrom::Audio = encoder{
|
||||
//encoded_packet.rescale_ts(Rational(1, 60), Rational(1, 44100)); // slow, ~30fps
|
||||
encoded_packet.rescale_ts(Rational(1, 60), Rational(1, 44100));
|
||||
}
|
||||
encoded_packet.rescale_ts(Rational(1, 60), self.octx.stream(stream_index).unwrap().time_base());
|
||||
eprintln!("📦 rescaled , pts {:?} dts {:?} size {}", encoded_packet.pts(), encoded_packet.dts(), encoded_packet.size());
|
||||
|
||||
match encoded_packet.write_interleaved(&mut self.octx) {
|
||||
|
|
Loading…
Reference in New Issue