• Welcome to TechPowerUp Forums, Guest! Please check out our forum guidelines for info related to our community.

Some help with handbrake

Joined
Sep 28, 2020
Messages
70 (0.05/day)
Hello, i have a large amount of files i am encoding to save space. Its mostly smut movies or some other videos where quality is not that important, you just want it stored. I am looking for some tips to further improve speed/space/quality, or a link to a guide and i will do the work myself. Im using a very old i5 2500K and i encode during the night when electricity is cheaper. Plan to upgrade soon. Its different types of video files, .avi, .mpeg., .mp4 (h.264), .mkv, etc. Some are from torrents, some downloaded from tube type sites, some are high quality, some extremely low quality, resolutions from 320x240 to full hd.

Right now the settings i am using are this:

1) same resolution as original
2) HEVC 10-bit H.265 .mp4
3) RF 25
4) encoder preset FAST
5) original fps - variable (changing this to variable 25 fps now since otherwise at some vids it crashes. Could i go even lower, like 23 fps to save space, without noticing much ?)
6) 128 aac mono

I tend to batch load the whole folder to save time. Other settings i leave at default since i dont know their effect. It mostly does the job done, though there is always room for improvement. Occasionaly (but rarely) i get a file that is larger than the original, which is strange since the original is like .avi, H.264, .mpeg or something different. Doesn't make much sense. What else can i change/modify to improve space/time/quality ?
 
Last edited:
Joined
Jun 21, 2021
Messages
3,094 (2.50/day)
System Name daily driver Mac mini M2 Pro
Processor Apple proprietary M2 Pro (6 p-cores, 4 e-cores)
Motherboard Apple proprietary
Cooling Apple proprietary
Memory Apple proprietary 16GB LPDDR5 unified memory
Video Card(s) Apple proprietary M2 Pro (16-core GPU)
Storage Apple proprietary onboard 512GB SSD + various external HDDs
Display(s) LG UltraFine 27UL850W (4K@60Hz IPS)
Case Apple proprietary
Audio Device(s) Apple proprietary
Power Supply Apple proprietary
Mouse Apple Magic Trackpad 2
Keyboard Keychron K1 tenkeyless (Gateron Reds)
VR HMD Oculus Rift S (hosted on a different PC)
Software macOS Sonoma 14.7
Benchmark Scores (My Windows daily driver is a Beelink Mini S12 Pro. I'm not interested in benchmarking.)
Before someone jumps all over me and tells me that these aren't optimal, I know. I'm just a regular computer user, not a video engineer. But I guarantee some TPU participant will dissect every single thing I've written with the goal of brutally tearing it to shreds. Enjoy the fodder!

I have been several years since I researched this topic. Like you my goal was to save storage space on existing content that didn't require ultra quality video. I do most of my Handbrake transcoding on my Mac mini 2018 these days.

Here are the comments I can offer.

Right now the settings i am using are this:

1) same resolution as original
2) HEVC 10-bit H.265 .mp4

Yes to both.

I currently use the H.265 10-bit (VideoToolbox) encoder setting which harnesses the hardware encoder in the Mac's T2 Security Chip.

I also use the .mp4 container since so they can be synced to my iPhone and iPad if desired; the native media players don't accept .mkv container files. My Kodi media player (a Raspberry Pi 4) can handle .mkv though.

I know there are hardware encoders for Intel CPUs (Quicksync), Nvidia (NVEnc), and AMD (I forgot what it's called, VCE/VCN I think). I did identical transcodes on all four (three Windows PCs plus the Mac's VideoToolbox encoder) and I thought they all gave acceptable output. I figure some video engineer could pick apart each and say what's good/bad about each but for my mundane purposes, all four hardware encoding technologies were adequate at least when I tried this sometime in 2020.

Back when Handbrake didn't offer the VideoToolbox Mac support, I used software encoding (H.265 10-bit) and did 2-Pass Encoding, Turbo First Pass. Two full passes simply took too much time for the tiny amount of image quality improvement.


When I researched this, I believe I read something that said that anything above RF 20 was a waste of time for mundane content and transcoding projects. My memory is hazy but I ended up with RF 19 or RF 20. If I recall correctly, transcoding animation source files results in better output if the RF isn't so high.

Today, I don't set quality with RF or CQ (Constant Quality) numbers.

I just set a target bitrate, Average Bitrate (kbps) that depends on output resolution. For 480p output, I generally set it around 1500-2000 kbps. For 1080p output, I generally set around 4000 kbps. If I care more about image quality for some content, I might bump 1080p transcodes up to 8000 kbps, especially if I am using 4K source material. If it's widescreen content that will end up 1920 x 800p or so, I sometimes use 6000 kbps.

I picked these values based on test encodes over the years.

4) encoder preset FAST

I use Encoder Preset MEDIUM if available like software transcoding. For the Mac's VideoToolbox setting, there are two settings: Speed and Quality. I generally select Quality since the bitrate is going to squash image quality anyhow. I don't need super fast encodes anyhow.

Under Video > Encoder Options > Additional Options I add this line:

strong-intra-smoothing=0:rect=0

I don't remember what it does. Someone seemingly knowledgeable mentioned it on some long forgotten Q&A forum so I've kept it there.

5) original fps - variable (changing this to variable 25 fps now since otherwise at some vids it crashes. Could i go even lower, like 23 fps to save space, without noticing much ?)

I keep Framerate (FPS): Same as source, Variable Framerate.

6) 128 aac mono

I avoid transcoding or downmixing audio. I select AAC or E-AC3 passthrough when available. Transcoding audio isn't going to save you much in the way of disk space, you might as well keep the original audio whether it's good (multi-channel Dolby/DTS) or bad.

A long time ago I used to downmix to 2-channel stereo so I could hear them on my iPhone or iPad. At some point, Apple started supporting multi-channel audio formats in iOS and iPadOS and downmixing during playback so now I can just leave them as is.

I tend to batch load the whole folder to save time. Other settings i leave at default since i dont know their effect. It mostly does the job done, though there is always room for improvement. Occasionaly (but rarely) i get a file that is larger than the original, which is strange since the original is like .avi, H.264, .mpeg or something different. Doesn't make much sense. What else can i change/modify to improve space/time/quality ?

My guess is that the RF 25 setting will increase some low-quality files to a higher size. This might have been why I decided to move away from RF/CQ as the way to set output quality.

Ultimately I ended up with these setting based on what my eyes told me was acceptable final quality. I transcoded the same source material (a chapter or short clip) with different settings and let my eyes decide. It's best to look for artifacts, etc. not just where the main action is happening but also in the background patterns, etc. But ultimately if you're watching some superhero fighting a villain, you're probably not looking at the power line on a utility pole in the background.

Anyhow, I suggest you try to transcode content you actually care about and see what settings you come up with. Then apply those settings to your larger batches (possibly dialing down quality if desired).

In the end, it's up to you to decide what works, sort of like cooking. You're the one who has to eat it.
 
Last edited:

hat

Enthusiast
Joined
Nov 20, 2006
Messages
21,745 (3.31/day)
Location
Ohio
System Name Starlifter :: Dragonfly
Processor i7 2600k 4.4GHz :: i5 10400
Motherboard ASUS P8P67 Pro :: ASUS Prime H570-Plus
Cooling Cryorig M9 :: Stock
Memory 4x4GB DDR3 2133 :: 2x8GB DDR4 2400
Video Card(s) PNY GTX1070 :: Integrated UHD 630
Storage Crucial MX500 1TB, 2x1TB Seagate RAID 0 :: Mushkin Enhanced 60GB SSD, 3x4TB Seagate HDD RAID5
Display(s) Onn 165hz 1080p :: Acer 1080p
Case Antec SOHO 1030B :: Old White Full Tower
Audio Device(s) Creative X-Fi Titanium Fatal1ty Pro - Bose Companion 2 Series III :: None
Power Supply FSP Hydro GE 550w :: EVGA Supernova 550
Software Windows 10 Pro - Plex Server on Dragonfly
Benchmark Scores >9000
Hello, i have a large amount of files i am encoding to save space. Its mostly smut movies or some other videos where quality is not that important, you just want it stored. I am looking for some tips to further improve speed/space/quality, or a link to a guide and i will do the work myself. Im using a very old i5 2500K and i encode during the night when electricity is cheaper. Plan to upgrade soon. Its different types of video files, .avi, .mpeg., .mp4 (h.264), .mkv, etc. Some are from torrents, some downloaded from tube type sites, some are high quality, some extremely low quality, resolutions from 320x240 to full hd.

Right now the settings i am using are this:

1) same resolution as original
2) HEVC 10-bit H.265 .mp4
3) RF 25
4) encoder preset FAST
5) original fps - variable (changing this to variable 25 fps now since otherwise at some vids it crashes. Could i go even lower, like 23 fps to save space, without noticing much ?)
6) 128 aac mono

I tend to batch load the whole folder to save time. Other settings i leave at default since i dont know their effect. It mostly does the job done, though there is always room for improvement. Occasionaly (but rarely) i get a file that is larger than the original, which is strange since the original is like .avi, H.264, .mpeg or something different. Doesn't make much sense. What else can i change/modify to improve space/time/quality ?
1. This is correct. Don't mess with the resolution, especially don't blow up smaller resolutions to a larger size. I've transcoded blu-ray rips from 1080p down to 720p to save a significant amount of space without losing much quality (in my opinion anyway), however.
2. Use .mkv if you can. It's a more versatile container.
3.
When I researched this, I believe I read something that said that anything above RF 20 was a waste of time for mundane content and transcoding projects. My memory is hazy but I ended up with RF 19 or RF 20. If I recall correctly, transcoding anime results in better output if the RF isn't so high.

Today, I don't set quality with RF or CQ (Constant Quality) numbers.

I just set a target bitrate, Average Bitrate (kbps) that depends on output resolution. For 480p output, I generally set it around 1500-2000 kbps. For 1080p output, I generally set around 4000 kbps. If I care more about image quality for some content, I might bump 1080p transcodes up to 8000 kbps, especially if I am using 4K source material. If it's widescreen content that will end up 1920 x 800p or so, I sometimes use 6000 kbps.

I would advise against this. RF/CQ values are smart and control the quality of the resulting video based on the RF/CQ target value. If you encode with a bitrate target instead, for example 8000kbps, you'll be getting close to 8000kbps all the time. You may not need 8000kbps during a scene where there's not much going on, such as a few characters just talking to each other without much changes in the background. On the other hand, you may need more than 8000kbps during scenes where there's a lot going on, such as a racing/chasing scene, or an explosion. This doesn't matter to RF/CQ values as they attempt to keep the quality consistent based on the value you chose, allowing the bitrate to rise when needed and fall when not needed. This should produce a result with consistent quality without fucky artifacts when something blows up, while allowing the resulting filesize to be smaller because you didn't have 8000kbps for every mundane scene in the movie.

Side note about anime: anime is generally much simpler to encode/decode than anything live action because the video is just simpler. There's a lot less fine details to consider. You can generally get away with a higher (as in higher numerical value) RF/CQ setting here.

4. Encoder presets change a lot of settings in the background. Generally, the slower you go, you'll end up with a higher quality result and a smaller filesize, but the video will be more difficult to encode, taking longer, and more difficult to decode as well. To my knowledge, the Medium setting is very common, though I tend to use veryslow. I've only had issues with playback on a PS3 that was out of sync with the audio and video, took a while to figure it out and I don't remember what the issue was.

5. Do not change the FPS. Use original framerate, constant FPS, unless you know your source is already variable FPS. Using variable FPS will result in unpleasantness.

6. I agree with cvaldes on this one. Don't bother messing with the audio, just pass it through. Definitely don't use mono. This isn't the 1960s.
 
Joined
Jun 21, 2021
Messages
3,094 (2.50/day)
System Name daily driver Mac mini M2 Pro
Processor Apple proprietary M2 Pro (6 p-cores, 4 e-cores)
Motherboard Apple proprietary
Cooling Apple proprietary
Memory Apple proprietary 16GB LPDDR5 unified memory
Video Card(s) Apple proprietary M2 Pro (16-core GPU)
Storage Apple proprietary onboard 512GB SSD + various external HDDs
Display(s) LG UltraFine 27UL850W (4K@60Hz IPS)
Case Apple proprietary
Audio Device(s) Apple proprietary
Power Supply Apple proprietary
Mouse Apple Magic Trackpad 2
Keyboard Keychron K1 tenkeyless (Gateron Reds)
VR HMD Oculus Rift S (hosted on a different PC)
Software macOS Sonoma 14.7
Benchmark Scores (My Windows daily driver is a Beelink Mini S12 Pro. I'm not interested in benchmarking.)
I would advise against this. RF/CQ values are smart and control the quality of the resulting video based on the RF/CQ target value. If you encode with a bitrate target instead, for example 8000kbps, you'll be getting close to 8000kbps all the time. You may not need 8000kbps during a scene where there's not much going on, such as a few characters just talking to each other without much changes in the background. On the other hand, you may need more than 8000kbps during scenes where there's a lot going on, such as a racing/chasing scene, or an explosion. This doesn't matter to RF/CQ values as they attempt to keep the quality consistent based on the value you chose, allowing the bitrate to rise when needed and fall when not needed. This should produce a result with consistent quality without fucky artifacts when something blows up, while allowing the resulting filesize to be smaller because you didn't have 8000kbps for every mundane scene in the movie.

Curiously, the CQ option is greyed out when using H.265 10-bit (VideoToolbox) encoder on my Mac. The only way to adjust quality is to change the number in Average Bitrate (kbps) field when using this hardware encoder.
 
Joined
Sep 28, 2020
Messages
70 (0.05/day)
Thanks for the answers, i will try to reply to keep this clean and neat. Also as unpleasant as it is, i will try to be more honest: what i am encoding is 95% smut. The other 5% is vids i take with my phone and occasional youtube video. I dont watch anime and movies i dont encode - i watch and delete.

1) Is there a good reason to go .mkv vs .mp4 ? I never use subtitles. Im interesting in why is .mkv better (or worse)
2) My problem with original fps is that nowadays some smut uses 60fps which i am not sure is necesary and it takes a lot of space vs just using 25-30fps. Variable i used for smaller size, thought it was smart using less fps when not needed and more when needed. But if it causes problems i will change to fixed.
3) Sadly all the hardware acceleration my hardware supports is AMD VCE (R9 390 is my gpu) and i remember reading its terrible. Is it better now or should i stick to slow software encoding by cpu ?
4) I used RF 25 to get smaller size. But just few hours ago i read that occasionaly it can cause wierdness where on small resolution files u get bigger size with RF 25 than u do with RF 20. But otherwise i consistently get smaller size with RF 25 than i do with RF 20.
5) I tend to do batch encoding - 1 setting for like 30 videos at once - saves me time and i just do manual for the files that come out wierd or need special treatment. So i need the best setting for as broad video selection as possible
6)The reason i changed audio was that i had some 5 hour recordings of camgirls that were like 9fps video with barely any movement and i got like 80% of file size was audio. But those are rare so i can do them manualy. I am not sure how do i set in handbrake to leave audio in default ? It just gives me the option to set either bitrate or quality, i dont see the default or same as input button
7) additional options would be great - with explanation included cause im interested in what they do. Right now i only have keyint=30 so i can smooth quick seek in all videos, without it occasionaly i get a video with lag when seeking. And its bothersome when u want to go through 5 hour video with constant 3 second skips to check where the good stuff is
 
Joined
Oct 15, 2011
Messages
2,357 (0.49/day)
Location
Springfield, Vermont
System Name KHR-1
Processor Ryzen 9 5900X
Motherboard ASRock B550 PG Velocita (UEFI-BIOS P3.40)
Memory 32 GB G.Skill RipJawsV F4-3200C16D-32GVR
Video Card(s) Sapphire Nitro+ Radeon RX 6750 XT
Storage Western Digital Black SN850 1 TB NVMe SSD
Display(s) Alienware AW3423DWF OLED-ASRock PG27Q15R2A (backup)
Case Corsair 275R
Audio Device(s) Technics SA-EX140 receiver with Polk VT60 speakers
Power Supply eVGA Supernova G3 750W
Mouse Logitech G Pro (Hero)
Software Windows 11 Pro x64 23H2
Software encoding by CPU: I know that you should upgrade to at least a 3rd-gen Ryzen, especially the Ryzen 7 3700X, that tends to be the sweet spot.

More true if doing game play recordings. Even a 2600K will be better in this department.
 

hat

Enthusiast
Joined
Nov 20, 2006
Messages
21,745 (3.31/day)
Location
Ohio
System Name Starlifter :: Dragonfly
Processor i7 2600k 4.4GHz :: i5 10400
Motherboard ASUS P8P67 Pro :: ASUS Prime H570-Plus
Cooling Cryorig M9 :: Stock
Memory 4x4GB DDR3 2133 :: 2x8GB DDR4 2400
Video Card(s) PNY GTX1070 :: Integrated UHD 630
Storage Crucial MX500 1TB, 2x1TB Seagate RAID 0 :: Mushkin Enhanced 60GB SSD, 3x4TB Seagate HDD RAID5
Display(s) Onn 165hz 1080p :: Acer 1080p
Case Antec SOHO 1030B :: Old White Full Tower
Audio Device(s) Creative X-Fi Titanium Fatal1ty Pro - Bose Companion 2 Series III :: None
Power Supply FSP Hydro GE 550w :: EVGA Supernova 550
Software Windows 10 Pro - Plex Server on Dragonfly
Benchmark Scores >9000
Curiously, the CQ option is greyed out when using H.265 10-bit (VideoToolbox) encoder on my Mac. The only way to adjust quality is to change the number in Average Bitrate (kbps) field when using this hardware encoder.
Ah, yes. I forgot to mention that hardware encoders are inferior to software encoding. Sure, they're fast, and they do have their place for that reason, but it's not something I would use for transcoding a movie library. I'd take the extra time with software encoding for better results.
Thanks for the answers, i will try to reply to keep this clean and neat. Also as unpleasant as it is, i will try to be more honest: what i am encoding is 95% smut. The other 5% is vids i take with my phone and occasional youtube video. I dont watch anime and movies i dont encode - i watch and delete.

1) Is there a good reason to go .mkv vs .mp4 ? I never use subtitles. Im interesting in why is .mkv better (or worse)
2) My problem with original fps is that nowadays some smut uses 60fps which i am not sure is necesary and it takes a lot of space vs just using 25-30fps. Variable i used for smaller size, thought it was smart using less fps when not needed and more when needed. But if it causes problems i will change to fixed.
3) Sadly all the hardware acceleration my hardware supports is AMD VCE (R9 390 is my gpu) and i remember reading its terrible. Is it better now or should i stick to slow software encoding by cpu ?
4) I used RF 25 to get smaller size. But just few hours ago i read that occasionaly it can cause wierdness where on small resolution files u get bigger size with RF 25 than u do with RF 20. But otherwise i consistently get smaller size with RF 25 than i do with RF 20.
5) I tend to do batch encoding - 1 setting for like 30 videos at once - saves me time and i just do manual for the files that come out wierd or need special treatment. So i need the best setting for as broad video selection as possible
6)The reason i changed audio was that i had some 5 hour recordings of camgirls that were like 9fps video with barely any movement and i got like 80% of file size was audio. But those are rare so i can do them manualy. I am not sure how do i set in handbrake to leave audio in default ? It just gives me the option to set either bitrate or quality, i dont see the default or same as input button
7) additional options would be great - with explanation included cause im interested in what they do. Right now i only have keyint=30 so i can smooth quick seek in all videos, without it occasionaly i get a video with lag when seeking. And its bothersome when u want to go through 5 hour video with constant 3 second skips to check where the good stuff is
It doesn't matter much to me what you're encoding... I don't really care. Anime was brought up for some reason, so I commented what I know about that specifically. Moving on...
1. It's a better, more versatile container with more features. That said, .mp4 is, or at least was, more compatible... but I would expect .mkv support to be better these days.
2. The problem with reducing FPS like that is you're just going to be dropping frames. The result is going to be jittery. If I recall correctly, I had similar issues with using variable FPS. It's better to stick with the original framerate without reducing it or using variable FPS.
3. Software encoding by CPU is better than even the latest iterations of nvenc or quicksync. It will take more time, but the result will be a higher quality video with a lower filesize.
4. IIRC an RF value of around 23 was recommended for HD video (1080p, think bluray rips). The lower the resolution the video, the lower numerical value (higher quality) RF value you should use. Try 18 for your lower resolution content. Feel free to experiment here with the veryfast preset just to see what the resulting quality looks like. When you're satisfied with the quality, encode the source file again with at least the medium preset for better quality and smaller file size.
5. This is fine, but you'll likely be making multiple profiles for different sources. I had no less than 9 presets to use depending on the source type last time I was transcoding things.
6. I don't even have Handbrake installed right now as I haven't encoded anything in a while... but I believe audio settings were on a different tab from where most of the relevant video settings were.
7. This isn't something I can help you with regarding Handbrake. Just stick to the slower presets and you'll be fine.
Software encoding by CPU: I know that you should upgrade to at least a 3rd-gen Ryzen, especially the Ryzen 7 3700X, that tends to be the sweet spot.

More true if doing game play recordings. Even a 2600K will be better in this department.
That doesn't matter in this case. He's encoding a library of pre-existing video, not trying to stream games on Twitch. I can encode HD video on a Pentium 4 if I want to (provided I'm not missing some critical instruction set in the hardware or something)... it'll just take longer.
 
Joined
Jun 21, 2021
Messages
3,094 (2.50/day)
System Name daily driver Mac mini M2 Pro
Processor Apple proprietary M2 Pro (6 p-cores, 4 e-cores)
Motherboard Apple proprietary
Cooling Apple proprietary
Memory Apple proprietary 16GB LPDDR5 unified memory
Video Card(s) Apple proprietary M2 Pro (16-core GPU)
Storage Apple proprietary onboard 512GB SSD + various external HDDs
Display(s) LG UltraFine 27UL850W (4K@60Hz IPS)
Case Apple proprietary
Audio Device(s) Apple proprietary
Power Supply Apple proprietary
Mouse Apple Magic Trackpad 2
Keyboard Keychron K1 tenkeyless (Gateron Reds)
VR HMD Oculus Rift S (hosted on a different PC)
Software macOS Sonoma 14.7
Benchmark Scores (My Windows daily driver is a Beelink Mini S12 Pro. I'm not interested in benchmarking.)
For sure hardware encoding is inferior to software encoding re: image quality. For me, hardware encoding with the right settings provides a transcoded result that's acceptable to my eyes for most content. I can always switch to 2-pass software encoding with ultra quality level settings when the content calls for a better transcoding operation.

Anyhow, OP really needs to try hardware encoding himself to see if the end result is acceptable. I will refer back to my cooking analogy: what someone might enjoy at his dinner table might be swill for someone else. It sounds like OP's source content doesn't feature Hollywood quality production values so hardware encoding might be useful.

I know nothing about how good AMD VCE was on his generation of GPU.

But in the end OP's going to watch the transcode video footage so it's up to him to try AMD VCE and software encoding on a handful of files and compare the source to the resulting files and decide for himself. Just transcode a short scene, maybe 10 minutes long.

As for retaining original audio, just set the Codec to passthrough:

hb-audio-snap.jpg


As you can see I can no longer change Mixdown, Samplerate, nor Bitrate. Those options are greyed out.
 
Last edited:
Joined
Sep 28, 2020
Messages
70 (0.05/day)
I noticed that a bunch of vids i have, even 1920x1080 have like 80 or even 72 audio quality. So i probably actualy made the size bigger using 128 :) I tested AMD VCE on my R9 390 and while it was really fast, the quality of the video was really bad. As for my aging i5 2500k, i think i will upgrade to a new system in the coming months, because on newer cpus it will be a lot more energy efficient to encode x265, meaning more fps per dollar of electricity. The prices of energy are going up fast. Maybe after raptorlake comes out, i can find some nice Ryzen 3 or Alderlake system for a cheap second hand price. I think anything i buy will be a huge boost from this processor. I will be looking for something with great idle power consumption since this pc is on 24/7
 
Joined
Sep 28, 2020
Messages
70 (0.05/day)
I have been looking into hardware vs software decoding in newer hardware. Since i am usualy encoding xxx stuff, like long camgirl recordings and im using an old not that great 1080p monitor, i dont think there is such a huge difference. At least for the videos where i dont care so much about the quality but only want a decent archive. For the very important videos i can always use software encoding.

So i was wondering, if we go for quality/power consumption/speed, which gpu would be a good option for hardware encoding ? I am guessing something new from nvidia. Does anyone have any figures for instance if we set the image quality to be as close as possible (for instance, fast software preset vs quality hardware preset), how much faster and more importantly, how much less energy i would use going the hardware way ? It would be great to see like, ok, if u go hardware way, you will lose 10% quality, but u will use 50% less energy and encode 50% faster.
 
Top