Re-encoding for smaller 4K files using Handbrake

2eyesee

Senior Member
Messages
2,497
Solutions
4
Reaction score
767
I just shoot casual video and don't really need 4K, but on the Nikon Z30 I recently purchased, even if I'm outputting in 1080p it looks much better if I shoot in 4K and downsample rather than shooting native 1080p.

What I'm not liking though is the huge file sizes - the only encoding option for 4K on the Z30 is 144Mbps, which results in file sizes around 900MB/min of video.

I've been playing around with re-encoding the 4K videos in Handbrake to see if this will give me more manageable file sizes with minimal loss in quality, and I've been amazed to find I can achieve around 90% reduction in file size without any noticeable reduction in video quality (at least to my untrained eye).

The only thing I did notice was in arears of deep shadow there was some blockiness and banding if I inspected still frames close up. However, it wasn't something I could discern in normal playback - but I only have a 1440p display - not 4K.

So I'm thinking the re-encoded files are not going to be as malleable in post-production as the original 4K files, but the Z30 only has 8-bit video so that wasn't something I was going to be doing anyway.

I just wanted to get some advice - from those more knowledgeable than me on video encoding - on if there's anything I need to be aware of here - before I re-encode and discard all my original videos that will rapidly fill up my hard drive.

For reference, I used the 'Super HQ 2160p60 4K HEVC Surround' profile in Handbrake, and just changed the framerate (I shot in 25 fps) and the video codec to H265 (which more than halves your final video size on its own).

Thanks for any feedback.
 
I just shoot casual video and don't really need 4K, but on the Nikon Z30 I recently purchased, even if I'm outputting in 1080p it looks much better if I shoot in 4K and downsample rather than shooting native 1080p.

What I'm not liking though is the huge file sizes - the only encoding option for 4K on the Z30 is 144Mbps, which results in file sizes around 900MB/min of video.

I've been playing around with re-encoding the 4K videos in Handbrake to see if this will give me more manageable file sizes with minimal loss in quality, and I've been amazed to find I can achieve around 90% reduction in file size without any noticeable reduction in video quality (at least to my untrained eye).

The only thing I did notice was in arears of deep shadow there was some blockiness and banding if I inspected still frames close up. However, it wasn't something I could discern in normal playback - but I only have a 1440p display - not 4K.

So I'm thinking the re-encoded files are not going to be as malleable in post-production as the original 4K files, but the Z30 only has 8-bit video so that wasn't something I was going to be doing anyway.

I just wanted to get some advice - from those more knowledgeable than me on video encoding - on if there's anything I need to be aware of here - before I re-encode and discard all my original videos that will rapidly fill up my hard drive.

For reference, I used the 'Super HQ 2160p60 4K HEVC Surround' profile in Handbrake, and just changed the framerate (I shot in 25 fps) and the video codec to H265 (which more than halves your final video size on its own).

Thanks for any feedback.
Why did you change the frame rate from what you shot in? 60/25 is not an integer and this will muck up the motion. There is zero advantage in terms of quality and compression efficiency.
 
I just wanted to get some advice - from those more knowledgeable than me on video encoding - on if there's anything I need to be aware of here - before I re-encode and discard all my original videos that will rapidly fill up my hard drive.

Thanks for any feedback.
My advice: 4K screens are becoming more and mroe affordable and Hard drives are (relatively) inexpensive.

If I absolutely couldn't afford more harddrives, and assuming that your camera shoots in h.264 codec, I would transcode it to h.265 codec, which I guess is roughly have the size of h.264

The problem with h.265 is that it is more processor intensive, so you are going to need a beefier computer to edit it.
 
Why did you change the frame rate from what you shot in? 60/25 is not an integer and this will muck up the motion. There is zero advantage in terms of quality and compression efficiency.
What I mean is the default in Handbrake for the Super HQ 2160p60 4K HEVC Surround preset has a framerate 60fps, and I change it to the same framerate of my video, which I shoot in 25fps. I notice there is a Same as source option too, so what I'd do is create a new Preset based on the Super HQ 2160p60 4K HEVC Surround, but with the following changes:

Video
Video Encoder: H.265 (x265)
Framerate: Same as source

Filters
Interlace Detection: Off
Deinterlace: Off
 
I just wanted to get some advice - from those more knowledgeable than me on video encoding - on if there's anything I need to be aware of here - before I re-encode and discard all my original videos that will rapidly fill up my hard drive.

Thanks for any feedback.
My advice: 4K screens are becoming more and mroe affordable and Hard drives are (relatively) inexpensive.
It's not just the cost of hard drives. It also impacts on my cloud storage for off-site backup - plus I also have a couple of USB Hard Drives as a local backup. So it leaves me having to buy not only a high capacity replacement hard drive for my PC, but also 2 high capacity USB hard drives, and upgrade my cloud storage.
If I absolutely couldn't afford more harddrives, and assuming that your camera shoots in h.264 codec, I would transcode it to h.265 codec, which I guess is roughly have the size of h.264
Yes, the Z30 does shoot in H.264. Even re-encoding in H.264 creates significantly small er files, but I had noticed that H.265 halves the size on top of that.

The problem with the Z30 is you can only shoot 4K at 'High Quality', which is a very high bitrate of 144Mbps. In 1080p you can shoot at 'High Quality' (28Mbps) or 'Normal' (14Mbps). So I think my idea of re-encoding with Handbrake is a good solution to get me good quality 4K with manageable file sizes.
The problem with h.265 is that it is more processor intensive, so you are going to need a beefier computer to edit it.
Noted. I have a reasonable PC (12th gen i5, 16GB RAM, RTX3060 GPU) and have edited 4K H.265 videos from my Pixel 8 Pro on it.

I might test exporting as H.264 vs H.265. If H.264 gives me something like an 80% reduction in file size (vs 90% with H.265) but they are easier to work with, that may be a better compromise.
 
Unfortunately looking at some more samples I've tested with re-encoding in Handbrake as revealed terrible banding issues in areas of flat colour.

Even using the 'Professional Production Standard' profile - which results in a file almost as large as the original - shows significant banding:



At this stage it looks like I'll just have to find room to keep the original 4K files, but perhaps there is a setting I can use in Handbrake to minimise this banding?
 
Unfortunately looking at some more samples I've tested with re-encoding in Handbrake as revealed terrible banding issues in areas of flat colour.

Even using the 'Professional Production Standard' profile - which results in a file almost as large as the original - shows significant banding:
[...]
At this stage it looks like I'll just have to find room to keep the original 4K files, but perhaps there is a setting I can use in Handbrake to minimise this banding?
Did you try the encoder options? Putting the preset on slower modes like "veryslow" can help in some cases.
 
Unfortunately looking at some more samples I've tested with re-encoding in Handbrake as revealed terrible banding issues in areas of flat colour.

Even using the 'Professional Production Standard' profile - which results in a file almost as large as the original - shows significant banding:
[...]
At this stage it looks like I'll just have to find room to keep the original 4K files, but perhaps there is a setting I can use in Handbrake to minimise this banding?
Did you try the encoder options? Putting the preset on slower modes like "veryslow" can help in some cases.
I've tried playing around with the presets in Handbrake, to no avail.

So started looking at other video encoding tools, and have found a solution to the problem using ffmpeg:



The final file size was 31% the size of the original (i.e. less than 1/3 the size), and as you can see above a vastly better result than the banding I had in Handbrake.

ffmpeg is command line, but once you've found the commands you need it's straight forward to use. The command I used for the above encode was:

ffmpeg -i input.mp4 -c:v libx264 -crf 17 -preset slow -c:a copy output.mp4

I did try to test encoding with AV1, but that proved unusably slow so I'll stick with H.264.
 
Unfortunately looking at some more samples I've tested with re-encoding in Handbrake as revealed terrible banding issues in areas of flat colour.

Even using the 'Professional Production Standard' profile - which results in a file almost as large as the original - shows significant banding:
[...]
At this stage it looks like I'll just have to find room to keep the original 4K files, but perhaps there is a setting I can use in Handbrake to minimise this banding?
Did you try the encoder options? Putting the preset on slower modes like "veryslow" can help in some cases.
I've tried playing around with the presets in Handbrake, to no avail.

So started looking at other video encoding tools, and have found a solution to the problem using ffmpeg:



The final file size was 31% the size of the original (i.e. less than 1/3 the size), and as you can see above a vastly better result than the banding I had in Handbrake.

ffmpeg is command line, but once you've found the commands you need it's straight forward to use. The command I used for the above encode was:

ffmpeg -i input.mp4 -c:v libx264 -crf 17 -preset slow -c:a copy output.mp4

I did try to test encoding with AV1, but that proved unusably slow so I'll stick with H.264.
Nice solution. I think I'll try it myself – I love the command line!



--
YouTube: https://www.youtube.com/@JasonPolakPhotography
Website: https://jpolak.org
 
ffmpeg is command line, but once you've found the commands you need it's straight forward to use. The command I used for the above encode was:

ffmpeg -i input.mp4 -c:v libx264 -crf 17 -preset slow -c:a copy output.mp4

I did try to test encoding with AV1, but that proved unusably slow so I'll stick with H.264.
Thanks for posting.

Hmmm... I thought handbrake was just a GUI for ffmpeg ¯\_(ツ)_/¯
 

Keyboard shortcuts

Back
Top