diff --git a/Backend/src/cameraStream/transcode.ts b/Backend/src/cameraStream/transcode.ts index 0ac2d6f..e9e8949 100644 --- a/Backend/src/cameraStream/transcode.ts +++ b/Backend/src/cameraStream/transcode.ts @@ -23,28 +23,28 @@ export const transcode = async ( }; const performTranscoding = async () => { - const ffmpegOptions = [ - '-i', - camera.rtspUri, - '-c:v', - 'libx264', - '-crf', - '23', - '-preset', - 'ultrafast', - '-an', - '-force_key_frames', - 'expr:gte(t,n_forced*4)', - '-hls_time', - '2', - '-hls_list_size', - '5', - '-hls_flags', - 'delete_segments', - '-start_number', - '1', - 'index.m3u8', - ]; + const ffmpegOptions = [ + '-i', + camera.rtspUri, + '-c:v', + 'libx264', + '-crf', + '23', + '-preset', + 'ultrafast', + '-an', + '-force_key_frames', + 'expr:gte(t,n_forced*4)', + '-hls_time', + '2', + '-hls_list_size', + '5', + '-hls_flags', + 'delete_segments', + '-start_number', + '1', + 'index.m3u8', + ]; const childProcess = spawn('ffmpeg', ffmpegOptions, workingDirectory); @@ -53,18 +53,15 @@ export const transcode = async ( active = true; trialCount = 0; } - console.log(data.toString()); }); childProcess.on('close', (code) => { active = false; - console.log(`closed and removed`); - console.log(camera.rtspUri); + console.log(`closed and removed ${camera.id}`); exec('rm -f *', workingDirectory, (error, stdout, stderr) => { if (error) { console.error(`Clearning folder cam${camera.id} error`); } - console.log(`Clearning folder cam${camera.id} successful`); }); }); }; diff --git a/Frontend/src/containers/video-stream-container.tsx b/Frontend/src/containers/video-stream-container.tsx index 818ccfe..e20da7d 100644 --- a/Frontend/src/containers/video-stream-container.tsx +++ b/Frontend/src/containers/video-stream-container.tsx @@ -67,9 +67,9 @@ export const VideoStreamContainer: FC = () => { socket.on("inactive", (data) => { const message = JSON.parse(data); const currentCamera = cameras.find((camera) => camera.id === message.id); - if (currentCamera?.isActive) { + // if (currentCamera?.isActive) { updateCameraStatus({ id: message.id, status: false }); - } + // } }); document.addEventListener("fullscreenchange", onExitFullScreenEscape); diff --git a/docker-compose.yml b/docker-compose.yml index 85d587b..d36914f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,27 +12,29 @@ services: env_file: - .secrets.yml - backend: - container_name: backend - image: node:lts-bullseye - depends_on: - - mongo - restart: on-failure # always - ports: - - "8080:8080" - working_dir: /home/node - volumes: - - ./Backend:/home/node - env_file: - - .secrets.yml - command: - - /bin/sh - - -c - - | - apt update - apt install ffmpeg -y - npm run docker:start - +# backend: +# container_name: backend +# platform: linux/amd64 +# image: node:lts-bullseye +# depends_on: +# - mongo +# restart: on-failure # always +# ports: +# - "8080:8080" +# working_dir: /home/node +# volumes: +# - ./Backend:/home/node +# env_file: +# - .secrets.yml +# command: +# - /bin/sh +# - -c +# - | +# apt update +# apt install ffmpeg -y +# npm run docker:start +# +# frontend: container_name: frontend image: node:21-alpine