lisamelton / video_transcoding

Tools to transcode, inspect and convert videos.
MIT License
2.39k stars 160 forks source link

Proposal to change default stereo mixdown format #262

Closed lisamelton closed 5 years ago

lisamelton commented 5 years ago

Proposal to change default stereo mixdown format

Currently all audio tracks converted to stereo AAC format by transcode-video, including the main track, are by default output in matrix-encoded Dolby Pro Logic II (DPL2) surround format when the original input is multi-channel surround sound. This means that even though the AAC stereo track contains only two discrete channels, it can be decoded as multiple channels.

DPL2 by Jim Fosgate is a marvel of compression and portability, a boon to home video transcoders since the undecoded stereo will play anywhere and just about every surround system made in the last 18 years has an official Dolby decoder or a good knockoff built into it.

And, most of the time, DPL2 can reconstruct the orignal multichannel audio with amazing fidelity. But, to be honest, DPL2 is a hack. And applying it indiscriminately can create spatial positioning issues and wide pans, usually to the right channel. The panning problem is most apparent during stereo playback.

Let me be clear. You won't notice these issues when applying DPL2 to most multichannel signals. Most likely your audio will sound great during playback. But once you do hear one of these aberrations, you can't un-hear it.

Until recently, DPL2 encoding of stereo output was the default behavior of HandBrake, too. But that changed in version 1.2.0 and now a true stereo mix is the default with DPL2 as an option.

The --mixdown option was added to transcode-video by @samhutchins shortly afterwards to allow changing the format of stereo output from DPL2 to true stereo.

What I propose now is that we change our default behavior to match HandBrake and describe the --mixdown option this way:

    --mixdown stereo|dpl2
                    set mixdown format for stereo audio tracks (default: stereo)

The good news is that due to the extremely sensible way Sam implemented the --mixdown option, this is a one-line change. Three lines if you count changing the --help text. :) So the risk of making this change is low, at least in that regard.

And since the default behavior of transcode-video is to create both a stereo and a true multichannel surround track for main audio output, there's low risk of losing practical fidelity as well.

I believe it was Sam who suggested to me the possibility of changing the default from DPL2 to stereo during our review of his patch, but it was @dkoenig01 that really got me seriously considering the change during the discussion of Issue #254.

I would love to hear from @khaosx, @rhapsodians, @damorrison, @vr8hub, @klogg416 and anyone else from that thread or elsewhere about this proposal. Thanks!

khaosx commented 5 years ago

@donmelton That's a yes from me. Given that the engine of this project is Handbrake, it never hurts to be as aligned with them as we can be within the bounds of good sense. I like the notion of a true stereo mix down to avoid any unpleasantness later, like @samhutchins found with Baby Driver (Sam, I picked up a copy of that today...it had me at Jon Bernthal).

lisamelton commented 5 years ago

@khaosx The Punisher is in that movie? Sweet!

And thanks for the feedback.

lisamelton commented 5 years ago

BTW and to clarify, the change the HandBrake team made in version 1.2.0 was to all their presets. The default behavior of HandBrakeCLI still seems to be using DPL2 encoding. Go figure.

lisamelton commented 5 years ago

And if you include --audio=1 in the command line to select the main audio track, HandBrakeCLI command will not use DPL2 encoding. Again, go figure.

samhutchins commented 5 years ago

Make the change. I stopped using dpl2 after looking at the examples in the HandBrake issue that made them change it, and I'll probably never use it again now that I've found examples of badness in my own library

rhapsodians commented 5 years ago

Thumbs up from me too to make the change to true stereo.

I don't know if Don has any indication of use cases but I expect it can be simplified down to a casual user (i.e. take a BluRay, rip it, transcode it based on most of the defaults) and those of us who tinker for whatever reason (video and audio quality nuances, extra audio tracks, subtitles, home theatre set-ups, transportability (e.g. iPads on planes) etc.

Whatever the outcome, getting a good/better stereo default is probably a win-win for the majority even if they don't know it. And for those of us with specific scenarios or just out of interest, we delve in more deeply anyway so can set non-defaults easily via the options.

klogg416 commented 5 years ago

default behavior of transcode-video is to create both a stereo and a true multichannel surround track for main audio output

This makes it all good in my mind, since a true surround track is baked in already, it seems that the stereo track should be set up for the best chance of succcess in a stereo configuration. If people want to go the route of 2.0 DPL2 only and save space, that option remains available and they will need to do enough reading to understand the pros and cons.

No concerns over here.

lisamelton commented 5 years ago

@samhutchins ...

Make the change. I stopped using dpl2 after looking at the examples in the HandBrake issue that made them change it, and I'll probably never use it again now that I've found examples of badness in my own library

Agreed and same here. And I keep finding more examples of badness in the process of re-transcoding my library. Which makes me sad. Not the re-transcoding part. I would find some excuse to do that anyway because I'm a maniac. :) But that I didn't notice this the first time.

@rhapsodians ...

Thumbs up from me too to make the change to true stereo.

Thanks!

I don't know if Don has any indication of use cases but I expect it can be simplified down to a casual user (i.e. take a BluRay, rip it, transcode it based on most of the defaults) and those of us who tinker for whatever reason (video and audio quality nuances, extra audio tracks, subtitles, home theatre set-ups, transportability (e.g. iPads on planes) etc.

Whatever the outcome, getting a good/better stereo default is probably a win-win for the majority even if they don't know it. And for those of us with specific scenarios or just out of interest, we delve in more deeply anyway so can set non-defaults easily via the options.

Good point! I suppose as transcoding tool providers, we should approach this like doctors taking the Hippocratic Oath, "First do no harm."

@klogg416 ...

default behavior of transcode-video is to create both a stereo and a true multichannel surround track for main audio output

This makes it all good in my mind, since a true surround track is baked in already, it seems that the stereo track should be set up for the best chance of succcess in a stereo configuration. If people want to go the route of 2.0 DPL2 only and save space, that option remains available and they will need to do enough reading to understand the pros and cons.

Agreed, and I believe that was also Sam's rationale in our first discussion about this.

And once I do get the Wiki launched, we need to make sure these tradeoffs with DPL2 are covered in depth for folks there.

No concerns over here.

Thanks, and thanks to all!

damorrison commented 5 years ago

This works with my own use case which is, I want a 5.1 track for my surround sound TV (ac3 and sonos) and everything else is for watching on the iPad with AirPods, and bog standard stereo works for that.

Movies

  1. Ripped blu rays - will want both ac3 and stereo. So this change is fine.
  2. Aquired blu rays - will want best I can get in order of either a) ac3 or b) dpl2 and then plus a plain stereo. So need to figure out what the original source is for the first two which needs some work.

TV I put my Tv into two categories 1) old or not fussed, I.e has either a mono, stereo track or I don’t care. This can be dpl2 if it already has one, or stereo if it’s not. 2) newer and immersive programmes that has a 5.1 already in which case i treat them the same as a movie rip 5.1 and a stero track.

So all in all this is a fine change.

On Wed, 27 Feb 2019 at 17:03, Don Melton notifications@github.com wrote:

@samhutchins https://github.com/samhutchins ...

Make the change. I stopped using dpl2 after looking at the examples in the HandBrake issue that made them change it, and I'll probably never use it again now that I've found examples of badness in my own library

Agreed and same here. And I keep finding more examples of badness in the process of re-transcoding my library. Which makes me sad. Not the re-transcoding part. I would find some excuse to do that anyway because I'm a maniac. :) But that I didn't notice this the first time.

@rhapsodians https://github.com/rhapsodians ...

Thumbs up from me too to make the change to true stereo.

Thanks!

I don't know if Don has any indication of use cases but I expect it can be simplified down to a casual user (i.e. take a BluRay, rip it, transcode it based on most of the defaults) and those of us who tinker for whatever reason (video and audio quality nuances, extra audio tracks, subtitles, home theatre set-ups, transportability (e.g. iPads on planes) etc.

Whatever the outcome, getting a good/better stereo default is probably a win-win for the majority even if they don't know it. And for those of us with specific scenarios or just out of interest, we delve in more deeply anyway so can set non-defaults easily via the options.

Good point! I suppose as transcoding tool providers, we should approach this like doctors taking the Hippocratic Oath, "First do no harm."

@klogg416 https://github.com/klogg416 ...

default behavior of transcode-video is to create both a stereo and a true multichannel surround track for main audio output

This makes it all good in my mind, since a true surround track is baked in already, it seems that the stereo track should be set up for the best chance of succcess in a stereo configuration. If people want to go the route of 2.0 DPL2 only and save space, that option remains available and they will need to do enough reading to understand the pros and cons.

Agreed, and I believe that was also Sam's rationale in our first discussion about this.

And once I do get the Wiki launched, we need to make sure these tradeoffs with DPL2 are covered in depth for folks there.

No concerns over here.

Thanks, and thanks to all!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/donmelton/video_transcoding/issues/262#issuecomment-467945099, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYJDQne-ac1qaED9RJViLiducMGckufks5vRrpTgaJpZM4bTbMK .

-- Kind regards, Dave

lisamelton commented 5 years ago

@damorrison Thanks for the feedback!

And I admire your thoughtful methodology. You are, of course, in the company of many other anal retentives here so it should not be surprising. :)

But here's a usage question for you: Do you ever listen to the AC-3 5.1 surround track on your iPad? Because I thought even Apple's software player does an excellent stereo mix (without transcoding).

lisamelton commented 5 years ago

@samhutchins Here's the patch for the change:

diff --git a/bin/transcode-video b/bin/transcode-video
index 291abad..d6efe22 100755
--- a/bin/transcode-video
+++ b/bin/transcode-video
@@ -162,8 +162,10 @@ Audio options:
                       (can be used multiple times)
     --aac-encoder NAME
                     use named AAC audio encoder (default: platform dependent)
-    --mixdown dpl2|stereo
-                    set mixdown format for stereo audio tracks (default: dpl2)
+    --mixdown stereo|dpl2
+                    set mixdown for stereo audio output tracks
+                      to regular stereo or Dolby Pro Logic II format
+                      (default: stereo)
     --no-audio      disable all audio output

 Subtitle options:
@@ -267,7 +269,7 @@ HERE
       @copy_audio                 = []
       @copy_audio_name            = []
       @aac_encoder                = nil
-      @mixdown                    = 'dpl2'
+      @mixdown                    = 'stereo'
       @burn_subtitle              = nil
       @force_subtitle             = nil
       @extra_subtitle             = []
@@ -652,7 +654,7 @@ HERE

       opts.on '--mixdown ARG' do |arg|
         @mixdown = case arg
-        when 'dpl2', 'stereo'
+        when 'stereo', 'dpl2'
           arg
         else
           fail UsageError, "invalid mixdown: #{arg}"

As you can see, I expanded the --help text a bit. Does that look OK to you? If so, I'll commit the change. Thanks.

samhutchins commented 5 years ago

Looks good! Ship it! :-)

lisamelton commented 5 years ago

@samhutchins OK, that's checked in now.

I also removed that previous addition to the "README" document explaining that stereo tracks can also include surround audio information in matrix-encoded Dolby Pro Logic II format since that's no longer the default behavior, nor is it recommended (which makes me sad).

I'll leave this open until the release sometime this week.

lisamelton commented 5 years ago

@samhutchins @dkoenig01 @khaosx, @rhapsodians, @damorrison, @vr8hub, @klogg416 OK, this has now been released in version 0.25.0 of the Gem. Thanks again for all your feedback!