Hi,
august wrote:
> Hi,
>
> could somebody explain what the
>
> gavl_audio_format_t::channel_locations[] is supposed to contain?
>
> Can I safely set them all to GAVL_CHID_NONE? Or, is it supposed to
> be numbered?
GAVL_CHID_NONE means "unknown/unsupported". GAVL_CHID_AUX is more likely
what you want.
As long as num_channels and channel_locations[] are always the same for
input and output, gavl should pass then through unchanged.
If it doesn't, it's a bug.
> I guess what is confusing me is all the LEFT, CENTER, and REAR
> definitions. I assume this comes from DVD 5.1 lingo, right?
Yes, exactly. gavl handled such multichannel setups from the very
beginning. Mplayer and ffmpeg still get them wrong sometimes :)
> I work with multi-channel audio at times, but never in a home
> entertainment environment. For me, a channel is just a channel.
>
> ....
>
> My problem is how to down mix from, say, an 8channel audio to a 4
> channel player.
>
> When using a stereo output, just setting this worked for the internal
> gavl_audio_converter:
>
> output_audio_format.channel_locations[0] = GAVL_CHID_NONE;
>
> But, now, when I want to mix 8 to 4 channels I am getting:
>
> Couldn't construct mix matrix, using (probably wrong) default
> Segmentation fault
Oops, that's probably because the default mix matrix is defined only
for up to 6 channels. Maybe you are the first one who throws 8 channels
at gavl.
> Here is the file I am testing:
> http://romanhaefeli.net/8ch_does_play.wav
>
> Strangely enough, this is an 8ch wav that DOES play on a 4channel
> output using gavl:
> http://romanhaefeli.net/8ch_does_not_play.wav
>
> I assume this has something to do with interlacing?
You probably mean interleaving, but that's irrelevant here.
The gavl_audio_converter_t converts input frames to non-interleaved
before it mixes.
> Any idea why this is happening? Seems weird that it would segfault
> on me..or am I doing something else stupid?
No, it's gavls fault.
> ...Ok, the real question:
>
> If my output is 5 channels, but my input is 8 channels, how do I tell
> gavl to simply select the first five channels?
>
> Or, is there a way to build a channel matrix in gavl so that I can
> mix arbitrary channels?
Not yet, but it would be a nice feature. A clean way would be a public function:
gavl_audio_options_set_mix_matrix(gavl_audio_options_t * opt, double ** matrix);
where matrix[i][j] contains the factor for mixing input channel j to output
channel i.
Internally, in gavl/mix.c there is a function init_matrix(), which could check
if there is a predefined matrix. If you want you can play around with that.
Also note, that the matrix is normalized by default such that the signal
*never* clips (maximum coefficient sum of each matrix row must be one).
Maybe you also want an option for disabling this.
I just commited a tiny fix for downmixing more than 6 input channels into one
output channel, so the actual number crunching stuff should support generic
mix setups already.
Burkhard
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Gmerlin-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gmerlin-general