Understanding Larger File Size after Encode

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Yawnny
Posts: 15
Joined: Thu May 18, 2017 5:53 am

Understanding Larger File Size after Encode

Post by Yawnny »

Please detail your question or problem in as much detail as possible:

Hi there,

I've been tweaking settings in handbrake but I I'm still a bit confused about file size after my files are encoded.

I download past broadcasts from twitch.tv and encode them to force a constant 30FPS so that there's no audio/video desync when editing in premier.

Previously I encoded at a constant quality of 18 RF but realized this is causing files to become larger than their original size.

I've been trying other RF values but the size of the output file always seems to be larger.. I went as low as 27 RF and although the file size discrepancy wasn't as huge as when using 18 RF, the output file was still larger than the input file. Quality was about the same as the original file as far as my eyes could see.

Original File Size: 4.38 GB

After Handbrake 23 RF: 5.32 GB

Is the general rule that file size becomes larger when you're trying to encode a file at a better quality than the source? ie: is it possible that these twitch vods I'm downloading are lower than 27 RF? I don't want to lose too much detail on these vods. I'm fine if the file size is the SAME after encoding, I just want the files to be constant framerate. I'm not really trying to compress per-se (where one would expect to lose quality), just force the framerate.

I eventually went lower still to 30 RF and THEN the file came out a touch smaller than the input but I noticed some quality degradation at this point.

I originally attempted at 'veryfast' encoder preset then to 'medium' but there wasn't any file size difference when trying at 27 RF between both speeds.

Again, my goal isn't to shrink file size - it's to force constant framerate - but ideally the file size isn't any larger than what the file originally was. Same file size would be fine.

Is it just a matter of playing around with the RF quality slider or is there some other options I should incorporate in my testing?

I've, for the most part, always had Web Optimized checked. I have tested without checking Web Optimized and on a 2GB file it saves about 100 MB or so by the looks of it.. in the testing above Web Optimized is always checked.

Appreciate any info!

Tell us about your environment. What version of HandBrake? What version of Windows are you running. etc.

CPU: i7 4770 K
RAM: 16GB DDR3

Handbrake Ver. 1.0.7

Windows 10

If there was any exception or error displayed, please copy it and paste it here:
N/A

Please include the scan or encode log:

Pastebin Log: https://pastebin.com/sFRPJygj

EDIT:
Pastebin link was broken. Fixed now.
Woodstock
Veteran User
Posts: 4620
Joined: Tue Aug 27, 2013 6:39 am

Re: Understanding Larger File Size after Encode

Post by Woodstock »

Are the source files interlaced?
Yawnny
Posts: 15
Joined: Thu May 18, 2017 5:53 am

Re: Understanding Larger File Size after Encode

Post by Yawnny »

Judging by MediaInfo it's Progressive:

File size : 4.38 GiB
Duration : 1 h 57 min
Overall bit rate mode : Variable
Overall bit rate : 5 349 kb/s
Writing application : Lavf56.25.101

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Format settings, GOP : M=1, N=30
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 1 h 57 min
Bit rate mode : Variable
Bit rate : 5 166 kb/s
Maximum bit rate : 15.0 Mb/s
Width : 1 920 pixels
Height : 1 080 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 29.970 (30000/1001) FPS
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.083
Stream size : 4.23 GiB (97%)
rollin_eng
Veteran User
Posts: 4857
Joined: Wed May 04, 2011 11:06 pm

Re: Understanding Larger File Size after Encode

Post by rollin_eng »

Your source is probably very compressed already thus you won't be able to compress it anymore without losing quality.
Yawnny
Posts: 15
Joined: Thu May 18, 2017 5:53 am

Re: Understanding Larger File Size after Encode

Post by Yawnny »

rollin_eng wrote: Fri Jul 21, 2017 7:03 pm Your source is probably very compressed already thus you won't be able to compress it anymore without losing quality.
This is my prevailing thought as well.

I'm trying to think when the compression would happen on a source like this.

My initial thought is when Twitch uploads the past broadcasts to their servers it's compressed at that point. Is this a safe presumption?

I do apply a Quick Stream Fix via VideoRedo TV Suite which rearranges time stamps in the file to be in the correct sequence so that Handbrake doesn't throw any "frame out of sequence went backwards" messages so perhaps this is compressing it even further, even though the output file after VideoRedo is identical to before.
Yawnny
Posts: 15
Joined: Thu May 18, 2017 5:53 am

Re: Understanding Larger File Size after Encode

Post by Yawnny »

rollin_eng wrote: Fri Jul 21, 2017 7:03 pm ..won't be able to compress it anymore without losing quality.
Is there a setting I can try to not even attempt compression ie: keep the file size and quality the same, but just force the 30FPS framerate? I'm quite happy with the original file size.

..Or is forcing a framerate in itself a form of compression?

Appreciate the help thus far.
Woodstock
Veteran User
Posts: 4620
Joined: Tue Aug 27, 2013 6:39 am

Re: Understanding Larger File Size after Encode

Post by Woodstock »

If the source is progressive, you should set deinterlace to "off"; Your log shows that it is set to decomb, and it appears that decomb "found something to do":
[01:19:53] comb detect: heavy 73964 | light 35471 | uncombed 101425 | total 210860
[01:19:54] decomb: deinterlaced 73964 | blended 35471 | unfiltered 101425 | total 210860
I would try the same encode without decomb, and see if it affects the file size.
Yawnny
Posts: 15
Joined: Thu May 18, 2017 5:53 am

Re: Understanding Larger File Size after Encode

Post by Yawnny »

Woodstock wrote: Fri Jul 21, 2017 7:27 pm If the source is progressive, you should set deinterlace to "off"; Your log shows that it is set to decomb, and it appears that decomb "found something to do":
[01:19:53] comb detect: heavy 73964 | light 35471 | uncombed 101425 | total 210860
[01:19:54] decomb: deinterlaced 73964 | blended 35471 | unfiltered 101425 | total 210860
I would try the same encode without decomb, and see if it affects the file size.
That makes total sense!

I'll give that shot and report back.
Yawnny
Posts: 15
Joined: Thu May 18, 2017 5:53 am

Re: Understanding Larger File Size after Encode

Post by Yawnny »

Setting deinterlace to "off" shaved off about 300MB so that was nice to see.

I'm going to keep playing with lower RF settings and see if I can hit the sweet spot.
rollin_eng
Veteran User
Posts: 4857
Joined: Wed May 04, 2011 11:06 pm

Re: Understanding Larger File Size after Encode

Post by rollin_eng »

Also probably better to just pass your audio through rather than re-encode it.

If you want your output to be roughly the same size and quality just do a 2 pass ABR at the same bitrate as your source. You will still lose some quality but it should keep it in the same ballpark.
Post Reply