General H.264-to-H.265 for best fidelity & "no better"
Posted: Wed Aug 14, 2019 4:16 am
I'm new to HandBrake. It's simultaneously wonderful and frustrating.
Probably everyone who reads this understands I-frames & P-frames & B-frames and decoding and all that. Decoding is fairly straightforward. The result of decoding is video frames, audio, and subtitles (content). The fundamental function of HandBrake is to encode that content according to the user's choice of encoder.
The objective is to produce an encoded stream that matches the content & no better. I write "no better" because one cannot improve on the source -- I of course disregard file size because I seek the best fidelity and "no better"; I don't want loss at all but I don't want file-size waste, either. H.265 is more efficient, and thus, H.264-to-H.265 transcode should produce smaller files, and that alone will satisfy me.
It occurs to me that if I take a 1080p24 H.264 M2TS source and transcode it to a 1080p24 H.265 MKV target, there is only one set of HandBrake settings that can do it with 100% fidelity and "no better". In fact, the source (1080p24 H.264 M2TS) really shouldn't matter. Whatever the source, given the decoded content, there should be one set of HandBrake settings that will produce the best (100%?) encode & "no better".
What are those HandBrake settings?
Of course there are many details involving filtering & block size-v-motion compensation &tc., nonetheless, assuming that I only transcode 'up' (H.264-to-H.265, for example), I contend that once the source has been decoded and a target codec has been chosen, there is one & only one set of HandBrake settings that will duplicate the source content & "no better".
Now, I can suppose that it's theoretically impossible to duplicate the source, even when transcoding 'up'. Is that so? I can suppose that I can only approach the source asymptotically; 98% ... 99% ... 99.9% ... 99.99% ... Is that so? It's easy to say that's so, but is it really so?
Now, suppose I knew how the source's H.264 encode had been set up, would I then be able to duplicate those settings for an equivalent H.265 encode? Is there an H.264-to-H.265 correspondance? Does HandBrake know what the H.264 settings were? I suspect not. But can HandBrake infer what the H.264 settings were based on metadata? I suspect so.
Currently, I have QP and the "Optimize Video" knobs to twiddle. They are mysterious to me and I'm tiring in the attempt, based on perceived video quality of test runs, to reverse engineer what they do and their effects.
Do 'you' have any thoughts? comments?
Probably everyone who reads this understands I-frames & P-frames & B-frames and decoding and all that. Decoding is fairly straightforward. The result of decoding is video frames, audio, and subtitles (content). The fundamental function of HandBrake is to encode that content according to the user's choice of encoder.
The objective is to produce an encoded stream that matches the content & no better. I write "no better" because one cannot improve on the source -- I of course disregard file size because I seek the best fidelity and "no better"; I don't want loss at all but I don't want file-size waste, either. H.265 is more efficient, and thus, H.264-to-H.265 transcode should produce smaller files, and that alone will satisfy me.
It occurs to me that if I take a 1080p24 H.264 M2TS source and transcode it to a 1080p24 H.265 MKV target, there is only one set of HandBrake settings that can do it with 100% fidelity and "no better". In fact, the source (1080p24 H.264 M2TS) really shouldn't matter. Whatever the source, given the decoded content, there should be one set of HandBrake settings that will produce the best (100%?) encode & "no better".
What are those HandBrake settings?
Of course there are many details involving filtering & block size-v-motion compensation &tc., nonetheless, assuming that I only transcode 'up' (H.264-to-H.265, for example), I contend that once the source has been decoded and a target codec has been chosen, there is one & only one set of HandBrake settings that will duplicate the source content & "no better".
Now, I can suppose that it's theoretically impossible to duplicate the source, even when transcoding 'up'. Is that so? I can suppose that I can only approach the source asymptotically; 98% ... 99% ... 99.9% ... 99.99% ... Is that so? It's easy to say that's so, but is it really so?
Now, suppose I knew how the source's H.264 encode had been set up, would I then be able to duplicate those settings for an equivalent H.265 encode? Is there an H.264-to-H.265 correspondance? Does HandBrake know what the H.264 settings were? I suspect not. But can HandBrake infer what the H.264 settings were based on metadata? I suspect so.
Currently, I have QP and the "Optimize Video" knobs to twiddle. They are mysterious to me and I'm tiring in the attempt, based on perceived video quality of test runs, to reverse engineer what they do and their effects.
Do 'you' have any thoughts? comments?