Ticket #6569 (closed patch: Fixed)
Opened 3 years ago
Last modified 18 months ago
ac3 level is low for 5.1 source
| Reported by: | markspieth | Owned by: | janneg |
|---|---|---|---|
| Priority: | minor | Milestone: | unknown |
| Component: | MythTV - Video Playback | Version: | unknown |
| Severity: | medium | Keywords: | |
| Cc: | Ticket locked: | no |
Description
the ac3 gain is low for 5.1 sourced audio streams but is ok for 2.0. we have channels which have 5.1 material with 2.0 ads between. audio level changes are annoying.
patch attached to fix this.
Attachments
Change History
comment:1 Changed 3 years ago by danielk
Mark, have you tried submitting this to the ffmpeg folks?
comment:2 Changed 3 years ago by anonymous
A hardcoded gain increase can result in clipping and is not an appropriate way to address the "loud commercials" problem. This problem varies across different broadcasters/affiliates and really must be fixed at the source. This patch would cause problems on channels that do set proper levels, as well as on other ac3-bearing content, such as DVDs. Additional reading: http://www.tvtechnology.com/article/12644
comment:3 Changed 3 years ago by anonymous
To attribute this problem to the broadcaster would be erroneous, AC3 5.1 volumes with ffmpeg have always been lower than other codecs, e.g. mp2 or mp3 even with the same programmes (BBC HD offers stereo mp2 alongside 5.1 AC3). This causes problems when switching between channels using differing audio formats and not just on audio stream changes on a single channel.
comment:4 Changed 3 years ago by markspieth
finally had time to look into this again. the problem I had experienced was my stupid error. I'd made some different mods to my main frontend which didnt reflect the algo correctly.
The patch does work correctly for both 6ch output and 2ch downmixed output for both 2.0 and 5.1 ac3 source material.
I suspect there is a gain problem that is scaled for the number of channels in the source. thus 1/3 (-10dB) for 6ch over 2ch. (2ch being louder). This is not a downmix issue either.
The spec does not mention this though. The gain values in the table should probably be 3 and not 3.16 for this reason.
If anyone has mixed 4ch/2ch or 4ch/6ch audio material it would be interesting to test this theory. I only have access to mixed 2ch/6ch material.
comment:5 Changed 3 years ago by markspieth
submitted patch to ffmpeg issue 1153
comment:6 Changed 3 years ago by stuartm
- Owner changed from ijr to janneg
- Status changed from new to assigned
comment:7 Changed 3 years ago by markspieth
this is an issue with dolby technical bulletin 11.
what I have done is essentially correct but off by 1 dB. they recommend 11 dB attenuation an all non ACE/EAC3
from a bit of web searching
For receivers featuring E-AC3, this should be consistent with Dolby Technical Bulletin 11: Requirement Updates for AC3 and E-AC3 in DVB Products [34]. Receivers featuring AC3 or E-AC3 decoding shall include the PCM Level Control feature described therein. For example, for MPEG-1 Layer 2 audio streams that have an average loudness of about -20 dBLeq, the receiver shall apply an attenuation of 11 dB for the digital output to match the internal reference level.
Cant find a copy of this bulletin but the concept is there. Something to do with RFMode.
Another spec Ive seen says reduce by a further 3dB on top of the 11dB.
Thus this should be consistent around the world and not just peculiar to some implementations.
comment:8 Changed 2 years ago by robertm
- Status changed from assigned to infoneeded
Mark,
Appreciate your expertise with the Dolby stuff-- can you comment on how/whether this still applies to the new audio code with all the resampling, upmixing, etc? If so, any chance of an updated patch?
comment:9 Changed 2 years ago by robertm
- Status changed from infoneeded to closed
- Resolution set to fixed
Mark,
I'm closing this one for now as you seem to be in touch with the audio guys regarding the current (and upcoming) audio changes that will affect or possibly render unnecessary this ticket. If this issue is uncorrected by those changes, please do feel free to reopen this ticket at any time with an update to your patch. Closing this as "fixed" as there's no real appropriate resolution otherwise.
Changed 19 months ago by Bill Meek <keemllib@…>
- Attachment mythtv_ac3gainfix.patch.v2 added
Works with trunk at 27015
comment:10 Changed 18 months ago by jyavenard
- Resolution changed from fixed to Fixed
