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. |
![]() |
#261 | Link | |||||||
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,727
|
Quote:
Such a conversion is trivial in Avisynth (and probably VapourSynth too) but it's slightly less so in FFMpeg. Now, in theory, lut3d *should* do that for you anyway, so something as simple as this should, in theory, suffice: Quote:
Quote:
In this case I'm going from BT709 SDR to BT2020 HLG HDR and indeed mediainfo shows the right info in the container: Quote:
When I index the newly created version with ffmpeg and I compare it to the Avisynth one I can see that lut3d in FFMpeg did convert to RGB Full Range, applied the LUT and converted back to YUV Limited TV Range correctly: Quote:
Avisynth top, FFMpeg bottom: ![]() ![]() Quote:
I also recommend -map_metadata -1 if you're doing it in FFMpeg directly to completely get rid of the original info before replacing it with the new one. By the way, this needs to be done regardless of the encoder you're using; I mean, even with Avisynth + x264 for instance you still need to specify the output to make decoders interpret it correctly, for instance in x264 it would have been something like: Quote:
Last edited by FranceBB; 12th October 2023 at 22:08. |
|||||||
![]() |
![]() |
![]() |
#263 | Link | |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,727
|
Linear Transformation v2.6 Released!
Quote:
Now, as an example, let's take a look at the following fake RGB32 input: Code:
ColorBars(848, 480, pixel_type="RGB32") pippo=last pluto=pippo.ConverttoY() AddAlphaPlane(pippo, pluto) ![]() and the last 8 are the alpha channel (+8 = 32): ![]() This is in BT709 SDR. When we apply: Code:
LinearTransformation(Input="Linear_BT709", Output="BT2100_PQ", Interpolation="Tetrahedral") what's gonna happen is that the stream will be divided in two parts: the normal part and the alpha channel and both will be subject to the very same transformation (in this case from BT709 to BT2020 PQ) before being added back to create a proper RGB32 output: ![]() ![]() as per mojie126's request. ![]() Last edited by FranceBB; 14th November 2023 at 18:27. |
|
![]() |
![]() |
![]() |
#265 | Link |
Broadcast Encoder
Join Date: Nov 2013
Location: Royal Borough of Kensington & Chelsea, UK
Posts: 2,727
|
Currently no, we can only go from dvhe0509 to BT709 SDR and even that took quite a lot of work for me and algia (Livio Aloja) one of my former colleagues, also an encoder, a senior editor and great friend of mine at Sky before he retired.
Nowadays he mostly goes fishing on the river in summer and fetching mushrooms in winter. That being said, going from dvhe0509 was extremely difficult due to the lack of openness from Dolby about the proprietary metadata in the pixel shader, so much so that the result of that conversion comes from using the official Harmonic reference encodes in both dvhe0509 and BT709 and reverse engineering the transformation matrix used, which is why it's less than perfect as it's not based on an official spec, but it's "good enough". Specifically, it applies to IPTc2 dvhe0509 inputs specifically, so it won't work with other kind of inputs. This is because, on a normal pipeline, you could have: Source dvhe0509 -> Proprietary Metadata interpreter -> standard HDR image -> LUT -> BT709 SDR however what we've done is this: Source dvhe0509 -> IPTc2 -> LUT -> BT709 SDR The fact is that nothing tells us that the input is always going to be IPTc2. Going the other way round, so from BT709 to dvhe0509 is impossible 'cause although the transformation could, in theory, be inverted, I would have no way to insert the proprietary metadata in the file so you would be left with something that no decoder could decode properly. In other words, you could, in theory, invert and do: BT709 SDR -> LUT -> IPTc2 then what? You're left with IPTc2 that needs to be encoded and flagged as such with the relative metadata so that an official decoder will be able to decode it, but we have no way to do that I'm afraid, so all you're left with is an uncompressed A/V stream living in RAM coming out from Avisynth with no metadata at all and that any decoder would get wrong. Out of curiosity, why are you trying to do this? Last edited by FranceBB; Today at 00:49. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
Display Modes | |
|
|