Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > General > Newbies

Reply
 
Thread Tools Search this Thread Display Modes
Old 23rd April 2024, 14:53   #1  |  Link
kiameliala
Registered User
 
Join Date: Apr 2024
Posts: 4
Recommend Encoding Setting x264 for Movie

Hi guys, im newbie as encoder. Anyone can help me to explain setting for x264?

Thanks before
kiameliala is offline   Reply With Quote
Old 25th April 2024, 00:58   #2  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,903
It's generally not necessary to mess around with individual settings too much. The rule of thumb is to use the slowest speed preset you can stand, which adjusts individual settings for you, along with the desired CRF value to specify the quality. The idea is that a given CRF value should give you roughly the same quality relative to the source each time (assuming all other settings are the same), but as CRF encoding aims to produce a certain quality, the encoder will use whatever bitrate is required to give you that quality, so the bitrate and file size can vary quite a bit from one encode to the next depending on how hard the video is to compress. Noisy or grainy video will require a higher bitrate than "clean" video. The alternative is to use 2 pass encoding to specify the bitrate/file size you want, but then you have no control over the quality. It also takes longer as CRF encoding only requires a single pass. x264 also has several tuning options to adjust some of the individual settings automatically for you. I use the film tuning for most encodes.

For the CRF value, the lower the value the higher the quality and the higher the bitrate. The default is 23, but most people probably use a lower value. The CRF value can also be adjusted a little according to the resolution of the video. As lower resolutions are generally upscaled on playback, it means any encoder artifacts are also upscaled, so if anything you might want to use a slightly lower CRF value for lower resolution video. I generally use CRF 18 for standard definition, CRF 19 for 720p, and CRF 20 for 1080p.

Something like this in the x264 command line would be adequate. A level of 4.1 ensures the encoder will adjust a few settings if necessary (according to the frame rate and resolution) to ensure the encoded video can be played by most hardware players. Level 4.1 is supported pretty universally these days.

--level 4.1 --preset slower --tune film --crf 18.0

If you want to start messing around with individual settings, there's a description of them here:
https://en.wikibooks.org/wiki/MeGUI/x264_Settings

Last edited by hello_hello; 25th April 2024 at 01:30.
hello_hello is offline   Reply With Quote
Old 29th April 2024, 17:54   #3  |  Link
kiameliala
Registered User
 
Join Date: Apr 2024
Posts: 4
Quote:
Originally Posted by hello_hello View Post
It's generally not necessary to mess around with individual settings too much. The rule of thumb is to use the slowest speed preset you can stand, which adjusts individual settings for you, along with the desired CRF value to specify the quality. The idea is that a given CRF value should give you roughly the same quality relative to the source each time (assuming all other settings are the same), but as CRF encoding aims to produce a certain quality, the encoder will use whatever bitrate is required to give you that quality, so the bitrate and file size can vary quite a bit from one encode to the next depending on how hard the video is to compress. Noisy or grainy video will require a higher bitrate than "clean" video. The alternative is to use 2 pass encoding to specify the bitrate/file size you want, but then you have no control over the quality. It also takes longer as CRF encoding only requires a single pass. x264 also has several tuning options to adjust some of the individual settings automatically for you. I use the film tuning for most encodes.

For the CRF value, the lower the value the higher the quality and the higher the bitrate. The default is 23, but most people probably use a lower value. The CRF value can also be adjusted a little according to the resolution of the video. As lower resolutions are generally upscaled on playback, it means any encoder artifacts are also upscaled, so if anything you might want to use a slightly lower CRF value for lower resolution video. I generally use CRF 18 for standard definition, CRF 19 for 720p, and CRF 20 for 1080p.

Something like this in the x264 command line would be adequate. A level of 4.1 ensures the encoder will adjust a few settings if necessary (according to the frame rate and resolution) to ensure the encoded video can be played by most hardware players. Level 4.1 is supported pretty universally these days.

--level 4.1 --preset slower --tune film --crf 18.0

If you want to start messing around with individual settings, there's a description of them here:
https://en.wikibooks.org/wiki/MeGUI/x264_Settings
Thanks for your reply, i wil try learn.
kiameliala is offline   Reply With Quote
Old 12th May 2024, 16:27   #4  |  Link
kiameliala
Registered User
 
Join Date: Apr 2024
Posts: 4
Quote:
Originally Posted by hello_hello View Post
It's generally not necessary to mess around with individual settings too much. The rule of thumb is to use the slowest speed preset you can stand, which adjusts individual settings for you, along with the desired CRF value to specify the quality. The idea is that a given CRF value should give you roughly the same quality relative to the source each time (assuming all other settings are the same), but as CRF encoding aims to produce a certain quality, the encoder will use whatever bitrate is required to give you that quality, so the bitrate and file size can vary quite a bit from one encode to the next depending on how hard the video is to compress. Noisy or grainy video will require a higher bitrate than "clean" video. The alternative is to use 2 pass encoding to specify the bitrate/file size you want, but then you have no control over the quality. It also takes longer as CRF encoding only requires a single pass. x264 also has several tuning options to adjust some of the individual settings automatically for you. I use the film tuning for most encodes.

For the CRF value, the lower the value the higher the quality and the higher the bitrate. The default is 23, but most people probably use a lower value. The CRF value can also be adjusted a little according to the resolution of the video. As lower resolutions are generally upscaled on playback, it means any encoder artifacts are also upscaled, so if anything you might want to use a slightly lower CRF value for lower resolution video. I generally use CRF 18 for standard definition, CRF 19 for 720p, and CRF 20 for 1080p.

Something like this in the x264 command line would be adequate. A level of 4.1 ensures the encoder will adjust a few settings if necessary (according to the frame rate and resolution) to ensure the encoded video can be played by most hardware players. Level 4.1 is supported pretty universally these days.

--level 4.1 --preset slower --tune film --crf 18.0

If you want to start messing around with individual settings, there's a description of them here:
https://en.wikibooks.org/wiki/MeGUI/x264_Settings
--level 4.1 --preset slower --tune film --crf 18.0
I have used this setting but the output is still too big, 720p => 2.1GB

What i have to do? Thanks
kiameliala is offline   Reply With Quote
Old 13th May 2024, 14:06   #5  |  Link
Rumbah
Registered User
 
Join Date: Mar 2003
Posts: 481
Just increase the crf value, then the bitrate will decrease. If I remember correctly then an increase of about 6 will cut the bitrate in half.
Rumbah is offline   Reply With Quote
Old 14th May 2024, 12:26   #6  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,903
Quote:
Originally Posted by kiameliala View Post
--level 4.1 --preset slower --tune film --crf 18.0
I have used this setting but the output is still too big, 720p => 2.1GB

What i have to do? Thanks
For CRF encoding, the final size is dependent on the duration in addition to the CRF value. What was the average bitrate? If your example is an average length movie, 2.1GB seems pretty reasonable to me, but try CRF19 or CRF20. Personally I wouldn't go any higher for 720p, but that's up to you.

Keep in mind though, you can't judge from a single encode because for a given CRF value the bitrate will change according to how hard the video is to compress. The next encode, assuming the resolution, duration and CRF value is the same, could result in a smaller file size, or it might end up larger.

The alternative is to use x265 instead, assuming it can be played by whatever hardware player you might be using. It's a lot slower than x264 though, and for x265 I do adjust some of it's individual settings as I find it blurs too much with the default values. For the same CRF value though, the bitrate should be lower, and you can probably get away with using slightly higher CRF values.

This is what I tend to use for a "slow" encode with x265, but everyone has different preferences. The bitrate will be greater than just using the slow preset on it's own. x265 doesn't have a film tuning, only tunings for heavy grain and for animation.

--crf 20.0 --profile main10 --preset slow --deblock=-1:-1 --no-open-gop --ctu 32 --rc-lookahead 40 --lookahead-slices 0 --psy-rdoq 1.5 --aq-strength 1.3 --no-strong-intra-smoothing --no-sao

Last edited by hello_hello; 14th May 2024 at 12:51.
hello_hello is offline   Reply With Quote
Old 21st May 2024, 16:50   #7  |  Link
kiameliala
Registered User
 
Join Date: Apr 2024
Posts: 4
Quote:
Originally Posted by hello_hello View Post
For CRF encoding, the final size is dependent on the duration in addition to the CRF value. What was the average bitrate? If your example is an average length movie, 2.1GB seems pretty reasonable to me, but try CRF19 or CRF20. Personally I wouldn't go any higher for 720p, but that's up to you.

Keep in mind though, you can't judge from a single encode because for a given CRF value the bitrate will change according to how hard the video is to compress. The next encode, assuming the resolution, duration and CRF value is the same, could result in a smaller file size, or it might end up larger.

The alternative is to use x265 instead, assuming it can be played by whatever hardware player you might be using. It's a lot slower than x264 though, and for x265 I do adjust some of it's individual settings as I find it blurs too much with the default values. For the same CRF value though, the bitrate should be lower, and you can probably get away with using slightly higher CRF values.

This is what I tend to use for a "slow" encode with x265, but everyone has different preferences. The bitrate will be greater than just using the slow preset on it's own. x265 doesn't have a film tuning, only tunings for heavy grain and for animation.

--crf 20.0 --profile main10 --preset slow --deblock=-1:-1 --no-open-gop --ctu 32 --rc-lookahead 40 --lookahead-slices 0 --psy-rdoq 1.5 --aq-strength 1.3 --no-strong-intra-smoothing --no-sao
Thank you, i will try this tips
kiameliala is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 13:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.