Commit 126bc23b00c78cdfc9d4654bcd50c6153b1b7aee
1 parent
fac85c34
Exists in
master
and in
1 other branch
Ajustes no Renderizador
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
renderer/src/renderer.cpp
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | Renderer::Renderer(char* videoPath, char* user_id) { | 3 | Renderer::Renderer(char* videoPath, char* user_id) { |
4 | this->folder_id = user_id; | 4 | this->folder_id = user_id; |
5 | this->path_video = videoPath; | 5 | this->path_video = videoPath; |
6 | - //serverInitialize(); | 6 | + serverInitialize(); |
7 | running = true; | 7 | running = true; |
8 | count_task = 0; | 8 | count_task = 0; |
9 | glosa_processed = 0; | 9 | glosa_processed = 0; |
@@ -20,8 +20,8 @@ Renderer::~Renderer() { | @@ -20,8 +20,8 @@ Renderer::~Renderer() { | ||
20 | } | 20 | } |
21 | 21 | ||
22 | void Renderer::serverInitialize(){ | 22 | void Renderer::serverInitialize(){ |
23 | - string render = "./render.sh "; | ||
24 | - render.append(folder_id).append(" \"VLIBRAS\"").append(" 1920 1080").append(" 1").append(" 30"); | 23 | + string render = "python render.py "; |
24 | + render.append(folder_id).append(" >/dev/null 2>&1 &"); | ||
25 | 25 | ||
26 | string command = "cd "; | 26 | string command = "cd "; |
27 | char* shPath; | 27 | char* shPath; |
@@ -33,7 +33,7 @@ void Renderer::serverInitialize(){ | @@ -33,7 +33,7 @@ void Renderer::serverInitialize(){ | ||
33 | 33 | ||
34 | command.append(" && ").append(render); | 34 | command.append(" && ").append(render); |
35 | system(command.c_str()); | 35 | system(command.c_str()); |
36 | - sleep(2); | 36 | + sleep(5); |
37 | } | 37 | } |
38 | 38 | ||
39 | void Renderer::receiveGlosa(std::string glosa, int64_t pts) { | 39 | void Renderer::receiveGlosa(std::string glosa, int64_t pts) { |
@@ -138,7 +138,7 @@ void Renderer::Run() { | @@ -138,7 +138,7 @@ void Renderer::Run() { | ||
138 | 138 | ||
139 | void Renderer::render() { | 139 | void Renderer::render() { |
140 | string command = "avconv -loglevel quiet -framerate 30 -i "; | 140 | string command = "avconv -loglevel quiet -framerate 30 -i "; |
141 | - command.append(PATH_SCREENS).append(folder_id).append("/frame_%d.png ") | 141 | + command.append(PATH_SCREENS).append("[\'").append(folder_id).append("\']").append("/frame_%d.png ") |
142 | .append("-vcodec libx264 -pix_fmt yuv420p ").append(path_video); | 142 | .append("-vcodec libx264 -pix_fmt yuv420p ").append(path_video); |
143 | system(command.c_str()); | 143 | system(command.c_str()); |
144 | notifyListeners(); | 144 | notifyListeners(); |
@@ -146,6 +146,6 @@ void Renderer::render() { | @@ -146,6 +146,6 @@ void Renderer::render() { | ||
146 | 146 | ||
147 | void Renderer::cleanFiles() { | 147 | void Renderer::cleanFiles() { |
148 | string clean = "rm -rf "; | 148 | string clean = "rm -rf "; |
149 | - clean.append(PATH_SCREENS).append(user_id).append("/"); | 149 | + clean.append(PATH_SCREENS).append(folder_id).append("/"); |
150 | system(clean.c_str()); | 150 | system(clean.c_str()); |
151 | } | 151 | } |
152 | \ No newline at end of file | 152 | \ No newline at end of file |