Spaces:
Sleeping
Sleeping
Commit
·
3903eb1
1
Parent(s):
2e506e8
Fix dockerfile
Browse files- Dockerfile +1 -1
- proxy-renderer.js +29 -10
Dockerfile
CHANGED
|
@@ -37,7 +37,7 @@ RUN npm run bundle || true
|
|
| 37 |
RUN npm run skip-font-warn || true
|
| 38 |
|
| 39 |
# Copy nginx config and start script
|
| 40 |
-
COPY --chown=
|
| 41 |
COPY --chown=1000 start.sh /app/start.sh
|
| 42 |
RUN chmod +x /app/start.sh
|
| 43 |
|
|
|
|
| 37 |
RUN npm run skip-font-warn || true
|
| 38 |
|
| 39 |
# Copy nginx config and start script
|
| 40 |
+
COPY --chown=1000 nginx.conf /etc/nginx/nginx.conf
|
| 41 |
COPY --chown=1000 start.sh /app/start.sh
|
| 42 |
RUN chmod +x /app/start.sh
|
| 43 |
|
proxy-renderer.js
CHANGED
|
@@ -4,7 +4,7 @@ import path from 'path';
|
|
| 4 |
import fs from 'fs';
|
| 5 |
import axios from 'axios';
|
| 6 |
import os from 'os'
|
| 7 |
-
import { exec } from 'child_process';
|
| 8 |
const { RenderUtils } = await import('./src/RenderUtils.cjs');
|
| 9 |
const { GenerateScript } = await import('./src/GenerateScript.cjs');
|
| 10 |
|
|
@@ -98,16 +98,35 @@ export const renderProxy = async (outFile, jobId, options) => {
|
|
| 98 |
|
| 99 |
await new Promise((resolve, reject) => {
|
| 100 |
console.log('Stitching chunks...: ' + concatCmd)
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
}
|
| 109 |
-
|
| 110 |
-
|
|
|
|
|
|
|
| 111 |
});
|
| 112 |
});
|
| 113 |
|
|
|
|
| 4 |
import fs from 'fs';
|
| 5 |
import axios from 'axios';
|
| 6 |
import os from 'os'
|
| 7 |
+
import { exec, spawn } from 'child_process';
|
| 8 |
const { RenderUtils } = await import('./src/RenderUtils.cjs');
|
| 9 |
const { GenerateScript } = await import('./src/GenerateScript.cjs');
|
| 10 |
|
|
|
|
| 98 |
|
| 99 |
await new Promise((resolve, reject) => {
|
| 100 |
console.log('Stitching chunks...: ' + concatCmd)
|
| 101 |
+
const ffmpegProcess = spawn(ffmpegPath, [
|
| 102 |
+
'-f', 'concat',
|
| 103 |
+
'-safe', '0',
|
| 104 |
+
'-i', concatListPath,
|
| 105 |
+
'-c:v', 'copy',
|
| 106 |
+
'-c:a', 'aac',
|
| 107 |
+
'-b:a', '192k',
|
| 108 |
+
'-y',
|
| 109 |
+
outFile
|
| 110 |
+
]);
|
| 111 |
+
|
| 112 |
+
ffmpegProcess.stdout.on('data', (data) => {
|
| 113 |
+
console.log(data.toString());
|
| 114 |
+
});
|
| 115 |
+
|
| 116 |
+
ffmpegProcess.stderr.on('data', (data) => {
|
| 117 |
+
console.error(data.toString());
|
| 118 |
+
});
|
| 119 |
+
|
| 120 |
+
ffmpegProcess.on('close', (code) => {
|
| 121 |
+
if (code === 0) {
|
| 122 |
+
resolve();
|
| 123 |
+
} else {
|
| 124 |
+
reject(new Error(`FFmpeg process exited with code ${code}`));
|
| 125 |
}
|
| 126 |
+
});
|
| 127 |
+
|
| 128 |
+
ffmpegProcess.on('error', (err) => {
|
| 129 |
+
reject(err);
|
| 130 |
});
|
| 131 |
});
|
| 132 |
|