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 27th February 2020, 06:51   #1  |  Link
Lathe
Registered User
 
Lathe's Avatar
 
Join Date: Aug 2005
Posts: 1,099
Number of Ref frames / amount of compression

Hello all!

I asked something similar last year, but I don't think I asked it very well So, I didn't quite get the answer that I THINK I need.

In doing a 1 Pass ABR compression for a Blu-ray where there is VERY LITTLE compression being done. Say for example a file is being compressed from a size of 25 Gigs to 22 Gigs. The resulting encode will be around a 24,000 bitrate, which is pretty decent. Normally, I like to thrown in a couple of little 'Tweaks' such as me-hex and subme-6 so that I can activate both the Psy and Trellis settings and give them a little bump. With this in mind using a VeryFast setting, and YES I am aware of the parameters included in that preset, since the resulting encoded bitrate is pretty high, is the default ref-1 setting 'good enough' or would adding an additional 'Tweak' setting the ref frames higher (2-4) make any discernible visual difference in your opinions.

In other words, should I just leave the ref-1 setting, or should I bother to increase the refs since the resulting bitrate will be fairly high?

Thank you kindly for any thoughts and input. Again, I am asking for your OPINIONS based on the above. With such little compression at 1080p is there any necessity to increase the ref frames higher than the ref-1 that the preset calls for. I am only interested in whether you feel the picture quality would be affected/improved enough to bother. I know the ref frames are primarily a factor of compression, so with such little compression will it matter visually?

Thanks!
Lathe is offline   Reply With Quote
Old 27th February 2020, 07:01   #2  |  Link
Blue_MiSfit
Derek Prestegard IRL
 
Blue_MiSfit's Avatar
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 5,986
This kind of tuning is just not usually necessary. The rule of thumb is good:

1) Use the slowest preset you can stand
2) Use a CRF value (or 2 pass VBR) that gives you a suitable balance between size and quality

If you do tune anything, tune the psychovisual options for your source.
Blue_MiSfit is offline   Reply With Quote
Old 7th March 2020, 10:10   #3  |  Link
Asmodian
Registered User
 
Join Date: Feb 2002
Location: San Jose, California
Posts: 4,403
I agree, use a slower preset rather than tweak veryfast a lot. Unless you can handle something a bit slower but still need faster than the next preset down? You are already slowing veryfast down to enable psy and trellis, I would increase ref to 2 before doing your tweaks. Maybe you should simply switch to the fast preset?

The amount of compression does not significantly change the way settings trade speed for quality. Using only one ref while using subme 6 doesn't make a lot of sense, another ref would offer a better quality for speed tradeoff. Remember the original video is not 25 Gigs, it is 250 Gigs per hour (assuming 8 bit 1920x1080p24). The original bluray is already very compressed and the first step when re-encoding is to uncompress it.
__________________
madVR options explained
Asmodian is offline   Reply With Quote
Old 10th March 2020, 22:50   #4  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,738
Reencoding to save ~15% file size seems pretty pointless to begin with. Better to just leave the video bitstream alone if possible.

Back when Doom9 was strapping and new, there were utilities that would reduce MPEG-2 encodes by 1-2 QP while preserving motion vectors, which was a pretty simple and very fast way to trim off up to maybe 20% in file size. Has anyone ever tried to do something similar for H.264?

For Blu-ray, there are a lot of restrictions on the bitstream. So if one didn't need to preserve BD player compatibility, I can see a system that would just reencode B and b frames to save bits, passing through IDR and P frames, taking advantage of non-hierarchical B-frames to save some bits.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 10th March 2020, 23:30   #5  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by benwaggoner View Post
Reencoding to save ~15% file size seems pretty pointless to begin with. Better to just leave the video bitstream alone if possible.
The only reason I could see is to make the content fit a size constrained medium, eg a BD-25.

Quote:
Back when Doom9 was strapping and new, there were utilities that would reduce MPEG-2 encodes by 1-2 QP while preserving motion vectors, which was a pretty simple and very fast way to trim off up to maybe 20% in file size. Has anyone ever tried to do something similar for H.264?
'DVD Shrink' or similar for H.264, you mean? Interesting thought.

Last edited by Sharc; 10th March 2020 at 23:43.
Sharc is offline   Reply With Quote
Old 12th March 2020, 00:56   #6  |  Link
benwaggoner
Moderator
 
Join Date: Jan 2006
Location: Portland, OR
Posts: 4,738
Quote:
Originally Posted by Sharc View Post
'DVD Shrink' or similar for H.264, you mean? Interesting thought.
Yeah. Same basic principal applies. And other tricks are available to H.264 encodes, like CAVLC to CABAC conversion. Reencoding just B and b frames would allow for messing with reference lists, maybe even increasing the number of reference frames.

Could be a fun project, but a lot of work and I don't know who would have the time or budget for it.
__________________
Ben Waggoner
Principal Video Specialist, Amazon Prime Video

My Compression Book
benwaggoner is offline   Reply With Quote
Old 12th March 2020, 15:59   #7  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
Quote:
Originally Posted by benwaggoner View Post
Yeah. Same basic principal applies. And other tricks are available to H.264 encodes, like CAVLC to CABAC conversion. Reencoding just B and b frames would allow for messing with reference lists, maybe even increasing the number of reference frames.

Could be a fun project, but a lot of work and I don't know who would have the time or budget for it.
But would the "DVD-shrink" method primarily save time or would the quality be better than a similar size full decode re-encode? Given how fast processors are now for H.264 is it worth the effort for just a speed gain (if that's all it is)? I mean my R9-3950X can do a blu-ray spec "veryslow" encode at 50+FPS (18Mbit/sec).

Last edited by Stereodude; 12th March 2020 at 16:01.
Stereodude is offline   Reply With Quote
Old 12th March 2020, 21:02   #8  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,997
Quote:
Originally Posted by Stereodude View Post
But would the "DVD-shrink" method primarily save time or would the quality be better than a similar size full decode re-encode? Given how fast processors are now for H.264 is it worth the effort for just a speed gain (if that's all it is)? I mean my R9-3950X can do a blu-ray spec "veryslow" encode at 50+FPS (18Mbit/sec).
I always find it a bit doubtful or unfair when people take the encoding speed (cost of time, energy consumption ....) out of the equation and compare the visual quality of ultrafast methods (GPU, or maybe requant etc.) with slow or veryslow settings of current CPU methods just to find out that the latter is superior. But of course I accept that the compromise between speed and visual quality is a personal decision .
The interesting aspect with the proposed alternatives is that one could possibly expect blazing encoding speeds without relying on expensive GPU (or CPU) hardware.
Just guessing, I would assume that for low compression the quality can be quite good (similar experience as with former DVD-Shrink). Unfortunately I don't have the skills to develop such solutions.

Last edited by Sharc; 12th March 2020 at 21:06.
Sharc is offline   Reply With Quote
Old 13th March 2020, 04:03   #9  |  Link
Stereodude
Registered User
 
Join Date: Dec 2002
Location: Region 0
Posts: 1,436
Quote:
Originally Posted by Sharc View Post
I always find it a bit doubtful or unfair when people take the encoding speed (cost of time, energy consumption ....) out of the equation and compare the visual quality of ultrafast methods (GPU, or maybe requant etc.) with slow or veryslow settings of current CPU methods just to find out that the latter is superior. But of course I accept that the compromise between speed and visual quality is a personal decision .
The interesting aspect with the proposed alternatives is that one could possibly expect blazing encoding speeds without relying on expensive GPU (or CPU) hardware.
Just guessing, I would assume that for low compression the quality can be quite good (similar experience as with former DVD-Shrink). Unfortunately I don't have the skills to develop such solutions.
Well, my experience was that re-encoding MPEG-2 content didn't look good. Some of the programs that messed with the stream gave visibly better results and were very fast. I didn't think DVD Shrink gave very good results. DVD2One, specifically 1.5.x gave much better looking results.

Hence my question about trying the same thing on H.264.
Stereodude 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 09:23.


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