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

Question/Recommendation: What audio options to use for 8-channel lossless UHD content #324

Open
kford opened this issue Dec 11, 2020 · 6 comments
Assignees
Labels

Comments

@kford
Copy link

kford commented Dec 11, 2020

Hi Don,

Just wondering if you could suggest audio options to transcode the 8-channel lossless source audio to conserve space while maintaining all the channels. The source audio track on UHD content is around 4GB so would definitely like to shed some weight.

Source Audio in question

Format/Info                              : Meridian Lossless Packing FBA with 16-channel presentation
Commercial name                          : Dolby TrueHD with Dolby Atmos
Codec ID                                 : A_TRUEHD
Duration                                 : 2 h 8 min
Bit rate mode                            : Variable
Bit rate                                 : 4 634 kb/s
Maximum bit rate                         : 8 247 kb/s
Channel(s)                               : 8 channels
Channel layout                           : L R C LFE Ls Rs Lb Rb
Sampling rate                            : 48.0 kHz
Frame rate                               : 1 200.000 FPS (40 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Delay relative to video                  : 9 ms
Stream size                              : 4.15 GiB (8%)
Title                                    : Surround 7.1
Language                                 : English
Default                                  : Yes
Forced                                   : No
Original source medium                   : Blu-ray
Number of dynamic objects                : 11
Bed channel count                        : 1 channel
Bed channel configuration                : LFE

I am in the process of installing a 5.1.2 Atmos setup and up until now was using the stereo speakers of my TV so I didn't really care much about audio. Using my default options, such as below,
transcode-video --crop 0:0:0:0 source.mkv --add-subtitle 1 --output target.mkv
I get an audio track like this, as well as a stereo AAC track omitted as irrelevant for this question.

Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 2 h 8 min
Bit rate mode                            : Constant
Bit rate                                 : 640 kb/s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Frame rate                               : 31.250 FPS (1536 SPF)
Bit depth                                : 16 bits
Compression mode                         : Lossy
Delay relative to video                  : -38 ms
Stream size                              : 586 MiB (5%)
Title                                    : Surround
Language                                 : English
Service kind                             : Complete Main
Default                                  : Yes
Forced                                   : No

The transcoded main audio track has 6 channels, instead of the 8 channels in the original content, which I believe to be the L and R top-middle Atmos channels. I'd like to retain the 8 channels of the source content, which I've only been able to do using copy-audio which gives me a lossless audio copy, but at the cost of 4GB

With these options
transcode-video source.mkv --output transcoded_double.mkv --audio-width main=double
I end up with this output track (I took out some values for brevity)

Format/Info                              : Audio Coding 3
Commercial name                          : Dolby Digital
Codec ID                                 : A_AC3
Duration                                 : 3 min 29 s
Channel(s)                               : 6 channels
Channel layout                           : L R C LFE Ls Rs
Sampling rate                            : 48.0 kHz
Bit depth                                : 16 bits
Compression mode                         : Lossy
Title                                    : Surround
Service kind                             : Complete Main

Can you suggest how I might retain the 8 channels of the source, while shedding some weight and maintaining reasonable quality?

Thanks!

@lisamelton lisamelton self-assigned this Dec 11, 2020
@lisamelton
Copy link
Owner

@kford The AC-3 encoder in HandBrake is not capable of creating more than six channels. The only want to get 8 channels is using AAC format. Try adding --audio-format surround=aac to your command line.

@kford
Copy link
Author

kford commented Jun 16, 2021

Hi Don,

I tried adding --audio-format surround=aac and still got 6-channel output. The source file is the same one in my original comment

Channel(s)                               : 8 channels
Channel layout                           : L R C LFE Ls Rs Lb Rb

and with this command

transcode-video --crop 0:0:0:0 my_home_movie.mkv --add-subtitle 1 --output /home/user/Videos/my_home_movie_transcoded.mkv --audio-format surround=aac --chapters 2 --veryquick

I get this output file with two audio tracks, a 6 channel and 2 channel stereo. Any other ideas?

ID                                       : 2
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : A_AAC-2
Duration                                 : 3 min 29 s
Channel(s)                               : 6 channels
Channel layout                           : C L R Ls Rs LFE
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -21 ms
Title                                    : Surround
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio #2
ID                                       : 3
Format                                   : AAC LC
Format/Info                              : Advanced Audio Codec Low Complexity
Codec ID                                 : A_AAC-2
Duration                                 : 3 min 29 s
Channel(s)                               : 2 channels
Channel layout                           : L R
Sampling rate                            : 48.0 kHz
Frame rate                               : 46.875 FPS (1024 SPF)
Compression mode                         : Lossy
Delay relative to video                  : -21 ms
Title                                    : Stereo
Language                                 : English
Default                                  : No
Forced                                   : No

@lisamelton
Copy link
Owner

@kford I'm sorry you're having this problem. But this used to work so I suspect there's been some change in HandBrake to limit the number of channels for AAC output? Because your command line looks correct.

BTW, it turns out that 7.1 audio in AAC format is a playback compatibility nightmare which is why I limited AAC output to 5.1 channels in my newer other-transcode tool.

@samhutchins
Copy link
Contributor

samhutchins commented Jun 16, 2021

@donmelton transcode_video seems to specify a 5point1 mixdown to HandBrake, at least from my testing

transcode-video "D:\Films\Chappie\Chappie (2015).mkv" --audio-format surround=aac --dry-run


HandBrakeCLI --input=D:\\Films\\Chappie\\Chappie\ \(2015\).mkv --output=Chappie\ \(2015\).mkv --markers --encoder=x264 --crop=0:0:0:0 --auto-anamorphic --encoder-profile=high --encoder-level=4.0 --quality=1 --audio=1,1 --aencoder=av_aac,av_aac --mixdown=5point1,stereo --subtitle=2 --subtitle-burned --encopts=vbv-maxrate=6000:vbv-bufsize=12000:crf-max=25:qpmax=34

@lisamelton
Copy link
Owner

lisamelton commented Jun 16, 2021

@samhutchins Hmmmm, you're correct. I think I had to do that because of the playback compatibility problems. I just forgot because it was so damn long ago. :/

@kford It might be possible to override that with --handbrake-option but I wouldn't advise it. Sorry.

@kford
Copy link
Author

kford commented Jun 25, 2021

I guess I'll go with copy-audio, but wow these 8 channel lossless audio files are huge. On one of the titles, it's 7.5GB for the audio!

Maximum bit rate                         : 10.2 Mb/s
Channel(s)                               : 8 channels
Channel layout                           : L R C LFE Ls Rs Lb Rb
Sampling rate                            : 48.0 kHz
Frame rate                               : 1 200.000 FPS (40 SPF)
Bit depth                                : 24 bits
Compression mode                         : Lossless
Stream size                              : 7.48 GiB (9%)
Title                                    : Surround 7.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants