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. |
|
|
Thread Tools | Search this Thread | Display Modes |
29th December 2019, 04:48 | #1 | Link |
Registered User
Join Date: Dec 2017
Posts: 90
|
How to import 32 bit floating point EXR sequence in AviSynth+?
I'd like to import a linear 32 bit floating point EXR sequence in AVISynth. I succeeded importing as RGB24 or RGB64 with ImageSource, however it cuts off all the values above 1. It would need to go into a format like RGBPS I think, but ImageSource throws an error if I try using that as pixel_type. What are my options?
|
29th December 2019, 05:03 | #2 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
Currently, you cannot use this workflow with EXR in avisynth properly - because there are no source filters capable. AVS+ has the RGBPS capability now, but nothing to load it with
Your options are to use another program that can handle EXR sequences and float eg. Natron (open source) , or commercial ones like After Effects, Nuke . Perhaps convert them to a format AVS+ can handle importing or Vapoursynth can load and handle them properly as float with it's imagemagick implementation (it's high bit depth, HDR) . Hopefully one day avisynth will get this too |
29th December 2019, 06:38 | #5 | Link |
...?
Join Date: Nov 2005
Location: Florida
Posts: 1,419
|
The following is incredibly janky and probably completely unsuitable for the purposes this was being asked for in the first place. But it was interesting getting this to 'work'.
VapourSynth can do it using imwri, as mentioned above. I couldn't find any 32-bit EXR samples to work with, so I had to try generating some myself. It didn't work; the only thing that did was converting one of the 16-bit EXR frames from Big Buck Bunny to 32-bit TIFF. So I tested with that. The corresponding VapourSynth script to test this out is something as simple as this: Code:
#!/usr/bin/env python import vapoursynth as vs core = vs.get_core() clip = core.imwri.Read('test32.tiff', alpha=False) clip = core.resize.Bicubic(clip=clip, format=vs.YUV444PS, matrix_s="709") clip.set_output() But what does this have to do with AviSynth, you ask? Well, you can load VapourSynth scripts in AviSynth. The newest build of VapourSource appears to be this one: https://github.com/Beatrice-Raws/VapourSource/releases There's a big caveat there, though: currently, none of the forks of VapourSource accept RGBPS, only float YUV. Hence that line in the example .vpy that converts to YUV444PS. But FFmpeg doesn't support that format. So we convert the RGBPS to YUV444PS to get it into AviSynth through VapourSource, and then inside of AviSynth+, we convert it back to RGBPS so FFmpeg can display it: Code:
VSImport("Template.vpy") ConvertToPlanarRGB() Last edited by qyot27; 31st December 2019 at 00:14. Reason: imwri comes with vs, see correction below |
29th December 2019, 06:54 | #6 | Link |
Registered User
Join Date: Sep 2007
Posts: 5,346
|
vapoursynth comes with imwri now
You have to use float_output=True for RGBPS, otherwise it will load as RGB48 . Wildcards are the same syntax as ImageSource, with respect to "placeholders" or padding eg. such as img_%05d.exr vsedit can display things like RGBPS, and the color picker will display the values <0 or >1 for R,G,B in the status bar . It's a great editor for high bit depth, and until / if avspmod every gets this - I actually use it also to preview avs scripts >8bit. (You can go the other way and import avs scripts into vpy for some types of pixel formats) Linear float to 10bit420 Rec.2020 PQ would look something like this Code:
clip = core.resize.Bicubic(clip, format=vs.YUV420P10, matrix_s="2020ncl", transfer_in_s="linear", transfer_s="st2084", primaries_in_s="2020", primaries_s="2020", chromaloc=2, nominal_luminance=1000) But there are bunch of other variables and stuff you probably have to do. But what is your EXR sequence originally from? Likely you have to make adjustments and grade it before converting. The input primaries and the nominal_luminance might need to be set differently |
Thread Tools | Search this Thread |
Display Modes | |
|
|