Bug 436524 - When Rendering Animation with Layer Style fx on animation layers, you receive a failed to render error
Summary: When Rendering Animation with Layer Style fx on animation layers, you receive...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 4.4.3
Platform: Microsoft Windows Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-03 09:02 UTC by Benjamin Round
Modified: 2021-05-11 03:42 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Krita 4.4.3 File with The animation that failed. (2.13 MB, application/x-krita)
2021-05-03 09:02 UTC, Benjamin Round
Details
KritaSystemInformation.txt (3.12 KB, text/plain)
2021-05-05 00:58 UTC, Benjamin Round
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Benjamin Round 2021-05-03 09:02:47 UTC
Created attachment 138112 [details]
Krita 4.4.3 File with The animation that failed.

SUMMARY
When Rendering Animation with Layer Style fx on animation layers, you receive a "failed to render frames error". This is only true when "Frame Rendering Clones Limit" under Performance>Advance is too high. In my case, I had to reduce the limit to 2 in order to render any animation even with just one animation layer.

STEPS TO REPRODUCE
1. Set "Frame Rendering CLones Limit" to the recommended setting or above
2. Apply layer styles to animation layer, in my case "Stroke" & "Inner Shadow"
3. Render Animation in a png/jpeg/tiff image sequence

OBSERVED RESULT
An Updating bar followed by "Failed to Render Animation Frames"

EXPECTED RESULT
The animation to render in the designated folder

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Comment 1 Eoin O'Neill 2021-05-04 21:21:56 UTC
Hi Benjamin,

There have been a lot of changes on the upcoming version of Krita 5 regarding animation rendering and caching. As a result, I seem to be unable to reproduce this bug on the master branch.

Could you try the latest nightly Krita build (Krita Next) available from our website and see if it works for you? If it doesn't work, could you please give me details on your operating system and hardware specs?

Sorry for the inconvenience,
Eoin.
Comment 2 Benjamin Round 2021-05-05 00:58:49 UTC
Created attachment 138155 [details]
KritaSystemInformation.txt

Hi Eoin,

I tried it with Krita 5 pre-alpha and the issue still persists.
Find attached my Krita info where the bug happened.


   - I am running Windows 10 Home 64bit
   - b350 gaming 3 - motherboard
   - r9 380x 4GB - GPU
   - Ryzen 1700 8c, 16thread - CPU
   - 2666MHz 16 GB Corsair Vengence - RAM
   - 1TB 970 evo NVME m.2 - SSD

I think that is all that is relevant, let me know otherwise.
The bug is a bit random as it worked once when I had "frame rendering clone
limit" set at 8. However, it hasn't ever worked when I push the limit to 16
(the max).

Thanks,
Benjamin


On Wed, May 5, 2021 at 9:21 AM Eoin O'Neill <bugzilla_noreply@kde.org>
wrote:

> https://bugs.kde.org/show_bug.cgi?id=436524
>
> Eoin O'Neill <eoinoneill1991@gmail.com> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>                  CC|                            |eoinoneill1991@gmail.com
>          Resolution|---                         |WORKSFORME
>              Status|REPORTED                    |NEEDSINFO
>
> --- Comment #1 from Eoin O'Neill <eoinoneill1991@gmail.com> ---
> Hi Benjamin,
>
> There have been a lot of changes on the upcoming version of Krita 5
> regarding
> animation rendering and caching. As a result, I seem to be unable to
> reproduce
> this bug on the master branch.
>
> Could you try the latest nightly Krita build (Krita Next) available from
> our
> website and see if it works for you? If it doesn't work, could you please
> give
> me details on your operating system and hardware specs?
>
> Sorry for the inconvenience,
> Eoin.
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 Bug Janitor Service 2021-05-05 04:33:40 UTC
Thanks for your comment!

Automatically switching the status of this bug to REPORTED so that the KDE team
knows that the bug is ready to get confirmed.

In the future you may also do this yourself when providing needed information.
Comment 4 Ahab Greybeard 2021-05-07 10:05:29 UTC
I have the "failed to render frames error" with the May 06 5.0.0-prealpha (git cb99b9e) appimage using the attached .kra file.
It does not happen with the 4.4.3 appimage or the May 06 4.4.4-alpha (git cc5d52c) appimages.

It happens after all the intermediate .png files have been created in the target folder and ffmpeg has started to create rendered frames.
At this stage, ffmpeg is running and I observed a large amount of RAM used by krita (7 GB) and increasing amounts of RAM used by ffmpeg (6.5 GB).
This was pushing my system RAM amount of 16GB considering I have 1.7GB in use by other applications.

If I resized the canvas to remove the top half of the existing image, then rendered as .mp4, the RAM usage was notably lower and it rendered with no problems.

@Benjamin Round: Can you use the Task Manager to note the RAM usage and then try resizing or cropping to see if that improves the situation?

This may be a 'system resources limit' problem.
Comment 5 Benjamin Round 2021-05-07 21:39:24 UTC
My memory limit is set to 100% (16335 MiB) in Krita. 

When rendering the png sequence Krita's RAM usage jumps up to 8GB, what is weird is that after rendering Krita's usage doesn't go down, not too sure what that is. 

However, there are still a few GB of RAM left to be utilized. At most my RAM jumped up to 80% usage. 

If I reduce the canvas height by 1000px the problem doesn't occur. So resolution definitely plays a role.

Just tested further when dividing the height and width by 5 and then duplicating the style layers. 
Then during rendering, I will get this note: The memory limit has been reached. The number of frames saved simultaneously is limited to 5
BUT my Ram usage is only sitting just below 9 GB, so it seems Krita doesn't want to use all the allocated RAM (note I my animation cache was set to On-Disk). 

Sorry if I am missing something obvious.
Comment 6 Tiar 2021-05-07 21:56:58 UTC
Can you please do this test: reduce the amount for Krita to 1-2GB, but make the Swap File Size much bigger. Then restart and try again. Does it work now?
Comment 7 Benjamin Round 2021-05-07 23:06:49 UTC
Hi Tiar,

Yes, this fixes the render error, but it is basically the same thing as setting the "frame rendering clones limit" to 1.

As I get this note while rendering: the memory limit has been reached. The number of frames saved simultaneously is limited to 1.
Comment 8 Eoin O'Neill 2021-05-11 03:31:05 UTC
I believe I've found the bug when further inspecting your file with multiple options. I think the FFMPEG subprocess is timing out since moving to the new FFMPEG wrapper backend. 

I'll try to fix this ASAP.
Comment 9 Eoin O'Neill 2021-05-11 03:42:32 UTC
Git commit 56986515bd1f1ce46876a073fdd6aae1a4aba877 by Eoin O'Neill.
Committed on 11/05/2021 at 03:40.
Pushed by eoinoneill into branch 'master'.

Fixed regression: Timeout time for FFMPEG was too low, failed to render fully on
certain systems and configurations.

M  +1    -1    libs/ui/animation/KisFFMpegWrapper.h

https://invent.kde.org/graphics/krita/commit/56986515bd1f1ce46876a073fdd6aae1a4aba877