Implement rendering animations to video as an extension plugin
AbandonedPublic

Authored by rempt on Aug 4 2016, 8:20 AM.

Details

Reviewers
dkazakov
Group Reviewers
Krita
Maniphest Tasks
Restricted Maniphest Task
Summary

This patch implements the following things:

  • It ports the video-export plugin from FilePlugin to an AnimationExporter

plugin.

  • It fixes a number of memory leaks because of incorrect handling of

KisPropertiesConfiguration objects. These objects are now Krita shared
ponters

  • It ports all usage of KisPropertiesConfiguration objects to use the

shared pointer version

  • It passes a properties config object to all import/export filters so

it's possible now to devise a system where import/export doesn't just
use the last used configuration, but one that can be specified programmatically
or on the command line (the last is still to do).

  • It implements a new plugin for rendering animations that allows the

user to specify the file type and the settings for the sequence files
generated. The plugin also loads the available AnimationExporter plugins
and allows the user to configure the settings for rendering the sequence
using ffmpeg. The set of frames that are exported is now also configurable.

  • There is a separate action for re-rendering the last rendered set of

frames.

  • It ports the video-export plugin to work with this system, and no longer

render a sequence itself.

  • It adds feedback and tells the user that there is a logfile for checking

when something goes wrong.

Ref T116

Diff Detail

Repository
R37 Krita
Branch
video-export-rebased
Lint
No Linters Available
Unit
No Unit Test Coverage
rempt updated this revision to Diff 5668.Aug 4 2016, 8:20 AM
rempt retitled this revision from to Implement rendering animations to video as an extension plugin.
rempt added a reviewer: Krita.
rempt updated this object.
rempt added a task: Restricted Maniphest Task.
rempt added a subscriber: Krita.
rempt added a comment.Aug 4 2016, 8:22 AM

Note: for testing, it's easiest to use the video-export-rebased branch.

The video export plugin stil doesn't compile :(

The export dialog looks really overloaded :(

Why should the user think about the PNG options when he exports into MKV? The only interesting thing that might be interesting for him is 1) whether to save transparency or to which color to replace it; 2) whether to convert into sRGB. Why should he know about PNG at all? Probably, some tabbed GUI could solve the issue?

@scottpetrovic, could you make any suggestions about that GUI? How can we make it less frightening?

And here is a small bug in the writing of "FF&mpeg"

dkazakov requested changes to this revision.Aug 5 2016, 8:04 PM
dkazakov added a reviewer: dkazakov.

This state is wrong. One cannot save into OGV with MP4 codec. The rightmost part should switch to the appropriate codec and let the user to choose the options.

This is a regression in comparison to master

This revision now requires changes to proceed.Aug 5 2016, 8:04 PM
rempt added a comment.Aug 5 2016, 8:11 PM

I will check that, but it's not a regression compared to master, because in master, the video export should be disabled because it breaks saving an unanimated gif image.

rempt added a comment.Aug 6 2016, 7:07 AM

Hm, I don't think I'll managed to do coding this weekend, so I see three options:

  • merge & fix the bugs during stabiliasation phase
  • merge & disable the plugin
  • wait four weeks

I would prefer the first option, of course.

woltherav added a subscriber: woltherav.EditedAug 16 2016, 1:36 PM

My proposal for the layout is:

  1. Stick every group into a tab instead, so it doesn't take up the whole screen.
  2. Add big, fat, configuration load/save dialog at the top.
  3. Add a 'convert whole animation to animated gif' preset.
  4. Merge and let others who understand video come up with other presets. Make a test build if possible and a call for proposals.
  5. Add those other proposals into master.

I have checked the latest version of the branch, and now it has only two minor issues:

  1. If you change video type in the drop down, the file extension is not updated until you click on the "..." button.
    1. Select container type to MP4, make sure that the filename is something like "filename.mp4"
    2. Select container type to GIF
    3. See that the file extension is not updated
  1. On Linux the plugin should automatically find the ffmpeg binary installed in the system. In my implementation QProcess could easily do it.

Except these two bugs, the branch is fine to be merged.

beelzy added a subscriber: beelzy.EditedSep 26 2016, 3:36 PM

Results from testing on OSX with ffmpeg static build:

Works for the most part, except for a few occasional memory leaks. After you click OK in the dialog box, it just won't do anything and then everything gets disabled like in the autosave bug. Trace here:

.mp4 files are created with yuv444 pixel format by default. They don't work on OSX though, so you have to tell ffmpeg to use yuv420p so that they'll display properly in OSX. Not entirely sure if we should make an entire option for this or just use yuv420p anyways.

.mkv files don't seem to run with VLC, but will work with mpv.

rempt abandoned this revision.Nov 2 2017, 8:50 AM

Cleaning up old and obsolete diffs...