Skip to content

Basic support for Video Animation Import

My first attempt at adding a feature. I didn't mark everything as tested cause I so far only tested 2 different ffmpeg version on linux. It would help if someone could test other platforms.

And of course check if my code is fine.

Thanks.

Oh and @scottpetrovic what do you think since it is based on your plugin?


Basic support for Animation Import

This patch allows importing video and animated images directly into krita using ffprobe and ffmpeg. It is mostly based on scott's python plugin, with a few extras, these include:

  • Wider video and animated images support (gif works properly)
  • Using the slower ffmpeg copy, it works even without ffprobe if needed
  • loading the thumbnails via stdout pipe without the disk overhead
  • ability to create new documents or import into current document
  • note: ffmpeg import will use default settings for its export of pngs which may not exactly honor the users choice of colorspace as this is "basic support".

This patch also includes an ffmpeg wrapper that is based on trying to merge in the future, both the videosaver and the recorder wrapper into one. The wrapper includes the ability to not only find ffmpeg/ffprobe, but also to record the capabilities of the ffmpeg encoders and decoders.

This patch as a whole should allow for importing pretty much almost any format ffmpeg supports. This of course means any format not bundled into ffmpeg such as an animated webp decoder, or in the case of FOSS versions of ffmpeg, h264 and h265 will not work. If the user does get a version that does support it, the capabilities would be recorded and they would be able to open those formats as well.

Test Plan

  1. Click File -> Import Video Animation Note: If ffmpeg is not found, it will give an error to go to options and add it. In that case you would need to download ffmpeg and add it.
  2. Pick a video or animated image that is NOT a webp or something really new like AV1/AVIF unless you happen to have an ffmpeg version that supports it.
  3. Choose any settings you wish and click okay.
  4. Try again with creating a new document.

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 Know Zero

Merge request reports