Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downmixing X.1 audio to Stereo introduces clipping on some sources #2030

Open
AndrewR79 opened this issue Apr 9, 2019 · 5 comments

Comments

2 participants
@AndrewR79
Copy link

commented Apr 9, 2019

Description of the problem

I noticed when watching some movies encoded with Handbrake that some have clipping on loud parts. I mix down X.1 to Stereo. I have noticed this on DTS-ES or DTS-EX sources, and bizarrely if using the AAC (avcodec) codec the issue does not occur, but for all the others it does including the FDK AAC codec!

I have uploaded a short clip of The Incredibles which can be downloaded here.
https://drive.google.com/file/d/1pRlYxeHpxycVioBNWIlIUsuQZMPw9dGa/view?usp=sharing

Mix-down to Stereo using any audio codec except for the AAC (avcodec) and you can hear the clipping when the missiles explode at around 0:33

Doesn't seem to matter what bitrate is chosen for the output.

Now use the AAC (avcodec) output format and it does not clip, and overall the clip is quieter.

HandBrake version (e.g., 1.0.0)

Handbrake 1.2.2

Operating system and version (e.g., Ubuntu 18.04 LTS, macOS 10.14 Mojave, Windows 10 1809)

Windows 10 1809 64-bit

Error message text or screenshot

Please provide any error messages or screenshots that may help.

HandBrake Activity Log (see https://handbrake.fr/docs/en/latest/help/activity-log.html)

This for an AAC (avcodec) encode. No clipping.
[The Incredibles Clip.mkv 04-09-2019 23-49-29.txt](https://github.com/HandBrake/HandBrake/files/3061289/The.Incredibles.Clip.mkv.04-09-2019.23-49-29.txt)

This is for an AAC (FDK) encode. Clipping. 
[The Incredibles Clip.mkv 04-09-2019 23-51-08.txt](https://github.com/HandBrake/HandBrake/files/3061291/The.Incredibles.Clip.mkv.04-09-2019.23-51-08.txt)

This is for an AC3 encode. Clipping.
[The Incredibles Clip.mkv 04-09-2019 23-52-35.txt](https://github.com/HandBrake/HandBrake/files/3061293/The.Incredibles.Clip.mkv.04-09-2019.23-52-35.txt)

This is for a FLAC encode. Clipping
[The Incredibles Clip.mkv 04-10-2019 00-06-58.txt](https://github.com/HandBrake/HandBrake/files/3061295/The.Incredibles.Clip.mkv.04-10-2019.00-06-58.txt)



If you need more info please let me know!

@sr55

This comment has been minimized.

Copy link
Contributor

commented Jun 15, 2019

How are you determining that there is clipping going on? How are you playing these files back?

@AndrewR79

This comment has been minimized.

Copy link
Author

commented Jun 17, 2019

Thanks for the reply

If you encode the mkv linked above (which is original source material) using my methods above, it results in clipping at the point the missiles explode at 0:33 when playing back on every player I have access too (except when using the avcodec aac encoder). I have to apply a gain of -6dB to stop the clipping.

This includes all media players I have access to:

  • Windows Media Player on Windows 10
  • SMPlayer on Windows 10
  • Plex for ROKU
  • Plex for IPAD
  • Plex for Android
  • Plex for Samsung Tizen smart TV
@sr55

This comment has been minimized.

Copy link
Contributor

commented Jun 18, 2019

The short answer is, there isn't an easy answer for this.

Your source has very little headroom, so it's not abnormal to see this effect.

With HandBrake, your only options are: Gain reduction, or --normalize-mix (CLI Only). Beyond that, you'll need a tool that has more advanced audio functionality than HandBrake can dream of having.

@AndrewR79

This comment has been minimized.

Copy link
Author

commented Jun 23, 2019

@sr55

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2019

Variance between encoders seems reasonable to expect. Especially the AAC encoder given it's not long out of "beta" and still has some rough edges. There are obviously losses in that encoder that are lowering volume and likely quality. (In this case, it happens to be beneficial but may cause issues in other situations)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.