Posts Tagged ‘python’

mrender: sendToAvconv 2014 update

Posted on: 1 Comment

It’s time for a new version of the sendToAvconv that takes into account the -start_number flag and xterm (two options that came out of comments from the last update from 2012).

Now called mrender, I add this to the afterRender callback in Nuke write nodes to send a subprocess call to avconv (or ffmpeg) and render a Quicktime. This is primarily meant for linux distros which don’t have great gui options for converting image sequences into movies.

Changelog

This update no longer requires image sequences output from Nuke to start at frame 0, or 1.

You can set xterm to show the output under the configuration options (request).

And if you have ffmpeg installed instead, you can set that to default

 

Move Image Sequences into Named Folders with Python

Posted on: 2 Comments

Sometimes we receive multiple image sequences in one folder.

These few lines of python will move each image sequence to its own folder.

To use:

  • Save this script to your Desktop,  ~/Desktop/sortSequences.py
  • Open terminal
    • cd /path/to/image_sequences/
    • python ~/Desktop/sortSequences.py

Send to FFmpeg from Nuke Update

Posted on: 6 Comments

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).

 

Execute FFmpeg Command in Nuke AfterRender Callback

Posted on: 3 Comments

Update: there’s some new code to use avconv insead

Freelancing from home, I don’t have a dedicated render manager. Running Ubuntu 11.10, FFmpeg is the most convenient solution for rendering Quicktime movies for review.

With the help of NathanR and ivanbusquets over at the Nuke forums, I’ve got a working AfterRender callback that spawns a shell subprocess to automate the creation of .mov files from an image sequence rendered out of Nuke.

The Code

Installation

  1. Add the above code to the ~/.nuke/menu.py.
  2. Add sendToFFmpeg() to the afterrender field in the python tab of your write node.

The .mov file should be created one directory up from rendered image sequence.

Note: FFmpeg assumes the image sequence starts at frame 0. At some point I’ll have to add an offset to adjust for those that don’t.

Nuke Python Script setProjectFrameRange

Posted on: No Comments

Often we receive plates with frame ranges that don’t begin at frame 1. The plates have 48 frame handles but we only need to deliver 8 frame handles. This script will set the selected Read node to start at frame 1 and set the correct handle ranges based on user input.

Saves a few seconds of math.

As an example, the project settings first frame for the settings in the image on the right would be 1 + 48 – 8 (41) and the last frame would 1 + [selected read node’s last frame ] – [selected read node’s first frame ] – 48 + 8.

Installation

  1. Add setProjectFrameRange.py to your ~/.nuke folder
  2. In ~/.nuke/menu.py, import setProjectFrameRange
  3. Add the command to a menu

Configuration

You can set the project handle default frame counts (48 and 8 in the image above) in the first portion of the class.

Download from Nukepedia.