VideoHelp Forum
+ Reply to Thread
Page 1 of 2
1 2 LastLast
Results 1 to 30 of 52
Thread
  1. I have been encoding some of my recordings, and I want to compress them as much as possible without losing quality.

    I have read this answer from YouTube on their recommended encoding settings:
    https://support.google.com/youtube/answer/1722171?hl=en-GB

    It says that, for example, 1080p should have a bigger bitrate than 480p.

    First of all, will these recommended settings cause a loss of quality?

    Second of all, what if the video is shot in portrait mode? Should a 1280x720 video have the same bitrate as a 720x1280 video, to keep the same quality? And then should a 960x960 video also have the bitrate? (since they have the same total number of pixels)

    Thanks
    Quote Quote  
  2. You can't compress at all without losing quality. The issue is how much quality you will lose. There isn't really any way to predict what bitrate is optimal for a particular video. And different people have different tolerances for artifacts. So you have two choices:

    1) Pick a bitrate (and hence size because size = bitrate * running time). But you don't know what the quality will be.

    2) Pick a quality. But you don't know what the size will be.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    You can't compress at all without losing quality. The issue is how much quality you will lose. There isn't really any way to predict what bitrate is optimal for a particular video. And different people have different tolerances for artifacts. So you have two choices:

    1) Pick a bitrate (and hence size because size = bitrate * running time). But you don't know what the quality will be.

    2) Pick a quality. But you don't know what the size will be.
    Thanks for the reply

    Yes, I understand that but surely there's a general bitrate for each resolution that will result in "practically" no visible quality loss to the viewer. Or close enough to not notice a difference.

    I'm just basing this guess on these two sites that discuss "optimum or recommended" bitrates for different resolutions.

    But that question aside... will the quality be basically the same if I use the bitrate on a 1280x720, a 960x960, and a 720x1280 video? Like, should they basically have the same "optimal" bitrate since they have the same amount of pixels per frame?
    Quote Quote  
  4. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    If absolute size is not critical to you, use CRF encoding instead. Use the "slow" or "medium" preset and choose
    CRF 20 -22. Check to see if the size/quality trade-off is good.

    The quality you get for a set bitrate depends on the complexity (clean/noisy, sharp/soft, still/movement, etc,etc)
    of the source
    Quote Quote  
  5. Originally Posted by Slasher_101 View Post
    will the quality be basically the same if I use the bitrate on a 1280x720, a 960x960, and a 720x1280 video? Like, should they basically have the same "optimal" bitrate since they have the same amount of pixels per frame?
    For a praticualr, yes, the quality at a given bitrate is relative to the number of pixels per frame. So a 1280x720 encoding will have essentially the identical quality as the same video rotated 90 degrees (a lossless transformation) and encoded with the same settings.

    Other picture properties, like those mentioned by davexnet, are of much more importance. There can easily be a several fold difference in the bitrate required to maintain quality for different videos.

    As was pointed out, unless you have a requirement for a specific file size (like putting a 2 hour movie on a DVD), you should consider using constant quality encoding -- you'll always get the quality you want.
    Last edited by jagabo; 17th Jun 2019 at 14:25.
    Quote Quote  
  6. Originally Posted by Slasher_101 View Post
    Yes, I understand that...
    No, you don't.
    ...but surely there's a general bitrate for each resolution that will result in "practically" no visible quality loss to the viewer.
    And that's why it can be said with confidence that you don't understand.

    As mentioned, experiment with different CRF values until you find the one you like - that provides the quality you can live with - and don't worry about the file size. For your 1280x720/720x1280 examples, you might start with a CRF value of 20 and go up or down from there.
    Quote Quote  
  7. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Yes, the ONLY time you can be certain of an exact bitrate for a given resolution, across all types of videos, is UNCOMPRESSED. Even losslessly-compressed videos will vary by content. Otherwise, it can vary WILDLY.

    Scott
    Quote Quote  
  8. Just in case I didn't make it clear in the first post: I'd like to make a program that chooses the right encoding settings to give little quality loss. Is it feasible for the program to make this choice based on resolution?

    Ok, so everyone seems to be recommending I use CRF. If I use CRF 20 on a low resolution video and a high resolution video will the quality loss be pretty much the same for both videos? Or should I probably find a different CRF for each resolution? Again, I'm trying to make a program that will choose the best CRF to use automatically
    Quote Quote  
  9. Originally Posted by Slasher_101 View Post
    If I use CRF 20 on a low resolution video and a high resolution video will the quality loss be pretty much the same for both videos?
    This is a gross generalization, but in general the lower the resolution the lower the CRF value (the higher the quality). Where CRF 20 might be suitable for 720p, I use CRF 18 for 480p, like for upload to YouTube (who will then lower the quality a lot with their reencoding).

    To answer your question, the same CRF might not be suitable for all resolutions, but you can experiment yourself. Have you started yet?
    Quote Quote  
  10. Yes. At the same CRF the low res video might have the same percentage loss as the high resolution video. But assuming you're going to view both videos full screen (ie, the same size) on a high resolution monitor, the defects in the low resolution video are going to be enlarged more, and hence, more visible. So it makes sense to use higher quality settings with lower res video.
    Quote Quote  
  11. what if the video is shot in portrait mode?
    Did you shoot this video? If so, why portrait mode?

    Why don't you make some test clips, view them and judge the quality for yourself?
    Quote Quote  
  12. My views on CRF encoding are fairly well known, I think it's a scam, pure and simple. The same people that will tell you that "you can't trust PSNR, SSIM or VMAF because mathematical formulas can't be trusted, only your eyes can be trusted" are the same people that trust CRF to determine a quality.


    I personally consider CRF deeply flawed, here is a good explanation of how CRF works:


    https://slhck.info/video/2017/02/24/crf-guide.html


    The question becomes what happens with a video that has lots of fast motion, CRF will lower the quality of large portions of the movie and up the quality of the lesser portions of the movie that has less motion. Conversely, a movie with relatively low levels of motion will have the bit rate ballooned upwards, as the algorithm decides that it needs more bit rate for more portions of the movie. If you add the so-called ""psy optimizations" into the mix, like psy-rdo, it's likely that you will end up with parts of the movie where the bit rate is through the roof for little return in quality.


    There's a reason you don't see CRF used for professional releases, like Blu-Ray and Ultra Blu-Ray.
    Quote Quote  
  13. Originally Posted by sophisticles View Post

    The question becomes what happens with a video that has lots of fast motion, CRF will lower the quality of large portions of the movie and up the quality of the lesser portions of the movie that has less motion. Conversely, a movie with relatively low levels of motion will have the bit rate ballooned upwards, as the algorithm decides that it needs more bit rate for more portions of the movie. If you add the so-called ""psy optimizations" into the mix, like psy-rdo, it's likely that you will end up with parts of the movie where the bit rate is through the roof for little return in quality.


    There's a reason you don't see CRF used for professional releases, like Blu-Ray and Ultra Blu-Ray.

    And it's not the reason you're alluding to

    The reason is CRF is not used for optical media is bitrate constraints . You have fixed media capacity limitations . You need to fit multiple audio and video tracks, accessory streams, sub tracks , menus into a defined space . With CRF encoding, you cannot predict the filesize

    But if you encode CRF whatever, then look at the bitrate, do another encode with 2 pass at that bitrate , you get very close results . Actually the CRF encode is usually very slightly better than 2pass if you put any weight into metrics . SSIM, PSNR and VMAF concur , under all types of genres, bitrate ranges .
    Quote Quote  
  14. Originally Posted by poisondeathray View Post

    And it's not the reason you're alluding to

    The reason is CRF is not used for optical media is bitrate constraints . You have fixed media capacity limitations . You need to fit multiple audio and video tracks, accessory streams, sub tracks , menus into a defined space . With CRF encoding, you cannot predict the filesize

    But if you encode CRF whatever, then look at the bitrate, do another encode with 2 pass at that bitrate , you get very close results . Actually the CRF encode is usually very slightly better than 2pass if you put any weight into metrics . SSIM, PSNR and VMAF concur , under all types of genres, bitrate ranges .
    I assume you do not realize the implications of what you just said. You said:

    "The reason is CRF is not used for optical media is bitrate constraints"

    I said:

    "CRF...If you add the so-called ""psy optimizations" into the mix, like psy-rdo, it's likely that you will end up with parts of the movie where the bit rate is through the roof for little return in quality."

    You basically agreed with me, while framing it as a differing opinion. You have seen my posts for enough years to know I have been constant on my opinion of CRF, it's supposed to be an "intelligent" rate control algorithm that "optimizes" quality for a given file size, but what it does, especially when coupled with the various Psy "optimizations" that most people leave enabled, it increases quality the exact same way I have been advocating for years, it simply increases bit rate used.

    I fail to see why one would not simply do the thinking for themselves, instead of relying on a half-baked algorithm someone else designed.

    Personally, I would rather have a slightly large file with uniform quality throughout, for instance instead of using CRF 18 + all the psy stuff, I would rather use QP 20, with all the psy stuff turned off, I/P ratio and P/B ratio set to 1, 3 or less B frames, no B Pyramid.

    To me it's just absurd the way most people encode their videos, they use encoders with defaults that encode an I frame at some quantizer, then thanks to the default settings they use, the P frames use a quantizer 40% larger than the I frames, and the B frames use a quantizer 30% larger than the P frames, meaning that the B frames used a quantizer 82% larger than the I frames and on top of that they enable an algorithm that allows B frames to make reference to these lower quality B frames. Then they pat themselves on the back for using "the best encoder" and give other people "advice" on how to encode their own garbage. Then they go on forums and complain that the quality of various streaming services that do use these encoders with these settings.

    And let me make this clear, the above applies to any encoder, hardware or software based, including NVIDIA's NVENC, with it's pathetic defaults for P frames and B frames and Intel's ICQ mode.

    Hard drive space is very cheap,the 1TB Intel 660P, that has a MTBF of 1.6 million hours and a write endurance of 200 TB, CRF tries to trick you by lowering the bit rate in parts it "thinks" you won't notice but increase it in parts that you will notice, how many times have you seen people complain about panning shots or fast moving scenes where the quality falls apart, why not encode with settings that ensure uniform high quality throughout?

    The developer's of CRF instinctively understood that quality is directly proportional to bit rate, that's why they designed CRF and all the psy optimization to increase bit rate when coupled together, why not eliminate the middle man, pretend one has a functioning brain and increase the bit rate yourself?
    Quote Quote  
  15. Originally Posted by sophisticles View Post
    Personally, I would rather have a slightly large file with uniform quality throughout, for instance instead of using CRF 18 + all the psy stuff, I would rather use QP 20, with all the psy stuff turned off, I/P ratio and P/B ratio set to 1, 3 or less B frames, no B Pyramid.
    This is only one of few usage cases - CRF is fine as some abstract concept how to synthetically describe quality - Qp=20 is pure and unrestricted VBR may work or not, depends on few other parameters. CRF is valid for x264 and related encoders, it may not exist and usually it doesn't exist in non-x264 related encoders. Changing your opinion is not my goal but you should check how quantizer is distributed over blocks in sources coded with CRF and Qp.
    I use fixed Qp only when i need to save some % in encoding time (but then i accept unavoidable IMHO suboptimal quantizer allocation).

    --

    @OP - H.264 SD around 2Mbps, HD around 8 - 10Mbps for good quality (over 90% population will not see any problems in common, average, natural video sources so for most of people it is perceived as lossless), for H.262 i would say SD 5 - 7Mbps is OK, HD around 20 - 30Mbps at least (but US is able to squeeze HD H.262 to 17Mbps), for H.265 you can reduce H.264 numbers by 30 - 40% (higher resolution lead to higher bitrate saving).
    Last edited by pandy; 18th Jun 2019 at 12:22.
    Quote Quote  
  16. Originally Posted by sophisticles View Post

    "The reason is CRF is not used for optical media is bitrate constraints"

    I said:

    "CRF...If you add the so-called ""psy optimizations" into the mix, like psy-rdo, it's likely that you will end up with parts of the movie where the bit rate is through the roof for little return in quality."

    You basically agreed with me, while framing it as a differing opinion. You have seen my posts for enough years to know I have been constant on my opinion of CRF, it's supposed to be an "intelligent" rate control algorithm that "optimizes" quality for a given file size, but what it does, especially when coupled with the various Psy "optimizations" that most people leave enabled, it increases quality the exact same way I have been advocating for years, it simply increases bit rate used.
    Not really. You seem to not understand the distinction

    And I didn't say anything about psy optimizations. You can't predict the filesize with or without psy optimizations. For the same reason QP isn't used in BD or UHD encoding


    Personally, I would rather have a slightly large file with uniform quality throughout, for instance instead of using CRF 18 + all the psy stuff, I would rather use QP 20, with all the psy stuff turned off, I/P ratio and P/B ratio set to 1, 3 or less B frames, no B Pyramid.
    You can obviously do whatever you want, but QP yields the worst quality , worst efficiency of any type of rate control. Have you actually compared this?

    At any "slightly large file", with the same filesize (bitrate), the CRF encoded file will yield higher quailty than the QP encoded file . With or without psy

    Do you want do try a little comparison competition ? It will be fun


    To me it's just absurd the way most people encode their videos, they use encoders with defaults that encode an I frame at some quantizer, then thanks to the default settings they use, the P frames use a quantizer 40% larger than the I frames, and the B frames use a quantizer 30% larger than the P frames, meaning that the B frames used a quantizer 82% larger than the I frames and on top of that they enable an algorithm that allows B frames to make reference to these lower quality B frames. Then they pat themselves on the back for using "the best encoder" and give other people "advice" on how to encode their own garbage. Then they go on forums and complain that the quality of various streaming services that do use these encoders with these settings.
    That's the whole point of temporal compression. That's the whole point of P,B frames - it's just a tradeoff where hopefully you don't see the deterioration in P,B frames. It works if bitrate is adequate and it's encoded properly. If we had unlimited bandwidth, we could just used uncompressed, all intra


    Hard drive space is very cheap
    Yes, but we still have to make compromises of some sort
    Quote Quote  
  17. Originally Posted by poisondeathray View Post
    Do you want do try a little comparison competition ? It will be fun
    It's on! Pick the test source, and do not pick one of those lame ducks flying type of sources.
    Quote Quote  
  18. Originally Posted by sophisticles View Post
    Originally Posted by poisondeathray View Post
    Do you want do try a little comparison competition ? It will be fun
    It's on! Pick the test source, and do not pick one of those lame ducks flying type of sources.
    You go ahead and pick a source. It doesn't have to be "one" . You get a better understanding and more complete picture if you use different sources, multiple tests

    So you said " I would rather use QP 20, with all the psy stuff turned off, I/P ratio and P/B ratio set to 1, 3 or less B frames, no B Pyramid. " , but you want to include an "apples to apples" test, so you'd have to encode CRF "x" "with all the psy stuff turned off, I/P ratio and P/B ratio set to 1, 3 or less B frames, no B Pyramid." also. Serial runs would have to be done, because it's unlikely you'd hit the same filesize (bitrate) as the QP run on your 1st go

    Then repeat CRF with the default settings (with default psy stuff, IP ratios etc..) again serial runs until you hit the same filesize (bitrate)


    Do you think CBR yields better quality (however you want to define it, metrics, subjective etc...) than VBR too at a given bitrate ? (it's a rhetorical question) . Because this similar . CRF is not a true measure of quality, but by the same token, neither is QP . We can only say there is a inverse relationship (lower values result in higher quality). QP "wastes" a lot of bitrate (the value does not change according to complexity - "constant quantizer") , so at typical bitrate ranges, on typical content you're going to get lower average quality. The distribution will not be as good. But go ahead , pick some sources
    Last edited by poisondeathray; 18th Jun 2019 at 14:41.
    Quote Quote  
  19. Originally Posted by poisondeathray View Post
    For example, why would you allocate more bitrate to a black frame ?
    I am surprised that you of all people would ask this question.

    Black as it relates to digital video is not the same as black as it is found in nature. In nature, black is the absence of color, which is the same as saying it is the absence of light. The absence of visible light, while we may refer to it as black, does not necessarily mean that there's no light.

    With digital information, it still takes data to encode the perceived absence of light, much like it takes still takes the same amount of data to encode an empty space as it does to encode an alphanumeric character.

    You can still get blocking and artifacting in black areas, as any x264 user can attest to (ZING!). Further, the greater the color gradients, including black, the more bit rate you need, for instance if you want to encode 0-255 content you should use more bit rate than if you're encoding 16-235 content and the same holds true if you're encoding BT.2020 and HDR requires even more bit rate.
    Quote Quote  
  20. Originally Posted by sophisticles View Post
    Originally Posted by poisondeathray View Post
    For example, why would you allocate more bitrate to a black frame ?
    I am surprised that you of all people would ask this question.

    Black as it relates to digital video is not the same as black as it is found in nature. In nature, black is the absence of color, which is the same as saying it is the absence of light. The absence of visible light, while we may refer to it as black, does not necessarily mean that there's no light.
    I never said anything about "no light."

    For example, in a movie title sequence, a fade in from black . That "black" isn't found in nature , it's synthetic

    Black letter box bars on a BD for example. It's smarter to underallocate bits to that black areas, that to forcea lower quantizers to those blocks , wasting bits where they could have been better allocated to , say an actor's face

    With digital information, it still takes data to encode the perceived absence of light, much like it takes still takes the same amount of data to encode an empty space as it does to encode an alphanumeric character.
    You're confused with uncompressed vs. compressed

    Uncompressed data requires the same amount per frame, per bit depth and chroma subsampling

    But we're talking about compression, and lossy compression

    Different types of content complexity require different amounts of bitrates to achieve the same level of quality

    A pure synthetic black frame (Y=16, Cb 128, Cr 128) will require less bits than , say, a shot from a camera with a foliage scene . And that' s the basic reasone why VBR is more efficient that CBR , and also why CRF is more efficient that QP . The distribution of bitrate among macroblocks is less efficient for CBR or QP


    You can still get blocking and artifacting in black areas, as any x264 user can attest to (ZING!). Further, the greater the color gradients, including black, the more bit rate you need, for instance if you want to encode 0-255 content you should use more bit rate than if you're encoding 16-235 content and the same holds true if you're encoding BT.2020 and HDR requires even more bit rate.
    Yes . x264 is terrible for dark areas , fades . Well known for this

    Yes, you definitely need more bitrate to preserve gradients . x265 does a better job, and 10bit helps too (both x264, x265 - even from an 8bit source)

    At given bitrate result encoded with QP , you will have higher quality overall with CRF encode resulting at the same bitrate . With CRF - Less bits are allocated to things less important things like black bars, less consequential things. More bits are allocated to things like faces, important things. Under both rate controls you will not be able to predict the bitrate, that's why neither is used for BD, UHD BD . And CRF actually comes very close to 2pass quality (actually slightly surpasses it, metric wise, most of the time)
    Quote Quote  
  21. Member azmoth's Avatar
    Join Date
    Jan 2010
    Location
    Indian Callcenter
    Search Comp PM
    Not to get between you guys little wager, but could you throw 1 pass abr into the mix as well when you test? About every fast encoder out there e.g Wondershare and the plethora of those types they bandy about on the Net, use it in their encoder settings rather than crf or 2 pass. The thing is at high bitrates abr looks good. I couldn't see any discernible differences between 1 pass abr eg. I did with Wonderfox HD Converter or 2 pass with Handbrake at the same bitrate setting using a high quality source. Cheers.
    Quote Quote  
  22. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Originally Posted by azmoth View Post
    Not to get between you guys little wager, but could you throw 1 pass abr into the mix as well when you test? About every fast encoder out there e.g Wondershare and the plethora of those types they bandy about on the Net, use it in their encoder settings rather than crf or 2 pass. The thing is at high bitrates abr looks good. I couldn't see any discernible differences between 1 pass abr eg.
    The higher the bitrate of the test, the harder it is to pick a winner. Anyway I can save you the time. ABR is going to be the worse when matched against 2-pass and CRF. ABR 1-pass is only really going to beat CBR.
    Quote Quote  
  23. ^ exactly what KarMa said

    At high bitrates, everything looks good. MPEG2 even looks good

    1pass unconstrained VBR, is worse than 2pass unconstrained VBR , or unconstrained CRF . Always. Even if you can't "see" the difference, frame by frame, zoomed in with trained eyes, the metrics demonstrate this

    But whether or not the difference is significant for the situation at hand is what matters . At high bitrates there might be 0.5% difference. At low bitrates there might be 10-20% difference and clearly visible differences

    To demonstrate this thoroughly , you also plot RD curves. You do multiple runs at different CRF (or QP) and plot against whatever metric (SSIM, VMAF etc...)

    It's only valid to compare visually at the same bitrate, but the curves enable you to extrapolate trends. e.g. how much better at a given bitrate range, or how much bitrate savings required to reach "x" quality etc...

    It's not really a "wager" . These findings have demonstrated, many, many times before (at least for x264; x265 is newer, fewer tests - but the trend is the same). The evidence is strong and it's very consistent across different genres and bitrate ranges. If you find a scenario where QP or 1pass VBR yields better results than CRF or 2pass VBR (compression quality, i.e quality at a given bitrate) , it's going to be the exception, not the norm.

    But people make trade offs all the time - So what if something is 3% better at that bitrate range but takes 2x slower to encode? Faster, lower quality settings encode faster (obviously). 1pass VBR is certainly faster to encode than CRF or 2pass. It's used all the time for streaming. Many people accept faster encoding, slightly larger filesize as a good tradeoff for general use. In other situations it might be appropriate to use better, slower, settings. Maybe you have bandwidth constraints and you need to squeeze slightly higher quality out of it. It depends on the situation. Others might require tuning for the genre (e.g. you would use different settings for clean simple animation with duplicate frames vs. an live action movie) . What I'm trying to say is you decide what is appropriate for your situation, and high bitrate trumps everything
    Quote Quote  
  24. it's trolling and confusing newbies

    this was already done many times, anyone could do it , I was doing it myself, encode CRF 1pass, calculate average bitrate from its result and do 2pass to that average,...videos are about the same

    encoding is a camouflage business for the money you have (computer speed), what else would that be? Secondly, it is suppose to be judged while watching actual video. As soon you start to use ai or freeze frames , it is pretty useless because we are not machines, as humans we just watch videos live and get a "feel" how good it is or not.

    And how 2pass VBR suppose to be better if you never know your sweet spot 2pass average actually is? It is always different for any movie. Or you cut movie short and again, it is different. So lets do this presumption and lie that 2pass VBR is better than CRF 1 pass. Yes. Ok. But what average bitrate do I encode? eeny-meeny ...
    Quote Quote  
  25. Sorry it took so long, I couldn't decide on test source, I wanted very high quality test files that I had never tested before and that I had never seen tested either. It took a while but I ran across this website, if you look around you can find the sources for all the test I conducted:


    http://www.beachfrontbroll.com


    To keep things simple, I encoded each clip 2 times, using x264 via AviDemux, once with CRF 23 plus the Medium preset and once with QP 23 with I/P and P/B ratio set to 1, B frames as references disabled as well as all no AQ (which means no MB-Tree) or Psy-RD.


    I let the chips fall where they may regarding file size, I didn't try to match the bit rates exactly, if one used more bit rate than the other, then so be it.


    I plan on posting more tests in the next couple of days.
    Image Attached Files
    Quote Quote  
  26. Member
    Join Date
    Jul 2007
    Location
    United States
    Search Comp PM
    There are professionals (Compressionists) who have gone to college to learn the fine art of compressing a 2TB+ cinema master for home viewing delivery. Here's an interesting (though rather old, the interviewee is referencing DVD) interview with a compressionist. http://www.filmsondisc.com/Features/compressionist.htm

    Still think there's a "One size fits all solution?"
    Quote Quote  
  27. I'd like to make a program that chooses the right encoding settings to give little quality loss.
    Here are my 2 cents of thoughts about writing such a program:

    I see a few bigger problems there:
    1. A measure of quality your program can understand is needed:
      Assuming you have such a measure of quality, your program would:
      1. choose/create a sample
        • the selection of the sample might be based of some fast analysis of the source or a bunch of random sections. All those compression tests in StaxRip, MeGui also do this. (iirc. they simply use a short sample composed of different sections of the source)
      2. simply encode that source with all given encoding settings that are possible
        • depending on experience some of the features of the encoder could be 'forbidden' or 'limited' based on experience, for example if you want quality X the quantizer selection can be restricted to 30-50 instead of 0-51,...
        • for some settings you can also limit that if feature F with setting X gives quality Y, feature F with settings X+1.. can be excluded
        • finding restrictions based on lots of tests and the chosen quality measurement is probably the hardest and most time consuming part here
    2. Your tool will need lots of time to test all the required settings.
    3. To really have meaningful limits tons of different sources would need to be encoded.

    So if you program is properly trained (in case it's a 'machine learning' program) or adjusted to reflect the data found you would have a tool which:
    1. would analyse a source
    2. select a 'small' source sample
    3. run a bunch of different encoding settings
    4. decide that setting X is 'probably' the best you can do for source X

    -> Is it possible to write something like that: Sure.
    Do I think someone is really doing this: No, since it would require a really good quality measurement algorithm. That said if it's really about mathematical information loss and not perceived quality loss PSNR is a useful quality measurement. Problem there is that the mathematical quality loss doesn't always align with the humanly perceived quality loss, which is why there are tons of quality measurement algorithms.


    => have fun

    Cu Selur

    Ps.: Just finding the optimum bitrate with otherwise given encoding restrictions would be simpler than finding the optimal encoding setting since it's would limit the amount of possible settings a lot.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  28. Originally Posted by sophisticles View Post
    …..I let the chips fall where they may regarding file size, I didn't try to match the bit rates exactly, if one used more bit rate than the other, then so be it.
    I understand, but it doesn't make sense to compare the quality of encodes with a huge difference in file size (bitrate) such as +69% in the case of Swan Goose, does it?

    I might be wrong, but AFAIK NVenc doesn't have a CRF equivalent, it always uses QP for 1-pass encoding.
    Last edited by Sharc; 20th Jun 2019 at 02:58. Reason: NVenc
    Quote Quote  
  29. I agree that you either need to keep the quality (using some measurement) or the file size constant to draw (useful) conclusions.

    AFAIK NVenc doesn't have a CRF equivalent, it always uses QP for 1-pass encoding.
    iirc NVEncC only does:
    1. one pass abr (with optional lookahead)
    2. one pass vbr (with optional lookahead)
    3. one pass cq
    3. one pass vbr (with optional lookahead and reencoding of frames) <- this sometimes is referred to as 2pass encoding, bug is something totally different than the classic Xpass encoding
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  30. I use this script in bash to convert movies in good quality under linux with ffmpeg,


    #!/bin/bash

    for f in *.mp4; do ffmpeg -i "$f" -c:v libx264 -preset veryslow -tune film -crf 20 -profile high -level 41 -g 30 -r 30000/1001 -flags +ilme+ildct -pix_fmt yuv420p -filter_complex scale=interl=1,fieldorder=tff,setsar=sar=40/33 -refs 10 -x264opts bluray-compat=1:vbv-bufsize=30000:vbv-maxrate=40000lices=4pen-gop=1:force-cfr=1 -acodec ac3 -s 720x480 -aspect 16:9 "${f%.mp4}.x264.veryslow.20.4.1.ac3.mp4"; done
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!