Why would an mp4 increase x3 after adding subtitles?

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
mrgulic
Posts: 4
Joined: Thu Nov 22, 2018 11:24 am

Why would an mp4 increase x3 after adding subtitles?

Post by mrgulic »

Description of problem or question:
I added subtitles to the movie The Avengers (like i have with countless other movies), but the output file size is 3 times that of the original.




Steps to reproduce the problem:
  • Added file to handbrake (drag and drop).
  • In subtitle tab, clicked Import SRT.
  • Selected the 4kb file
  • Checked burn in option
  • Clicked start




HandBrake version:
10.5 64bit




Operating system and version:
Windows 7 64bit




HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

HandBrake 0.10.5.0 - 64bit Version
OS: Microsoft Windows NT 6.1.7601 Service Pack 1 - 64bit
CPU: AMD A8-7600 Radeon R7, 10 Compute Cores 4C+6G  
Ram: 15303 MB, 
GPU Information:
  AMD Radeon(TM) R7 Graphics - 15.200.1062.1004
Screen: 1280x720
Temp Dir: C:\Users\admin\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\admin\AppData\Roaming\HandBrake Team\HandBrake\0.10.5.0

-------------------------------------------

CLI Query:  -i "C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig.mp4" -t 1 --angle 1 -c 1 -o "C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig - burnin.mp4"  -f mp4  --crop 0:0:10:0 --strict-anamorphic  --modulus 2 -e x264 -q 18 --vfr -a 1 -E av_aac -6 dpl2 -R 48 -B 160 -D 0 --gain 0 --audio-fallback ac3 --srt-file "C:\\Users\\admin\\Documents\\_mp4Output\\the-avengers_english-1070135\\The Avengers forced.srt" --srt-codeset UTF-8 --srt-offset 0 --srt-lang eng --srt-burn=1 --markers="C:\Users\admin\AppData\Local\Temp\The Avengers (2012) orig - burnin-1-chapters.csv" --encoder-level="4.1"  --encoder-profile=high  --verbose=1 --no-dvdnav

[06:34:45] hb_init: starting libhb thread
HandBrake 0.10.5 (2016021100) - MinGW x86_64 - https://handbrake.fr
4 CPUs detected
Opening C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig.mp4...
[06:34:45] CPU: 
[06:34:45]  - logical processor count: 4
[06:34:45] OpenCL device #1: Advanced Micro Devices, Inc. Spectre
[06:34:45]  - OpenCL version: 2.0 AMD-APP (1800.8)
[06:34:45]  - driver version: 1800.8 (VM)
[06:34:45]  - device type:    GPU
[06:34:45]  - supported:      YES
[06:34:45] Intel Quick Sync Video support: no
[06:34:45] hb_scan: path=C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig.mp4, title_index=1
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig.mp4/BDMV/index.bdmv
libbluray/bdnav/index_parse.c:162: indx_parse(): error opening C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig.mp4/BDMV/BACKUP/index.bdmv
libbluray/bluray.c:2182: nav_get_title_list(C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig.mp4) failed
[06:34:45] bd: not a bd - trying as a stream/file instead
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.BUP.
ERROR: dvd: ifoOpen failed
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 1
    compatible_brands: isomavc1
    creation_time   : 2012-08-21 16:52:50
  Duration: 02:22:54.89, start: 0.000000, bitrate: 2200 kb/s
    Stream #0.0(und): Video: h264 (High), yuv420p, 1920x1080 [PAR 1:1 DAR 16:9], 2102 kb/s, 23.98 fps, 96k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2012-08-21 16:52:50
    Stream #0.1(eng): Audio: aac, 44100 Hz, stereo, fltp, 93 kb/s (default)
    Metadata:
      creation_time   : 2012-08-21 16:53:34
    Stream #0.2: Video: mjpeg, yuvj444p, 284x405 [PAR 300:300 DAR 284:405], 90k tbn
[06:34:45] scan: decoding previews for title 1
Scanning title 1 of 1, preview 1, 0.00 %[06:34:45] scan: audio 0x1: aac, rate=44100Hz, bitrate=93909 English (AAC) (2.0 ch)
Scanning title 1 of 1, preview 3, 30.00 %
Scanning title 1 of 1, preview 6, 60.00 %
Scanning title 1 of 1, preview 8, 80.00 %[06:34:46] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 0/0/10/0, aspect 16:9, PAR 1:1
Scanning title 1 of 1, preview 10, 100.00 %[06:34:46] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig.mp4
  + duration: 02:22:54
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 0/0/10/0
  + support opencl: yes
  + support hwd: yes
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 02:22:54
  + audio tracks:
    + 1, English (AAC) (2.0 ch) (iso639-2: eng)
  + subtitle tracks:
Reading chapter markers from file C:\Users\admin\AppData\Local\Temp\The Avengers (2012) orig - burnin-1-chapters.csv
[06:34:46] 1 job(s) to process
[06:34:46] starting job
[06:34:46] work: sanitizing track 1 mixdown Dolby Pro Logic II to Stereo
[06:34:46] sync: expecting 205591 video frames
[06:34:46] work: only 1 chapter, disabling chapter markers
[06:34:46] job configuration:
[06:34:46]  * source
[06:34:46]    + C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig.mp4
[06:34:46]    + title 1, chapter(s) 1 to 1
[06:34:46]    + container: mov,mp4,m4a,3gp,3g2,mj2
[06:34:46]    + data rate: 2200 kbps
[06:34:46]  * destination
[06:34:46]    + C:\Users\admin\Documents\_mp4Output\The Avengers (2012) orig - burnin.mp4
[06:34:46]    + container: MPEG-4 (libavformat)
[06:34:46]  * video track
[06:34:46]    + decoder: h264
[06:34:46]      + bitrate 2102 kbps
[06:34:46]    + filters
[06:34:46]      + Framerate Shaper (0:27000000:1126125)
[06:34:46]        + frame rate: same as source (around 23.976 fps)
[06:34:46]      + Subtitle renderer (0:0:10:0)
[06:34:46]      + Crop and Scale (1910:1080:0:0:10:0)
[06:34:46]        + source: 1920 * 1080, crop (0/0/10/0): 1910 * 1080, scale: 1910 * 1080
[06:34:46]    + strict anamorphic
[06:34:46]      + storage dimensions: 1910 * 1080, mod 2
[06:34:46]      + pixel aspect ratio: 1 / 1
[06:34:46]      + display dimensions: 1910 * 1080
[06:34:46]    + encoder: H.264 (libx264)
[06:34:46]      + profile: high
[06:34:46]      + level:   4.1
[06:34:46]      + quality: 18.00 (RF)
[06:34:46]  * subtitle track 1, English (track 0, id 0xff) Text [SRT] -> Render/Burn-in, offset: 0, charset: UTF-8
[06:34:46]  * audio track 1
[06:34:46]    + decoder: English (AAC) (2.0 ch) (track 1, id 0x1)
[06:34:46]      + bitrate: 93 kbps, samplerate: 44100 Hz
[06:34:46]    + mixdown: Stereo
[06:34:46]    + encoder: AAC (libavcodec)
[06:34:46]      + bitrate: 160 kbps, samplerate: 48000 Hz
[06:34:46] reader: first SCR 7507 id 0x0 DTS 0
[06:34:46] encx264: min-keyint: 24, keyint: 240
[06:34:46] encx264: encoding at constant RF 18.000000
[06:34:46] encx264: unparsed options: level=4.1:vbv-bufsize=78125:vbv-maxrate=62500
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX XOP FMA4 FMA3 LZCNT BMI1
x264 [info]: profile High, level 4.1
[06:34:46] sync: first pts is 7507
[11:32:16] reader: done. 1 scr changes
[11:32:20] work: average encoding speed for job is 11.514352 fps
[11:32:20] sync: got 205567 frames, 205591 expected
[11:32:20] render: lost time: 0 (0 frames)
[11:32:20] render: gained time: 0 (0 frames) (0 not accounted for)
[11:32:20] h264-decoder done: 205567 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:3905  Avg QP:13.40  size:148973
x264 [info]: frame P:106158 Avg QP:16.70  size: 44343
x264 [info]: frame B:95504 Avg QP:18.83  size: 12431
x264 [info]: consecutive B-frames: 29.1% 24.0%  8.6% 38.4%
x264 [info]: mb I  I16..4: 13.0% 69.5% 17.5%
x264 [info]: mb P  I16..4:  5.8% 20.2%  1.9%  P16..4: 29.5% 17.6%  6.0%  0.0%  0.0%    skip:18.9%
x264 [info]: mb B  I16..4:  0.4%  0.8%  0.1%  B16..8: 34.8%  8.1%  1.2%  direct: 3.1%  skip:51.5%  L0:43.3% L1:50.5% BI: 6.2%
x264 [info]: 8x8 transform intra:71.8% inter:76.7%
x264 [info]: coded y,uvDC,uvAC intra: 48.4% 65.9% 28.1% inter: 16.5% 17.8% 0.8%
x264 [info]: i16 v,h,dc,p: 31% 31%  6% 31%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 27% 26% 21%  3%  4%  5%  5%  4%  5%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 33% 25% 13%  4%  7%  6%  6%  4%  3%
x264 [info]: i8c dc,h,v,p: 53% 27% 15%  5%
x264 [info]: Weighted P-Frames: Y:1.7% UV:1.2%
x264 [info]: ref P L0: 69.2%  9.2% 15.9%  5.5%  0.1%
x264 [info]: ref B L0: 86.8% 11.9%  1.3%
x264 [info]: ref B L1: 96.1%  3.9%
x264 [info]: kb/s:6042.76
[11:32:20] aac-decoder done: 0 frames, 0 decoder errors, 0 drops
[11:32:20] mux: track 0, 205567 frames, 6476153083 bytes, 6041.99 kbps, fifo 2048
[11:32:20] mux: track 1, 401947 frames, 171800640 bytes, 160.28 kbps, fifo 4096
[11:32:20] libhb: work result = 0
Encode done!
HandBrake has exited.

User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Why would an mp4 increase x3 after adding subtitles?

Post by s55 »

Your basically re-encoding at a higher "quality" level than the source. (without actually being higher quality). I.e increased bits per pixel for no real gain.

Adjust the RF quality slider to something more reasonable for 1080p around the 22 to 24 mark.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Why would an mp4 increase x3 after adding subtitles?

Post by mduell »

Because you're using quality based encoding with an unreasonable quality target given your source.
mrgulic
Posts: 4
Joined: Thu Nov 22, 2018 11:24 am

Re: Why would an mp4 increase x3 after adding subtitles?

Post by mrgulic »

s55 wrote: Thu Nov 22, 2018 7:13 pm Your basically re-encoding at a higher "quality" level than the source. (without actually being higher quality). I.e increased bits per pixel for no real gain.

Adjust the RF quality slider to something more reasonable for 1080p around the 22 to 24 mark.
Thanks for your reply.

My RF is at always at 18, which handbrake says is SD (18-20), which I would expect to produce a smaller file then 22-24 (being 20-23 is HD). Or am I misunderstanding the documentation?

Edit: I just read that little popup again. It appears to be contradicting (or at least that is my interpretation).
"...lower values correspond to higher quality" and then several lines below is "..... 18 to 20 for standard definition and 20 to 23 for High Definition". Am i crazy or are those statements in contrast to each other?
Last edited by mrgulic on Thu Nov 22, 2018 11:41 pm, edited 1 time in total.
mrgulic
Posts: 4
Joined: Thu Nov 22, 2018 11:24 am

Re: Why would an mp4 increase x3 after adding subtitles?

Post by mrgulic »

mduell wrote: Thu Nov 22, 2018 10:46 pm Because you're using quality based encoding with an unreasonable quality target given your source.
Thanks for your reply.

As far as I recall, I use the default settings, aside from adjusting the RF to 18. I saved this as a preset years ago, and have used it ever since. If there is another video quality setting that I should adjust, I am all ears. I have never had cause to adjust anything else (aside from cropping once) so I am not familiar with what all the other settings do.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Why would an mp4 increase x3 after adding subtitles?

Post by Woodstock »

Lower numbers preserve more detail. On DVD sources, you really can't afford to lose as much. :)
mrgulic
Posts: 4
Joined: Thu Nov 22, 2018 11:24 am

Re: Why would an mp4 increase x3 after adding subtitles?

Post by mrgulic »

Thanks all.

I have been re-coding in increasing increments of 2 and comparing. So far the file size decrease a little over 1 gb each increment without any noticeable loss in picture quality (but that could just be my failing eyesight).
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Why would an mp4 increase x3 after adding subtitles?

Post by mduell »

That's why encoding quality is highly subjective.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Why would an mp4 increase x3 after adding subtitles?

Post by Woodstock »

For the kind of comparison you're doing, remember that you do not have to encode the whole movie... Pick parts that are hard for the encoder to work with, that is, high detail and fast motion. These are the areas where "unacceptable to me" appears soonest.
Post Reply