Browse Source

Signed-off-by: Caner <40012261+Canees@users.noreply.github.com>

Caner 3 years ago
parent
commit
59c25f9331
1 changed files with 6 additions and 6 deletions
  1. 6 6
      ffmpeg.js

+ 6 - 6
ffmpeg.js

@@ -82,12 +82,12 @@ server.on("connection", async (socket) => {
     })
     })
 
 
     // linux
     // linux
-    // exec(`ffmpeg -f -video_size 640x480 -i /dev/video0 -pix_fmt yuv420p -c h264 -cpu-used 10 -g 5 -preset ultrafast -tune zerolatency -f rtp rtp://127.0.0.1:${port}`, (error, stdout, stderr) => {
-    //   if (error) {
-    //     console.error(`exec error: ${error}`);
-    //     return;
-    //   }
-    // })    
+    exec(`ffmpeg -re -f -video_size 640x480 -i /dev/video0 -pix_fmt yuv420p -c h264_omx -vstats -cpu-used 10 -g 5 -preset ultrafast -tune zerolatency -f rtp rtp://127.0.0.1:${port}`, (error, stdout, stderr) => {
+      if (error) {
+        console.error(`exec error: ${error}`);
+        return;
+      }
+    })    
 
 
     udp.on("message", (data) => {
     udp.on("message", (data) => {
       const rtp = RtpPacket.deSerialize(data);
       const rtp = RtpPacket.deSerialize(data);