Houdini COP Post-Render Script - ffmpeg encode proRes

Encode output of the image sequence with ffmpeg in Apple ProRes format.
Name must be finish with .$F.ext where $F can be set  with any zero padding like $F, $F4, etc...
Copy and paste this code into Post-Render Script in COP node.
# fsimerey 2016
import os import subprocess # profile integer # Select the ProRes profile to encode
# proxy # lt # standard # hq # 4444 filesPath = hou.expandString('`chs("copoutput")`') startFrame = hou.expandString('`chs("f1")`') dirPath = ('/').join(filesPath.split("/")[:-1]) destDir = ('/').join(filesPath.split("/")[:-2]) files = filesPath.split("/")[-1] ext = files.split('.')[-1] pad = len(files.split('.')[-2]) name = files.split('.')[0] command = 'ffmpeg -start_number {0} -i {1}/{2}.%{3}d.{4} -vcodec prores -profile:v 1 -r 25 -y {5}/{6}_proRes.mov'.format(startFrame,dirPath,name,pad,ext,destDir,name) # print command try: print('Start encoding in proRes...') process = subprocess.Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE) res = process.communicate() # subprocess.call(command, shell=True) except hou.Error: raise hou.OperationFailed("Error while encoding ffmpeg.") print("Encoding to ProRes Done.")

You can save this script in a file then enter this in post-render Script:
execfile("pathtomyfile.py")