Closed jottr closed 8 years ago
D:\mpv-x86_64>mpv --ao=help
Available audio outputs:
wasapi : Windows WASAPI audio output (event mode)
openal : OpenAL audio output
null : Null audio output
pcm : RAW PCM/WAVE file writer audio output
you need to compile mpv with --enable-openal
flag
Thank you for trying to help.
I've tried to configure the build via $./waf configure --enable-openal
, which restulted in:
Checking for OpenAL audio output: no ('openal >= 1.13' not found)
I installed openal-soft
via homebrew, but am unsure how to link the library.
The following caveats come with the homebrew formula:
==> Caveats This formula is keg-only, which means it was not symlinked into /usr/local.
OS X provides OpenAL.framework.
Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add to your build variables:
LDFLAGS: -L/usr/local/opt/openal-soft/lib CPPFLAGS: -I/usr/local/opt/openal-soft/include
How should I proceed?
@pigoz I saw that you were the main contributor to the homebrew formula. Would it be possible to add openal to the formula itself?
@jottr just add depends_on 'openal-soft'
to the formula and --enable-openal
to the configure section of the formula if you want to test.
Or to test with mpv from git:
LDFLAGS=-L/usr/local/opt/openal-soft/lib CPPFLAGS=-I/usr/local/opt/openal-soft/include ./waf configure --enable-openal
Thank you @pigoz for helping!
I added depends_on "openal-soft" => :optional
and then installed mpv via $ brew install mpv --enable-openal --build-from-source
.
$ brew info mpv
mpv: stable 0.18.1 (bottled), HEAD
Free, open source, and cross-platform media player
https://mpv.io
/usr/local/Cellar/mpv/0.18.1 (321 files, 8.5M) *
Built from source on 2016-08-06 at 17:30:50
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/mpv.rb
==> Dependencies
Build: pkg-config β
Required: libass β, ffmpeg β
Recommended: jpeg β, little-cms2 β, lua β, youtube-dl β
Optional: libaacs β, libarchive β, libbluray β, libcaca β, libdvdnav β, libdvdread β, openal-soft β, uchardet β, vapoursynth β
...
Openal-soft seems to be present as per brew info
, but it looks like it is not available to mpv:
$ mpv -ao=help
Available audio outputs:
coreaudio : CoreAudio AudioUnit
null : Null audio output
coreaudio_exclusive: CoreAudio Exclusive Mode
pcm : RAW PCM/WAVE file writer audio output
I must be missing a crucial step. Also, once installed, how would I actually employ openal/hrtf on an appropriate video/audio source, read, how would I contruct the flags to get binaural audio output - the documentation is a bit lacking here.
I don't know if the way mpv uses openal can even use its hrtf filter. mpv places each audio channel as 3D source, instead of a single multi-channel source. Also, hrtf is probably not worth using anyway.
@wmv Why would it not be worth using? Would you mind elaborating? Will the effects not be noticeable/satisfying? If not, would that be due to mpv's implementation, or due to problems with the hrtf-filter itself?
Do video players or encoders even exist that are capable of properly playing/converting multichannel 3d audio into a working binaural source?
I've tried with mplayer and hrtf enabled, but the effect was not as three dimensional as expected. But this could also be due to misconfiguration on my end.
Old mplayer hrtf filter is joke, use sofalizer with one of clubfritz files.
I have tested hrtf in openal to work well from an audio quality / user experience perspective. As to getting it built with homebrew, I don't have the facility to test right now.
However, once you have openal enabled in mpv, just add a line to / create the openal config file
echo "hrtf = true" >> ~/.alsoftrc
You also need to make sure that you have the hrtf profiles installed, which probably just happens once you get openal properly installed in homebrew. On debian they're in the separate libopenal-data package though. These are a run-time dependency though , so they shouldn't have any influence on whether you can actually compile openal support.
It is kind of crappy that it requires using an entirely different (basically unmaintained) ao though. I haven't yet tried sofalizer, though it sounds promising.
So while I admit that getting back something like this isn't as simple as using the old af_hrtf, the old af_hrtf had some bad problems, so it's not coming back.
@richardpl is there any reason why af_sofalizer has no default profiles?
One of the reasons is to not pollute FFmpeg git history with binary files.
mpv version and platform
Openal seems to not be available?
Or should I check the audio filters?
Reproduction steps
I use a video file with a 6-channel DTS audio source:
How can I utilize the HRTF function with openal (or without), so that I can hear multichannel surround audio source as binaural audio over headphones?
Will I need to compile mpv with openal/hrtf support? If yes, how? If not, how can I enable hrtf?