mpv-player / mpv

🎥 Command line video player
https://mpv.io
Other
27.91k stars 2.87k forks source link

Is there any way to play movies with virtual surround sound on a headset? #3885

Closed JulianLai closed 7 years ago

JulianLai commented 7 years ago

mpv version and platform

mpv 0.21.0 (C) 2000-2016 mpv/MPlayer/mplayer2 projects
 built on Wed Nov  2 00:00:15 UTC 2016
ffmpeg library versions:
   libavutil       55.35.100
   libavcodec      57.65.100
   libavformat     57.57.100
   libswscale      4.3.100
   libavfilter     6.66.100
   libswresample   2.4.100
ffmpeg version: 3.2.git

Is there any way to play it like how Razer Surround Sound does?

mia-0 commented 7 years ago

No idea what exactly that does but you can use the sofalizer filter through libavfilter. I recommend using one of the ClubFritz files with it.

JulianLai commented 7 years ago

@lachs0r What is the difference between ClubFritz1.sofa ~ClubFritz12.sofa?

How to use it after I add the --vf=lavfi to mpv?

JulianLai commented 7 years ago

@lachs0r

af=lavfi:sofalizer=sofa=/home/laichiaheng/.config/mpv/ClubFritz6.sofa:type=freq:radius=1

Error parsing option sofalizer (option not found)
Option af: Error while parsing lavfi parameter sofalizer (sofa)
Error parsing option af (option could not be parsed)
/home/laichiaheng/.config/mpv/mpv.conf:9: setting option af='lavfi:sofalizer=sofa=/home/laichiaheng/.config/mpv/ClubFritz6.sofa:type=freq:radius=1' failed.

What does it mean?

mia-0 commented 7 years ago

It means you didn’t understand what the manual says.

af=lavfi=[sofalizer=optiona:optionb]

JulianLai commented 7 years ago

@lachs0r af=lavfi=[sofalizer=sofa=/home/laichiaheng/.config/mpv/ClubFritz6.sofa:type=freq:radius=1]

[ffmpeg] No such filter: 'sofalizer'
[lavfi] Can't configure libavfilter graph.
Reinitialization did not work, audio filter 'lavfi' returned error code -2
Audio filter chain:
  [in] 48000Hz 5.1(side) 6ch s32
  [lavfi] 0Hz empty 0ch ?? <-
  [out] 0Hz empty 0ch ??
  [ao] 0Hz empty 0ch ??
Could not create audio filter chain.
Error at audio filter chain pre-init!
mia-0 commented 7 years ago

According to the documentation I just linked, FFmpeg needs to be built with --enable-netcdf.

JulianLai commented 7 years ago

@lachs0r The sound is so quiet with sofalizer, I have to set the gain to 40.

Which one do you seggest between ClubFritz1~12?

richardpl commented 7 years ago

From another user, he reported 4 is balanced, 6 have more bass and 12 if you want more treble. Note that 6 is slower because its not optimized case off fft processing, very big fft window.

kevmitch commented 7 years ago

presumably their properties are described in this paywalled paper

Argon- commented 7 years ago

I'm not sure if they are described as you might expect it. Additionally, there is no explicitly stated mapping from their descriptions to a certain filename. Quotes:


[...] The “Club Fritz” database HRTFs have been converted to the open standard SOFA file format for HRTFs to enable ease of data navigation. 12 HRTF sets were selected from the full database according to the following criteria:

Table I offers an overview of the selected contributions. screen shot 2016-12-12 at 14 30 33

[...] “Club Fritz” is an on-going project for HRTF measurement system comparisons containing over 60 datasets from 14 research labs around the world. The uniqueness of this collection lies in that by controlling for several variables like head geometry and binaural microphone type and placement, emphasis in the analysis can be given to differences due to factors particular to every participating institution. The current study offers a global comparison of a subset from the “Club Fritz” database consisting of 12 KU-100 HRTF datasets from 10 laboratories. Only the built-in microphone responses were considered in an attempt to focus on inter-database variations independent of microphone-related variations. The analysis focused on spectral and interaural time difference comparisons as well as left/right symmetry assessments between datasets.
The spectral variation overview between the 12 HRTF datasets was based on the two common points measured across all institutions: 0° and 180° azimuth on the horizontal plane. The results were compared to two HRTF subsets measured in the same physical space over the span of a week and 10 years. [...]


Maybe some of the references contain what you desire, dunno.

JulianLai commented 7 years ago

What are the short names of these channels? Such as FR (front right), FL (front left), RR (rear right), RL (rear left), how about the others? Front Left Height? Left Surround?

By the way, I have to set the FL to 15 degree and FR to 345 degree to make it more front.

richardpl commented 7 years ago

See http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavutil/channel_layout.c

JulianLai commented 7 years ago

@richardpl I can't find RR in the channel names, but it appears in FFmpeg's example.

richardpl commented 7 years ago

It is BR and BL...