Skip to content

Use ffmpeg color data to determine profile for video import.

Wolthera van Hövell requested to merge wolthera/ffmpeg-colorspace-import into master

This patch uses the FFMPEG color primaries and transfer information together with all the stuff I did for the heif/avif support to get the appropriate profile. This would fix this bug, and also automate selecting the appropriate colorspace.

Also uses bits_per_raw_sample to give us the most likely bitdepth. It however may not be in the repositories yet, Krita will still load a 16bit layer for an import that produces one, though into an 8bit document.

This patch also fixes a ton of strings to be translatable...

TODO

  • Remove superfluous UI options.
  • There's already a resize option in there, so I am still not sure why we're keeping the resolution.

... Do we have any unittests that need to be checked?

Test Plan

Load this file into Krita: candle-anim-hdr

It should resemble this candle-anim (At least, it should resemble in terms of saturation. If the flame seems mostly warm yellow instead of orange, something's wrong)

This has not been tested with a video file that's completely grayscale. It should result in a document that's 8bit sRGB but with a grayscale layer imported.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.
Edited by Wolthera van Hövell

Merge request reports