B-pyramid, subq and treillis questions

HandBrake for Mac 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
Deleted User 11865

B-pyramid, subq and treillis questions

Post by Deleted User 11865 »

I'm trying to determine which settings to use for encoding movies with HandBrake. My goal is to create movies with a given bitrate, so I will be using 2-pass encoding. However, to determine the settings, what I'm trying to do is a constant quality encode (same source, same picture settings) with different settings, and compare the resulting file sizes. While it's not perfect, my guess is that the settings which produce the smallest files are more likely to give a better quality once I limit the bitrate.

While doing so, I've noticed that the "Pyramidal B-Frames", "Subpixel Motion Estimation" and "Treillis" settings don't behave as I would expect. Based on what I read on your wiki and elsewhere, these options should improve quality or, for a given quality, reduce bitrate. Interestingly, for a given quality, they seem to increase the bitrate.

Here's what I did: I took a sample video (only 13 seconds) and used the "Constant Quality Rate" setting. Then, I did 3 re-encodes, first disabling treillis, then setting subq to 7, then disabling b-pyramids. Each time, the resulting file was smaller than the previous encode. I have the individual activity logs for each encode.

First encode: Constant Quality Rate preset, every x264 setting left untouched. File is 4.9 MB, QuickTime reports a data rate of 3114.77 kbit/s.

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/Friends Test Constant Quality Rate.mkv: 2009-03-03 21:43:18 +0100
Handbrake Version: 0.9.3 (2008112300)

[21:43:18] macgui: Rip: Pending queue count is 0
[21:43:18] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[21:43:18] macgui: Rip: Going right to performNewQueueScan
[21:43:18] macgui: scanning specifically for title: 1
[21:43:18] macgui: performNewQueueScan currentQueueEncodeIndex is: 0
[21:43:18] hb_scan: path=/Volumes/LaCieDisk/excluded/Videos & Movies/Friends Test/Friends Test.vob, title_index=1
[21:43:18] scan: trying to open with libdvdread
[21:43:18] dvd: not a dvd - trying as a stream/file instead
[21:43:18] file is MPEG DVD Program Stream
[21:43:18] add_audio_to_title: added AC3 audio stream 0x84bd
[21:43:18] add_audio_to_title: added AC3 audio stream 0x83bd
[21:43:18] add_audio_to_title: added AC3 audio stream 0x82bd
[21:43:18] add_audio_to_title: added AC3 audio stream 0x81bd
[21:43:18] add_audio_to_title: added AC3 audio stream 0x80bd
[21:43:18] scan: decoding previews for title 1
[21:43:18] scan: audio 0x80bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:43:18] scan: audio 0x84bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:43:18] scan: audio 0x83bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:43:18] scan: audio 0x82bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:43:18] scan: audio 0x81bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:43:18] scan: 10 previews, 720x576, 25.000 fps, autocrop = 2/0/12/6, aspect 4:3, PAR 16:15
[21:43:18] scan: title (0) job->width:704, job->height:544
[21:43:18] libhb: scan thread found 1 valid title(s)
[21:43:19] macgui: ScanDone state received from fQueueEncodeLibhb
[21:43:19] macgui: processNewQueueEncode title list is: 1
[21:43:19] macgui: Preset: Constant Quality Rate
[21:43:19] macgui: processNewQueueEncode number of passes expected is: 1
[21:43:19] macgui: prepareJob exiting
[21:43:19] 1 job(s) to process
[21:43:19] starting job
[21:43:19] job configuration:
[21:43:19]  * source
[21:43:19]    + /Volumes/LaCieDisk/excluded/Videos & Movies/Friends Test/Friends Test.vob
[21:43:19]    + title 1, chapter(s) 1 to 1
[21:43:19]  * destination
[21:43:19]    + /Users/tim/Desktop/Friends Test Constant Quality Rate.mkv
[21:43:19]    + container: Matroska (.mkv)
[21:43:19]      + chapter markers
[21:43:19]  * video track
[21:43:19]    + decoder: mpeg2
[21:43:19]      + bitrate 7500 kbps
[21:43:19]    + frame rate: same as source (around 25.000 fps)
[21:43:19]    + strict anamorphic
[21:43:19]      + storage dimensions: 720 * 576 -> 720 * 576, crop 0/0/0/0
[21:43:19]      + pixel aspect ratio: 16 / 15
[21:43:19]      + display dimensions: 768 * 576
[21:43:19]    + filter
[21:43:19]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (1:2:6:9:80:16:16)
[21:43:19]    + encoder: x264
[21:43:19]      + options: ref=3:mixed-refs=1:bframes=3:b-pyramid=1:weightb=1:deblock=-2,-1:trellis=1:analyse=all:8x8dct=1:me=umh:subq=9:psy-rd=1,1
[21:43:19]      + quality: 0.60
[21:43:19]  * audio track 0
[21:43:19]    + decoder: Unknown (AC3) (2.0 ch) (track 1, id 84bd)
[21:43:19]      + bitrate: 192 kbps, samplerate: 48000 Hz
[21:43:19]    + AC3 passthrough
[21:43:19] dvd: not a dvd - trying as a stream/file instead
[21:43:19] reader: first SCR 1190326
[21:43:19] yadif thread started for segment 0
[21:43:19] yadif thread started for segment 1
[21:43:19] decomb thread started for segment 0
[21:43:19] decomb thread started for segment 1
[21:43:19] encx264: encoding with stored aspect 16/15
[21:43:19] encx264: Encoding at constant RF 20.400000
x264 [info]: using SAR=16/15
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
x264 [info]: profile High, level 3.0
No accelerated IMDCT transform found
[21:43:19] sync: expecting 361 video frames
[21:43:19] a52_syncinfo failed
[21:43:19] a52_syncinfo ok
[21:43:19] mpeg2: "Chapter  1" (1) at frame 0 time 10800
[21:43:19] sync: first pts is 10800
[21:43:42] reader: done. 1 scr changes
[21:43:47] sync: got 310 frames, 361 expected
[21:43:47] work: average encoding speed for job is 11.746342 fps
[21:43:49] mpeg2 done: 311 frames
[21:43:49] render: lost time: 0 (0 frames)
[21:43:49] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:3     Avg QP:18.47  size: 43472  PSNR Mean Y:42.88 U:50.19 V:50.25 Avg:44.25 Global:44.25
x264 [info]: slice P:110   Avg QP:20.59  size: 24581  PSNR Mean Y:42.95 U:47.62 V:48.17 Avg:44.06 Global:43.96
x264 [info]: slice B:197   Avg QP:22.29  size:  9857  PSNR Mean Y:42.47 U:47.07 V:47.89 Avg:43.58 Global:43.50
x264 [info]: consecutive B-frames:  2.3% 18.2% 54.7% 24.8%
x264 [info]: mb I  I16..4:  0.7% 87.8% 11.5%
x264 [info]: mb P  I16..4:  0.7% 11.3%  0.7%  P16..4: 43.6% 25.9% 15.1%  0.4%  0.4%    skip: 2.0%
x264 [info]: mb B  I16..4:  0.1%  0.9%  0.0%  B16..8: 43.7%  1.8%  3.0%  direct: 8.3%  skip:42.3%  L0:33.5% L1:30.5% BI:36.0%
x264 [info]: 8x8 transform  intra:88.6%  inter:71.9%
x264 [info]: ref P L0  48.7% 34.0% 17.3%
x264 [info]: ref B L0  73.3% 26.7%
x264 [info]: ref B L1  92.1%  7.9%
x264 [info]: SSIM Mean Y:0.9760380
x264 [info]: PSNR Mean Y:42.641 U:47.298 V:48.013 Avg:43.759 Global:43.664 kb/s:3081.38
[21:43:49] decomb: yadif deinterlaced 55 | blend deinterlaced 2 | unfiltered 252 | total 309
[21:43:49] libhb: work result = 0
Second encode: same as first encode, with treillis=0. File is 3.3 MB, QuickTime reports 2132.56 kbits/s.

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/Friends Test Constant Quality Rate + (treillis=0).mkv: 2009-03-03 21:44:24 +0100
Handbrake Version: 0.9.3 (2008112300)

[21:44:24] macgui: Rip: Pending queue count is 0
[21:44:24] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[21:44:24] macgui: Rip: Going right to performNewQueueScan
[21:44:24] macgui: scanning specifically for title: 1
[21:44:24] macgui: performNewQueueScan currentQueueEncodeIndex is: 1
[21:44:24] hb_scan: path=/Volumes/LaCieDisk/excluded/Videos & Movies/Friends Test/Friends Test.vob, title_index=1
[21:44:24] scan: trying to open with libdvdread
[21:44:24] dvd: not a dvd - trying as a stream/file instead
[21:44:24] file is MPEG DVD Program Stream
[21:44:24] add_audio_to_title: added AC3 audio stream 0x84bd
[21:44:24] add_audio_to_title: added AC3 audio stream 0x83bd
[21:44:24] add_audio_to_title: added AC3 audio stream 0x82bd
[21:44:24] add_audio_to_title: added AC3 audio stream 0x81bd
[21:44:24] add_audio_to_title: added AC3 audio stream 0x80bd
[21:44:24] scan: decoding previews for title 1
[21:44:24] scan: audio 0x80bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:44:24] scan: audio 0x84bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:44:24] scan: audio 0x83bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:44:24] scan: audio 0x82bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:44:24] scan: audio 0x81bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:44:24] scan: 10 previews, 720x576, 25.000 fps, autocrop = 2/0/12/6, aspect 4:3, PAR 16:15
[21:44:24] scan: title (0) job->width:704, job->height:544
[21:44:24] libhb: scan thread found 1 valid title(s)
[21:44:24] macgui: currentScanCount received from fQueueEncodeLibhb
[21:44:24] macgui: ScanDone state received from fQueueEncodeLibhb
[21:44:24] macgui: processNewQueueEncode title list is: 1
[21:44:24] macgui: Preset: Constant Quality Rate
[21:44:24] macgui: processNewQueueEncode number of passes expected is: 1
[21:44:24] macgui: prepareJob exiting
[21:44:24] 1 job(s) to process
[21:44:24] starting job
[21:44:24] job configuration:
[21:44:24]  * source
[21:44:24]    + /Volumes/LaCieDisk/excluded/Videos & Movies/Friends Test/Friends Test.vob
[21:44:24]    + title 1, chapter(s) 1 to 1
[21:44:24]  * destination
[21:44:24]    + /Users/tim/Desktop/Friends Test Constant Quality Rate + (treillis=0).mkv
[21:44:24]    + container: Matroska (.mkv)
[21:44:24]      + chapter markers
[21:44:24]  * video track
[21:44:24]    + decoder: mpeg2
[21:44:24]      + bitrate 7500 kbps
[21:44:24]    + frame rate: same as source (around 25.000 fps)
[21:44:24]    + strict anamorphic
[21:44:24]      + storage dimensions: 720 * 576 -> 720 * 576, crop 0/0/0/0
[21:44:24]      + pixel aspect ratio: 16 / 15
[21:44:24]      + display dimensions: 768 * 576
[21:44:24]    + filter
[21:44:24]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (1:2:6:9:80:16:16)
[21:44:24]    + encoder: x264
[21:44:24]      + options: ref=3:mixed-refs=1:bframes=3:b-pyramid=1:weightb=1:deblock=-2,-1:trellis=0:analyse=all:8x8dct=1:me=umh:subq=9:psy-rd=1,1
[21:44:24]      + quality: 0.60
[21:44:24]  * audio track 0
[21:44:24]    + decoder: Unknown (AC3) (2.0 ch) (track 1, id 84bd)
[21:44:24]      + bitrate: 192 kbps, samplerate: 48000 Hz
[21:44:24]    + AC3 passthrough
[21:44:24] dvd: not a dvd - trying as a stream/file instead
[21:44:24] reader: first SCR 1190326
[21:44:24] encx264: encoding with stored aspect 16/15
[21:44:24] encx264: Encoding at constant RF 20.400000
x264 [info]: using SAR=16/15
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
[21:44:24] yadif thread started for segment 0
[21:44:24] yadif thread started for segment 1
[21:44:24] decomb thread started for segment 0
[21:44:24] decomb thread started for segment 1
x264 [info]: profile High, level 3.0
No accelerated IMDCT transform found
[21:44:24] a52_syncinfo failed
[21:44:24] a52_syncinfo ok
[21:44:24] sync: expecting 361 video frames
[21:44:24] mpeg2: "Chapter  1" (1) at frame 0 time 10800
[21:44:24] sync: first pts is 10800
[21:44:44] reader: done. 1 scr changes
[21:44:48] sync: got 310 frames, 361 expected
[21:44:48] work: average encoding speed for job is 13.970933 fps
[21:44:49] mpeg2 done: 311 frames
[21:44:49] render: lost time: 0 (0 frames)
[21:44:49] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:3     Avg QP:18.47  size: 48124  PSNR Mean Y:45.41 U:49.32 V:49.38 Avg:46.37 Global:46.31
x264 [info]: slice P:110   Avg QP:20.51  size: 16923  PSNR Mean Y:42.95 U:46.78 V:47.34 Avg:43.93 Global:43.83
x264 [info]: slice B:197   Avg QP:22.02  size:  5933  PSNR Mean Y:42.19 U:46.50 V:47.26 Avg:43.26 Global:43.18
x264 [info]: consecutive B-frames:  2.3% 18.2% 54.7% 24.8%
x264 [info]: mb I  I16..4:  0.9% 90.0%  9.2%
x264 [info]: mb P  I16..4:  0.4%  8.7%  0.5%  P16..4: 48.2% 25.1% 12.7%  0.3%  0.3%    skip: 3.7%
x264 [info]: mb B  I16..4:  0.1%  0.5%  0.0%  B16..8: 52.4%  1.5%  3.0%  direct: 7.7%  skip:34.9%  L0:33.0% L1:51.8% BI:15.2%
x264 [info]: 8x8 transform  intra:89.7%  inter:69.4%
x264 [info]: ref P L0  58.5% 27.2% 14.3%
x264 [info]: ref B L0  80.1% 19.9%
x264 [info]: ref B L1  91.7%  8.3%
x264 [info]: SSIM Mean Y:0.9752198
x264 [info]: PSNR Mean Y:42.491 U:46.629 V:47.310 Avg:43.532 Global:43.422 kb/s:2048.20
[21:44:49] decomb: yadif deinterlaced 55 | blend deinterlaced 2 | unfiltered 252 | total 309
[21:44:49] libhb: work result = 0
Third encode: same as second encode, with subq=7. File is 3.3 MB, QuickTime reports 2091.29 kbits/s.

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/Friends Test Constant Quality Rate + (treillis=0:subq=7).mkv: 2009-03-03 21:45:06 +0100
Handbrake Version: 0.9.3 (2008112300)

[21:45:06] macgui: Rip: Pending queue count is 0
[21:45:06] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[21:45:06] macgui: Rip: Going right to performNewQueueScan
[21:45:06] macgui: scanning specifically for title: 1
[21:45:06] macgui: performNewQueueScan currentQueueEncodeIndex is: 2
[21:45:06] hb_scan: path=/Volumes/LaCieDisk/excluded/Videos & Movies/Friends Test/Friends Test.vob, title_index=1
[21:45:06] scan: trying to open with libdvdread
[21:45:06] dvd: not a dvd - trying as a stream/file instead
[21:45:06] file is MPEG DVD Program Stream
[21:45:06] add_audio_to_title: added AC3 audio stream 0x84bd
[21:45:06] add_audio_to_title: added AC3 audio stream 0x83bd
[21:45:06] add_audio_to_title: added AC3 audio stream 0x82bd
[21:45:06] add_audio_to_title: added AC3 audio stream 0x81bd
[21:45:06] add_audio_to_title: added AC3 audio stream 0x80bd
[21:45:06] scan: decoding previews for title 1
[21:45:06] scan: audio 0x80bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:06] scan: audio 0x84bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:06] scan: audio 0x83bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:06] scan: audio 0x82bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:06] scan: audio 0x81bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:06] scan: 10 previews, 720x576, 25.000 fps, autocrop = 2/0/12/6, aspect 4:3, PAR 16:15
[21:45:06] scan: title (0) job->width:704, job->height:544
[21:45:06] libhb: scan thread found 1 valid title(s)
[21:45:07] macgui: currentScanCount received from fQueueEncodeLibhb
[21:45:07] macgui: ScanDone state received from fQueueEncodeLibhb
[21:45:07] macgui: processNewQueueEncode title list is: 1
[21:45:07] macgui: Preset: Constant Quality Rate
[21:45:07] macgui: processNewQueueEncode number of passes expected is: 1
[21:45:07] macgui: prepareJob exiting
[21:45:07] 1 job(s) to process
[21:45:07] starting job
[21:45:07] job configuration:
[21:45:07]  * source
[21:45:07]    + /Volumes/LaCieDisk/excluded/Videos & Movies/Friends Test/Friends Test.vob
[21:45:07]    + title 1, chapter(s) 1 to 1
[21:45:07]  * destination
[21:45:07]    + /Users/tim/Desktop/Friends Test Constant Quality Rate + (treillis=0:subq=7).mkv
[21:45:07]    + container: Matroska (.mkv)
[21:45:07]      + chapter markers
[21:45:07]  * video track
[21:45:07]    + decoder: mpeg2
[21:45:07]      + bitrate 7500 kbps
[21:45:07]    + frame rate: same as source (around 25.000 fps)
[21:45:07]    + strict anamorphic
[21:45:07]      + storage dimensions: 720 * 576 -> 720 * 576, crop 0/0/0/0
[21:45:07]      + pixel aspect ratio: 16 / 15
[21:45:07]      + display dimensions: 768 * 576
[21:45:07]    + filter
[21:45:07]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (1:2:6:9:80:16:16)
[21:45:07]    + encoder: x264
[21:45:07]      + options: ref=3:mixed-refs=1:bframes=3:b-pyramid=1:weightb=1:deblock=-2,-1:trellis=0:analyse=all:8x8dct=1:me=umh:subq=7:psy-rd=1,1
[21:45:07]      + quality: 0.60
[21:45:07]  * audio track 0
[21:45:07]    + decoder: Unknown (AC3) (2.0 ch) (track 1, id 84bd)
[21:45:07]      + bitrate: 192 kbps, samplerate: 48000 Hz
[21:45:07]    + AC3 passthrough
[21:45:07] dvd: not a dvd - trying as a stream/file instead
[21:45:07] reader: first SCR 1190326
[21:45:07] encx264: encoding with stored aspect 16/15
[21:45:07] encx264: Encoding at constant RF 20.400000
x264 [info]: using SAR=16/15
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
[21:45:07] yadif thread started for segment 0
[21:45:07] yadif thread started for segment 1
[21:45:07] decomb thread started for segment 0
[21:45:07] decomb thread started for segment 1
x264 [info]: profile High, level 3.0
No accelerated IMDCT transform found
[21:45:07] a52_syncinfo failed
[21:45:07] a52_syncinfo ok
[21:45:07] sync: expecting 361 video frames
[21:45:07] mpeg2: "Chapter  1" (1) at frame 0 time 10800
[21:45:07] sync: first pts is 10800
[21:45:22] reader: done. 1 scr changes
[21:45:26] sync: got 310 frames, 361 expected
[21:45:26] work: average encoding speed for job is 17.545925 fps
[21:45:27] mpeg2 done: 311 frames
[21:45:27] render: lost time: 0 (0 frames)
[21:45:27] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:3     Avg QP:18.47  size: 46375  PSNR Mean Y:45.29 U:49.16 V:49.21 Avg:46.25 Global:46.19
x264 [info]: slice P:110   Avg QP:20.52  size: 16386  PSNR Mean Y:42.83 U:46.78 V:47.33 Avg:43.83 Global:43.73
x264 [info]: slice B:197   Avg QP:22.00  size:  5916  PSNR Mean Y:42.15 U:46.50 V:47.25 Avg:43.23 Global:43.15
x264 [info]: consecutive B-frames:  2.3% 18.2% 54.7% 24.8%
x264 [info]: mb I  I16..4:  0.6% 89.2% 10.2%
x264 [info]: mb P  I16..4:  0.4%  8.8%  0.6%  P16..4: 48.0% 24.7% 13.3%  0.3%  0.4%    skip: 3.5%
x264 [info]: mb B  I16..4:  0.0%  0.5%  0.0%  B16..8: 52.8%  1.5%  3.1%  direct: 7.8%  skip:34.3%  L0:33.0% L1:52.9% BI:14.1%
x264 [info]: 8x8 transform  intra:90.2%  inter:69.2%
x264 [info]: ref P L0  59.3% 26.8% 13.9%
x264 [info]: ref B L0  80.9% 19.1%
x264 [info]: ref B L1  91.6%  8.4%
x264 [info]: SSIM Mean Y:0.9750096
x264 [info]: PSNR Mean Y:42.423 U:46.625 V:47.299 Avg:43.473 Global:43.367 kb/s:2004.63
[21:45:27] decomb: yadif deinterlaced 55 | blend deinterlaced 2 | unfiltered 252 | total 309
[21:45:27] libhb: work result = 0
Last encode: same as third encode, with b-pyramid=0. File is 3.1 MB, QuickTime reports 2012.98 kbits/s.

Code: Select all

HandBrake Activity Log for /Users/tim/Desktop/Friends Test Constant Quality Rate + (treillis=0:subq=7:b-pyramid=0).mkv: 2009-03-03 21:45:49 +0100
Handbrake Version: 0.9.3 (2008112300)

[21:45:49] macgui: Rip: Pending queue count is 0
[21:45:49] macgui: Rip: No pending jobs, so sending this one to doAddToQueue
[21:45:49] macgui: Rip: Going right to performNewQueueScan
[21:45:49] macgui: scanning specifically for title: 1
[21:45:49] macgui: performNewQueueScan currentQueueEncodeIndex is: 3
[21:45:49] hb_scan: path=/Volumes/LaCieDisk/excluded/Videos & Movies/Friends Test/Friends Test.vob, title_index=1
[21:45:49] scan: trying to open with libdvdread
[21:45:49] dvd: not a dvd - trying as a stream/file instead
[21:45:49] file is MPEG DVD Program Stream
[21:45:49] add_audio_to_title: added AC3 audio stream 0x84bd
[21:45:49] add_audio_to_title: added AC3 audio stream 0x83bd
[21:45:49] add_audio_to_title: added AC3 audio stream 0x82bd
[21:45:49] add_audio_to_title: added AC3 audio stream 0x81bd
[21:45:49] add_audio_to_title: added AC3 audio stream 0x80bd
[21:45:49] scan: decoding previews for title 1
[21:45:49] scan: audio 0x80bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:49] scan: audio 0x84bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:49] scan: audio 0x83bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:49] scan: audio 0x82bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:49] scan: audio 0x81bd: AC-3, rate=48000Hz, bitrate=192000 Unknown (AC3) (2.0 ch)
[21:45:49] scan: 10 previews, 720x576, 25.000 fps, autocrop = 2/0/12/6, aspect 4:3, PAR 16:15
[21:45:49] scan: title (0) job->width:704, job->height:544
[21:45:49] libhb: scan thread found 1 valid title(s)
[21:45:49] macgui: currentScanCount received from fQueueEncodeLibhb
[21:45:49] macgui: ScanDone state received from fQueueEncodeLibhb
[21:45:49] macgui: processNewQueueEncode title list is: 1
[21:45:49] macgui: Preset: Constant Quality Rate
[21:45:49] macgui: processNewQueueEncode number of passes expected is: 1
[21:45:49] macgui: prepareJob exiting
[21:45:49] 1 job(s) to process
[21:45:49] starting job
[21:45:49] job configuration:
[21:45:49]  * source
[21:45:49]    + /Volumes/LaCieDisk/excluded/Videos & Movies/Friends Test/Friends Test.vob
[21:45:49]    + title 1, chapter(s) 1 to 1
[21:45:49]  * destination
[21:45:49]    + /Users/tim/Desktop/Friends Test Constant Quality Rate + (treillis=0:subq=7:b-pyramid=0).mkv
[21:45:49]    + container: Matroska (.mkv)
[21:45:49]      + chapter markers
[21:45:49]  * video track
[21:45:49]    + decoder: mpeg2
[21:45:49]      + bitrate 7500 kbps
[21:45:49]    + frame rate: same as source (around 25.000 fps)
[21:45:49]    + strict anamorphic
[21:45:49]      + storage dimensions: 720 * 576 -> 720 * 576, crop 0/0/0/0
[21:45:49]      + pixel aspect ratio: 16 / 15
[21:45:49]      + display dimensions: 768 * 576
[21:45:49]    + filter
[21:45:49]      + Deinterlaces selectively with yadif/mcdeint and lowpass5 blending (1:2:6:9:80:16:16)
[21:45:49]    + encoder: x264
[21:45:49]      + options: ref=3:mixed-refs=1:bframes=3:weightb=1:deblock=-2,-1:trellis=0:analyse=all:8x8dct=1:me=umh:subq=7:psy-rd=1,1
[21:45:49]      + quality: 0.60
[21:45:49]  * audio track 0
[21:45:49]    + decoder: Unknown (AC3) (2.0 ch) (track 1, id 84bd)
[21:45:49]      + bitrate: 192 kbps, samplerate: 48000 Hz
[21:45:49]    + AC3 passthrough
[21:45:49] dvd: not a dvd - trying as a stream/file instead
[21:45:49] reader: first SCR 1190326
[21:45:49] yadif thread started for segment 0
[21:45:49] yadif thread started for segment 1
[21:45:49] decomb thread started for segment 0
[21:45:49] decomb thread started for segment 1
[21:45:49] encx264: encoding with stored aspect 16/15
[21:45:49] encx264: Encoding at constant RF 20.400000
x264 [info]: using SAR=16/15
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 PHADD SSE4.1 Cache64
x264 [info]: profile High, level 3.0
No accelerated IMDCT transform found
[21:45:49] a52_syncinfo failed
[21:45:49] a52_syncinfo ok
[21:45:49] sync: expecting 361 video frames
[21:45:49] mpeg2: "Chapter  1" (1) at frame 0 time 10800
[21:45:49] sync: first pts is 10800
[21:46:06] reader: done. 1 scr changes
[21:46:10] sync: got 310 frames, 361 expected
[21:46:10] work: average encoding speed for job is 16.301970 fps
[21:46:11] mpeg2 done: 311 frames
[21:46:11] render: lost time: 0 (0 frames)
[21:46:11] render: gained time: 0 (0 frames) (0 not accounted for)
x264 [info]: slice I:3     Avg QP:18.60  size: 45736  PSNR Mean Y:45.21 U:49.10 V:49.15 Avg:46.17 Global:46.11
x264 [info]: slice P:110   Avg QP:20.52  size: 16681  PSNR Mean Y:42.73 U:46.76 V:47.29 Avg:43.74 Global:43.65
x264 [info]: slice B:199   Avg QP:22.48  size:  5060  PSNR Mean Y:41.89 U:46.44 V:47.17 Avg:42.99 Global:42.92
x264 [info]: consecutive B-frames:  1.9% 18.1% 55.3% 24.6%
x264 [info]: mb I  I16..4:  0.6% 89.7%  9.7%
x264 [info]: mb P  I16..4:  0.4%  9.7%  0.6%  P16..4: 46.9% 24.7% 13.4%  0.3%  0.4%    skip: 3.6%
x264 [info]: mb B  I16..4:  0.0%  0.4%  0.0%  B16..8: 49.2%  1.4%  2.8%  direct: 6.8%  skip:39.4%  L0:33.5% L1:49.6% BI:16.9%
x264 [info]: 8x8 transform  intra:90.2%  inter:67.2%
x264 [info]: ref P L0  74.3% 14.8% 10.9%
x264 [info]: ref B L0  85.5% 14.5%
x264 [info]: SSIM Mean Y:0.9738498
x264 [info]: PSNR Mean Y:42.214 U:46.579 V:47.231 Avg:43.287 Global:43.184 kb/s:1909.69
[21:46:11] decomb: yadif deinterlaced 55 | blend deinterlaced 2 | unfiltered 252 | total 309
[21:46:11] libhb: work result = 0
I'm using this test as an example, but I did several other tests (some with HandBrake 0.9.3, some with MPEG Streamclip 1.9.2 + x264Encoder 0.9.11) which give me similar results for the options I mentioned.

Are the results I'm seeing normal?
Also, does a 2-pass encode with limited bitrate make everything different (will the options which seem to increase the bitrate here, improve or reduce the quality of a 2-pass bitrate-based encode)?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: B-pyramid, subq and treillis questions

Post by jbrjake »

You cannot use the size of an encode at a given rate factor given using a particular option set to in any way indicate the quality of that set of options. Sometimes higher quality means retaining more detail, or more accurate pixel placement, that isn't as efficient to compress.

I don't think you understand what you're doing. You're saying trellis is giving you bigger encode but you're not testing trellis alone, you're also testing full-strength psy-trellis vs no psy-trellis. And, um, yes, psy-trellis bloats CRF encodes. This is well-known. Why would you leave psychoviz optimizations on at all for this kind of testing? It also really invalidates your testing to turn things off progressively instead of comparing each option on its own against your control set.
Deleted User 11865

Re: B-pyramid, subq and treillis questions

Post by Deleted User 11865 »

jbrjake wrote:I don't think you understand what you're doing.
You're probably right. But that's why I'm asking here.
jbrjake wrote:You're saying trellis is giving you bigger encode but you're not testing trellis alone, you're also testing full-strength psy-trellis vs no psy-trellis. And, um, yes, psy-trellis bloats CRF encodes. This is well-known.
I didn't notice that. Since I don't find a way to deactivate it from the GUI, I'm not sure how to disable it. I guess I could change something in the x264 advanced options string?

FWIW, for the first encode, I just clicked on the "Constant Quality Rate" preset and left all x264 settings as they were (I did set cropping to 0 and enable decombing, but that's not related).
jbrjake wrote:Sometimes higher quality means retaining more detail, or more accurate pixel placement, that isn't as efficient to compress.
That's something I was starting to suspect, although because of my improper use of treillis made the increase in bitrate made it seem surreal.

Thanks very much for your help. I guess I'll have to fix my testing methodology…
Deleted User 11865

Re: B-pyramid, subq and treillis questions

Post by Deleted User 11865 »

Thanks again, disabling psy-trellis got rid of my problem with trellis :-)

I have another question though. I have read on the HandBrake wiki:
HandBrake Wiki wrote: Subpixel Motion Estimation (subme)

This setting is finer-grained than the motion estimation settings above. Instead of dealing with whole pixels, it deals with 4 fractional pixels, or quarter pixels (qpel). Higher levels increase quality by further refining the motion prediction for these quarter pixels, but take longer to encode. The default, 6, turns on a feature called rate distortion optimization, including psychovisual enhancements. 7 enables that rate distortion for B-frames. 8 refines those decisions for I and P frames, and 9 adds on refinement for B-frames as well.
By setting psy-rd=0,0, I think I am disabling psy-rdo (which is "rate distortion optimization", right?) and psy-trellis. So with this setting, is there any advantage is using subme >5 (i.e. do values of 6 and above enable other features/refinements)?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: B-pyramid, subq and treillis questions

Post by jbrjake »

....for all the things I mentioned in the bit you're quoting besides the psy-rd. Like regular RDO, and the refinements.
Deleted User 11865

Re: B-pyramid, subq and treillis questions

Post by Deleted User 11865 »

jbrjake wrote:....for all the things I mentioned in the bit you're quoting besides the psy-rd. Like regular RDO, and the refinements.
OK. Thank you.
Post Reply