larksuite / rsmpeg

A Rust crate that exposes FFmpeg's power as much as possible.
https://docs.rs/rsmpeg/latest/rsmpeg/
MIT License
647 stars 40 forks source link

SwrContext同样代码和音频,Mac中运行正常,Win报错SwrConvertError(-1668179713) #168

Closed 425776024 closed 6 months ago

425776024 commented 6 months ago

你好 SwrContext同样代码和音频,Mac中运行正常,WIndow报错SwrConvertError(-1668179713)

除此函数的其它函数,如图像转换的'sws_getContext' ,以及视频输出,在Mac、Windows同一份代码均能正常运行:

let mut audio_resample_context = SwrContext::new(
            av_get_default_channel_layout(encode_context.channels),
            encode_context.sample_fmt,
            encode_context.sample_rate,
            av_get_default_channel_layout(decode_context.channels),
            decode_context.sample_fmt,
            decode_context.sample_rate,
        ).context("Could not allocate resample context").unwrap();

// 此处报错
audio_resample_context.convert_frame(Some(&_frame), &mut new_frame).unwrap();
ldm0 commented 6 months ago

-1668179713 means AVERROR_INPUT_CHANGED, you might have fed a malformed frame into the audio resample context. Could you provide a minimal reproducible example?