Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
x264 [2017/02/05 09:40] beandog |
x264 [2023/04/09 19:56] (current) beandog |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== x264 ====== | + | ====== x264 / AVC ====== |
* [[Handbrake]] | * [[Handbrake]] | ||
Line 6: | Line 6: | ||
* [[http://dev.beandog.org/x264_preset_reference.html|x264 preset reference]] | * [[http://dev.beandog.org/x264_preset_reference.html|x264 preset reference]] | ||
* [[http://www.x264bluray.com/|Authoring a professional Blu-ray Disc with x264]] | * [[http://www.x264bluray.com/|Authoring a professional Blu-ray Disc with x264]] | ||
- | * [[http://mewiki.project357.com/wiki/X264_Settings|x264 Settings]] | ||
* [[http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC|Wikipedia: H264]] | * [[http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC|Wikipedia: H264]] | ||
- | * [[http://www.streaminglearningcenter.com/articles/understanding-h264-encoding-parameters---profiles-and-levels.html|Understanding H.264 Encoding Parameters - Profiles and Levels]] | ||
* [[http://mmmash.blogspot.com/2013/03/x264-motion-estimation-method-comparison.html|X264 - Motion Estimation Method- Comparison]] - I like this one. :) | * [[http://mmmash.blogspot.com/2013/03/x264-motion-estimation-method-comparison.html|X264 - Motion Estimation Method- Comparison]] - I like this one. :) | ||
* [[http://birds-are-nice.me/publications/extremex264_5.shtml|Extreme x264 encoding]] | * [[http://birds-are-nice.me/publications/extremex264_5.shtml|Extreme x264 encoding]] | ||
+ | * [[https://en.wikibooks.org/wiki/MeGUI/x264_Settings|MeGUI/x264 Settings]] - the best place to get a description of each setting | ||
- | === h264 levels === | + | When encoding, if you want to cover all your bases, there are two H.264 settings to use, and two x264 encoding arguments to pass: |
- | DVDs max out at high 3.1. You don't need 3.2 on DVDs because that is the first level that accepts 720p. | + | * H.264 profile: high |
+ | * H.264 level: 4.1 | ||
+ | * x264 preset: medium | ||
+ | * x264 CRF: 23 | ||
- | Blu-ray at high 4.1. You can go higher if you want, it's your preference. :) | + | Optionally, you can set the x264 tuning as well. Best choices are film, animation, and grain. |
+ | |||
+ | Don't change any other settings than those. If you do, you're going down the rabbit hole. | ||
+ | |||
+ | === H.264 levels === | ||
+ | |||
+ | DVDs max out at high 3.1. You don't need 3.2 on DVDs because that is the first level that accepts 720p. | ||
+ | |||
+ | Blu-ray at high 4.1. You can go higher if you want, it's your preference. :) | ||
The levels (baseline, main, high) are used to determine which hardware you want to target, and influences what quality you can expect and what encoding features will be used. Blu-ray uses high profile. | The levels (baseline, main, high) are used to determine which hardware you want to target, and influences what quality you can expect and what encoding features will be used. Blu-ray uses high profile. | ||
Line 36: | Line 46: | ||
=== mtune === | === mtune === | ||
- | Keep it simple (for DVDs): use ''film'' or ''animation''. For **old** movies or sources that have artifacts already, use ''grain'' or you risk making it even worse. | + | Keep it simple (for DVDs): use ''film'' or ''animation''. For **old** movies or sources that have artifacts already, use ''grain'' or you risk making it even worse. |
=== Choosing an x264 preset === | === Choosing an x264 preset === | ||
Line 69: | Line 79: | ||
* [[http://x264dev.multimedia.cx/archives/102|Encoding animation]] - good read for overview of challenges. | * [[http://x264dev.multimedia.cx/archives/102|Encoding animation]] - good read for overview of challenges. | ||
- | "All of this combines to make animation at first glance deceptively easy–but in reality quite difficult–to encode." So true! | + | "All of this combines to make animation at first glance deceptively easy–but in reality quite difficult–to encode." So true! |
His tests on x264 | His tests on x264 | ||
Line 91: | Line 101: | ||
* uneven multi-hexagon (umh): slow, slower, veryslow | * uneven multi-hexagon (umh): slow, slower, veryslow | ||
* exhaustive (tesa): placebo | * exhaustive (tesa): placebo | ||
- | |||
- | === Steve's Defaults === | ||
- | |||
- | Here are examples of using H.264 high profile at level 4.1 (Blu-ray settings), with x264 CRF 23 on medium preset. | ||
- | |||
- | Using MP4 as the container will encode the audio to AAC by default. If using MKV, it depends on the encoder, so I'm specifying it directly. | ||
- | |||
- | libav (whose syntax I find easier to remember), see also their x264 guide: | ||
- | |||
- | <code> | ||
- | avconv -i source.mpg -vcodec libx264 -profile:v high -level:v 4.1 -preset:v medium -crf 23 -c:a libfdk_aac video.mp4 | ||
- | avconv -i source.mpg -vcodec libx264 -profile:v high -level:v 4.1 -preset:v medium -crf 23 -c:a libfdk_aac video.mkv | ||
- | </code> | ||
- | |||
- | <code> | ||
- | ffmpeg -i source.mpg -c:v libx264 -profile:v high -level 4.1 -crf 23 -c:a libfdk_aac video.mp4 | ||
- | ffmpeg -i source.mpg -c:v libx264 -profile:v high -level 4.1 -crf 23 -c:a libfdk_aac video.mkv | ||
- | </code> | ||
- | |||
- |