[FFmpeg-devel] [PATCH] avfilter/af_amerge: add reorder_inputs option to be able to turn off reordering
Marton Balint
cus at passwd.hu
Mon Sep 5 21:51:55 EEST 2016
On Mon, 5 Sep 2016, Nicolas George wrote:
> Le decadi 20 fructidor, an CCXXIV, Marton Balint a écrit :
>> The order of the channels to remain unchanged regardless of the input
>> channel layout (which is often guessed only). Filtering in ffmpeg is
>> unfortunately forcing you to use channel layouts, even if you don't want to,
>> even if you only want to say: this track has 2 channels, that stream track
>> has 1 channels. Don't assume anything else.
>
> I feel Carl Eugen has the right of it.
>
> libavfilter can work with streams with unknown layouts, but some individual
> filters may not. To make them work is relatively easy. First, make sure they
> do not use the channel layout: most filters from the fork will use the
> channel layout to know the number of channels, we have a separated field for
> that. Then declare accordingly the list of formats in query formats.
>
> The real problem is ffmpeg.c: it will try to guess the channel layout when
> none is specified. I think I added an option to avoid that, but it may have
> been lost at some point.
>
> And of course, most of the time, there is a channel layout, you just have to
> make sure it is properly set at input and let the logic do its work.
The work needed fixing this is definitely not comparable to the work I
did creating this patch, or the work anyone will have to do maintaining
it. Asking me to go in this direction, seems an unreasonable amount of
extra work for me, and most probably I will not do it, and rather abandon
the patch, or maintain it privately.
>> Another example: You have a file, with mono tracks. Some tracks have correct
>> metadata describing the channel layout of the files, others don't.
> ^^^^^^^^^^^^
> This is what needs fixing.
I don't trust the input channel layouts, I want to specify that all my
input channel layouts are unkown. Can/will I do this with -channel_layout
0 or something like that?
>> You wan't
>> the channels in file-order, regardless of the correctness of the input
>> channel layout metadata in the file.
>
> Not true. Codecs work with the channel layouts, for inter-channel
> correlation, for the cutoff frequency on the subwoofer, etc.
>
Sure, I plan to use uncompressed audio on the output side.
Regards,
Marton
More information about the ffmpeg-devel
mailing list