{"id":489,"date":"2011-03-07T12:54:04","date_gmt":"2011-03-07T12:54:04","guid":{"rendered":"http:\/\/www.kurianos.com\/wordpress\/?p=489"},"modified":"2011-03-07T12:54:04","modified_gmt":"2011-03-07T12:54:04","slug":"maya-playblast-with-sound-in-linux","status":"publish","type":"post","link":"https:\/\/www.kurianos.com\/wordpress\/?p=489","title":{"rendered":"Maya Playblast With Sound in Linux"},"content":{"rendered":"<p>Maya Playblast With Sound in Linux<\/p>\n<p>You need to make a GUI for your tool &#8230;<\/p>\n<p>[Python]<br \/>\nimport os<br \/>\nimport sys<br \/>\nimport subprocess<br \/>\nimport re<\/p>\n<p>def createTimeCode(frame,fps):<br \/>\n    hourCode = 00<br \/>\n    mintCode = frame\/fps\/60<br \/>\n    secCode = frame % 60<br \/>\n    milSecndCode = frame % fps<br \/>\n    result = &#8216;%02d:%02d:%02d:%02d&#8217;%(hourCode,mintCode,secCode,milSecndCode)<br \/>\n    return(result)<\/p>\n<p>def maya_playblast_cmd(imageFileSeq,audioFile,frameRate,outputFolder,outputFormat,outputSeqName,startFrame,endFrame):<br \/>\n\tpadding_count = 0<br \/>\n\tfor i in range (10, 0, -1):<br \/>\n\t\tif imageFileSeq.find(&#8220;#&#8221;*i)!=-1:<br \/>\n\t\t\tpadding_count = padding_count+1<br \/>\n\timage_path_split = os.path.basename(imageFileSeq).split(&#8216;.&#8217;)<br \/>\n\timage_path_split[-2] = &#8216;%&#8217;+&#8217;0%sd&#8217;%(padding_count)<br \/>\n\timage_path_join = &#8216;.&#8217;.join(image_path_split)<br \/>\n\timage_path_prs = &#8216;%s\/%s&#8217;%(os.path.dirname(imageFileSeq),image_path_join)<br \/>\n\toutputSeqName = outputSeqName.split(&#8216;.&#8217;)<br \/>\n\toutputSeqName = outputSeqName[0]<br \/>\n\tstartFrame_code = createTimeCode(startFrame,frameRate)<br \/>\n\tendFrame_code = createTimeCode(endFrame,frameRate)<br \/>\n\tffmpegCmd = &#8216;ffmpeg -i %s -i %s -ss %s -t %s -vcodec ffv1 -sameq -y -r %s %s\/%s%s&#8217;%(image_path_prs,audioFile,startFrame_code,endFrame_code,frameRate,outputFolder,outputSeqName,outputFormat)<\/p>\n<p>\tproc = subprocess.Popen(ffmpegCmd,shell=True,stdin=subprocess.PIPE,)<br \/>\n\tproc.communicate()<\/p>\n<p>imageFileSeq=&#8217;\/home\/kurian\/my_work\/sequence_file\/new_seq\/blastA0LDVA.####.jpg&#8217;<br \/>\naudioFile = &#8216;\/home\/kurian\/my_work\/sequence_file\/audio_file\/iliketomoveitmoveit.wav&#8217;<br \/>\noutputFolder = &#8216;\/home\/kurian\/my_work\/sequence_file\/out_put_fld&#8217;<br \/>\noutputFormat = &#8216;.mov&#8217;<br \/>\nframeRate = 25<br \/>\nstartFrame = 0<br \/>\nendFrame = 500<br \/>\noutputSeqName = os.path.splitext(os.path.basename(imageFileSeq))[0]<br \/>\nmaya_playblast_cmd(imageFileSeq,audioFile,frameRate,outputFolder,outputFormat,outputSeqName,startFrame,endFrame)<br \/>\n[\/Python]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Maya Playblast With Sound in Linux You need to make a GUI for your tool &#8230; [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 = &#8216;%02d:%02d:%02d:%02d&#8217;%(hourCode,mintCode,secCode,milSecndCode) return(result) def maya_playblast_cmd(imageFileSeq,audioFile,frameRate,outputFolder,outputFormat,outputSeqName,startFrame,endFrame): padding_count = 0 for i in [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[11,14],"tags":[],"class_list":["post-489","post","type-post","status-publish","format-standard","hentry","category-maya","category-python"],"_links":{"self":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=489"}],"version-history":[{"count":1,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/489\/revisions"}],"predecessor-version":[{"id":490,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/489\/revisions\/490"}],"wp:attachment":[{"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kurianos.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}