FFMpeg 3.2
发件人: He Lei<mailto:[email protected]> 发送时间: 2016年11月17日 17:44 收件人: [email protected]<mailto:[email protected]> 主题: [FFmpeg-user] how to use swr_convert_frame convert audio form s16p to s16 Hi, My sources like this: AVFrame *pOutFrame = av_frame_alloc(); pOutFrame->channel_layout = AV_CH_LAYOUT_STEREO; pOutFrame->format = AVSampleFormat::AV_SAMPLE_FMT_S16; pOutFrame->sample_rate = 44100; static SwrContext* m_pSwrCtx = swr_alloc_set_opts(NULL, AV_CH_LAYOUT_STEREO, AV_SAMPLE_FMT_S16, 44100, pFrame->channel_layout,(AVSampleFormat)pFrame->format, pFrame->sample_rate, 0, NULL); swr_init(m_pSwrCtx); swr_convert_frame(m_pSwrCtx, pOutFrame, pFrame));//return 0 av_frame_free(&pOutFrame); pFrame { nb_channel =2;fotmat=s16p;nb_sample=1024,rate=44100} After called swr_convert_frame; I found the linesize[0] of pOutFrame is incorrect,; according to common sense: pOutFrame linesize[0] should be nb_channel * nb_sample * sample_bytes, That is 2*1024*2 = 4096 (format is S16), but it’s 4224; What's wrong with me…… _______________________________________________ ffmpeg-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe". _______________________________________________ ffmpeg-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/ffmpeg-user To unsubscribe, visit link above, or email [email protected] with subject "unsubscribe".
