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 > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st June 2015, 23:48   #1  |  Link
Solon8
Registered User
 
Join Date: Mar 2013
Posts: 35
Quality trouble

Hello everyone,

I'm using the x264's Slow preset with MeGUI, but I don't know... there's something bugging me.

In the video, the faces or objects that are close to the camera are detailed, clean, looking-good! But when it's in the background, like a person or whatever, then the quality isn't that great, almost grainy, it loses its detail. Beside increasing bitrate, is there a parameter I should try changing for that issue?

I don't know if it's because I'm getting used to the video quality I'm watching, but I did not have this problem a few years ago, with an actually faster preset. I don't get it.

Solon8 is offline   Reply With Quote
Old 2nd June 2015, 03:08   #2  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
What bitrate/CRF value are you using?

Can you post a source vs encode screenshot as an example?
hello_hello is offline   Reply With Quote
Old 2nd June 2015, 16:31   #3  |  Link
Solon8
Registered User
 
Join Date: Mar 2013
Posts: 35
I bought the movie from an online french VOD service, and I'm trying to reencode it to the best size/quality ratio because I don't have a lot of space on my HD, so I'm using 950 kbps for the video.

Source: http://i.imgur.com/SKH9BB5.jpg
Reencoded: http://i.imgur.com/tagbnwk.jpg

Is it just a matter of bitrate, or should I play with... I don't know, the deblocking maybe or something like it?
Solon8 is offline   Reply With Quote
Old 2nd June 2015, 16:57   #4  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Solon8 View Post
I don't have a lot of space on my HD, so I'm using 950 kbps for the video.

...

Is it just a matter of bitrate, or should I play with... I don't know, the deblocking maybe or something like it?
The bitrate is very low for 1280x544. That's most likely the biggest problem.
Without knowing your entire x264 command line it's difficult to suggest something since I don't know into which command line "Slow preset with MeGUI" translates.

Some general hints:
  • Increase bitrate to at least 2Mbps
  • If the above results into a unacceptable file size, reduce frame size
  • Use a slower x264 preset
__________________
Groucho's Avisynth Stuff

Last edited by Groucho2004; 2nd June 2015 at 17:13.
Groucho2004 is offline   Reply With Quote
Old 3rd June 2015, 10:27   #5  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
What are you playing back to? If you're using PC only for now, would you be willing to switch to x265 instead? It's much slower, but even on medium preset would look better than x264 at these low bitrates. Otherwise, you're right at the point where reducing the resolution is beneficial, as Groucho said. Chopping the edges off and making it 16:9 would also help without sacrificing too much, relative to the quality gain. Try a scene with a couple different methods to see what you can tolerate best.
foxyshadis is offline   Reply With Quote
Old 3rd June 2015, 11:44   #6  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
I assume the slow x264 preset with MeGUI is literally the default x264 settings with the slow x264 speed preset? If so, that should be fine.

If the video isn't being resized or filtered in any way then it can only be the bitrate if you're not using "odd" encoder settings (noise filtering can blur a little as well as reduce noise so use it if you think it's necessary as that'll help keep the bitrate down but don't apply heavy noise filtering if it's not required).

CRF encoding is a better idea because you pick the quality and after a while you'll find a CRF value that gives you an average file size you're happy with and hopefully a quality you can live with. The file sizes will vary quite a bit which is why I say "an average" file size.

Maybe start with the default CRF value of 23 (lower values = higher quality) and check the resulting bitrate. If you're happy with the quality that might give you an indication as to whether your current bitrate is realistic.

You can encode small sections of video for testing rather than encode it all (although still encode a decent amount) by adding Trim() to the end of a script. For example to encode frames 1000 to 2000 you could use this:

Trim(1000,2000)

And I assume you're using "automated 2 pass" or "targeting file size" encoding (same thing for MeGUI) and not ABR (average bitrate) encoding in order to specify a bitrate, because especially at low bitrates, 2 pass would probably do a much better job.

Last edited by hello_hello; 3rd June 2015 at 11:49.
hello_hello is offline   Reply With Quote
Old 3rd June 2015, 14:39   #7  |  Link
Solon8
Registered User
 
Join Date: Mar 2013
Posts: 35
Quote:
Originally Posted by Groucho2004 View Post
The bitrate is very low for 1280x544. That's most likely the biggest problem.
Without knowing your entire x264 command line it's difficult to suggest something since I don't know into which command line "Slow preset with MeGUI" translates.

Some general hints:
  • Increase bitrate to at least 2Mbps
  • If the above results into a unacceptable file size, reduce frame size
  • Use a slower x264 preset
I know the bitrate is quite low. But I heard about popular Internet groups that encode movies at such bitrate or even lower.
And like I said, I used to do it with my own videos and I was satisfied with it, but not anymore now I got new settings and lost the old ones.

Quote:
Originally Posted by foxyshadis View Post
What are you playing back to? If you're using PC only for now, would you be willing to switch to x265 instead? It's much slower, but even on medium preset would look better than x264 at these low bitrates. Otherwise, you're right at the point where reducing the resolution is beneficial, as Groucho said. Chopping the edges off and making it 16:9 would also help without sacrificing too much, relative to the quality gain. Try a scene with a couple different methods to see what you can tolerate best.
I've tried it but it's way too slow. The quality is good though (to my standards), but it's too slow and my TV can't even play it. So I'll stick to x264 for now.

Quote:
Originally Posted by hello_hello View Post
I assume the slow x264 preset with MeGUI is literally the default x264 settings with the slow x264 speed preset? If so, that should be fine.

If the video isn't being resized or filtered in any way then it can only be the bitrate if you're not using "odd" encoder settings (noise filtering can blur a little as well as reduce noise so use it if you think it's necessary as that'll help keep the bitrate down but don't apply heavy noise filtering if it's not required).

CRF encoding is a better idea because you pick the quality and after a while you'll find a CRF value that gives you an average file size you're happy with and hopefully a quality you can live with. The file sizes will vary quite a bit which is why I say "an average" file size.

Maybe start with the default CRF value of 23 (lower values = higher quality) and check the resulting bitrate. If you're happy with the quality that might give you an indication as to whether your current bitrate is realistic.

You can encode small sections of video for testing rather than encode it all (although still encode a decent amount) by adding Trim() to the end of a script. For example to encode frames 1000 to 2000 you could use this:

Trim(1000,2000)

And I assume you're using "automated 2 pass" or "targeting file size" encoding (same thing for MeGUI) and not ABR (average bitrate) encoding in order to specify a bitrate, because especially at low bitrates, 2 pass would probably do a much better job.
Yep, I'm talking about the Slow x264 speed preset. But I even tried Slower and Very Slow but it doesn't solve my problem and, remember, a few years ago I was using the Medium preset, with even lower bitrate and it was fine (to my standards). Maybe my eyes got used to the quality and I'm more demanding? But you know, in MeGUI, what the presets don't change is: the deblocking values, the psy-rd, the qmin/qmax and the AQ strength (maybe some others that I haven't noticed). So if using slower presets doesn't help, the problem must come from these values, no? (and the bitrate)

Yes, I'm using 2-pass encoding but I think you're right, I think CRF encoding is a better choice than picking bitrate in my case. I just need to find the right value for me.

Thank you all for your replies!
Solon8 is offline   Reply With Quote
Old 3rd June 2015, 14:52   #8  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
If you're talking about YIFY, your encoding screenshot is what I would expect from them, in fact maybe a little better. I think you've just been spoiled (happens to us all!). A combination of a little crop & resize will help a little, but you can't expect a miracle when you're conserving space either.
foxyshadis is offline   Reply With Quote
Old 3rd June 2015, 14:56   #9  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by Solon8 View Post
I know the bitrate is quite low. But I heard about popular Internet groups that encode movies at such bitrate or even lower.
And like I said, I used to do it with my own videos and I was satisfied with it, but not anymore now I got new settings and lost the old ones.
Personally I think most of the encodes you're referring to look pretty average. The more you encode, the more bad stuff you notice and the fussier you become, I find. Have you changed your TV or viewing conditions at all?

Quote:
Originally Posted by Solon8 View Post
But you know, in MeGUI, what the presets don't change is: the deblocking values, the psy-rd, the qmin/qmax and the AQ strength (maybe some others that I haven't noticed). So if using slower presets doesn't help, the problem must come from these values, no? (and the bitrate)
MeGUI doesn't have any x264 presets as such. It used to, but if you're using the old encoder presets found in the drop down box in MeGUI's main window delete them as they'll be old an outdated, then create your own.
The encoder configuration lets you select an x264 speed preset. It simply adds something like --preset slow to the command line, but if you show the advanced settings you'll see the appropriate ones are changed accordingly.

The deblocking, psy and AQ strength settings are changed when you select an appropriate x264 tuning. For example when Tuning "None" is selected the deblock settings are zero and zero, select Tuning "Film" and they'll change to -1 and -1 under the advanced settings tab as they're the defaults for the film tuning, but you'll just see --tune film in the command line.

Last edited by hello_hello; 3rd June 2015 at 15:00.
hello_hello is offline   Reply With Quote
Old 3rd June 2015, 15:21   #10  |  Link
Solon8
Registered User
 
Join Date: Mar 2013
Posts: 35
Quote:
Originally Posted by hello_hello View Post
The encoder configuration lets you select an x264 speed preset. It simply adds something like --preset slow to the command line, but if you show the advanced settings you'll see the appropriate ones are changed accordingly.
Yes, yes, we're talking about the same thing.

Quote:
Originally Posted by hello_hello View Post
The deblocking, psy and AQ strength settings are changed when you select an appropriate x264 tuning. For example when Tuning "None" is selected the deblock settings are zero and zero, select Tuning "Film" and they'll change to -1 and -1 under the advanced settings tab as they're the defaults for the film tuning, but you'll just see --tune film in the command line.
Ah, OK! So --tune changes these. I'll try with --tune film.

Also, since you mention the viewing, now I think about, could my player settings be the cause of this? I don't remember using specific settings before, just the K-Lite Codec Pack maybe, but now I'm on a new computer I may not have the same settings.

If I use MadRV or whatever (with MPC), could that make my film look better?

Edit:Quicky question: I remember a time where the default qmin was 10, now it's 0 and the default qmax was 51, now it's 69. Why has it change so much? And is 0/69/4 really better than 10/51/4 on all occasion?

Last edited by Solon8; 3rd June 2015 at 15:24. Reason: question
Solon8 is offline   Reply With Quote
Old 3rd June 2015, 15:38   #11  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,558
69 is only for 10-bit x264. 8-bit will silently accept it, but change it back to 51.
foxyshadis is offline   Reply With Quote
Old 3rd June 2015, 16:46   #12  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Solon8 View Post
But I heard about popular Internet groups that encode movies at such bitrate or even lower.
Excellent point of reference.

You have to realize that the required bitrate for the same perceived quality depends largely on the nature of the movie/video. For a Cartoon you probably won't need more than 1Mbps for 720p but for a movie like "300" or "Black Swan" which have artificially added noise you need easily 10Mbps.

I noticed that your re-encoded screen shot is not only from a different frame than the source, it's also very blurry. Did you add any filters?
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 3rd June 2015, 16:52   #13  |  Link
Solon8
Registered User
 
Join Date: Mar 2013
Posts: 35
Quote:
Originally Posted by foxyshadis View Post
69 is only for 10-bit x264. 8-bit will silently accept it, but change it back to 51.
Oh OK, thanks. What about qmin ? (from 10 to 0)

Quote:
Originally Posted by Groucho2004 View Post
I noticed that your re-encoded screen shot is not only from a different frame than the source, it's also very blurry. Did you add any filters?
I noticed I saved the wrong frame afterwards too.
No filter at all, beside the resize one (Lanczos sharp).

This was my encoding settings:

"cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=20 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=950 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00"

See anything particularly wrong with it? Beside the low bitrate.

Last edited by Solon8; 3rd June 2015 at 16:53. Reason: forgot something
Solon8 is offline   Reply With Quote
Old 3rd June 2015, 17:41   #14  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Solon8 View Post
"cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x113 / me=umh / subme=8 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=20 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=2 / keyint=240 / keyint_min=24 / scenecut=40 / intra_refresh=0 / rc_lookahead=50 / rc=2pass / mbtree=1 / bitrate=950 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00"

See anything particularly wrong with it? Beside the low bitrate.
This looks more like a medium/slow preset. If you have enough CPU power I would change the following to increase quality at the same bitrate (roughly equivalent to --preset veryslow):

--ref 16
--subme 10
--me_range 24
--trellis 2
--bframes 8
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 4th June 2015, 20:02   #15  |  Link
hello_hello
Registered User
 
Join Date: Mar 2011
Posts: 4,823
Quote:
Originally Posted by Solon8 View Post
Also, since you mention the viewing, now I think about, could my player settings be the cause of this? I don't remember using specific settings before, just the K-Lite Codec Pack maybe, but now I'm on a new computer I may not have the same settings.
You might want to check your video card's settings and disable any video enhancing stuff. That's likely to make it look worse if it's enabled by default. Other than that there's nothing else I can think of likely to effect the "quality" as such.
I don't know if modern video cards have noise or deblocking filters. Mine doesn't, but both can cause blurring. My TV's media player has noise filters but I disable all the video enhancing crap in the TVs settings too.
hello_hello is offline   Reply With Quote
Old 4th June 2015, 22:37   #16  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,750
Quote:
Originally Posted by Solon8 View Post
In the video, the faces or objects that are close to the camera are detailed, clean, looking-good! But when it's in the background, like a person or whatever, then the quality isn't that great, almost grainy, it loses its detail. Beside increasing bitrate, is there a parameter I should try changing for that issue?
Lots of good advice in the thread.

But for that specific effect, that's an Adaptive Quant issue where QPs are too high for those flat/smooth slow moving areas.

Using a slower preset, and --tune film are both good. But if you're still not getting there, you could try --aq-mode 2.

It'd be nice if you could copy the full command line from MeGUI's last Advanced pane here.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 5th June 2015, 01:19   #17  |  Link
Solon8
Registered User
 
Join Date: Mar 2013
Posts: 35
Quote:
Originally Posted by Groucho2004 View Post
This looks more like a medium/slow preset. If you have enough CPU power I would change the following to increase quality at the same bitrate (roughly equivalent to --preset veryslow):

--ref 16
--subme 10
--me_range 24
--trellis 2
--bframes 8
I've tried those settings but the difference was not much unfortunately.

Quote:
Originally Posted by hello_hello View Post
You might want to check your video card's settings and disable any video enhancing stuff. That's likely to make it look worse if it's enabled by default. Other than that there's nothing else I can think of likely to effect the "quality" as such.
I don't know if modern video cards have noise or deblocking filters. Mine doesn't, but both can cause blurring. My TV's media player has noise filters but I disable all the video enhancing crap in the TVs settings too.
I just checked and it doesn't seem to have any enhancement.

Quote:
Originally Posted by benwaggoner View Post
Lots of good advice in the thread.

But for that specific effect, that's an Adaptive Quant issue where QPs are too high for those flat/smooth slow moving areas.

Using a slower preset, and --tune film are both good. But if you're still not getting there, you could try --aq-mode 2.

It'd be nice if you could copy the full command line from MeGUI's last Advanced pane here.
I just tried it but the difference was not much either. I guess I hoped for a miracle, but I'll need to use a bigger bitrate for this movie.

Should I always use aq-mode 2 for all my files from now on? And if not, in what occasion should I use it?

Also, I just encoded the movie with a CRF of 26 and I find the quality acceptable (to my standards). I'll keep playing with the value, but from what I see, I think I'll stick to a range of 24-26. It seems to be the kind of quality/size I want to have. Does anyone disagree?

Thank you all for your replies.
Solon8 is offline   Reply With Quote
Old 5th June 2015, 12:08   #18  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Solon8 View Post
Also, I just encoded the movie with a CRF of 26 and I find the quality acceptable (to my standards).
Wow, I usually encode with CRF16 ~ CRF18. Anyway, whatever floats your boat.
__________________
Groucho's Avisynth Stuff
Groucho2004 is offline   Reply With Quote
Old 5th June 2015, 12:37   #19  |  Link
Solon8
Registered User
 
Join Date: Mar 2013
Posts: 35
Quote:
Originally Posted by Groucho2004 View Post
Wow, I usually encode with CRF16 ~ CRF18. Anyway, whatever floats your boat.
Yes, but you don't encode at 950 kbps either. We knew we would use different CRF right away.
Solon8 is offline   Reply With Quote
Old 5th June 2015, 12:53   #20  |  Link
Groucho2004
 
Join Date: Mar 2006
Location: Barcelona
Posts: 5,034
Quote:
Originally Posted by Solon8 View Post
Yes, but you don't encode at 950 kbps either.
Sure I do. I encoded a bunch of Simpsons and Family Guy DVDs even below that bitrate.
__________________
Groucho's Avisynth Stuff
Groucho2004 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 16:54.


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