HandBrake 1.7.0 – The open source video transcoder
forum.handbrake.fr
forum.handbrake.fr
average bitrate [kbps] = target size [kilobits] ÷ length [seconds]
Example: You have 2'48" file that you need to be 5GB or less. - 2'48" is 10,080s
- 5GB = 40,000,000 kb
- average bitrate = 40,000,000 kb ÷ 10,080s = 3,968 kbps
- If audio is 256 kbps, average video bitrate should be 3,712 kbps or less
If anyone from the Handbrake team is reading, thank you for all of your work on Handbrake. <3I usually encode at constant quality. The output size heavily depends on the input video. So, I wrote a wrapper in python that parses the HandbrakeCLI output estimates the final size based on percent completed & the current output file size. Then I can stop early if I realize the file is gonna be huge / the output quality is so shitty that I have to bump the quality factor.
This will need to be your average bitrate over the entire file, but the bitrate doesn’t have to be constant. It can (and ideally should) vary widely between static scenes and action sequences, for example.
Are there any big gotchas with the current version of this nice app?
Anyway, the main issue is the lack of man power, so many requested features that would be nice to have are stuck in features paradise. I guess that's the same as every Open Source project.
You can already do it manually (installing iTunes and some 3rd party open-source CLI tools), but it would be nice to incorporate it into HB.
> We can't link to the Core Audio DLL at all, so it's not an option unfortunately.
> Apache isn't GPL compatible. Nor is linking at run time to proprietary non-system libraries.
https://github.com/HandBrake/HandBrake/issues/191#issuecomme...
Works much faster than any app and I can customize it
The handbrake GUI has a drop down list of encoding presets. I find that as an amateur, selecting one of those presets is the best way to make a file smaller.
> I find that as an amateur, selecting one of those presets is the best way to make a file smaller.
These presets are not helpful when you want to try to make something specific like "I want to make this file fit in 3GB" which is something that an amateur typically wants to achieve.
It's not even that hard to actually do, which makes me wonder why Handbrake has never implemented this kind of things.
After trial and error, I found the original file size to be preserved and not to correspond to the presumed smaller output of say a lower resolution output.
It would also work with a one-pass encode, but setting the bitrate that way risks wasting space in simple parts of the video and degrading quality in complex parts. Two-pass encoding takes longer but distributes bandwidth better.
The problem is that "retaining X quality" is extremely vague and subjective. Also, a lot of people conflate resolution with quality (see YIFY Torrents). While yes, you need enough pixels to have reasonable quality, if the encoder set CRF to 50, 8K video won't save you.
There's very little that is user-friendly in Handbrake.
Much easier to google / llm for the right ffmpeg arguments
hahahahha
I’ve used the CLI tool for a lot of my media library and it really isn’t that hard, there are even wrapper scripts in GitHub that simplify the whole thing and are easier than handbrake
An app can be very user friendly, but does not give the user the power they didnt know they wanted. This is what handbrake is - you get a nice GUI, you get to choose from a list of presets (unless you know what you're doing and customize it). Then you click go - you can even queue up more files.
Someone who is using handbrake is not going to learn the command line. How would they know how to queue up ffmpeg? Don't say batch scripts, because that's not something a normal user would use.
It seems like presets still exist.
https://handbrake.fr/docs/en/latest/technical/official-prese...
I've tried fiddling around with when the subtitles should start, but because the subtitles end up stretched out so much, that makes all the later subtitles wrong. And I'm typically ripping a bunch of TV shows, so I want to do as little manual work as possible for each episode, because that all adds up quickly.
Do you know if I'm missing a library or a setting somewhere? Maybe I just need to try again with the latest version and see if it's been fixed over time.
I tried using the libraries from MakeMKV but found it easier to just two step the process.
If you care enough about subtitles and are converting for future reference then it's worth using SubtitleEdit to correct | align | correct case | spell check | generate translations | etc and then merge final (video + audio) tracks from HB with SubtitleTracks using (say) MKV Toolnix.
https://nikse.dk/SubtitleEdit/
These are tools that can be streamlined and batched (with some degree of learning curve).
> so I want to do as little manual work as possible for each episode
I typically transcode Audio+Video, seperate out subtitles automatically along with "most common least destructive" touchups scripted and then watch.
You can achieve this by dropping input file in a watched folder and having the results plopped out in a "to be viewed" folder.
Most of the time everything is A-OK .. when the syncing is out I correct it via SubtitleEdit and continue watching.
You can save Episode.mkv and Episode.srt together, or batch bind the srt into the mkv as you store OR you can go to town with multiple subtitles if you're a media meta data nerd.
I rely on gaupol for subtitle editing.
I use both. One thing I prefer about ffmpeg is that I prefer it when I'm being a control freak.
Basically, if I'm encoding a lot of videos, I will sometimes fail to notice that some box has been ticked in Handbrake, that will screw up my encode. In particular, Handbrake always defaults to resizing my videos, 100% of the time, and I always have to turn that off manually. If I fail to do that, it will resize my videos and I'll end up wasting an hour doing encodes, or 3-4 hours if I'm using CPU instead of GPU.
Which implies you actually understand all the ffmpeg opts and how they interact.
I very much doubt trail an error, or reading manpages is "mich faster" than picking a preset, ticking a box or dragging a slider in handbrake.
As long as you have this behavior for non-critical code it's just a little sad because you are delegating something you could easily have learnt. For hype sake I guess.
But if you do use this technique in a work related context you are just going to produce average code that you won't be able to debug when something break...
This is the only case I would ever use a text generator. If you cannot understand it, you cannot trust the output and you cannot learn it in case of doubt.
This is why it is so great for grammar and protocol, but very problematic for actual research questions.
[0]: https://github.com/oyvindln/vhs-decode/wiki/CX-Cards#what-is...
Feed ChatGPT's output to a question, back as input to it, say it was from a human (1, amateur, 2, expert) and for each case, for that question, ask it if it is correct.
A ChatTuring (pronounced chattering) Test.
But now I'm seeking a --chatgpt option similar to --help so I can navigate any man page.
If you have true experience in some field try to ask ChatGPT some questions and you will be shocked what nonsense it suggests, put in very nice words.
From a random blog post that a search machine brings up you can often get some clues whether the author has good understanding or just wrote down a random finding they had during trial and error. And that finding is still more on the side of error than doing it correctly.
In ChatGPT answers I don't see such hints.
* Improved performance on arm64 / aarch64 / Apple Silicon architectures
* Latest FFmpeg provides faster HEVC decoding, 30% faster bwdif filter
* New SVT-AV1 assembly optimizations provide up to 4x increase in performance
* Improved video conversion speed by removing unneeded frame copies for better memory efficiencyOr some bash magic: `handbrake-cli -i <(cat video-file.mp4)`?
I never used handbrake-cli, only used the gui before, so I have no idea.
It's one of the very few transcoders that isn't just a wrapper of FFMPEG (which is both an advantage and a disadvantage).
I use an Android video compressor that does this fairly well. But on the FR for this on the Handbrake GH one of the maintainers says it's not really feasible.
TBH I would just recommend Staxrip if you are on Windows: https://github.com/staxrip/staxrip
There is a vapoursynth-based linux equivalent, I can't remember what its called.
Or maybe some av1an GUI. All of these things support a target file size with many more features than Handbrake.
The FR issue is here, by the way:
https://github.com/HandBrake/HandBrake/issues/4640
Thanks for the suggestion on Staxrip, I've given it a download!
Your use case is as strange to the rest of the world as you thinking a Vimeo preset is strange to you.
I couldn't find a proper ffmpeg command to copy the HDR metadata from input source to output. Last time I checked it was not possible. I needed to extract the metadata manually (e.g. using MediaInfo), then pass each metadatum as an argument for ffmpeg.
Does anyone know if it's still the case?
To elaborate---and you already know this, but for the benefit of others---there are two common HDR video standards: Dolby Vision and HDR10. Both require custom support within the encoder (eg this is more of a libx265 thing, less of a libavformat/ffmpeg thing).
Fortunately, if your source video is HDR10, that means you can extract the global (unchanging) transfer functions and tone mapping and apply them yourself to the output metadata. FFmpeg can supply this to the encoder, but it doesn't copy it from the source to the destination by default. Here's an article that describes how to do this: https://codecalamity.com/encoding-uhd-4k-hdr10-videos-with-f...
I've been able to reencode one HDR10-encoded video from one format to another while preserving the metadata, the final command from my shell history was something like:
ffmpeg -i Movie-with-HDR.mkv -c:v libx265 -map_metadata:s:0 0:s:0 -map_metadata:g:0 0 -x265-params crf=21:master-display="G(13250,34500)B(7500,3000)R(34000,16000)WP(15635,16450)L(10000000,50)":max-cll=1000,240 Movie-output.mkv
where the `master-display` and `max-cll` settings are the color transfer functions from the first video that I had to extract from some other tool. These settings are documented in the libx265 parameters: https://x265.readthedocs.io/en/master/cli.htmlThe process for Dolby Vision is harder. Since that metadata is dynamic, I'm not sure how one could get it from the source, but it can be supplied to libx265 through a command line argument. Unfortunately, it's only exposed through the command line and isn't available to the API, so ffmpeg can't do this for you yet.
Other references:
- On the process of extracting the proper transfer functions and supplying them to ffmpeg: https://medium.com/@yllanos/how-to-encode-a-4k-hdr-movie-usi... and https://codecalamity.com/encoding-uhd-4k-hdr10-videos-with-f...
- A bunch of folks working together to do same: https://www.reddit.com/r/ffmpeg/comments/g3uucr/how_do_i_enc...
- On converting from dolby vision to HDR10, HLG vs PQ, https://www.reddit.com/r/ffmpeg/comments/nkxbay/how_to_conve...
- On subtleties of dolby vision: https://www.reddit.com/r/ffmpeg/comments/a32yv4/deleted_by_u...
ffmpeg -i $input_file -movflags use_metadata_tags -crf 22 $output_file
Source: https://video.stackexchange.com/a/26076Has the changelog I imagine most want to see.
0. https://github.com/HandBrake/HandBrake/releases/tag/1.7.0
For instance, if you want to post a video to Discord, you have a ~50MB cap unless you pay like $10/mo
I use Handbrake to compress videos over that cap. I could post it to YouTube but I don't want to clutter up my account with hundreds of 20-30 second uploads.
Handbrake is useful for lots of things. My partner have to upload his dissertation defense video and the university have strict requirement of the formats. He used Handbrake to convert his video to their formats of choice. It works well for him on his aging 10 years old MacBook Pro (upgraded the HDD to SSD years ago).
As a second example, Handbrake only supports h264, h265, AV1, and a couple MPEG codecs. This means Handbrake can convert HDR video; it extracts that data and supplies it to the output encoder automatically, while FFmpeg doesn't do that for you.