abstractfactory/maya-capture

FFMPEG support

Closed this issue · 8 comments

Goal

Allow user to use ffmpeg to convert playblasted image sequence instead of using default maya playblast.

Usecase

We're currently having a problem with a machine that suddenly started to refuse exporting of any quicktimes from maya using cmds.playblast. Feels like old days when 64 bit maya couldn't export quicktime at all because of incompatible codecs.

Long story short. Adding an option to use ffmpeg to create the final video.

Implementation

Considering this would be 'advanced' feature, I'd assume that ffmpeg is on the path, so we could simply:

  • check if ffmpeg flag is on
  • override export format to image sequence
  • pass the image sequence (and potentially sound from timeline) to ffmpeg via subprocess

Nothing would really change for the user, apart from having more robust solution in case of troubles with maya playblast.

I've done the same in houdini because that one doesn't export quicktimes at all and it was very straightforward, I'll have a look at making a PR when I find a minute.

Oo, this does sound a tad complex.

I think the way to do it is to playblast to png, and run ffmpeg yourself, separately.

fname = capture()
subprocess.call(["ffmpeg", fname, "..."])

What do you think?

Sure that's what I'm doing now anyway. Maybe you're right and it's too much for capture.

Just thought it might be interesting for people to be able to separate from maya's codecs without knowing how to use ffmpeg.

Just thought it might be interesting for people to be able to separate from maya's codecs without knowing how to use ffmpeg.

Aw, I think it falls a bit outside the scope, to be honest.

Ok if I close this?

We're post-processing with FFMPEG as well. Might be overkill for capture since our requirements were also very specific, like drawing overlay text and alike.

We're currently having a problem with a machine that suddenly started to refuse exporting of any quicktimes from maya using cmds.playblast. Feels like old days when 64 bit maya couldn't export quicktime at all because of incompatible codecs.

Is this only with quicktimes on Maya 2016? If so, see #29

Feel free to continue the discussion, just closing before I forget.

Aw, I think it falls a bit outside the scope, to be honest.

Sure. Only putting it out there ;)

Is this only with quicktimes on Maya 2016? If so, see #29

Yes. however it's a different error

maya unable to create video track. check format

Strange thing is, that I can't reliably reproduce it. Once in a while it happens, stays for with a machine , but after a restart it works. Other times 2-3 restarts don't help. Really, really random it seems. Anyways, I'll just keep post processing with ffmpeg and stay away from maya quicktimes :)

Out of interest. what kind of overlays are you drawing with ffmpeg? I was planning to add some burn-ins, but can't force myself to sit down and get them all laid out nicely using ffmpeg. It's a bit of a pain getting these overlays good looking with drawtext.

maya unable to create video track. check format

Are you getting the error on a machine with more than 16 CPU cores and h264 encoding? There's a bug where the higher threads causes an issue with h264 encoding (especially when 1080p or higher in resolution). Not sure if this is the same problem you're having though.

Here's an example overlay with some notes:

overlay