mpv-player / mpv-player/mpv

DolbyE Audio Decoding in MPV (FFMpeg supports it)

Open
#9,353 8 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

meta:feature-request
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

It would be cool if MPV supported DolbyE audio decoding on the fly instead of hearing just noise.

Expected behavior of the wanted feature

Once playing an mxf file with DolbyE 5.1 tracks, MPV should be able to recognize them and decode them.
The decoding is already supported in FFMpeg.

Actual behavior of MPV

Audio is decoded as noise which might damage hardware.

How to reproduce

Step 1: Download the sample file from here: https://we.tl/t-R8dRX8gIzT
Step 2: Play it in MPV
Step 3: Hear the noise on the first track and on the second track

Audio Layout of the Sample:

The sample has the following audio layout:
Track 1: DolbyE 5.1 + 2.0 Stereo Downmix Italian
Track 2: DolbyE 5.1 + 2.0 Stereo Downmix English
Track 3: PCM S24LE 2.0 Stereo Downmix Italian (you can listen to this one just fine)
Track 4: PCM S24LE 2.0 Stereo Downmix English (you can listen to this one just fine)

Mediainfo
General
Complete name                            : \\mibctvan000\Ingest\MEDIA\temp\DolbyE.mxf
Format                                   : MXF
Commercial name                          : XDCAM HD422
Format version                           : 1.3
Format profile                           : OP-1a
Format settings                          : Open / Incomplete
File size                                : 872 MiB
Duration                                 : 1 min 2 s
Overall bit rate                         : 116 Mb/s
Encoded date                             : 2021-10-25 12:27:15.452
Writing application                      : Omneon Inc. Omneon Media Subsystem 8.2.0.0.1
Writing library                          : Omneon Media Api (windows)

Video
ID                                       : 2
Format                                   : MPEG Video
Commercial name                          : XDCAM HD422
Format version                           : Version 2
Format profile                           : 4:2:2@High
Format settings                          : CustomMatrix / BVOP
Format settings, BVOP                    : Yes
Format settings, Matrix                  : Custom
Format settings, GOP                     : M=3, N=12
Format settings, picture structure       : Frame
Format settings, wrapping mode           : Frame
Codec ID                                 : 0D01030102046101-0401020201040300
Duration                                 : 1 min 2 s
Bit rate mode                            : Constant
Bit rate                                 : 50.0 Mb/s
Width                                    : 1 920 pixels
Clean aperture width                     : 1 571 pixels / 1 571 pixels
Height                                   : 1 080 pixels
Display aspect ratio                     : 16:9
Frame rate                               : 25.000 FPS
Standard                                 : Component
Color space                              : YUV
Chroma subsampling                       : 4:2:2
Bit depth                                : 8 bits
Scan type                                : Interlaced
Scan order                               : Top Field First
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.965
Time code of first frame                 : 00:00:00:00
Time code source                         : Group of pictures header
GOP, Open/Closed                         : Closed
Stream size                              : 375 MiB (43%)
Color range                              : Limited
Color primaries                          : BT.709
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.709

Audio #1
ID                                       : 3-1
Format                                   : Dolby E
Format settings                          : Little
Format settings, wrapping mode           : Frame (BWF)
Muxing mode                              : SMPTE ST 337
Codec ID                                 : 0D01030102060100-0402020203021C00
Duration                                 : 1 min 2 s
Bit rate mode                            : Constant
Bit rate                                 : 1 291 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L C Ls X R LFE Rs X
Sampling rate                            : 48.0 kHz
Frame rate                               : 25.000 FPS (1920 SPF)
Bit depth                                : 20 bits
Delay relative to video                  : -9 h 59 min
Stream size                              : 9.67 MiB (1%)
Title                                    : Program_1
Locked                                   : Yes

Audio #2
ID                                       : 3-2
Format                                   : Dolby E
Format settings                          : Little
Format settings, wrapping mode           : Frame (BWF)
Muxing mode                              : SMPTE ST 337
Codec ID                                 : 0D01030102060100-0402020203021C00
Duration                                 : 1 min 2 s
Bit rate mode                            : Constant
Bit rate                                 : 505 kb/s
Channel(s)                               : 2 channels
Channel layout                           : X X X L X X X R
Sampling rate                            : 48.0 kHz
Frame rate                               : 25.000 FPS (1920 SPF)
Bit depth                                : 20 bits
Delay relative to video                  : -9 h 59 min
Stream size                              : 3.78 MiB (0%)
Title                                    : Program_2
Locked                                   : Yes

Audio #3
ID                                       : 5-1
Format                                   : Dolby E
Format settings                          : Little
Format settings, wrapping mode           : Frame (BWF)
Muxing mode                              : SMPTE ST 337
Codec ID                                 : 0D01030102060100-0402020203021C00
Duration                                 : 1 min 2 s
Bit rate mode                            : Constant
Bit rate                                 : 1 291 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L C Ls X R LFE Rs X
Sampling rate                            : 48.0 kHz
Frame rate                               : 25.000 FPS (1920 SPF)
Bit depth                                : 20 bits
Delay relative to video                  : -9 h 59 min
Stream size                              : 9.67 MiB (1%)
Title                                    : Program_1
Locked                                   : Yes

Audio #4
ID                                       : 5-2
Format                                   : Dolby E
Format settings                          : Little
Format settings, wrapping mode           : Frame (BWF)
Muxing mode                              : SMPTE ST 337
Codec ID                                 : 0D01030102060100-0402020203021C00
Duration                                 : 1 min 2 s
Bit rate mode                            : Constant
Bit rate                                 : 505 kb/s
Channel(s)                               : 2 channels
Channel layout                           : X X X L X X X R
Sampling rate                            : 48.0 kHz
Frame rate                               : 25.000 FPS (1920 SPF)
Bit depth                                : 20 bits
Delay relative to video                  : -9 h 59 min
Stream size                              : 3.78 MiB (0%)
Title                                    : Program_2
Locked                                   : Yes

Audio #5
ID                                       : 6
Format                                   : PCM
Format settings                          : Little
Format settings, wrapping mode           : Frame (BWF)
Codec ID                                 : 0D01030102060100
Duration                                 : 1 min 2 s
Bit rate mode                            : Constant
Bit rate                                 : 2 304 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 25.000 FPS (1920 SPF)
Bit depth                                : 24 bits
Stream size                              : 17.3 MiB (2%)
Locked                                   : Yes

Audio #6
ID                                       : 7
Format                                   : PCM
Format settings                          : Little
Format settings, wrapping mode           : Frame (BWF)
Codec ID                                 : 0D01030102060100
Duration                                 : 1 min 2 s
Bit rate mode                            : Constant
Bit rate                                 : 2 304 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Frame rate                               : 25.000 FPS (1920 SPF)
Bit depth                                : 24 bits
Stream size                              : 17.3 MiB (2%)
Locked                                   : Yes

Text
ID                                       : 8-777
Format                                   : Teletext Subtitle
Muxing mode                              : Ancillary data / OP-47 / SDP
Duration                                 : 1 min 2 s

Other #1
ID                                       : 1-Material
Type                                     : Time code
Format                                   : MXF TC
Frame rate                               : 25.000 FPS
Time code of first frame                 : 10:00:00:00
Time code settings                       : Material Package
Time code, striped                       : Yes

Other #2
ID                                       : 1-Source
Type                                     : Time code
Format                                   : MXF TC
Frame rate                               : 25.000 FPS
Time code of first frame                 : 10:00:00:00
Time code settings                       : Source Package
Time code, striped                       : Yes

Other #3
ID                                       : System scheme 1-1-0
Muxing mode                              : System scheme 1


How to decode DolbyE 5.1 with FFMpeg
@echo off 
setlocal EnableDelayedExpansion

cd /d %~dp0


for %%a in (%*) do  (
   call :inizia %%a
   shift
)
exit

:inizia

ffmpeg.exe  -i %1  -map 0:1 -acodec copy  -f u8 -y stream1.u8
ffmpeg.exe  -i %1  -map 0:2 -acodec copy  -f u8 -y stream2.u8
ffmpeg.exe  -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y out1.wav
ffmpeg.exe  -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y out2.wav
ffmpeg.exe  -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y out3.wav
ffmpeg.exe  -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y out4.wav
ffmpeg.exe  -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y out5.wav
ffmpeg.exe  -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y out6.wav
ffmpeg.exe  -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y out7.wav
ffmpeg.exe  -i stream1.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.8 -y out8.wav
ffmpeg.exe  -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.0:0.0.0 -y out9.wav
ffmpeg.exe  -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.1:0.0.0 -y out10.wav
ffmpeg.exe  -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.2:0.0.0 -y out11.wav
ffmpeg.exe  -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.3:0.0.0 -y out12.wav
ffmpeg.exe  -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.4:0.0.0 -y out13.wav
ffmpeg.exe  -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.5:0.0.0 -y out14.wav
ffmpeg.exe  -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.6:0.0.0 -y out15.wav
ffmpeg.exe  -i stream2.u8 -acodec pcm_s24le -ar 48000 -ac 1 -map_channel 0.0.7:0.0.8 -y out16.wav



pause


:eof

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the linked MXF sample and reviewing how MPV handles FFmpeg audio streams. Compare the Dolby E tracks with the working PCM tracks and verify the FFmpeg-supported decoding path. Done means Dolby E 5.1 tracks play as audio instead of noise without affecting the existing PCM tracks.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.