Bug 412599 - "Render Animation" uses MPEG-4 size limits while in Image Sequence mode
Summary: "Render Animation" uses MPEG-4 size limits while in Image Sequence mode
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Animation (show other bugs)
Version: 4.2.7
Platform: Debian stable Linux
: NOR normal
Target Milestone: ---
Assignee: Shivam Balikondwar
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-04 13:09 UTC by caetano
Modified: 2020-01-28 09:50 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description caetano 2019-10-04 13:09:58 UTC
SUMMARY
When attempting to render an image sequence with File > Render Animation..., if the video format is set to MPEG-4 (but you are still in the Image Sequence mode), the image size restrictions of MPEG-4 apply to the export, causing a failure if your image is larger than what MPEG-4 allows (10 000px either in width or height).
Switching the Video format to GIF and going back to image sequence (e.g. jpg) solves the issue.

STEPS TO REPRODUCE
1. Create or open an animation and set the canvas size to be superior to 10 000 either in width or height
2. Go to File > Render Animation...
3. Select Video and make sure the export format is MPEG-4
4. Select Image Sequence and pick any format (e.g. jpg)
5. Click OK
6. You should see an error message saying :
	Could not render animation:
	Mpeg4 (.mp4) requires width and height to be even numbers.
	Please resize or crop the image before exporting.
which by the way is the wrong error message, since it doesn't have anything to do with odd numbers but rather the size limit.

7. Go once again to File > Render Animation...
8. This time in Video, select GIF as the export format
9. Select Image Sequence back and keep the same image format as before
10. Click OK : this time the export should work


SOFTWARE/OS VERSIONS
Krita appimage 4.2.7.1
Linux: Debian 9 (XFCE)
Qt Version: 5.7.1
Comment 1 Ahab Greybeard 2019-10-04 19:33:32 UTC
Using the 4.2.7.1 appimage on Debian 10, I don't get this error under those conditions for a 12,000 x 11,000 px 3-frame animation. It gives three .png or .jpg frame images as output When I select Image Sequence.

If I try to render it as a .mp4 video, I get the following error in the log file:
[libx264 @ 0x6d521c0] height not divisible by 2 (10000x9167)
That seems like a problem with the internal scaling arithmetic.

I got my FFmpeg 64-bit static build from https://johnvansickle.com/ffmpeg/ which is linked to from ffmpeg.org. Where did you get your FFmpeg from?
Comment 2 caetano 2019-10-05 16:23:40 UTC
I'll have to contradict that.
I just tested it on a fresh Debian 10 install and the error is still there.

I have the ffmpeg that comes pre-installed in Debian (stable 7:4.1.4-1~deb10u1 amd64), however I assume  the appimage contains its own dependencies, as that's what they're all about.
Furthermore there's no indication on the Krita download page that we should download ffmpeg, whereas there is such an indication for G'MIC (https://krita.org/en/download/krita-desktop/), nor do I see any mention of ffmpeg in the installation documentation:
https://docs.krita.org/en/user_manual/getting_started/installation.html?highlight=installation
so it seems very unlikely to me that we're supposed to do this additional step. I could be wrong but I'll need some evidence.

Did you make sure to select MPEG-4 prior to selecting Image Sequence?

Maybe your specific image dimensions somehow bypassed this bug. I got the error on a 21960x3720 as well as on a 11000x200 image.
Comment 3 Ahab Greybeard 2019-10-05 17:41:31 UTC
Evidence: https://docs.krita.org/en/reference_manual/render_animation.html?highlight=ffmpeg#setting-up-krita-for-exporting-animations

zerano.com (linked to in the manual) is the Windows and macOS builds. You'll need the link I gave you.

I suggest you try this to see if it solves the problem.
Comment 4 caetano 2019-10-06 14:33:18 UTC
tbh I don't see the point. The gif workaround solves the issue and it's not my decision to consider that ffmpeg is too heavy to be bundled and that the download page doesn't need information about it like G'MIC does.
Comment 5 Tiar 2019-10-09 10:46:48 UTC
One probably needs to install ffmpeg even if you're using appimages. But you already do it. Nevertheless, can you please tell us what is the version of ffmpeg you're using? When you open the Render Animation dialog, there is a text box for a path to ffmpeg, can you please copy it and paste into a console and add --version and click enter and copy here what you've got?

Can you please show a screenshot of your Render Animation dialog just before clicking ok? And a screenshot of "Both" tab just to see what the Video options are. It might be the scaled size that makes the difference...

@Ahab - I'm not sure if it's really not a bug because the dialog depends on Krita's internal checks before using ffmpeg... so something must be triggering it...
Comment 6 Ahab Greybeard 2019-10-09 17:48:20 UTC
Yes, this is a krita internal error message and not an FFmpeg internal error.

I can confirm this happens for an image size of 11,000 x 200 px under the conditions stated.

This may not be purely an image size problem but an image size ratio/relationship problem.

Setting to Confirmed
Comment 7 Shivam Balikondwar 2019-12-13 21:18:33 UTC
I think confirm that i fixed the issue, can someone please add me this bug? 
Also i need to add someone as a reviewer here so can anyone take initiative.
Comment 8 Ahab Greybeard 2019-12-14 07:20:22 UTC
@Shivam - Now that you've made a comment, you're added to the CC list.
When did you fix this behaviour?
I'd be happy to test it with 4.3.0 preapha builds (soon) but I can't review code.
Comment 9 Shivam Balikondwar 2019-12-14 11:22:24 UTC
@Ahab here is the code along with the MR for it. 
https://invent.kde.org/kde/krita/merge_requests/201
Hope to recieve a quick response :). 
Good day.
Comment 10 Ahab Greybeard 2019-12-14 11:51:24 UTC
@Shivam - I'm sorry but I can't review code. I don't have that skill or knowledge. I can only do some confirmation testing when it's been incorporated into a 4.3.0 prealpha build.
I'd be happy to do that when it's been merged and built.
Comment 11 Shivam Balikondwar 2019-12-14 11:52:38 UTC
ah ok do you know anyone who can review?
Comment 12 Tiar 2019-12-14 12:56:10 UTC
@Shivam Balikondwar when you put your code on invent in a merge request to the official repository, developers know about it and you don't need to ask for the review in any other place :)
Comment 13 Halla Rempt 2020-01-16 14:56:38 UTC
Git commit 168d3a141ee110eb6e6ef3a1a0301e1a54b36984 by Boudewijn Rempt, on behalf of Shivam Balikondwar.
Committed on 16/01/2020 at 14:56.
Pushed by rempt into branch 'master'.

Fixed unneeded error message in Render Animation.

This patch fixes the error that the user gets when he tries to
render the anim in Image Sequence mode by setting the video encoding
option as Mp4.

M  +4    -2    plugins/extensions/animationrenderer/AnimationRenderer.cpp
M  +2    -2    plugins/extensions/animationrenderer/DlgAnimationRenderer.cpp

https://invent.kde.org/kde/krita/commit/168d3a141ee110eb6e6ef3a1a0301e1a54b36984
Comment 14 Halla Rempt 2020-01-28 09:50:29 UTC
Git commit 4673d11c1207906fab09e1a7bf6089fbf0fc3f6c by Boudewijn Rempt, on behalf of Shivam Balikondwar.
Committed on 28/01/2020 at 09:10.
Pushed by rempt into branch 'krita/4.2'.

Fixed unneeded error message in Render Animation.

This patch fixes the error that the user gets when he tries to
render the anim in Image Sequence mode by setting the video encoding
option as Mp4.

(cherry picked from commit 168d3a141ee110eb6e6ef3a1a0301e1a54b36984)

M  +4    -2    plugins/extensions/animationrenderer/AnimationRenderer.cpp
M  +2    -2    plugins/extensions/animationrenderer/DlgAnimationRenderer.cpp

https://invent.kde.org/kde/krita/commit/4673d11c1207906fab09e1a7bf6089fbf0fc3f6c