HandBrake: Difference between revisions

From miki
Jump to navigation Jump to search
Line 39: Line 39:


== Best settings for DVD ==
== Best settings for DVD ==
=== Notes ===
Notes:
Notes:
* Asking google (handbrake best settings for dvd, etc).
* Asking google (handbrake best settings for dvd, etc).
Line 54: Line 55:
* Audio, select all language, in auto passthrough.
* Audio, select all language, in auto passthrough.
* Subtitles, all subtitles, no burn in.
* Subtitles, all subtitles, no burn in.
* Bench: Bad Teacher, denoise, deblock, decomb: 96.99 / 95.70 fps, 2357MB, 1672kbps. But strange artefacts in generic (around statue, also around the text in generic).
* Bench: Bad Teacher, x264, denoise, deblock, decomb: 96.99 / 95.70 fps, 2357MB, 1672kbps. But strange artefacts in generic (around statue, also around the text in generic).
* Bench: Bad Teacher, decomb, RF 18, slow: 81.93 fps, 2511 MB, 1881 kbps. Better output, but bigger and slower.
* Bench: Bad Teacher, x264, decomb, RF 18, slow: 81.93 fps, 2511 MB, 1881 kbps. Better output, but bigger and slower.
* Bench: Bad Teacher, denoise medium, decomb, RF 18, slow: 97.36 fps, 2206MB, 1445kbps, pretty much same quality as "decomb", but smaller and faster...
* Bench: Bad Teacher, x264, decomb, denoise medium, RF 18, slow: 97.36 fps, 2206MB, 1445kbps, pretty much same quality as "decomb", but smaller and faster...
* Bench: Bad Teacher, denoise medium, decomb, 2-pass CBR 1800: 90.83+95.99 fps, 2443MB, 1800kbps,
* Bench: Bad Teacher, x264, decomb, denoise light , RF 18, slow: 93.07 fps, 2266MB, 1536kbps.
* Bench: Bad Teacher, denoise medium, decomb, 2-pass CBR 1800 turbo 1st pass: 252.61+97.87 fps, 2442MB, 1800kbps,
* Bench: Bad Teacher, x264, decomb, denoise light , lapsharplightfilm, RF 18, slow: 83.07 fps, 2394MB, 1726kbps.
* Bench: Bad Teacher, denoise medium, decomb, RF 16, slow: 86.15 fps, 2629MB, 2077kbps,
* Bench: Bad Teacher, x264, decomb, denoise light , RF 20, slow: 108.46 fps, 1954MB, 1070kbps.
* Bench: Bad Teacher, denoise medium, decomb, RF 18, slower: 64.24 fps, 2213MB, 1456kbps,
* Bench: Bad Teacher, x264, decomb, denoise medium, RF 16, slow: 86.15 fps, 2629MB, 2077kbps.
* Bench: Bad Teacher, x264, decomb, denoise medium, RF 18, slower: 64.24 fps, 2213MB, 1456kbps,
* Bench: Bad Teacher, x264, decomb, denoise medium, 2-pass CBR 1800: 90.83+95.99 fps, 2443MB, 1800kbps,
* Bench: Bad Teacher, x264, decomb, denoise medium, 2-pass CBR 1800 turbo 1st pass: 252.61+97.87 fps, 2442MB, 1800kbps,
* Bench: Bad Teacher, x265, decomb, denoise light , RF 20, slow: 23.62 fps, 1743MB, 754kbps.
* Bench: Bad Teacher, x265, decomb, denoise light , RF 20, medium: 42.97 fps, 1688MB, 672kbps.
* Bench Final Cut, decomb, denois light, RF 18, slow, audio AAC 192: 73.59fps, 2238MB, 3103kbps. Audio very soft.
* Bench Final Cut, decomb, denois light, RF 18, slow, audio AAC 192: 73.59fps, 2238MB, 3103kbps. Audio very soft.
* Bench Final Cut, decomb, denois medium, RF 18, slow, audio AC3 passthrough 192: 78.35fps, 2001MB, 2734kbps.
* Bench Final Cut, decomb, denois medium, RF 18, slow, audio AC3 passthrough 192: 78.35fps, 2001MB, 2734kbps.
Line 72: Line 78:
* Check that 720*576 is played ok (no need to go to 1024x576 as said in link above).
* Check that 720*576 is played ok (no need to go to 1024x576 as said in link above).
* Transcode all audio to AAC (so that to get direct play). Use Stereo only. Use Dynamic Range. Use
* Transcode all audio to AAC (so that to get direct play). Use Stereo only. Use Dynamic Range. Use

=== Subtitles ===
* Which subtitle choose?
:* All of them, but assuming they can be displayed correctly.
* Subtitle seems to be "VOBSUB".
* Make a test on Plex on Shield.
* Make a test on Plex on Chrome.
* Make a test with VLC.
* Make a test with mplayer.

=== Audio ===
* Which audio track to choose?
:* VO + French
:* Should we take Dutch if available?
* Which codec to use?
:* Ideally passthrough is best, but if AC3, it cannot directplay on Shield TV, which is a bit annoying.
:* If transcoding to AAC, audio is very soft. Should we use dynamic range? Should we normalize loudness?

=== Video - aspect ratio ===
Note:
* 16:9 = 1.77:1 = 1024 x 576 = 1920 x 1080 (assuming square pixels).
* 16.7:9 = 1.85:1 = 1024 x 552.
* 4:3 = 12:9 = 1.33:1 = 1024 x 768 = 1920 x 1440 (assuming square pixels).

* Pixel Aspect Ratio (PAR)
:* This is the pixel ratio to use when displaying an image.
:* 1:1 means the stored image assume square pixels.
:* 64:45 is the pixel ratio to use to change a 720x576 image into a 16:9 image 1024x576 (we have 720 / 45 * 64 = 1024)
::* 720x576 is an image with ratio 5:4 assuming square pixel, but it becomes 16:9 assuming pixel ratio 64:45.
::* To be displayed on a monitor with square pixels, then the 720x576 image must be stretched to 1024x576 image to preserved the final image ratio 16:9.
:* With 720x576 image,
::* a 16:15 PAR gives an image aspect ratio of 4:3.
::* a 64:45 PAR gives an image aspect ratio of 16:9.

* Which aspect ratio?
:* DVD PAL is always 720x576, but handbrake automatically crops to remove black edges.
:* So resulting image cannot simply be panned to fit say 1920x1080 (16:9) display. The best fit must respect the desired aspect ratio.
:* In addition, some DVD does not document the aspect ratio correctly.
::* Ask Google to get correct a/r (<code>final cut dvd aspect ratio</code>, <code>bad teacher dvd aspect ratio</code>).
* For handbrake, we have to define:
:* '''Storage geometry''', the size of the encoded image, which is the size of the source after cropping.
:* '''Display geometry''', the size of the image to be displayed on screen, which is the size of the source after cropping.
* Examples
:* DVD Final Cut, 1998
::* Internet lookup: release ratio is 1.66:1.
::* This seems like a bad DVD rip. Viewing the DVD shows an image ratio of 4:3.
::* HB detects an issue with PAR: Video PAR 16:15 (ie. 4:3 image) != conainer PAR 64:45 (ie. 16:9 image). It defaults back to 16:9
::* HB detects image as 720x576 with 12/14/14/10 autocrop, ie. 694x552, image 16:9, PAR 64:45.
::* To correct the image ratio, we remove all crop (to keep the bar / pillar, which seem to be intended), and set the display geometry to 956 x 576.
:* DVD Bad Teacher, 2011
::* Internet look-up: movie aspect ration is 1.85:1.
::* HB detects image as 720x576 with 12/12/0/0 autocrop, ie. 720x552, image 16:9 PAR 64:45.
::* HB sets encode size at 720x552, and display size at 1024x552, with standard PAR 64:45, which gives the correct ratio 16.7:1, aka 1.85:1.

Revision as of 22:27, 23 December 2020

HandBrake is a powerful, yet easy to use video encoder for Linux.

Links

Tips

Encode a DVD title

  • Click Source.
  • Select DVD to encode, and select folder VIDEO_TS (don't open it), and click OK.

Benchmarks

  • Movie: Bad Teacher
  • All Audio.
  • All Subtitles.
Version PC CPU Freq S/C/T Encoder Preset Level Quality Encoding speed Video bitrate track0 (video) size Comment
Xenial zacxl0005 i5-4300U 1.90GHz 1/2/4 H.264 veryfast 4.0 20 (RF) 135.4 fps 983.24 kb/s 658 MB No decomb
Zesty zacxl0005 i5-4300U 1.90GHz 1/2/4 H.264 fast 3.1 20 (RF) 50.4 fps 1174.29 kb/s 786 MB Fast
Zesty kraken X5650 2.67GHz 2/6/6 H.264 fast 3.1 20 (RF) 163.9 fps 1151.50 kb/s 771 MB Fast
Zesty kraken X5650 2.67GHz 2/6/12 H.264 fast 3.1 20 (RF) 177.9 fps 1151.50 kb/s 771 MB Fast
Zesty kraken X5650 2.67GHz 2/6/12 H.264 veryfast 4.0 22 (RF) 332.8 fps 654.67 kb/s 438 MB Very fast, No decomb
Zesty kraken X5650 2.67GHz 2/6/12 H.264 veryfast 4.0 22 (RF) 351.0 fps 660.70 kb/s 442 MB Very fast
Zesty kraken X5650 2.67GHz 2/6/12 H.264 veryfast 4.0 20 (RF) 332.9 fps 952.46 kb/s 637 MB Legacy normal (No decomb default)
Zesty kraken X5650 2.67GHz 2/6/12 H.265 fast auto 20 (RF) 41.8 fps 706.52 kb/s 473 MB Legacy normal (No decomb default)
  • S/C/T: Socket(s), Core per Socket, Thred per Socket.

Best settings for DVD

Notes

Notes:

  • Asking google (handbrake best settings for dvd, etc).
  • H265 doesn't seem to bring lot of advantage over H264, because H265 is mainly for highres video, which DVD isn't. H265 is much much slower however.

Handbrake presets:

  • HQ 576p25 Surround: H.264, RF:18, Peak Framerate, Constant Quality, Preset slow, Tune none, Profile high, Level 3.1.
  • SuperHQ 576p25 Surround: H.264, RF:16, Peak Framerate, Constant Quality, Preset veryslow, Tune none, Profile high, Level 3.1, more settings ref=5:bframes=5.

Using:

  • Starting from HQ 576p25.
  • Set Tune to film.
  • Set Filters, Deblock, to Light (and tune medium); denoise filter to HQDN3D, preset medium. Interlace detection to Default, Deinterlace to Decomb.
  • Audio, select all language, in auto passthrough.
  • Subtitles, all subtitles, no burn in.
  • Bench: Bad Teacher, x264, denoise, deblock, decomb: 96.99 / 95.70 fps, 2357MB, 1672kbps. But strange artefacts in generic (around statue, also around the text in generic).
  • Bench: Bad Teacher, x264, decomb, RF 18, slow: 81.93 fps, 2511 MB, 1881 kbps. Better output, but bigger and slower.
  • Bench: Bad Teacher, x264, decomb, denoise medium, RF 18, slow: 97.36 fps, 2206MB, 1445kbps, pretty much same quality as "decomb", but smaller and faster...
  • Bench: Bad Teacher, x264, decomb, denoise light , RF 18, slow: 93.07 fps, 2266MB, 1536kbps.
  • Bench: Bad Teacher, x264, decomb, denoise light , lapsharplightfilm, RF 18, slow: 83.07 fps, 2394MB, 1726kbps.
  • Bench: Bad Teacher, x264, decomb, denoise light , RF 20, slow: 108.46 fps, 1954MB, 1070kbps.
  • Bench: Bad Teacher, x264, decomb, denoise medium, RF 16, slow: 86.15 fps, 2629MB, 2077kbps.
  • Bench: Bad Teacher, x264, decomb, denoise medium, RF 18, slower: 64.24 fps, 2213MB, 1456kbps,
  • Bench: Bad Teacher, x264, decomb, denoise medium, 2-pass CBR 1800: 90.83+95.99 fps, 2443MB, 1800kbps,
  • Bench: Bad Teacher, x264, decomb, denoise medium, 2-pass CBR 1800 turbo 1st pass: 252.61+97.87 fps, 2442MB, 1800kbps,
  • Bench: Bad Teacher, x265, decomb, denoise light , RF 20, slow: 23.62 fps, 1743MB, 754kbps.
  • Bench: Bad Teacher, x265, decomb, denoise light , RF 20, medium: 42.97 fps, 1688MB, 672kbps.
  • Bench Final Cut, decomb, denois light, RF 18, slow, audio AAC 192: 73.59fps, 2238MB, 3103kbps. Audio very soft.
  • Bench Final Cut, decomb, denois medium, RF 18, slow, audio AC3 passthrough 192: 78.35fps, 2001MB, 2734kbps.
  • Bench Final Cut, decomb, denois medium, RF 20, slow, audio AC3 passthrough 192, dimension 720x576, ratio 1.66:1: 89.06fps, 1418MB, 1821kbps.


Things to try:

Subtitles

  • Which subtitle choose?
  • All of them, but assuming they can be displayed correctly.
  • Subtitle seems to be "VOBSUB".
  • Make a test on Plex on Shield.
  • Make a test on Plex on Chrome.
  • Make a test with VLC.
  • Make a test with mplayer.

Audio

  • Which audio track to choose?
  • VO + French
  • Should we take Dutch if available?
  • Which codec to use?
  • Ideally passthrough is best, but if AC3, it cannot directplay on Shield TV, which is a bit annoying.
  • If transcoding to AAC, audio is very soft. Should we use dynamic range? Should we normalize loudness?

Video - aspect ratio

Note:

  • 16:9 = 1.77:1 = 1024 x 576 = 1920 x 1080 (assuming square pixels).
  • 16.7:9 = 1.85:1 = 1024 x 552.
  • 4:3 = 12:9 = 1.33:1 = 1024 x 768 = 1920 x 1440 (assuming square pixels).
  • Pixel Aspect Ratio (PAR)
  • This is the pixel ratio to use when displaying an image.
  • 1:1 means the stored image assume square pixels.
  • 64:45 is the pixel ratio to use to change a 720x576 image into a 16:9 image 1024x576 (we have 720 / 45 * 64 = 1024)
  • 720x576 is an image with ratio 5:4 assuming square pixel, but it becomes 16:9 assuming pixel ratio 64:45.
  • To be displayed on a monitor with square pixels, then the 720x576 image must be stretched to 1024x576 image to preserved the final image ratio 16:9.
  • With 720x576 image,
  • a 16:15 PAR gives an image aspect ratio of 4:3.
  • a 64:45 PAR gives an image aspect ratio of 16:9.
  • Which aspect ratio?
  • DVD PAL is always 720x576, but handbrake automatically crops to remove black edges.
  • So resulting image cannot simply be panned to fit say 1920x1080 (16:9) display. The best fit must respect the desired aspect ratio.
  • In addition, some DVD does not document the aspect ratio correctly.
  • Ask Google to get correct a/r (final cut dvd aspect ratio, bad teacher dvd aspect ratio).
  • For handbrake, we have to define:
  • Storage geometry, the size of the encoded image, which is the size of the source after cropping.
  • Display geometry, the size of the image to be displayed on screen, which is the size of the source after cropping.
  • Examples
  • DVD Final Cut, 1998
  • Internet lookup: release ratio is 1.66:1.
  • This seems like a bad DVD rip. Viewing the DVD shows an image ratio of 4:3.
  • HB detects an issue with PAR: Video PAR 16:15 (ie. 4:3 image) != conainer PAR 64:45 (ie. 16:9 image). It defaults back to 16:9
  • HB detects image as 720x576 with 12/14/14/10 autocrop, ie. 694x552, image 16:9, PAR 64:45.
  • To correct the image ratio, we remove all crop (to keep the bar / pillar, which seem to be intended), and set the display geometry to 956 x 576.
  • DVD Bad Teacher, 2011
  • Internet look-up: movie aspect ration is 1.85:1.
  • HB detects image as 720x576 with 12/12/0/0 autocrop, ie. 720x552, image 16:9 PAR 64:45.
  • HB sets encode size at 720x552, and display size at 1024x552, with standard PAR 64:45, which gives the correct ratio 16.7:1, aka 1.85:1.