[FFmpeg-user] Forced upmixing scheme with no way to disable
Paul B Mahol
onemda at gmail.com
Fri Jun 24 10:33:05 EEST 2022
On Fri, Jun 24, 2022 at 1:47 AM Jeremy F <advanced4 at gmail.com> wrote:
> The join filter appears to work - specifying a 6.0 layout does indeed
> output what I want, but: the backend video player (AVPro) in the game I'm
> playing does not respect/acknowledge 6.0 (seemingly) so that doesn't work.
> Also the webplayer for the CDN I'm using also does not work (flv.js). Lucky
> me!
>
> These of course are not ffmpeg's fault, but would anyone have advice for,
> perhaps setting the AAC channel layout bit to say it's 5.1 instead? (I
> *think* that might fix it?). I don't think that's unreasonable, my layout
> very well may be true to 5.1, but ffmpeg forcing a 128hz filter is not
> always desired. I should be able to override that filter but retain a 5.1
> channel layout designation.
>
> IIUC lowpass is done in encoder.
> On Thu, Jun 23, 2022 at 5:22 PM Paul B Mahol <onemda at gmail.com> wrote:
>
> > On Thu, Jun 23, 2022 at 10:30 PM Jeremy F <advanced4 at gmail.com> wrote:
> >
> > > Unfortunately due to platform limitations, AAC is the only
> > > mutli-channel audio codec supported in my use case. However, I do not
> > see,
> > > at a glance, where the AAC specification mandates that if there are 6
> > > channels, that channel 4 must be a 128hz LFE channel. AAC also supports
> > the
> > > 6.0 channel layout for example, which does not include LFE. Ffmpeg
> > appears
> > > to be making assumptions at channel layout, as well as doing
> > corresponding
> > > upmixing schemes, with no way to override or disable. This is does not
> > > appear to be an AAC problem
> > >
> >
> > Then use join filter instead of amerge and specify 6.0 layout,
> >
> > Good luck.
> >
> > >
> > > On Thu, Jun 23, 2022 at 4:04 PM Paul B Mahol <onemda at gmail.com> wrote:
> > >
> > > > On Thu, Jun 23, 2022 at 8:43 PM Jeremy F <advanced4 at gmail.com>
> wrote:
> > > >
> > > > > That's what I thought! However, here are some commands showing
> this.
> > I
> > > > set
> > > > > the lowpass to be 10khz on channel4 just to prevent any confusion
> (it
> > > > > should clearly _not_ sound like any kind of real low pass filter).
> > With
> > > > an
> > > > > input of "vid.mp4" that has standard stereo, run the following:
> > > > >
> > > > > ffmpeg -i vid.mp4 -err_detect ignore_err -filter_complex
> > > > >
> > > > >
> > > >
> > >
> >
> "[0:a]channelsplit[left][right];[left]asplit=3[l1][l2][l3];[l1]aecho=1.0:0.7:25|60:0.5|0.3[l1];[l2]lowpass=f=550[l2];[l3]adelay=1,aecho=1.0:0.7:25|60:0.5|0.3[l3];[right]asplit=3[r1][r2][r3];[r1]aecho=1.0:0.7:25|60:0.5|0.3[r1];[r2]lowpass=f=10000[r2];[r3]adelay=1,aecho=1.0:0.7:25|60:0.5|0.3[r3];[l1][r1][l2][r2][l3][r3]amerge=inputs=6[a]"
> > > > > -map 0:v -map [a] -acodec aac -c:v copy vid1.mp4
> > > > >
> > > > > Then to extract channel 4 (since its zero based it's labeled 3):
> > > > >
> > > > > ffmpeg -i vid1.mp4 -map_channel 0.1.3 ch4.mp3
> > > > >
> > > > > ch4.mp3 will be a 128hz lowpass filtered version of the audio,
> > despite
> > > me
> > > > > never specifying that.
> > > > >
> > > > >
> > > > Stop transcoding to aac.
> > > >
> > > >
> > > >
> > > > >
> > > > > On Thu, Jun 23, 2022 at 1:48 PM Paul B Mahol <onemda at gmail.com>
> > wrote:
> > > > >
> > > > > > On Thu, Jun 23, 2022 at 7:09 PM Jeremy F <advanced4 at gmail.com>
> > > wrote:
> > > > > >
> > > > > > > A more succinct way of putting it: if I channelsplit (or any
> > other
> > > > type
> > > > > > of
> > > > > > > upmixing as far as I'm aware) into 6 channels, channel 4 always
> > > has a
> > > > > > 128hz
> > > > > > > low pass filter applied to it. I do not want this
> > > > > > >
> > > > > > > My particular use case is I play a game that supports
> > multi-channel
> > > > > live
> > > > > > > audio streams, but no filters on any audio. So I apply filters
> > > myself
> > > > > and
> > > > > > > position them as appropriate in the game (i.e. a reverb/echo
> > effect
> > > > in
> > > > > a
> > > > > > > hallway, a 550hz lowpass outside the main area, etc.). More
> > > > generally,
> > > > > > > ffmpeg should allow me to apply any effect to any channel, but
> it
> > > > would
> > > > > > > appear ffmpeg sees me using 6 channels, and decides to use the
> > > > default
> > > > > > > 5.1(side) upmixing scheme. I could find little documentation on
> > > this
> > > > > > > behaviour, but this page very briefly mentions this behaviour
> > about
> > > > > > halfway
> > > > > > > down https://trac.ffmpeg.org/wiki/AudioChannelManipulation
> > > > > > >
> > > > > > > Also my provided command was a bit verbose. I could simply
> > > > channelsplit
> > > > > > L &
> > > > > > > R into 3 channels each without any modification to any
> individual
> > > > > > channels.
> > > > > > > All channels will be duplicates of its original L or R channel,
> > but
> > > > > > channel
> > > > > > > 4 will have a 128hz low pass on it.
> > > > > > >
> > > > > >
> > > > > > That directly contradicts with reality.
> > > > > >
> > > > > > FFmpeg never applies lowpass to LFE channels, unless you call
> > lowpass
> > > > > > filter or similar filter on it.
> > > > > >
> > > > > >
> > > > > > >
> > > > > > > On Thu, Jun 23, 2022 at 12:55 PM Paul B Mahol <
> onemda at gmail.com>
> > > > > wrote:
> > > > > > >
> > > > > > > > On Thu, Jun 23, 2022 at 6:45 PM Jeremy F <
> advanced4 at gmail.com>
> > > > > wrote:
> > > > > > > >
> > > > > > > > > Hi I'm probably using ffmpeg in an edge-case way, but I
> > simply
> > > > want
> > > > > > to
> > > > > > > > take
> > > > > > > > > 2 channels/stereo, and end up with 6 channels of audio,
> > where I
> > > > can
> > > > > > > > > apply/modify/filter each channel as I please. And I figured
> > out
> > > > the
> > > > > > > > ffmpeg
> > > > > > > > > magic to do this, but along my dive into this it appears
> that
> > > no
> > > > > > matter
> > > > > > > > the
> > > > > > > > > method used to upmix (of which there are many such as "-ac
> > 6",
> > > > > > > "asplit",
> > > > > > > > > "pan", "channelsplit") it appears no matter what, I'm
> forced
> > to
> > > > use
> > > > > > the
> > > > > > > > > upmixing scheme that always sets channel 4 to a lowpass
> > filter
> > > of
> > > > > > > 128hz,
> > > > > > > > > rendering it useless for my case.
> > > > > > > > >
> > > > > > > > > There doesn't appear to be a way to disable this that I can
> > > find,
> > > > > and
> > > > > > > it
> > > > > > > > > seems like there should be
> > > > > > > > >
> > > > > > > > > My current command I'm using, which works great except for
> > > > channel
> > > > > 4
> > > > > > > > > (labeled r2 in here). No matter what filter I apply, it
> > always
> > > > ends
> > > > > > up
> > > > > > > > > being a lowpass of 128.
> > > > > > > > >
> > > > > > > > > -err_detect ignore_err -filter_complex
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> [0:a]channelsplit[left][right];[left]asplit=3[l1][l2][l3];[l1]aecho=1.0:0.7:25|60:0.5|0.3[l1];[l2]lowpass=f=550[l2];[l3]adelay=1,aecho=1.0:0.7:25|60:0.5|0.3[l3];[right]asplit=3[r1][r2][r3];[r1]aecho=1.0:0.7:25|60:0.5|0.3[r1];[r2]lowpass=f=550[r2];[r3]adelay=1,aecho=1.0:0.7:25|60:0.5|0.3[r3];[l1][r1][l2][r2][l3][r3]amerge=inputs=6[a]
> > > > > > > > > -map 0:v -map [a] -acodec aac -c:v copy
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > The code, at a glance, seems to corroborate this, but it's
> a
> > > bit
> > > > > > beyond
> > > > > > > > my
> > > > > > > > > depth to do anything further (and I don't want to compile /
> > > make
> > > > a
> > > > > > > custom
> > > > > > > > > version of ffmpeg)
> > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> https://github.com/FFmpeg/FFmpeg/blob/9aa20d28cdda0dcaa4daa2848670a6530c6ba26a/libavfilter/af_surround.c
> > > > > > > > >
> > > > > > > > > So, if possible, how can I disabled the upmixing scheme?
> > > > > > > > >
> > > > > > > >
> > > > > > > > The surround filter have nothing to do with that filtergraph
> > > above.
> > > > > > > >
> > > > > > > > And I really failed to understand what you are trying to do.
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > > > Thanks!
> > > > > > > > > --
> > > > > > > > > Sincerely,
> > > > > > > > >
> > > > > > > > > Jeremy
> > > > > > > > > _______________________________________________
> > > > > > > > > ffmpeg-user mailing list
> > > > > > > > > ffmpeg-user at ffmpeg.org
> > > > > > > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > > > > > > >
> > > > > > > > > To unsubscribe, visit link above, or email
> > > > > > > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > > > > > > >
> > > > > > > > _______________________________________________
> > > > > > > > ffmpeg-user mailing list
> > > > > > > > ffmpeg-user at ffmpeg.org
> > > > > > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > > > > > >
> > > > > > > > To unsubscribe, visit link above, or email
> > > > > > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > --
> > > > > > > Sincerely,
> > > > > > >
> > > > > > > Jeremy
> > > > > > > _______________________________________________
> > > > > > > ffmpeg-user mailing list
> > > > > > > ffmpeg-user at ffmpeg.org
> > > > > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > > > > >
> > > > > > > To unsubscribe, visit link above, or email
> > > > > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > > > > >
> > > > > > _______________________________________________
> > > > > > ffmpeg-user mailing list
> > > > > > ffmpeg-user at ffmpeg.org
> > > > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > > > >
> > > > > > To unsubscribe, visit link above, or email
> > > > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Sincerely,
> > > > >
> > > > > Jeremy
> > > > > _______________________________________________
> > > > > ffmpeg-user mailing list
> > > > > ffmpeg-user at ffmpeg.org
> > > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > > >
> > > > > To unsubscribe, visit link above, or email
> > > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > > >
> > > > _______________________________________________
> > > > ffmpeg-user mailing list
> > > > ffmpeg-user at ffmpeg.org
> > > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > > >
> > > > To unsubscribe, visit link above, or email
> > > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > > >
> > >
> > >
> > > --
> > > Sincerely,
> > >
> > > Jeremy
> > > _______________________________________________
> > > ffmpeg-user mailing list
> > > ffmpeg-user at ffmpeg.org
> > > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> > >
> > > To unsubscribe, visit link above, or email
> > > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> > >
> > _______________________________________________
> > ffmpeg-user mailing list
> > ffmpeg-user at ffmpeg.org
> > https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> >
> > To unsubscribe, visit link above, or email
> > ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
> >
>
>
> --
> Sincerely,
>
> Jeremy
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-request at ffmpeg.org with subject "unsubscribe".
>
More information about the ffmpeg-user
mailing list