Log in

View Full Version : best format for images in Avisynth+


DiablosDemon
28th October 2020, 20:53
Hello all. After many months of doing my research and figuring out Avisynth+ I have been getting very nice results. I've mostly been using the modified script by meloware. I'm starting with .dpx 10bit image files which I bring into Davinci Resolve 16 to do basic editing and cropping scene by scene. I have been exporting in .dpx and then converting to .png to use in Avisynth+. When the files are converted in XNconvert they are output at .png 8 bit which I'm not sure if that's really a good conversion or I'm losing quality. I would like to stay with image files and not video. Saying this I can export from Resolve in AVI, Cineon, DCP, DPX, EXR, IMF, Jpeg2000, MJ2, MP$, MXF OP-Atom, MFX OPIA, Quicktime, and Tiff. The only one I know of that Avisynth+ can import is Tiff. Is Tiff good or bad? If anyone can direct me to a better solution for quality I would appreciate it very much. I'm happy with the results I've achieved but would like to know if there's a better way. Thank you.

FranceBB
29th October 2020, 13:36
Whenever we have to work and encode mezzanine files coming out from Resolve, we use DNxHR muxed in .mxf.
Although DNxHR is lossy, it's also 4:4:4 12bit with a very high bitrate, so it's probably gonna be fine for many scenarios / use case.
If you're so concerned about outputting something lossless, you can output an uncompressed 10bit planar .avi file (I think it supports v210).
As to the images, .tiff 16bit planar is fine and, as a matter of fact, it's also the codec we use before we encode in JPEG2000 whenever we have to make a DCP (Motion JPEG2000 12bit) that has to be sent to the cinema, so no problem.

poisondeathray
29th October 2020, 16:16
I have been exporting in .dpx and then converting to .png to use in Avisynth+. When the files are converted in XNconvert they are output at .png 8 bit which I'm not sure if that's really a good conversion or I'm losing quality. I would like to stay with image files and not video.

Yes there is quality loss going from 10bit dpx to 8bit png

One issue with >8 bitdepth image sequences - such as 16bit TIFF or PNG - is avisynth does not currently have a good way to import them. ImageSource is currently 8bit only.

You can load individual high bit depth files with ffms2, but a sequence import requires a slow ffms2 workaround, and there is clutter - an index file is produced per image . The scriptclip workaround is not necessarily frame accurate with seeks either; so temporal filtering could be an issue
https://forum.doom9.org/showthread.php?p=1677861

I would use vapoursynth if dealing with high bitdepth image sequences. It's imagemagick plugin supports high bit depth sequence imports and 32bit float import as well (e.g. EXR) . If you can do your additional processing in vapoursynth, I would just stay there. But if you need avisynth, another workaround would be to import the image sequence using vpy script, and Vapoursource VSImport into the avisynth script. This also adds additional overhead, and not all pixel formats are supported by the avs VSImport plugin - but YUV444P16 and YUV444PS are supported, so it can be a lossless transform from RGB30 or RGB48

Otherwise use a video format. DNxHR and Cineform are good options

StvG
29th October 2020, 17:39
One issue with >8 bitdepth image sequences - such as 16bit TIFF or PNG - is avisynth does not currently have a good way to import them. ImageSource is currently 8bit only.
ImageSource supports Y16, RGB48 and RGB64 (avs+) with use_DevIL=true. ( http://avisynth.nl/index.php/ImageSource#ImageReader_and_ImageSource )

poisondeathray
29th October 2020, 17:41
ImageSource supports Y16, RGB48 and RGB64 (avs+) with use_DevIL=true. ( http://avisynth.nl/index.php/ImageSource#ImageReader_and_ImageSource )

Nice . DevIL is good :devil:

DiablosDemon
30th October 2020, 00:28
Thank you. I haven't used Vaporsynth but can try. I am using imagesource in the Avisynth+ script. Most of what you have told me is over my head but I will research it all and see what I can manage. I'm not a code writer so most of my attempts have been scripts from other people which I have successfully made work with as few modifications as possible. It has worked and amazingly well. It will take me decades to learn what most of you know (if I have that long). Thanks again.