Ffmpeg.exe launched from mayapy

Hi there,

I’m trying to create a playblast using mayapy.
My script creates png images using pm.ogsRender, than I launch a ffmpeg subprocess command to create a mov file and delete the images sequence.

Everything works fine when I launch the script in a running maya session, but as soon as the script is launched using mayapy, ffmpeg returns an exit code 255:

ffmpeg -y -framerate 24 -start_number 1001 -i foo/bar.%04d.png -c:v h264 -pix_fmt yuv420p -crf 17 -movflags +frag_keyframe+separate_moof+omit_tfhd_offset+empty_moov foo/bar.mov

I can’t find any clear ffmpeg exit code list, can you help me on debuging this? From researchs on the web I found out this exit code had to do with “SIGINT” but I have no idea what it is.

Thanks a lot,


How exactly are you calling it? I just opened mayapy and converted a random mp4 file to an animated gif like this without any issues. I’m on win10, 64bit with ffmpeg 4.2.3.

input subprocess
ffmeg = '<full path to ffmpeg.exe>'
srcFile = '<some source file>'
outFile = '<some output file>'
cmd = [ffmpeg, '-i', srcFile, outFile]

My not great ideas are:

  • Try a super simple case like this, maybe an additional ffmpeg param is causing issues
  • Try a different ffmpeg version
  • Use a different method to call it in python, like os.system. subprocess should be the right way but if it doesn’t always work, then it is not right way.