diff --git a/main.cpp b/main.cpp index 49fb547..1d3d3c3 100644 --- a/main.cpp +++ b/main.cpp @@ -38,15 +38,11 @@ void updateRequestStatus(const char* filename, char* id, char* status); string createFileToRespWeb(char* id); void updateRequestStatusWeb(const char* filename, char* id, char* status); -//função temporária para a logisitica dos videos gerados -void sendFileToPath(char* source, char* dest); - string filename; bool isFailed; int main(int argc, char* argv[]) { - cout << argc << endl; struct timeval tv1, tv2; double t1, t2; @@ -269,18 +265,6 @@ void serviceOnlySRT(char* path_file, char* transparency, char* id){ } delete service_srt; - string source = "vlibras_user/vlibras-api/videos/"; - - string command = "ffmpeg -i "; - command.append(source) - .append(id).append(".ts") - .append(" -vcodec copy -f flv ") - .append(source).append(id).append(".flv") - .append(" && rm ") - .append(source).append(id).append(".ts"); - - system(command.c_str()); - } void serviceREC2(){ @@ -311,17 +295,6 @@ void serviceREC2(){ **/ } -void sendFileToPath(char* source, char* dest){ - char* command = (char*) malloc(strlen(source) + strlen(dest)+1); - strcpy(command, "cp "); - strcat(command, source); - strcat(command, " "); - strcat(command, dest); - system(command); - free(command); -} - - void fail(string msg){ printf("\n"); DDDDPRINTF("Ops... Tivemos um problema! :(\n"); diff --git a/mixer/src/Mixer.cpp b/mixer/src/Mixer.cpp index 2cb4039..abcd50d 100644 --- a/mixer/src/Mixer.cpp +++ b/mixer/src/Mixer.cpp @@ -135,12 +135,13 @@ void Mixer::mixVideos () { void Mixer::setPathFinal(string path){ pathFinal = path+"_Libras.flv"; + } -char* Mixer::getPathFinal(){ - char* path = new char[pathFinal.size()+1]; - strcpy(path, (char*) pathFinal.c_str()); - return path; +string Mixer::getPathFinal(){ + //char* path = new char[pathFinal.size()+1]; + //strcpy(path, (char*) pathFinal.c_str()); + return pathFinal; } /*Ajusta o FPS do vídeo principal para 45 se preciso...*/ diff --git a/mixer/src/include/Mixer.h b/mixer/src/include/Mixer.h index 0c3925b..5325b25 100644 --- a/mixer/src/include/Mixer.h +++ b/mixer/src/include/Mixer.h @@ -67,7 +67,7 @@ public: string getNumThreads(); void initialize(string mainVideo, string slVideo, int, int, int); void setPathFinal(string path); - char* getPathFinal(); + string getPathFinal(); diff --git a/servico/src/include/serviceWindowGeneration.h b/servico/src/include/serviceWindowGeneration.h index 0b6e305..2d59334 100644 --- a/servico/src/include/serviceWindowGeneration.h +++ b/servico/src/include/serviceWindowGeneration.h @@ -68,7 +68,9 @@ protected: void setUserId(char* _userId); //TEMP - void sendFileToPath(); + void sendFileToPath(string source); + + void transcodeVideoToFlv(); public: diff --git a/servico/src/serviceWindowGeneration.cpp b/servico/src/serviceWindowGeneration.cpp index d8643d1..d7d021c 100644 --- a/servico/src/serviceWindowGeneration.cpp +++ b/servico/src/serviceWindowGeneration.cpp @@ -47,9 +47,9 @@ void ServiceWindowGeneration::finalizouSincronizacao() { if (getRunningOption() != '2' && serviceType != SERVICE_TYPE_TEXT && serviceType != SERVICE_TYPE_SRT_ONLY) { mixer = new Mixer(); mixer->initialize(this->path_input, this->path_libras,this->position,this->size,this->transparency); - setPathLibras(mixer->getPathFinal()); - sendFileToPath(); + sendFileToPath(mixer->getPathFinal()); } + this->running = false; } @@ -207,15 +207,26 @@ void ServiceWindowGeneration::codifica(vector * glosas) { legendas_enviadas++; } -void ServiceWindowGeneration::sendFileToPath(){ - char* command = (char*) malloc(strlen(getPathLibras()) + strlen(FINAL_DESTINATION_API)+10); - strcpy(command, "cp "); - strcat(command, getPathLibras()); - strcat(command, " "); - strcat(command, FINAL_DESTINATION_API); - strcat(command, getUserId()); - strcat(command, ".flv"); - system(command); - free(command); +void ServiceWindowGeneration::sendFileToPath(string source){ + + string command = "cp "; + command.append(source) + .append(" ").append(FINAL_DESTINATION_API).append(getUserId()).append(".flv") + .append(" && rm ").append(path_libras); + system(command.c_str()); + +} + +void ServiceWindowGeneration::transcodeVideoToFlv(){ + + string command = "ffmpeg -i "; + command.append(getPathLibras()) + .append(" -vcodec copy -f flv ") + .append(FINAL_DESTINATION_API).append(user_id).append(".flv") + .append(" && rm ") + .append(getPathLibras()); + + system(command.c_str()); + } diff --git a/servico/src/serviceWindowGenerationFromSRT.cpp b/servico/src/serviceWindowGenerationFromSRT.cpp index f5f8246..15f75aa 100644 --- a/servico/src/serviceWindowGenerationFromSRT.cpp +++ b/servico/src/serviceWindowGenerationFromSRT.cpp @@ -157,4 +157,7 @@ void ServiceWindowGenerationFromSRT::Run() { usleep(200000); //200ms } finish_srt = true; + + if (serviceType == 5) + transcodeVideoToFlv(); } diff --git a/servico/src/serviceWindowGenerationFromText.cpp b/servico/src/serviceWindowGenerationFromText.cpp index a31cd17..9fe6f16 100644 --- a/servico/src/serviceWindowGenerationFromText.cpp +++ b/servico/src/serviceWindowGenerationFromText.cpp @@ -68,6 +68,9 @@ void ServiceWindowGenerationFromText::Run() { printf("[INFO]: A transcodificação para .webm está ativada!\n"); transcodeVideoToWebm(); } + else + transcodeVideoToFlv(); + alive = false; } @@ -81,6 +84,6 @@ void ServiceWindowGenerationFromText::transcodeVideoToWebm() { .append(".webm") .append(" && rm ") .append(getPathLibras()); - printf("[INFO]: Transcodification command -> %s\n", command.c_str()); + //printf("[INFO]: Transcodification command -> %s\n", command.c_str()); system(command.c_str()); } \ No newline at end of file diff --git a/tradutor/src/py/Simplificador.py b/tradutor/src/py/Simplificador.py index 7077596..f38b365 100644 --- a/tradutor/src/py/Simplificador.py +++ b/tradutor/src/py/Simplificador.py @@ -33,9 +33,7 @@ class Simplificador(object): w = self.auxConvert(self.it.getAtualW()) t = self.it.getAtualT() self.__b = False - if (w.upper() == "E") and (countWords == 0): - self.__ts.append([self.__dicSin[w.upper()],t]) - if self.__dicWords.has_key(t) == False and w.upper() != "E" and w.upper() != ".": # verifica se nao eh artigo/preposicao + if self.__dicWords.has_key(t) == False: # verifica se nao eh artigo/preposicao wu = w.upper() # deixa o token maiusculo #if t[:2] == "VB": if t == "VB-P" or t == "VB-D" or t == "VB-R": -- libgit2 0.21.2