pencil2d / pencil

Pencil2D is an easy, intuitive tool to make 2D hand-drawn animations. Pencil2D is open source and cross-platform.
http://pencil2d.org
GNU General Public License v2.0
1.47k stars 273 forks source link

Crash when exporting movie #1828

Closed John-Hollingum closed 6 months ago

John-Hollingum commented 6 months ago

Issue Summary

A particular project won't export mp4. When running the export movie function after some encouraging movement of the progress bars it halts with a 'something went wrong' info box (see content below). The program continues to run OK, and work is saveable. It will allow gif export; it just halts on mp4 export.

Other projects are exporting mp4 ok.

The problem project is the first I've tried with a camera resolution of 1728 971 all previous (working) ones have been at 1024768

------ OR BELOW THIS -->

Actual Results

I see and info box with this information

Command: C:/Program Files (x86)/Pencil2D/plugins/ffmpeg.exe -f rawvideo -pixel_format bgra -video_size 1728x971 -framerate 24 -i - -threads 12 -pix_fmt yuv420p -y C:/Users/jshol/Documents/video projects/rachel exhibition/ph_advert.mp4 ffmpeg version 4.1.1 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 8.2.1 (GCC) 20190212 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat 58. 20.100 / 58. 20.100 libavdevice 58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc 55. 3.100 / 55. 3.100 Input #0, rawvideo, from 'pipe:': Duration: N/A, start: 0.000000, bitrate: 1288617 kb/s Stream #0:0: Video: rawvideo (BGRA / 0x41524742), bgra, 1728x971, 1288617 kb/s, 24 tbr, 24 tbn, 24 tbc Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264)) [libx264 @ 00000150aeb3b8c0] height not divisible by 2 (1728x971) Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height Conversion failed! Exit status: CrashExit Exit code: 1 System Info Pencil2D version: 0.6.6 (stable) Build ABI: x86_64-little_endian-llp64 Kernel: winnt, 10.0.22631 Operating System: Windows 10 (10.0) end

Expected Results

I'd expect the mp4 to be generated

### Video or Image Reference ### Steps to reproduce I just load the problem project and the select export movie ### System Information + Pencil2D Version: Version: 0.6.6 commit: ac415788dfb21f66e1cbcc1ad60443225a2d0e37 date: 2021-02-17_13:03:37 Operating System: Windows 10 (10.0) CPU Architecture: x86_64 Qt Version: 5.12.10 + Operating System: OS Name Microsoft Windows 11 Home Version 10.0.22631 Build 22631 Other OS Description Not Available OS Manufacturer Microsoft Corporation + RAM Size: Installed Physical Memory (RAM) 16.0 GB Total Physical Memory 15.7 GB Available Physical Memory 8.79 GB Total Virtual Memory 16.8 GB Available Virtual Memory 8.60 GB Page File Space 1.06 GB + Graphics Tablet: none
J5lx commented 6 months ago

This is your culprit:

[libx264 @ 00000150aeb3b8c0] height not divisible by 2 (1728x971) Error initializing output stream 0:0 -- Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

When exporting as MP4 you can only use a resolution that is divisible by 2. This is not a limitation of Pencil2D but a limitation of the format itself. In order to export your project, you must either change the resolution to be divisible by 2, or use a different format such as AVI.

Since we already have an existing report of this issue at #1491 (to make the error easier to understand) I will close this as a duplicate. If you encounter other movie export issues, you can also check out the movie export troubleshooting guide on our forum.

John-Hollingum commented 6 months ago

Nice!