音频通道布局
channel layout of audio
我有一些问题希望您能回答。
我正在使用 ffmpeg sdk 开发基于 ffplay.c 的新视频播放器。
但是,有些概念我不明白。
什么是频道布局,音频频道?
mono audio is one channel
stereo 2 channel
... additional channels are also accommodated
在每个样本的音频缓冲区中,每个通道的数据都是交错的(仅适用于 packed sample formats
,这是典型的):
第一个样本(对于 16 位 CD 质量音频的位深度通常为 2 个字节)
two bytes ch a
two bytes ch b
第二个样本
two bytes ch a
two bytes ch b
对于视频,这还包括将视频交织到数据流中......根据视频编解码器采用不同的方法
Here is an excerpt from ffmpeg docs :
For planar sample formats, each audio channel is in a separate data plane, and linesize is the buffer size, in bytes, for a single plane. All data planes must be the same size. For packed sample formats, only the first data plane is used, and samples for each channel are interleaved. In this case, linesize is the buffer size, in bytes, for the 1 plane.
声道布局可用于描述音频的组织方式,例如单声道只有 1 个声道,立体声只有 2 个声道。你可以这样想,你怎么听到声音,可以有很多来源(地点),对吧?比如前中、前左、前右等
每个单独的频道代表一个来源,频道布局只是频道的组合。
有关详细信息,请参阅 Manipulating audio channels with ffmpeg:-)
我有一些问题希望您能回答。
我正在使用 ffmpeg sdk 开发基于 ffplay.c 的新视频播放器。
但是,有些概念我不明白。
什么是频道布局,音频频道?
mono audio is one channel
stereo 2 channel
... additional channels are also accommodated
在每个样本的音频缓冲区中,每个通道的数据都是交错的(仅适用于 packed sample formats
,这是典型的):
第一个样本(对于 16 位 CD 质量音频的位深度通常为 2 个字节)
two bytes ch a
two bytes ch b
第二个样本
two bytes ch a
two bytes ch b
对于视频,这还包括将视频交织到数据流中......根据视频编解码器采用不同的方法
Here is an excerpt from ffmpeg docs :
For planar sample formats, each audio channel is in a separate data plane, and linesize is the buffer size, in bytes, for a single plane. All data planes must be the same size. For packed sample formats, only the first data plane is used, and samples for each channel are interleaved. In this case, linesize is the buffer size, in bytes, for the 1 plane.
声道布局可用于描述音频的组织方式,例如单声道只有 1 个声道,立体声只有 2 个声道。你可以这样想,你怎么听到声音,可以有很多来源(地点),对吧?比如前中、前左、前右等
每个单独的频道代表一个来源,频道布局只是频道的组合。
有关详细信息,请参阅 Manipulating audio channels with ffmpeg:-)