filters实现设置音频的AV_SAMPLE_FMT_S16P

本文详细介绍了FFmpeg中音频采样格式的枚举定义及其平面格式,包括无符号8位、有符号16位等常见格式,并阐述了如何设置输出格式约束来最小化格式转换。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

enum AVSampleFormat {
    AV_SAMPLE_FMT_NONE = -1,
    AV_SAMPLE_FMT_U8,          ///< unsigned 8 bits
    AV_SAMPLE_FMT_S16,         ///< signed 16 bits
    AV_SAMPLE_FMT_S32,         ///< signed 32 bits
    AV_SAMPLE_FMT_FLT,         ///< float
    AV_SAMPLE_FMT_DBL,         ///< double


    AV_SAMPLE_FMT_U8P,         ///< unsigned 8 bits, planar
    AV_SAMPLE_FMT_S16P,        ///< signed 16 bits, planar
    AV_SAMPLE_FMT_S32P,        ///< signed 32 bits, planar
    AV_SAMPLE_FMT_FLTP,        ///< float, planar
    AV_SAMPLE_FMT_DBLP,        ///< double, planar

    AV_SAMPLE_FMT_NB           ///< Number of sample formats. DO NOT USE if linking dynamically
};


6.6 aformat

Set output format constraints for the input audio. The framework will negotiate the most appropriate format to minimize conversions.

The filter accepts the following named parameters:

sample_fmts

A ’|’-separated list of requested sample formats.

sample_rates

A ’|’-separated list of requested sample rates.

channel_layouts

A ’|’-separated list of requested channel layouts.

See (ffmpeg-utils)channel layout syntax for the required syntax.

If a parameter is omitted, all values are allowed.

For example to force the output to either unsigned 8-bit or signed 16-bit stereo:


<span style="font-family:Arial, Helvetica, sans-serif;color:#000000;"><span style="white-space: normal;">aformat=sample_fmts=u8|s16:channel_layouts=stereo
</span></span>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值