From d7f6d50c506d68256ae1203d54145a738576ba13 Mon Sep 17 00:00:00 2001 From: gtaaas Date: Tue, 10 Feb 2015 19:16:07 -0300 Subject: [PATCH] versao atual --- .gitignore | 3 +++ avatar_Hozana_wikiLibras.blend | Bin 10880416 -> 0 bytes libras.py | 185 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------- moves.py | 191 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ param.json | 5 +++++ util.py | 110 +++++++++++++++++++++++++++----------------------------------------------------------------------------------- 6 files changed, 346 insertions(+), 148 deletions(-) create mode 100644 moves.py create mode 100644 param.json diff --git a/.gitignore b/.gitignore index 98d855b..d7feb0e 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,6 @@ *.pyc textures/ __pycache__ +extra/ +Libs/ +users/ diff --git a/avatar_Hozana_wikiLibras.blend b/avatar_Hozana_wikiLibras.blend index 14f24ad..5d07a58 100644 Binary files a/avatar_Hozana_wikiLibras.blend and b/avatar_Hozana_wikiLibras.blend differ diff --git a/libras.py b/libras.py index da08884..08e9652 100644 --- a/libras.py +++ b/libras.py @@ -1,80 +1,135 @@ # -*- coding: UTF-8 -*- + +# importa modulos do Python import sys -sys.path.append('/home/gtaaas/wikilibras/wikilibras-core') +import os + +# insere o diretorio atual no path +# permite que o código seja executado de qualquer diretório, possibilitando acesso aos modulos locais +sys.path.append(os.getcwd()) + +# importa modulos nativos do Blender e Python +import bpy import json -import lbsObjects + +# importa modulos locais +import objects import util +import moves + +# verifica a quantidade de argumentos recebidos +if (len(sys.argv) != 6): + print ("WikiLibras: Invalid number of arguments") + exit(1) + +# tenta decodificar o argumento JSON recebido +try: + json_input = json.loads(sys.argv[5]) +except (ValueError, KeyError, TypeError): + print ("WikiLibras: JSON format error") + exit(1) + +# ajusta as configuraçẽs de renderização +util.outconf() + +# define a posição dos keyframes +hands_default_frames = [15, 18] + +# Carrega o objeto presente no avatar +armature = bpy.context.scene.objects.get('Armature.001') + +# Cria uma Action +act = bpy.context.scene.animation_data_create() + +# Função responsável por selecionar as pose-libs e setar os frames +def setPose(actions, parametesConf, positionFrames, bones): + bpy.ops.object.mode_set(mode = 'OBJECT') + bpy.ops.object.select_all(action="DESELECT") + bpy.ops.object.mode_set(mode = 'POSE') + for l in range(len(actions)): + armature.pose_library = bpy.data.actions[actions[l]] + for x in range(len(positionFrames)): + bpy.ops.poselib.apply_pose(pose_index= parametesConf[l]) + for i in range(0, (len(bones))): + armature.pose.bones[bones[i]].keyframe_insert(data_path = 'location', index = -1, frame = positionFrames[x]) + armature.pose.bones[bones[i]].keyframe_insert(data_path = 'rotation_quaternion', index = -1, frame = positionFrames[x]) +# Função responsável por setar pose padrão +def poseDefault(positionFrames, bones): + setPose([2], [0], positionFrames, bones) -def circular_or_semiCircular(hand,pose,orientation,direction,radius,laps,intensity = 5,initialFrame = 15): - center = pose.location.x,pose.location.y,pose.location.z +# Função responsável por setar as configuraçẽs das mãos +def generationConfigurations(actions, handParam, positionFrames, bones): + setPose(actions, handParam, positionFrames, bones) + +def faceConfiguration(handParam, positionFrames, bones): + # Função responsável por setar a configuração da face + setPose([7], handParam, positionFrames, bones) + +# Função que recupera o frame final do movimento +def get_endFrame(): + endsFrame = [18] + if(json_input["rightHand"] != []): + if(json_input["rightHand"][0] == "circular" or json_input["rightHand"][0] == "semicircular"): + endsFrame.append(int(json_input["rightHand"][4]*8*5+15)) + if(json_input["leftHand"] != []): + if(json_input["leftHand"][0] == "circular" or json_input["leftHand"][0] == "semicircular"): + endsFrame.append(int(json_input["leftHand"][4]*8*5+15)) + return(max(endsFrame)) + +initialFrame, endFrame = 15, get_endFrame() + +def circular_or_semiCircular(pose, orientation, direction, radius, laps, intensity = 5, initialFrame = 15): + center = pose.location.x, pose.location.y, pose.location.z if(orientation == 'perpendicular'): if(direction == 'horario'): - endFrame = hand.rotationCircular(center,radius,1,0,2,pose,0,laps,intensity,initialFrame) + endFrame = moves.locationCircular(center, radius, 1, 0, 2, pose, 0, laps, intensity, initialFrame) else: - endFrame = hand.rotationCircular(center,radius,0,1,2,pose,0,laps,intensity,initialFrame) + endFrame = moves.locationCircular(center, radius, 0, 1, 2, pose, 0, laps, intensity, initialFrame) elif(orientation == 'paralelo'): if(direction == 'horario'): - endFrame = hand.rotationCircular(center,radius,1,2,0,pose,0,laps,intensity,initialFrame) + endFrame = moves.locationCircular(center, radius, 1, 2, 0, pose, 0, laps, intensity, initialFrame) else: - endFrame = hand.rotationCircular(center,radius,2,1,0,pose,0,laps,intensity,initialFrame) + endFrame = moves.locationCircular(center, radius, 2, 1, 0, pose, 0, laps, intensity, initialFrame) return endFrame -def get_endFrame(json_input): - endsFrame = [] - if(json_input["rightHand"][0] == "circular" or json_input["rightHand"][0] == "semicircular"): - endsFrame.append(int(json_input["rightHand"][4]*8*5+15)) - if(json_input["leftHand"][0] == "circular" or json_input["leftHand"][0] == "semicircular"): - endsFrame.append(int(json_input["leftHand"][4]*8*5+15)) - return(max(endsFrame)) -#Configurações gerais -json_input = json.loads(sys.argv[5]) # Load jason -util.outconf() -handPosFrame = {'loc':[15],'rot':[15]} -armature = lbsObjects.Armadura('Armature.001') -initialFrame,endFrame = 18,get_endFrame(json_input) - -#Initial Pose -lbsObjects.Pose({'loc':[0], 'rot':[0]}, armature) #Set the default pose - -#ConfHandRight -if(json_input["rightHand"] != []): - movRight = json_input["rightHand"][0] - pose = armature.pose.bones['ik_FK.R'] - if(movRight == "pontual"): - handRight = lbsObjects.MaoDireita(json_input["rightHand"][-3:],{'loc':[15,endFrame],'rot':[15,endFrame]}, armature) - else: - handRight = lbsObjects.MaoDireita(json_input["rightHand"][-3:],handPosFrame, armature) - if(movRight == "circular" or movRight == "semicircular"): - orientation,direction,radius,laps = json_input["rightHand"][1:5] - endFrame = circular_or_semiCircular(handRight,pose,orientation,direction,radius,laps,5) - handRight.genConf({'loc':[endFrame],'rot':[endFrame]}) - handRight.genOri({'loc':[endFrame],'rot':[endFrame]}) - elif(json_input["rightHand"][0] == "retilineo"): - pass - -#ConfLeftRight -if(json_input["leftHand"] != []): - movLeft = json_input["leftHand"][0] - pose = armature.pose.bones['ik_FK.L'] - if(movLeft == "pontual"): - handLeft = lbsObjects.MaoEsquerda(json_input["leftHand"][-3:], {'loc':[15,endFrame],'rot':[15,endFrame]}, armature) - else: - handLeft = lbsObjects.MaoEsquerda(json_input["leftHand"][-3:], handPosFrame, armature) - if(movLeft == "circular" or movLeft == "semicircular"): - orientation,direction,radius,laps = json_input["leftHand"][1:5] - endFrame = circular_or_semiCircular(handRight,pose,orientation,direction,radius,laps,5) - handLeft.genConf({'loc':[endFrame],'rot':[endFrame]}) - handLeft.genOri({'loc':[endFrame],'rot':[endFrame]}) - elif(json_input["leftHand"][0] == "retilineo"): - pass - -if(json_input["facialExp"] != []): - #confFace - lbsObjects.Face(json_input["facialExp"], armature, int(endFrame/1.5)) # Set face - -#confPoseEnd -lbsObjects.Pose({'loc':[1,endFrame+20],'rot':[1,endFrame+20]},armature) # Set the final pose - -util.render_sign(json_input["userId"],json_input["signName"],1,endFrame + 20) +#------------------ Configurações------------------------------ + +#Função que inicia a configuração de ambas as mãos +def configureHands(): + # Array com valores dos campos que serão passados pelo JSON + hands = ["rightHand", "leftHand"] + iks = ['ik_FK.R', 'ik_FK.L'] + bones_ = [util.rightBonesConf, util.leftBonesConf] + #Array com as actions FAKES que seram selecionadas no Blender para cada lado do corpo + actions = [[0, 3, 5], [1, 4, 6]] + global endFrame + for i in range(len(hands)): + if(json_input[hands[i]] != []): + move = json_input[hands[i]][0] + pose = armature.pose.bones[iks[i]] + if(move == "pontual"): + generationConfigurations(actions[i], json_input[hands[i]][-3:], [15, endFrame], bones_[i]) + else: + generationConfigurations(actions[i], json_input[hands[i]][-3:], hands_default_frames, bones_[i]) + if(move == "circular" or move == "semicircular"): + orientation, direction, radius, laps = json_input[hands[i]][1:5] + endFrame = circular_or_semiCircular(handRight, pose, orientation, direction, radius, laps, 5) + elif(json_input[hands[i]][0] == "retilineo"): + pass + +# Função que inicia a configuração da face +def configureFace(): + global endFrame + if(json_input["facialExp"] != []): + # Set face + faceConfiguration(json_input["facialExp"], [endFrame/2], util.faceBonesConf) + +#configureHands() +#configureFace() + +# Default Pose +poseDefault([0, endFrame+15], util.allBones) + +util.render_sign(json_input["userId"], json_input["signName"], 1, endFrame + 25) diff --git a/moves.py b/moves.py new file mode 100644 index 0000000..72f8b0a --- /dev/null +++ b/moves.py @@ -0,0 +1,191 @@ +# -*- coding: UTF-8 -*- + +def locationCircular(self, center, radius, i_axis, j_axis, k_axis, pose, initialPosition, laps, frameJump = 5, initialFrame = 15, turn = None): + sqrt22 = radius * math.sqrt(2) / 2 + rad2 = (radius/2) + currentFrame = initialFrame + for l in range(initialPosition, initialPosition + math.floor(8 * laps) + 1): + if ((l % 8) == 0 ): + pose.location[i_axis] = center[i_axis] + radius + pose.location[j_axis] = center[j_axis] + pose.location[k_axis] = center[k_axis] + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + if ((l % 8) == 1): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] + sqrt22 + pose.location[k_axis] = center[k_axis] + if(turn == 1): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] + rad2 + pose.location[k_axis] = center[k_axis] - rad2 + elif(turn == -1): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] + rad2 + pose.location[k_axis] = center[k_axis] + rad2 + pose.keyframe_insert(frame = initialPosition, index = -1, data_path = 'location') + currentFrame += frameJump + if ((l % 8) == 2): + pose.location[i_axis] = center[i_axis] + pose.location[j_axis] = center[j_axis] + radius + pose.location[k_axis] = center[k_axis] + if(turn == 1): + pose.location[j_axis] = center[j_axis] + sqrt22 + pose.location[k_axis] = center[k_axis] - sqrt22 + elif(turn == -1): + pose.location[j_axis] = center[j_axis] + sqrt22 + pose.location[k_axis] = center[k_axis] + sqrt22 + pose.keyframe_insert(frame = initialPosition, index = -1, data_path = 'location') + currentFrame += frameJump + if ((l % 8) == 3): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] + sqrt22 + pose.location[k_axis] = center[k_axis] + if(turn == 1): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] + rad2 + pose.location[k_axis] = center[k_axis] - rad2 + elif(turn == -1): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] + rad2 + pose.location[k_axis] = center[k_axis] + rad2 + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + + if ((l % 8) == 4): + pose.location[i_axis] = center[i_axis] - radius + pose.location[j_axis] = center[j_axis] + pose.location[k_axis] = center[k_axis] + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + + if ((l % 8) == 5): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] - sqrt22 + pose.location[k_axis] = center[k_axis] + if(turn == 1): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] - rad2 + pose.location[k_axis] = center[k_axis] + rad2 + elif(turn == -1): + pose.location[i_axis] = center[i_axis] - sqrt22 + pose.location[j_axis] = center[j_axis] - ray2 + pose.location[k_axis] = center[k_axis] - ray2 + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + + if ((l % 8) == 6): + pose.location[i_axis] = center[i_axis] + pose.location[j_axis] = center[j_axis] - radius + pose.location[k_axis] = center[k_axis] + if(turn == 1): + pose.location[j_axis] = center[j_axis] - sqrt22 + pose.location[k_axis] = center[k_axis] + sqrt22 + elif(turn == -1): + pose.location[j_axis] = center[j_axis] - sqrt22 + pose.location[k_axis] = center[k_axis] - sqrt22 + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + + if ((l % 8) == 7): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] - sqrt22 + pose.location[k_axis] = center[k_axis] + if(turn == 1): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] - ray2 + pose.location[k_axis] = center[k_axis] + ray2 + elif(turn == -1): + pose.location[i_axis] = center[i_axis] + sqrt22 + pose.location[j_axis] = center[j_axis] - ray2 + pose.location[k_axis] = center[k_axis] - ray2 + pose.keyframe_insert(frame = currentFrame, index = -1, data_path = 'location') + currentFrame += frameJump + currentFrame -= frameJump + return currentFrame + + +# testing . . . +def locationHelicoidal(center, startRadius, incRadius, x, y, z, currentLoc, laps, frameJump): + sqrt22 = radius * math.sqrt(2) / 2 + allLaps = math.floor(8 * laps) + 1 + + #for i in range(currentLoc, currentLoc + math.floor(8 * laps) + 1): + for i in range(currentLoc, currentLoc + allLaps): + print("All Laps:", allLaps) + if ((i % 8) == 0 ): + obj.location[x] = center[x] + radius + obj.location[y] = center[y] + obj.location[z] += incRadius /allLaps + obj.keyframe_insert(frame = bpy.context.scene.frame_end, index = -1, data_path = 'location') + bpy.context.scene.frame_end += frameJump + + if ((i % 8) == 1): + obj.location[x] = center[x] + sqrt22 + obj.location[y] = center[y] + sqrt22 + obj.location[z] += incRadius /allLaps + obj.keyframe_insert(frame = bpy.context.scene.frame_end, index = -1, data_path = 'location') + bpy.context.scene.frame_end += frameJump + + if ((i % 8) == 2): + obj.location[x] = center[x] + obj.location[y] = center[y] + radius + obj.location[z] += incRadius /allLaps + obj.keyframe_insert(frame = bpy.context.scene.frame_end, index = -1, data_path = 'location') + bpy.context.scene.frame_end += frameJump + + if ((i % 8) == 3): + obj.location[x] = center[x] - sqrt22 + obj.location[y] = center[y] + sqrt22 + obj.location[z] += incRadius /allLaps + obj.keyframe_insert(frame = bpy.context.scene.frame_end, index = -1, data_path = 'location') + bpy.context.scene.frame_end += frameJump + + if ((i % 8) == 4): + obj.location[x] = center[x] - radius + obj.location[y] = center[y] + obj.location[z] += incRadius /allLaps + obj.keyframe_insert(frame = bpy.context.scene.frame_end, index = -1, data_path = 'location') + bpy.context.scene.frame_end += frameJump + + if ((i % 8) == 5): + obj.location[x] = center[x] - sqrt22 + obj.location[y] = center[y] - sqrt22 + obj.location[z] += incRadius /allLaps + obj.keyframe_insert(frame = bpy.context.scene.frame_end, index = -1, data_path = 'location') + bpy.context.scene.frame_end += frameJump + + if ((i % 8) == 6): + obj.location[x] = center[x] + obj.location[y] = center[y] - radius + obj.location[z] += incRadius /allLaps + obj.keyframe_insert(frame = bpy.context.scene.frame_end, index = -1, data_path = 'location') + bpy.context.scene.frame_end += frameJump + + if ((i % 8) == 7): + obj.location[x] = center[x] + sqrt22 + obj.location[y] = center[y] - sqrt22 + obj.location[z] += incRadius /allLaps + obj.keyframe_insert(frame = bpy.context.scene.frame_end, index = -1, data_path = 'location') + bpy.context.scene.frame_end += frameJump + + bpy.context.scene.frame_end -= frameJump + +# testing . . . +def locationSenoidal(obj): + obj.location = [0, 0, 0] + bpy.context.scene.frame_start = 1 + bpy.context.scene.frame_end = 1 + seno = 0 + waveHeight = 5.0 + wave = 5 + pi180 = math.pi / 180 + print(pi180) + for wave in range(0, 3): + for i in range(-180, 180): + obj.location[1] = math.sin(i * (pi180)) * waveHeight + obj.location[2] += 0.005 + if (i % 10 == 0): + obj.keyframe_insert(frame = bpy.context.scene.frame_end, index = -1, data_path = 'location') + bpy.context.scene.frame_end += 1 + \ No newline at end of file diff --git a/param.json b/param.json new file mode 100644 index 0000000..89f2bf2 --- /dev/null +++ b/param.json @@ -0,0 +1,5 @@ +'{"userId": 4,"rightHand": ["circular","perpendicular","horario",0.6,1,"conf_20","Ori_4","Pa_6"],"leftHand":["pontual","conf_10","Ori_3","Pa_3"],"facialExp": "Exp_6","signName":"teste_novo"}' + +'{"userId": 4,"rightHand": ["pontual","conf_20","Ori_4","Pa_6"],"leftHand":["circular","perpendicular","horario",0.6,1,"conf_20","Ori_4","Pa_6"],"facialExp": "Exp_6","signName":"pontual_direita"}' + +'{"userId": 4,"rightHand": ["semicircular","perpendicular","horario",0.6,0.5,"conf_20","Ori_4","Pa_6"],"leftHand":["pontual","conf_10","Ori_3","Pa_3"],"facialExp": "Exp_6","signName":"SemiCircular"}' diff --git a/util.py b/util.py index f12f438..9fafa67 100644 --- a/util.py +++ b/util.py @@ -1,21 +1,22 @@ # -*- coding: UTF-8 -*- import bpy -import math as m -import subprocess as sub -import sys -sys.path.append("./") +import math bones = ["BnMao.R", "BnMao.L"] -def sizeRadius(value): - value = value.lower() - if (value == 'grande'): - return 1 - elif (value == 'medio'): - return 0.6 - else: - return 0.3 - +armature = bpy.context.scene.objects.get('Armature.001') +rightBonesConf = [1, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66] +leftBonesConf = [0, 43, 44, 45, 46, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82] +faceBonesConf =[15, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 47] +allBones = list(range(len(armature.pose.bones))) + +def erase_all_keyframes(): + for i in bpy.data.objects: + i.animation_data_clear() + bpy.context.scene.frame_start = 1 + bpy.context.scene.frame_current = bpy.context.scene.frame_start + bpy.context.scene.frame_end = bpy.context.scene.frame_start + def outconf(): bpy.context.scene.render.resolution_x = 640 bpy.context.scene.render.resolution_y = 480 @@ -24,8 +25,15 @@ def outconf(): bpy.context.scene.render.ffmpeg.format = 'MPEG4' bpy.context.scene.render.ffmpeg.codec = 'H264' # bpy.context.scene.render.filepath = '/tmp/' - - + +def render_sign(userId, signName, beginFrame, endFrame): + bpy.context.scene.render.filepath = "//users//"+ str(userId)+ "//"+ signName + "_" + bpy.context.scene.frame_start = beginFrame + bpy.context.scene.frame_end = endFrame + bpy.ops.render.render(animation = True, write_still = False, layer = "", scene = "") + bpy.ops.wm.quit_blender() + +""" def flip(frame, lado): print ("flipou Frame: " + str(frame) + " BONE: " + str(bones[lado])) for i in range(0, 4, 1): @@ -33,12 +41,11 @@ def flip(frame, lado): def fixRots(lado): keyFrames = bpy.Object.Get("Armature.001").getAction().getFrameNumbers() - print (keyFrames) rotFrames = [[]] status = [True] * (len(keyFrames) + 1) - for i in range(0,len(keyFrames),1): - bpy.Set('curframe',keyFrames[i]) + for i in range(0, len(keyFrames), 1): + bpy.Set('curframe', keyFrames[i]) rotFrames[-1] = bpy.Object.Get("Armature.001").getPose().bones[bones[lado]].quat.toEuler() rotFrames.append( [] ) @@ -46,7 +53,7 @@ def fixRots(lado): for k in range(1, len(keyFrames), 1): for i in range(0, 3, 1): - if (m.fabs(rotFrames[k][i] - rotFrames[k-1][i])) > 180 : + if (math.fabs(rotFrames[k][i] - rotFrames[k-1][i])) > 180 : status[k] = False print (status[0:len(status)-1]) @@ -60,67 +67,4 @@ def fixRots(lado): status[k+1] = True print (status[0:len(status)-1]) - -''' -def get_calculo_mov(radius,orientation,sense): -''' - -def render_sign(userId,signName,beginFrame,endFrame): - bpy.context.scene.render.filepath = "//Users//"+ str(userId)+ "//"+ signName + "_" - bpy.context.scene.frame_start = beginFrame - bpy.context.scene.frame_end = endFrame - bpy.ops.render.render(animation = True, write_still = False, layer = "", scene = "") - - bpy.ops.wm.quit_blender() - -""" -def lib_parse (filename): - res = [] - cfg = None - with open(filename) as f: - for ln in f: - ln = ln.split() - - if len(ln) == 0: - continue - elif len(ln) in (1,2,3,4): - cfg = Struct(name = ln[0], - bones = []) - res.append (cfg) - else: - name = ln[0] - loc = [float(x) for x in ln[2:5]] - rot = [float(x) for x in ln[6:]] - cfg.bones.append (Struct(name = name, loc = loc, rot = rot)) - return res - -def read_lines_file(fileName): - with open(fileName,"r") as f: - return [x.strip() for x in f] - -# Struct-like dictionary. obj['x'] == obj.x -class Struct: - def __init__ (self, **kws): - self.__dict__ = kws - - def __getitem__(self, i): - return self.__dict__[i] - - def __repr__ (self): - return repr(self.__dict__) - -def parseVideo(id,nameSign,endFrame): - print ("Convertendo AVI em FLV usando ffmpeg") - num = endFrame + 30 - if(num > 100): - s = "0" + str(num); - else: - s = "00" + str(num); - print (nameSign+"_0001_"+s+".avi"); - - sub.call(["ffmpeg", "-i", "/usr/share/WikiLIBRAS/server/ScriptsPython/"+nameSign+"_0001_"+s+".avi", "-bpy", "2028k", "-s", "640x480", "-r", "30", "-acodec", "copy", nameSign+".flv"]) - - print (id + "**********************************************") - sub.call(["mv", "/usr/share/WikiLIBRAS/server/ScriptsPython/"+nameSign+".flv", "/home/gtaaas/gtaaas_web/public/uploads/files/"+id+ "/"]) -""" - +""" \ No newline at end of file -- libgit2 0.21.2