drawing recorder plugin
Needs ReviewPublic

Authored by shiyan on Mar 4 2019, 6:57 PM.

Details

Reviewers
None
Group Reviewers
Krita
Summary

add a drawing recording plugin to generate time-lapse videos

Diff Detail

Repository
R37 Krita
Branch
drawing_recorder (branched from master)
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 9164
Build 9182: arc lint + arc unit
shiyan created this revision.Mar 4 2019, 6:57 PM
Restricted Application added a reviewer: Krita. · View Herald TranscriptMar 4 2019, 6:57 PM
Restricted Application added a project: Krita. · View Herald Transcript
shiyan requested review of this revision.Mar 4 2019, 6:57 PM
shiyan added a comment.EditedMar 4 2019, 7:05 PM

Hello there,

A few weeks back I said in the IRC that I made a video recording plugin out of the overview docker to record time-lapse drawing videos. I'm trying to upstream it.

An example video generated yesterday https://youtu.be/dx3P05lNLEI

There will be more iterations before this change can be finalized.

Major issues:

  1. not cross-platform yet, I work on linux, I have an old mac, but I don't have windows.
  2. new dependency introduced (gstreamer), I link the one on my system. not sure if this is allowed.
  3. can't handle canvas size changes
  4. supports only one recording at a time.
  5. no proper error handling, not many configs exposed.

I will keep revising this.

Thanks!

rempt added a subscriber: rempt.Mar 4 2019, 7:41 PM

Okay, I added a few notes. I'm quite impressed with how far you've come, but I haven't tested yet whether it impacts the painting performance :-)

plugins/dockers/recorder/CMakeLists.txt
1

Yes... This really is a problem. Adding dependencies on gstreamer and glib is a tough call. It would make the plugin essentially linux-only and optional -- even though gstreamer is already a dep for QMultiMedia.

For animation, we use a shell exit to ffmpeg to turn frame images into video. In other places we try to use QMultiMedia, but I cannot figure out how to make that create video.

The way you handle the deps needs to be fixed as well, but we can work together on that.

plugins/dockers/recorder/encoder.h
13

Um, consistent indentation with 4 spaces, no tabes is appreciated :-)

13

We also tend to put the private member variables in a private: section at the bottom of the class declaration, not like here at the top.

plugins/dockers/recorder/recorderdocker_dock.cpp
2

Take care of copyright lines when copying code :-)

Bollebib added a subscriber: Bollebib.EditedMar 17 2019, 12:06 PM

I would definitly be interested in this since i upload art to youtube constantly

i hope there will be a test version for this in the future ,but i'm rooting for you to finish this!

not cross-platform yet, I work on linux, I have an old mac, but I don't have windows.

->i hope it gets ported to windows since i use that.

can't handle canvas size changes

->this is probably fine as an initial limitation

supports only one recording at a time.

->this is fine

As i understand similar features like this working

I think procreator saves the timelaps in the drawing file. And even if the file is closed and opened,the timelapse just resumes. Would this be the case for this implementation too?

Thanks in advance for fixing localization issues.

plugins/dockers/recorder/recorderdocker_dock.cpp
56

It might be that i18n() is missing here.

72

It might be that i18n() is missing here.

77

It might be that i18n() is missing here

158

It might be that i18n() should be used instead of tr() here.

Thank you @Bollebib,

Sorry my time is limited, but I will try to work on it a bit more this week.

not cross-platform yet, I work on linux, I have an old mac, but I don't have windows.

->i hope it gets ported to windows since i use that.

ya, I wanted to be cross-platform too, but i currently don't have a windows machine, mac support is easier for me to do.

can't handle canvas size changes

->this is probably fine as an initial limitation

This is actually not that hard to achieve.

supports only one recording at a time.

->this is fine

This is not that hard either, but I wonder if there is a need for this.

As i understand similar features like this working

I think procreator saves the timelapse in the drawing file. And even if the file is closed and opened,the timelapse just resumes. Would this be the case for this implementation too?

In the current implementation, i set a limit of the maximum frames (images) of a single video file.. If a video exceeds that frame number, I save the current video and automatically start a new video file. the file name would be in a pattern like record001.webm record002.webm ...

then I will use ffmpeg to merge them together before uploading to youtube . it's very simple to do.

the reason I set this frame number limitation is because I want to save the video frequently, so that in case of a crash, you won't lose most of the previous recording.

video files are tricky (at least the way I'm doing it, this could be improved later.), you need to "wrap it up" with a proper "footer" data, otherwise the video file is corrupted. therefore I can't treat it like a normal file and simply append new images to it.

as of right now, in the case that you stop Krita and relaunch next time, I will generate a new video file with name record003.webm ... for example,

and again, in the end, I use ffmpeg or imovie to combine them together.

plugins/dockers/recorder/CMakeLists.txt
1

ya, I'm fine with linux-only and being optional. I didn't notice performance issue, but my linux machine is kinda beefy.

I will try to resolve the issues you've pointed out.

Thanks!

Thank you @Bollebib,

Sorry my time is limited, but I will try to work on it a bit more this week.

not cross-platform yet, I work on linux, I have an old mac, but I don't have windows.

->i hope it gets ported to windows since i use that.

ya, I wanted to be cross-platform too, but i currently don't have a windows machine, mac support is easier for me to do.

can't handle canvas size changes

->this is probably fine as an initial limitation

This is actually not that hard to achieve.

supports only one recording at a time.

->this is fine

This is not that hard either, but I wonder if there is a need for this.

As i understand similar features like this working

I think procreator saves the timelapse in the drawing file. And even if the file is closed and opened,the timelapse just resumes. Would this be the case for this implementation too?

In the current implementation, i set a limit of the maximum frames (images) of a single video file.. If a video exceeds that frame number, I save the current video and automatically start a new video file. the file name would be in a pattern like record001.webm record002.webm ...

then I will use ffmpeg to merge them together before uploading to youtube . it's very simple to do.

the reason I set this frame number limitation is because I want to save the video frequently, so that in case of a crash, you won't lose most of the previous recording.

video files are tricky (at least the way I'm doing it, this could be improved later.), you need to "wrap it up" with a proper "footer" data, otherwise the video file is corrupted. therefore I can't treat it like a normal file and simply append new images to it.

as of right now, in the case that you stop Krita and relaunch next time, I will generate a new video file with name record003.webm ... for example,

and again, in the end, I use ffmpeg or imovie to combine them together.

sure i understand that

but will there then be settings to have a sped up version of the video that you can input? A quick timelapse is usually better then a long 2-3 hour file.

or would we need to do that manually ourselves?

i just worry about big filesizes as well