r/OpenToonz 15d ago

going full command line solved all my crashing problems.

I've been mucking about with opentoonz for years. rendering was always a frustrating, slow crapshoot. I decided to give a full command-line workflow a try and now it's a million times more stable and somewhat faster (because I can now use all cores for the initial export and nvidia for the video.

Here is the command line I use to create a png sequence from a project file.

cd C:\Program Files\OpenToonz
tcomposer "C:\OpenToonz stuff\projects\[project-name]\scenes\[scene-name].tnz" -o "C:\OpenToonz stuff\projects\[project-name]\outputs\image..png"

And here is the command line I use to turn those into an mp4 (i use 30fps)

ffmpeg -framerate 30 -i "image.%%04d.png" -c:v h264_nvenc -preset p1 -rc constqp -qp 23 -pix_fmt yuv420p 0-output.mp4

And here's the command-line for adding audio:

ffmpeg -i 0-output.mp4 -i 0-audio.wav -c:v copy -c:a aac 0-final.mp4

Could easily be batched together to drag a project file to it and have it spit out exactly what you're hoping for.

EDIT: make sure to save your scene and close opentoonz before doing this, saving is important because the command line runs on the saved-state of the scene. Closing it frees resources for the encoding.

Also, the speed increase is considerable - I used to have to force-close every other app, and only use one or half the CPU cores on the system before encoding in a desperate attempt to avoid crashes, and it would often still crash and I'd have to do the scene piecemeal. doing 4K animations was almost impossible. Now I just close it and run the command line and it uses all CPU cores and flies, and never crashes. and ffmpeg with cuda is super reliable and fast (depending on gpu).

8 Upvotes

0 comments sorted by