Maya Playblast With Sound in Linux

Maya Playblast With Sound in Linux

You need to make a GUI for your tool …

[Python]
import os
import sys
import subprocess
import re

def createTimeCode(frame,fps):
hourCode = 00
mintCode = frame/fps/60
secCode = frame % 60
milSecndCode = frame % fps
result = ‘%02d:%02d:%02d:%02d’%(hourCode,mintCode,secCode,milSecndCode)
return(result)

def maya_playblast_cmd(imageFileSeq,audioFile,frameRate,outputFolder,outputFormat,outputSeqName,startFrame,endFrame):
padding_count = 0
for i in range (10, 0, -1):
if imageFileSeq.find(“#”*i)!=-1:
padding_count = padding_count+1
image_path_split = os.path.basename(imageFileSeq).split(‘.’)
image_path_split[-2] = ‘%’+’0%sd’%(padding_count)
image_path_join = ‘.’.join(image_path_split)
image_path_prs = ‘%s/%s’%(os.path.dirname(imageFileSeq),image_path_join)
outputSeqName = outputSeqName.split(‘.’)
outputSeqName = outputSeqName[0]
startFrame_code = createTimeCode(startFrame,frameRate)
endFrame_code = createTimeCode(endFrame,frameRate)
ffmpegCmd = ‘ffmpeg -i %s -i %s -ss %s -t %s -vcodec ffv1 -sameq -y -r %s %s/%s%s’%(image_path_prs,audioFile,startFrame_code,endFrame_code,frameRate,outputFolder,outputSeqName,outputFormat)

proc = subprocess.Popen(ffmpegCmd,shell=True,stdin=subprocess.PIPE,)
proc.communicate()

imageFileSeq=’/home/kurian/my_work/sequence_file/new_seq/blastA0LDVA.####.jpg’
audioFile = ‘/home/kurian/my_work/sequence_file/audio_file/iliketomoveitmoveit.wav’
outputFolder = ‘/home/kurian/my_work/sequence_file/out_put_fld’
outputFormat = ‘.mov’
frameRate = 25
startFrame = 0
endFrame = 500
outputSeqName = os.path.splitext(os.path.basename(imageFileSeq))[0]
maya_playblast_cmd(imageFileSeq,audioFile,frameRate,outputFolder,outputFormat,outputSeqName,startFrame,endFrame)
[/Python]