Send to FFmpeg from Nuke Update

Update: sendToAvconv has been depreciated in favourr of mrender

Ubuntu 12.04 has moved to avconv from ffmpeg and my previous python script to execute a shell script on Nuke’s afterRender callback needed to be updated appropriately.

Additional changes:

  • The function now takes an arg ‘dnxhd’ to output a movie using the avid codec instead of the default x264.
  • the renderSlug configuration option has been added
    • when false: the movie start frame = the nuke project start frame*
    • when true: the movie start frame = 0

* Note: You always have to render from frame 0 out of Nuke regardless of the project start frame (avconv image sequences always start at 0).

 

Tags: , , , ,
Posted on: 6 Comments

6 Responses

  1. […] there’s some new code to use avconv […]

  2. Bert says:

    Thanks for sharing! This is very useful.
    Would it be possible to have feedback of the mov rendering in a separate window?
    For example a terminal window pops up and shows what’s actually going on?

  3. Richard Greenwood says:

    Hi Bert,

    Perhaps there is a more elegant solution, but we can use xterm or gnome-terminal to see the avconv output.

    For example line 26 in the code above changes to:
    enc = 'xterm -hold -e avconv -y -v verbose -r %s -i \'%s\' -an -ss %s -vcodec %s -threads 0 \'%s\'' % (fps, imgSeqPath, ss, vcodec[codec], movPath)

    Alternatively, using gnome-terminal requires us to create a terminal profile that does not close the terminal window after completion and then call gnome-terminal -x with the --tab-with-profile=PROFILENAME flag.

    I hope this helps!

    Looking at this script a year later, I think it could be updated further. I found out just today that FFmpeg (and presumable avconv) takes a -start_number option. So we could do away with the slug and -ss portions of the script altogether.

  4. […] You can set xterm to show the output under the configuration options (request). […]

  5. adam ghering says:

    does this work in windows?

  6. Richard Greenwood says:

    Adam, it was designed for use in linux – it may need some modification for use on Windows.

Leave a Reply