Timelapse Export Failed

Welcome to the forum, @lemonjiuce.

For us to help, you need to provide some info.

Which version # of Krita are you using and which version # of Windows?
Is this the first time you tried to export a timelapse?
Can you provide a screenshot of the export dialogue so we can see all the settings?

Also, please see this topic from @ae_croissant who seems to have an identical problem:
Timelapse export error - Can't export

1 Like

im using krita’s 5.2.2 on windows 11, it is the first time i’ve tried to export a timelapse, and here is the export dialogue:

I have 3 suggestions for you to try. Do them one at a time so if one of these work, you will know which one was the problem.

  1. Reduce the dimensions of your timelapse. You do this by FIRST clicking the lock icon next to the canvas dimensions so the aspect ratio is retained. Change one dimension and the other will be calculated for you.

  2. Change the profile from x264 to openh264

  3. Krita 5.2.2 comes preloaded with FFmpeg. Your diaglog box is not pointing to Krita’s built-in FFmpeg. Click the folder icon next to the FFmpeg location and put it back to the default. You’ll find it in Program Files > Krita (x64) > bin > ffmpeg.exe

1 Like

As a matter of interest and possible significance, what is the full path to the ffmpeg.exe that you initially tried?

1 Like

i’ve tried all the suggestions one by one but none of them worked, all showing different error screens. but all of them at once solved the problem. thanks for the help :+1:

1 Like

i downloaded an external ffmpeg that i found recommended by some replies from posts ive seen, the path being C:/Program Files/Krita (x64)/ffmpeg/bin/ffmpeg.exe

Today, a new user reported that it helped to downgrade to the former FFmpeg version since the current version 7.0 seem to have issues.
With the following link, you can download the former version ffmpeg-6.1.1-essentials_build.zip directly, or you can go to this website and download the ffmpeg-6.1.1-essentials_build.zip from there (it is the same file).

Michelist

1 Like

Now that @lemonjiuce seems to indicate that they are using the krita 5.2.2 built-in ffmpeg as suggested by @sooz, this seems to have fixed the problem.

It’s not a good idea to make any modifications/additions to the contents of C:/Program Files

When using an externally supplied ffmpeg, you should put the entire downloaded folder into another location.
Here is where I point to for ffmpeg and have done for a while:
C:/FFMPEG/ffmpeg-6.1.1-essentials_build/bin/ffmpeg.exe

I must remember not to upgrade to gyan’s ffmpeg 7.0.
I’ll try 7.whatever in the future to see if it gets fixed.

3 Likes

I’m glad it’s working now, @lemonjiuce.

I haven’t used it with Krita, but for other audio/video related things like muxing, and FFmpeg 7.0 from Gyan.dev works like a charm so far, so I’m really curious what Krita dislikes here.

Michelist

1 Like

I’ve tried the gyan: 7.0-essentials, 7.0-full and the latest 2024-04-10-essentials builds.
They all work fine with rendering an animation but they all fail with that error message when Exporting a timelapse record.

Maybe ffmpeg has changed something to do with parameter ordering or definition for the command call that is particular to timelapse exporting?

I’ll ping @freyalupen who I believe knows about ffmpeg things.

This sort of thing is one of the reasons I stay with old/working builds of utility applications as long as I can.

Hello, @AhabGreybeard! Actually I was looking into this just earlier, and got sidetracked, and forgot to post my findings.

Can confirm this error with FFmpeg 7.0 (self-compiled).

Full log shows it to be an issue with the xfade filter (used for the transition effect):

[Parsed_xfade_8 @ 0x600001810630] The inputs needs to be a constant frame rate; current rate of 1/0 is invalid
[Parsed_xfade_8 @ 0x600001810630] Failed to configure output pad on Parsed_xfade_8
[fc#0 @ 0x600001d10000] Error reinitializing filters!
[fc#0 @ 0x600001d10000] Task finished with error code: -22 (Invalid argument)
[fc#0 @ 0x600001d10000] Terminating thread with return code -22 (Invalid argument)
[vost#0:0/h264_videotoolbox @ 0x126607930] Could not open encoder before EOF
[vost#0:0/h264_videotoolbox @ 0x126607930] Task finished with error code: -22 (Invalid argument)
[vost#0:0/h264_videotoolbox @ 0x126607930] Terminating thread with return code -22 (Invalid argument)

I haven’t looked into the cause yet, so I don’t know if it can be worked around or needs to be addressed by an FFmpeg update.

Other than, it can be avoided by using the old version of the recording profile, which doesn’t have the “result preview” or “extend result” filters.
It’s still present as the default of the “Custom” profiles, just change the extension to “mp4” instead of “editme” and add the appropriate encoder to the end, so it looks like:

-framerate $IN_FPS
-i "$INPUT_DIR%07d.$EXT"
-framerate $IN_FPS
-start_number $FRAMES-1
-i "$INPUT_DIR%07d.$EXT"
-filter_complex "loop=$LAST_FRAME_SEC:size=1:start=$FRAMES,scale=$WIDTH:$HEIGHT"
-r $OUT_FPS

-c:v x264
-r $OUT_FPS
-pix_fmt yuv420p
3 Likes

Thank you for that information @freyalupen
It will probably be easier to tell people to revert to their previous version of ffmpeg or to get the 6.1.1-essentials build, for the time being.

1 Like

Hmm reading that error even if it may be a bug with ffmpeg we may be able to fix it for people by setting the framerate for the transition clips explicitly with the framerate filter. The transition clip didn’t have a framerate explicitly set previously, so maybe some default behavior has changed in that 7.0 that caused this issue.

I’m on linux so the gyan.dev seems windows only and the git master doesn’t seem to fail for me I so haven’t tested it yet. But I think updating the transition clip to set the framerate should fix it if someone can test:

 [transition4]framerate=fps=$IN_FPS[transition5];
 [transition5][main4]xfade=transition=smoothright:duration=0.5:offset=0[v1];

You can edit the profile by clicking the pencil icon next to the “Render As” dropdown. And the full profile should look like:

Full profile
-framerate $IN_FPS
-i "$INPUT_DIR%07d.$EXT"
-framerate $IN_FPS
-start_number $FRAMES-1
-i "$INPUT_DIR%07d.$EXT"
-filter_complex "
 [0]loop=$LAST_FRAME_SEC*$IN_FPS:size=1:start=$FRAMES[main1];
 [main1]scale=$WIDTH:$HEIGHT[main2];
 [main2]loop=1:size=1:start=0[main3];
 [main3]setpts=PTS-STARTPTS[main4];
 [1]split [first1][transition1];
 [transition1]scale=$WIDTH:$HEIGHT [transition2];
 [transition2]loop='if(gte($FIRST_FRAME_SEC, 1), $IN_FPS, 0)':size=1:start=1[transition3];
 [transition3]setpts=PTS-STARTPTS[transition4];
 [transition4]framerate=fps=$IN_FPS[transition5];
 [transition5][main4]xfade=transition=smoothright:duration=0.5:offset=0[v1];
 [v1]setpts=PTS-STARTPTS[v2];
 [v2]trim=start_frame=1[v3];
 [first1]loop='if(gte($FIRST_FRAME_SEC, 1), ($FIRST_FRAME_SEC*$OUT_FPS) - 0.5, $FIRST_FRAME_SEC*$OUT_FPS)':size=1:start=1[preview1];
 [preview1]scale=$WIDTH:$HEIGHT[preview2];
 [preview2]setpts=PTS-STARTPTS[preview3];
 [preview3][v3] concat [final1];
 [final1] setpts=PTS-STARTPTS[final2];
 [final2] trim=start_frame=1
"
-c:v libx264
-r $OUT_FPS
-pix_fmt yuv420p
1 Like

With that change, I get this error instead:

[Parsed_xfade_9 @ 0x600002d3d8c0] First input link main frame rate (30/1) do not match the corresponding second input link xfade frame rate (1/0)

Which is fixed by also setting the framerate for main:

 [main4]framerate=fps=$IN_FPS[main5];
 [transition5][main5]xfade=transition=smoothright:duration=0.5:offset=0[v1];

Then it works. (Aside from “Extend result” not showing, which is unrelated.)

1 Like

This topic was automatically closed 4 days after the last reply. New replies are no longer allowed.