[Libav-user] about channel_layout in AVCodecContext

Nicolas George nicolas.george at normalesup.org
Mon Mar 18 13:18:10 CET 2013

L'octidi 28 ventôse, an CCXXI, 黄轩宇 a écrit :
> But today I found a video, when avcode_open called on it to get audio
> codec, the returned AVCodecContext
> has channels field 1, but channle_layout 0.
> Since 0 channle_layout will cause swcontext init error, I'd like to know

Are you sure of that? IIRC, lswr is perfectly capable of dealing with
unknown channel layouts. You have to provide the channel count, of course.

> what 1 channels but 0 channel_layout means

It means 1 channel, but we do not know which one, it may be the left channel
of a stereo stream that was split, or more or less anything.


  Nicolas George

More information about the Libav-user mailing list