You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
88.2/96/176.4/192 kHz encoding/passthrough. See also #483.
This will need some special care, as many devices do not support sample rates higher than 48 kHz. I have some ideas for this but time not permitting, for now this placeholder will have to suffice.
Here are the device/playback scenarios I'm envisioning we may need to support in one way or another:
Support for 44.1/48 kHz only. We should transcode to one or the other based on the input (e.g. 11.025/22.05 kHz to 44.1 kHz; 8/16/24/32 to 48 kHz. This mode could possibly be the default, as it's very similar to what we do now and is the most compatible.
Support for all standard sample rates up to 48 kHz. There is some risk that a non-standard or sufficiently unpopular sample rate may not be supported on some devices. I'm not terribly concerned about this, as it's an edge case (never even seen it) that can be worked around with custom presets.
Support for 44.1/48 kHz for the first, more compatible track, and support for higher sample rates for supplementary tracks. Continuing with paradigm of the first track is stereo at limited bit rate, second track is surround or similar.
Support for higher sample rates for all tracks.
Making matters more interesting, some devices do not support only certain higher sample rates, such as 176.4 kHz.
What we need is a concise set of controls on the audio defaults sheet:
Convert sample rates less than 48 kHz to:(radio/select)
(o) 44.1/48 kHz (Auto)
( ) 48 kHz
( ) Do not convert
_[x] Limit first encoder for each selected track to 48 kHz(checkbox)
It's not perfect, but I believe it covers the a high percentage of what people will want, and it fits into the existing paradigm and controls. I'm certainly open to feedback and discussion.
I failed to mention, we could theoretically remove the Samplerate column entirely. But it's probably better to keep it, populated with a selection based on what the other controls make available. This gives the maximum flexibility so the user can select options outside of what these rules provide for.
Another thing that came up in conversation with a friend: enabling "Limit first encoder for each selected track to 48 kHz" should guarantee a compatible audio track, especially when combined with "Convert sample rates less than 48 kHz (to 44.1/48)". These options should probably be default in the official presets.
I just realized the irony of how this looks given I was and am against the Opus codec's initial enforcement of converting all input to 48 kHz. But I'm not advocating that at all; I'm advocating options to limit sample rate to 48 kHz for compatibility, and to upsample lesser rates to either 44.1 or 48 kHz for compatibility. This is similar to what even an inexpensive non-oversampling DAC with dual crystal oscillators does, and matching this behavior is superior to Opus' method when using one.
Lately I found 96k/24b audio is more and more common in blu-rays I purchased (mainly live concerts), and I wish to transcode them with the same sample rate (I use FLAC codec, which supports it.)
Currently I have to convert the audio track manually and then merge it back using mkvmerge, which isn't a big problem but would be great to not need to.
I had this issue while wanting to do a lossless rip of a game soundtrack on Blu-Ray (96kHz/24b).
For those who know what they're doing and just want to unlock higher sample rates without any additional GUI settings, you can just add a the missing sample rates in the libhb/common.c file for the relevant version of HandBrake you're using (see the changes).
For a Windows build, just set up a Ubuntu 20.04 VM with VirtualBox (for a VM dedicated to this task you'll need a minimum of 4GB of memory and 20GB of storage for the process to complete smoothly, for a minimal install of Ubuntu anyway, I'd also recommend 4vCPU) and compile a hb.dll according to the documentation, which alongside the scripts is good enough to make it an "easy" process for a non-developer.
If you're in this case, after the git clone command and once inside the HandBrake folder you can fetch the version tags using git fetch --all --tags, switch to the version you're using by doing git checkout [tag or branch name] (without the []) and then add the lines locally to the libhb/common.c file before starting the build.
Then get the hb.dll file from your VM any way you want (Dropbox, network share, passthrough USB key, shared VM folder with the host, SFTP, ...) replace your old hb.dll with it, and you'll have your extended choices at the same place of the interface as before.
"It just works" for FLAC 24-bit, according to MediaInfo on an encoded file anyway.
Activity
bradleysepos commentedon Jun 6, 2017
Targeting for 1.2.0.
Here are the device/playback scenarios I'm envisioning we may need to support in one way or another:
Making matters more interesting, some devices do not support only certain higher sample rates, such as 176.4 kHz.
What we need is a concise set of controls on the audio defaults sheet:
(o) 44.1/48 kHz (Auto)
( ) 48 kHz
( ) Do not convert
[x] 88.2 kHz [x] 96 kHz [ ] 176.4 kHz [x] 192 kHz
It's not perfect, but I believe it covers the a high percentage of what people will want, and it fits into the existing paradigm and controls. I'm certainly open to feedback and discussion.
bradleysepos commentedon Jun 6, 2017
I failed to mention, we could theoretically remove the Samplerate column entirely. But it's probably better to keep it, populated with a selection based on what the other controls make available. This gives the maximum flexibility so the user can select options outside of what these rules provide for.
bradleysepos commentedon Jun 6, 2017
Another thing that came up in conversation with a friend: enabling "Limit first encoder for each selected track to 48 kHz" should guarantee a compatible audio track, especially when combined with "Convert sample rates less than 48 kHz (to 44.1/48)". These options should probably be default in the official presets.
I just realized the irony of how this looks given I was and am against the Opus codec's initial enforcement of converting all input to 48 kHz. But I'm not advocating that at all; I'm advocating options to limit sample rate to 48 kHz for compatibility, and to upsample lesser rates to either 44.1 or 48 kHz for compatibility. This is similar to what even an inexpensive non-oversampling DAC with dual crystal oscillators does, and matching this behavior is superior to Opus' method when using one.
bradleysepos commentedon Jun 7, 2017
Second comp. This integrates some feedback and also shows what the default settings should be.
fireattack commentedon Apr 18, 2020
Just want to provide a use case.
Lately I found 96k/24b audio is more and more common in blu-rays I purchased (mainly live concerts), and I wish to transcode them with the same sample rate (I use FLAC codec, which supports it.)
Currently I have to convert the audio track manually and then merge it back using
mkvmerge, which isn't a big problem but would be great to not need to.Update common.c
Ruzgfpegk commentedon Oct 17, 2021
I had this issue while wanting to do a lossless rip of a game soundtrack on Blu-Ray (96kHz/24b).
For those who know what they're doing and just want to unlock higher sample rates without any additional GUI settings, you can just add a the missing sample rates in the libhb/common.c file for the relevant version of HandBrake you're using (see the changes).
For a Windows build, just set up a Ubuntu 20.04 VM with VirtualBox (for a VM dedicated to this task you'll need a minimum of 4GB of memory and 20GB of storage for the process to complete smoothly, for a minimal install of Ubuntu anyway, I'd also recommend 4vCPU) and compile a hb.dll according to the documentation, which alongside the scripts is good enough to make it an "easy" process for a non-developer.
If you're in this case, after the
git clonecommand and once inside the HandBrake folder you can fetch the version tags usinggit fetch --all --tags, switch to the version you're using by doinggit checkout [tag or branch name](without the []) and then add the lines locally to the libhb/common.c file before starting the build.Then get the hb.dll file from your VM any way you want (Dropbox, network share, passthrough USB key, shared VM folder with the host, SFTP, ...) replace your old hb.dll with it, and you'll have your extended choices at the same place of the interface as before.
"It just works" for FLAC 24-bit, according to MediaInfo on an encoded file anyway.
w3sip commentedon Feb 6, 2023
Not sure if it's easy(er), but rather than add higher sample rate options for audio codecs, would it be possible to add a "same as source" one?
bradleysepos commentedon Feb 6, 2023
That's what "Auto" means in this case. Unfortunately, it's limited to 48 kHz at the moment.
galad87 commentedon Apr 11, 2024
e74b389 introduced some new sample rates, so now FLAC and TrueHD are able to encode at 88.2/96/176.4/192 kHz.