Transcoding 8K H264 to H265

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
jdmuys
Posts: 8
Joined: Sun May 27, 2007 3:16 pm

Transcoding 8K H264 to H265

Post by jdmuys » Wed Sep 04, 2019 1:31 pm

Description of problem or question:
Hi,

I purchased the beautiful movie Beneath the Sea because it's available in 8K and I have an 8K Samsung TV.
The problem is that I was delivered the movie encoded in H264 (MP4 container, 31,57GB), while the TV can only play 8K movies encoded in H265.
So I want to transcode it to H265, while maintaining as much of it as possible.

My first attempt yielded a 411GB file. Clearly I did something wrong. I expect to be able to transcode to similar quality with a smaller file than original (for an 8K movie).

Reading up here and the doc, I suspect the reason might be that the constant quality RF parameter was set to 2.
I just restarted an process with RF=22.

While it's processing (ETA in 30hour), I figured I might avoid another futile attempt by asking here: is RF the most likely culprit? is RF=22 a good value for 8K video? Any other settings to look at?

I am a bit of a video ignoramus obviously, and while I am willing to learn, I would also like to get to watch my movie sooner than later :-)

So thanks for any suggestion

Jean-Denis

Image

HandBrake version (e.g., 1.0.0):

1.2.2


Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

MacBook Pro 2,9GHz Core I9 with Radeon Pro Vega 20, under macOS Catalina 10.15 beta (19A546d)


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

Code: Select all


[10:34:53] macgui: Handbrake Version: 1.2.2  (2019022300)
[10:34:53] macgui: built-in presets updated
[10:34:53] hb_init: starting libhb thread
[10:34:53] hb_init: starting libhb thread
[10:35:10] macgui: trying to open a folder or file
[10:35:10] macgui: ScanCore scanning titles with a duration of 10 seconds or more
[10:35:10] CPU: Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
[10:35:10]  - Intel microarchitecture Kaby Lake
[10:35:10]  - logical processor count: 12
[10:35:10] hb_scan: path=/Users/jdmuys/Downloads/Beneath the Sea 8K.mp4, title_index=0
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /Users/jdmuys/Downloads/Beneath the Sea 8K.mp4
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[10:35:10] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
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.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[10:35:10] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/jdmuys/Downloads/Beneath the Sea 8K.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2019-07-12T20:18:08.000000Z
  Duration: 00:59:34.74, start: 0.000000, bitrate: 70650 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 7680x4320, 70328 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2019-07-12T20:18:10.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
    Metadata:
      creation_time   : 2019-07-12T20:18:12.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
[10:35:11] scan: decoding previews for title 1
[10:35:12] scan: audio 0x1: aac, rate=48000Hz, bitrate=317375 English (AAC LC) (2.0 ch)
[10:35:21] scan: 10 previews, 7680x4320, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[10:35:21] libhb: scan thread found 1 valid title(s)
[10:35:21] macgui: ScanCore scan done
[19:21:19] macgui: QueueCore prevented sleep
[19:21:19] macgui: QueueCore scanning specifically for title: 1
[19:21:19] CPU: Intel(R) Core(TM) i9-8950HK CPU @ 2.90GHz
[19:21:19]  - Intel microarchitecture Kaby Lake
[19:21:19]  - logical processor count: 12
[19:21:19] hb_scan: path=/Users/jdmuys/Downloads/Beneath the Sea 8K.mp4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /Users/jdmuys/Downloads/Beneath the Sea 8K.mp4
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[19:21:19] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
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.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[19:21:19] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/jdmuys/Downloads/Beneath the Sea 8K.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: mp42mp41
    creation_time   : 2019-07-12T20:18:08.000000Z
  Duration: 00:59:34.74, start: 0.000000, bitrate: 70650 kb/s
    Stream #0:0(eng): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 7680x4320, 70328 kb/s, 23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
    Metadata:
      creation_time   : 2019-07-12T20:18:10.000000Z
      handler_name    : ?Mainconcept Video Media Handler
      encoder         : AVC Coding
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 317 kb/s (default)
    Metadata:
      creation_time   : 2019-07-12T20:18:12.000000Z
      handler_name    : #Mainconcept MP4 Sound Media Handler
[19:21:20] scan: decoding previews for title 1
[19:21:22] scan: audio 0x1: aac, rate=48000Hz, bitrate=317375 English (AAC LC) (2.0 ch)
[19:21:41] scan: 10 previews, 7680x4320, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[19:21:41] libhb: scan thread found 1 valid title(s)
[19:21:41] macgui: QueueCore scan done
[19:21:41] macgui: QueueCore started encoding Beneath the Sea 8K HEVC Handbrake.mp4
[19:21:41] macgui: QueueCore with preset Production Max (Modified)
[19:21:41] 1 job(s) to process
[19:21:41] starting job
[19:21:41] work: only 1 chapter, disabling chapter markers
[19:21:41] job configuration:
[19:21:41]  * source
[19:21:41]    + /Users/jdmuys/Downloads/Beneath the Sea 8K.mp4
[19:21:41]    + title 1, chapter(s) 1 to 1
[19:21:41]    + container: mov,mp4,m4a,3gp,3g2,mj2
[19:21:41]    + data rate: 70650 kbps
[19:21:41]  * destination
[19:21:41]    + /Users/jdmuys/Movies/Beneath the Sea 8K HEVC Handbrake.mp4
[19:21:41]    + container: MPEG-4 (libavformat)
[19:21:41]  * video track
[19:21:41]    + decoder: h264
[19:21:41]      + bitrate 70328 kbps
[19:21:42]    + filters
[19:21:42]      + Framerate Shaper (mode=1:rate=27000000/1126125)
[19:21:42]        + frame rate: 23.976 fps -> constant 23.976 fps
[19:21:42]      + Crop and Scale (width=7680:height=4320:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[19:21:42]        + source: 7680 * 4320, crop (0/0/0/0): 7680 * 4320, scale: 7680 * 4320
[19:21:42]    + Output geometry
[19:21:42]      + storage dimensions: 7680 x 4320
[19:21:42]      + pixel aspect ratio: 1 : 1
[19:21:42]      + display dimensions: 7680 x 4320
[19:21:42]    + encoder: H.265 (libx265)
[19:21:42]      + preset:  fast
[19:21:42]      + profile: auto
[19:21:42]      + quality: 2.00 (RF)
[19:21:42]      + color profile: 1-1-1
[19:21:42]  * audio track 1
[19:21:42]    + decoder: English (AAC LC) (2.0 ch) (track 1, id 0x1)
[19:21:42]      + bitrate: 317 kbps, samplerate: 48000 Hz
[19:21:42]    + AAC Passthru
[19:21:46] sync: expecting 85708 video frames
x265 [info]: HEVC encoder version 2.9
x265 [info]: build info [Mac OS X][clang 10.0.0][64 bit] 8bit+10bit+12bit
x265 [info]: using cpu capabilities: MMX2 SSE2Fast LZCNT SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x265 [info]: Main profile, Level-6 (Main tier)
x265 [info]: Thread pool created using 12 threads
x265 [info]: Slices                              : 1
x265 [info]: frame threads / pool features       : 3 / wpp(68 rows)
x265 [info]: Coding QT: max CU size, min CU size : 64 / 8
x265 [info]: Residual QT: max TU size, max depth : 32 / 1 inter / 1 intra
x265 [info]: ME / range / subpel / merge         : hex / 57 / 2 / 2
x265 [info]: Keyframe min / max / scenecut / bias: 24 / 240 / 40 / 5.00
x265 [info]: Lookahead / bframes / badapt        : 15 / 4 / 0
x265 [info]: b-pyramid / weightp / weightb       : 1 / 1 / 0
x265 [info]: References / ref-limit  cu / depth  : 3 / on / on
x265 [info]: AQ: mode / str / qg-size / cu-tree  : 1 / 1.0 / 32 / 1
x265 [info]: Rate Control / qCompress            : CRF-2.0 / 0.60
x265 [info]: tools: rd=2 psy-rd=2.00 rskip signhide tmvp fast-intra
x265 [info]: tools: strong-intra-smoothing lslices=8 deblock sao
[19:21:52] sync: first pts video is 0
[19:21:52] sync: "Chapter 1" (1) at frame 1 time 0
[19:21:52] sync: first pts audio 0x1 is 0
[19:22:22] macgui: QueueCore stopped preventing sleep
[21:09:49] macgui: QueueCore prevented sleep
[23:26:34] reader: done. 1 scr changes
[23:28:08] work: average encoding speed for job is 0.905072 fps
[23:28:09] vfr: 85707 frames output, 0 dropped and 0 duped for CFR/PFR
[23:28:09] vfr: lost time: 0 (0 frames)
[23:28:09] vfr: gained time: 0 (0 frames) (0 not accounted for)
[23:28:09] aac-decoder done: 167564 frames, 0 decoder errors
[23:28:09] h264-decoder done: 85707 frames, 0 decoder errors
[23:28:09] sync: got 85707 frames, 85708 expected
[23:28:09] sync: framerate min 23.981 fps, max 23.981 fps, avg 23.976 fps
x265 [info]: frame I:    640, Avg QP:3.79  kb/s: 1609417.91
x265 [info]: frame P:  17019, Avg QP:1.54  kb/s: 1631103.74
x265 [info]: frame B:  68048, Avg QP:4.97  kb/s: 735394.90
x265 [info]: Weighted P-Frames: Y:4.9% UV:3.5%
x265 [info]: consecutive B-frames: 2.5% 1.3% 0.2% 0.3% 95.7% 

encoded 85707 frames in 273983.11s (0.31 fps), 919784.07 kb/s, Avg QP:4.28
[23:28:10] mux: track 0, 85707 frames, 410993915695 bytes, 919774.11 kbps, fifo 512
[23:28:10] mux: track 1, 167564 frames, 141814999 bytes, 317.37 kbps, fifo 1024
[23:28:11] libhb: work result = 0
[23:28:11] macgui: QueueCore work done
[23:28:11] macgui: Queue Done, there are no more pending encodes
[23:28:11] macgui: QueueCore stopped preventing sleep



rollin_eng
Veteran User
Posts: 3163
Joined: Wed May 04, 2011 11:06 pm

Re: Transcoding 8K H264 to H265

Post by rollin_eng » Wed Sep 04, 2019 2:00 pm

22 seems like a good place to start.

You can always encode a small chapter or time period to test your settings, rather than waiting for the whole thing to encode.

mduell
Veteran User
Posts: 6678
Joined: Sat Apr 21, 2007 8:54 pm

Re: Transcoding 8K H264 to H265

Post by mduell » Wed Sep 04, 2019 3:50 pm

Speaking broadly, the defaults are much more sensible than pushing settings you don't understand to one extreme end of the scale.

Even RF 22 seems low for 8K, you've got a lot of pixels to work with and the TV isn't making your eyes any better. But see how you like the result.

In general I would advise against forcing constant framerate unless you have a specific need for it (degenerate video editing software, constrained playback environments, etc), although it's not doing any harm on this particular encode.

musicvid
Veteran User
Posts: 3292
Joined: Sat Jun 27, 2009 1:19 am

Re: Transcoding 8K H264 to H265

Post by musicvid » Thu Sep 05, 2019 11:46 am

If your x265 comes in around 2/3 the size of the x264 original, you're in the right neighborhood. There is no real correlation between CRF / CQ numbers across encoders, and the index disparities get worse with hardware encoders. The numbers pretty much are what they are, all the way from 12-30.

Post Reply