avcodec_encode_audio2 error nb_samples> frame_size [英] avcodec_encode_audio2 error nb_samples > frame_size

查看:239
本文介绍了avcodec_encode_audio2 error nb_samples> frame_size的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



我想使用FFMPEG对音频进行编码,但问题是AVFrame的nb_samples是22050,但编码器的frame_size是1152.所以我怎样才能使用avcodec_encode_audio2函数。有没有人有这样做的例子?



提前谢谢。

解决方案

你需要使用缓冲区,如FIFO。请参阅:

主人的FFmpeg / transcode_aac.c·FFmpeg / FFmpeg·GitHub [ ^ ]

Hi There

I want to encode audio using FFMPEG, but the problem is the nb_samples of the AVFrame is 22050 but the frame_size of the encoder is 1152. So how can I use avcodec_encode_audio2 function with this. Does anyone have an example of a way to do this?

Thanks in advance.

解决方案

You need to use a buffer, like a FIFO. See here:
FFmpeg/transcode_aac.c at master · FFmpeg/FFmpeg · GitHub[^]


这篇关于avcodec_encode_audio2 error nb_samples> frame_size的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆