[FFmpeg-devel] TrueHD track in EVO not playable/testable with ffplay

Justin Ruggles justin.ruggles
Sun Jul 19 05:10:22 CEST 2009


Ramiro Polla wrote:
> On Tue, Jul 14, 2009 at 5:26 PM, Michael Niedermayer<michaelni at gmx.at> wrote:
>> On Tue, Jul 14, 2009 at 02:59:13PM -0300, Ramiro Polla wrote:
>>> On Mon, Jul 13, 2009 at 6:02 PM, Justin Ruggles<justin.ruggles at gmail.com> wrote:
>>>> If you decide on using channels + request_channels + output_channels,
>>>> here is what I think should happen.
>>>>
>>>> demuxer/parser : set channels to the number of source channels,
>>>> completely ignoring request_channels.
>>>>
>>>> decoder : during init(), set channels to the number of source channels,
>>>> set output_channels to what it will output, trying if it can to honor
>>>> request_channels.
>>>>
>>>> The user can see if output_channels matches request_channels after
>>>> decoder init.
>>> And what shall the user do if output_channels has no value after decoder init?
>> he should call av_find_stream_info() either way and that should fill it in,
>> in theory ...
> 
> I have a few more ideas:
> - av_find_stream_info() tests for output_channels if request_channels
> is set. this would require request_channels to be set before even
> opening the codec;
> - av_find_stream_info() fills possible channel combinations in
> coded_channels[] and the user chooses from that to set
> request_channels. In this case it would set coded_channels[0] = 2;
> coded_channels[1] = 6; coded_channels[2] = 0; or something like that.

Let me make sure I understand your idea correctly:
- add a coded_channels array to AVCodecContext
- make coded_channels a required parameter in has_codec_parameters()
- the demuxer, parser, and/or decoder sets coded_channels[]
- add output_channels to AVCodecContext
- the decoder sets output_channels based on coded_channels,
request_channels, and the decoder's capabilities. if request_channels is
not set (e.g. possibly when called from av_find_stream_info()) it sets
output_channels to the highest number of coded_channels supported by the
decoder.

So if I do understand this correctly, I think it could work.  But it
would require updating existing demuxers, parsers, and decoders.  It
would also make AVCodecContext.channels kind of obsolete and ambiguous
unless channels is used to indicate the number of output channels
instead of adding a new field for that.

-Justin




More information about the ffmpeg-devel mailing list